mirror of
https://github.com/vinc/moros.git
synced 2024-06-19 07:27:06 +00:00
44 lines
577 B
Plaintext
44 lines
577 B
Plaintext
|
(defn eq? (a b)
|
||
|
(eq a b))
|
||
|
|
||
|
(defn atom? (x)
|
||
|
(atom x))
|
||
|
|
||
|
(defn string? (x)
|
||
|
(eq? (type x) "string"))
|
||
|
|
||
|
(defn boolean? (x)
|
||
|
(eq? (type x) "boolean"))
|
||
|
|
||
|
(defn symbol? (x)
|
||
|
(eq? (type x) "symbol"))
|
||
|
|
||
|
(defn number? (x)
|
||
|
(eq? (type x) "number"))
|
||
|
|
||
|
(defn list? (x)
|
||
|
(eq? (type x) "list"))
|
||
|
|
||
|
(defn function? (x)
|
||
|
(eq? (type x) "function"))
|
||
|
|
||
|
(defn lambda? (x)
|
||
|
(eq? (type x) "lambda"))
|
||
|
|
||
|
(def null '())
|
||
|
|
||
|
(defn null? (x)
|
||
|
(eq? x null))
|
||
|
|
||
|
(defn first (lst)
|
||
|
(car lst))
|
||
|
|
||
|
(defn rest (lst)
|
||
|
(cdr lst))
|
||
|
|
||
|
(defn second (lst)
|
||
|
(first (rest lst)))
|
||
|
|
||
|
(defn third (lst)
|
||
|
(second (rest lst)))
|