Merge pull request #358 from bjh21/bjh21-extra-tests
[jackhill/mal.git] / mal / core.mal
index 33b6a5e..15bcac3 100644 (file)
@@ -1,10 +1,31 @@
+(def! _fn? (fn* [x]
+  (if (fn? x)
+    (if (get (meta x) "ismacro")
+      false
+      true)
+    false)))
+
+(def! macro? (fn* [x]
+  (if (fn? x)
+    (if (get (meta x) "ismacro")
+      true
+      false)
+    false)))
+
 (def! core_ns
   [["=" =]
    ["throw" throw]
    ["nil?" nil?]
    ["true?" true?]
    ["false?" false?]
+   ["number?" number?]
+   ["string?" string?]
+   ["symbol" symbol]
    ["symbol?" symbol?]
+   ["keyword" keyword]
+   ["keyword?" keyword?]
+   ["fn?" _fn?]
+   ["macro?" macro?]
 
    ["pr-str" pr-str]
    ["str" str]
@@ -21,6 +42,7 @@
    ["-" -]
    ["*" *]
    ["/" /]
+   ["time-ms" time-ms]
 
    ["list" list]
    ["list?" list?]
    ["rest" rest]
    ["empty?" empty?]
    ["count" count]
-   ["conj" conj]
    ["apply" apply]
    ["map" map]
 
+   ["conj" conj]
+   ["seq" seq]
+
    ["with-meta" with-meta]
    ["meta" meta]
    ["atom" atom]