Merge pull request #358 from bjh21/bjh21-extra-tests
[jackhill/mal.git] / mal / core.mal
index 526944f..15bcac3 100644 (file)
@@ -1,13 +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]
@@ -24,6 +42,7 @@
    ["-" -]
    ["*" *]
    ["/" /]
+   ["time-ms" time-ms]
 
    ["list" list]
    ["list?" list?]
@@ -49,6 +68,9 @@
    ["apply" apply]
    ["map" map]
 
+   ["conj" conj]
+   ["seq" seq]
+
    ["with-meta" with-meta]
    ["meta" meta]
    ["atom" atom]