return BoolNew(SymbolQ(a:args[0]))
endfunction
+function MalStringQ(args)
+ return BoolNew(StringQ(a:args[0]))
+endfunction
+
function MalKeyword(args)
return KeywordNew(ObjValue(a:args[0]))
endfunction
endif
endfunction
+function MalSeq(args)
+ let obj = a:args[0]
+ if EmptyQ(obj)
+ return g:MalNil
+ elseif ListQ(obj)
+ return obj
+ elseif VectorQ(obj)
+ return ListNew(ObjValue(obj))
+ elseif StringQ(obj)
+ return ListNew(map(split(ObjValue(obj), '\zs'), 'StringNew(v:val)'))
+ endif
+ throw "seq requires string or list or vector or nil"
+endfunction
+
function MalMeta(args)
return ObjMeta(a:args[0])
endfunction
\ "false?": NewNativeFn("MalFalseQ"),
\ "symbol": NewNativeFn("MalSymbol"),
\ "symbol?": NewNativeFn("MalSymbolQ"),
+ \ "string?": NewNativeFn("MalStringQ"),
\ "keyword": NewNativeFn("MalKeyword"),
\ "keyword?": NewNativeFn("MalKeywordQ"),
\ "list": NewNativeFn("MalList"),
\ "map": NewNativeFn("MalMap"),
\ "throw": NewNativeFn("MalThrow"),
\ "conj": NewNativeFn("MalConj"),
+ \ "seq": NewNativeFn("MalSeq"),
\ "meta": NewNativeFn("MalMeta"),
\ "with-meta": NewNativeFn("MalWithMeta"),
\ "atom": NewNativeFn("MalAtom"),