X-Git-Url: http://git.hcoop.net/jackhill/mal.git/blobdiff_plain/ece70f970306f819b148979c3d17f266c7e08146..fbfe6784d2db983018340e4e1492d8d017029867:/impls/swift3/Sources/core.swift diff --git a/impls/swift3/Sources/core.swift b/impls/swift3/Sources/core.swift index dcf5e300..be44f35c 100644 --- a/impls/swift3/Sources/core.swift +++ b/impls/swift3/Sources/core.swift @@ -272,6 +272,14 @@ let core_ns: Dictionary) throws -> MalVal> = [ } return list(res) }, + "vec": { + if $0.count != 1 { throw MalError.General(msg: "Invalid vec call") } + switch $0[0] { + case MV.MalList (let lst, _): return vector(lst) + case MV.MalVector(let lst, _): return vector(lst) + default: throw MalError.General(msg: "Invalid vec call") + } + }, "nth": { if $0.count != 2 { throw MalError.General(msg: "Invalid nth call") } switch ($0[0], $0[1]) {