Merge pull request #383 from asarhaddon/ada2tco-do
[jackhill/mal.git] / mal / core.mal
index 581397d..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?]
@@ -50,6 +69,7 @@
    ["map" map]
 
    ["conj" conj]
+   ["seq" seq]
 
    ["with-meta" with-meta]
    ["meta" meta]