git » jacl.git » commit 989e40a

car, cdr, numberp. start on gensym in prep for OR

author Alan Dipert
2020-01-29 06:05:25 UTC
committer Alan Dipert
2020-01-29 06:05:25 UTC
parent c59a8549bb19c7a6c9f1b439f11cf24da4fc04d5

car, cdr, numberp. start on gensym in prep for OR

boot.lisp +23 -4

diff --git a/boot.lisp b/boot.lisp
index eb1976f..e0dfb20 100644
--- a/boot.lisp
+++ b/boot.lisp
@@ -32,7 +32,13 @@
 (export 'export)
 
 (defun %instanceof (obj ctor)
-  (%js "(~{} instanceof ~{})" obj ctor))
+  (jacl:%js "(~{} instanceof ~{})" obj ctor))
+
+(defun %== (x y)
+  (jacl:%js "(~{} == ~{})" x y))
+
+(defun %=== (x y)
+  (jacl:%js "(~{} === ~{})" x y))
 
 (export 'set)
 (defun set (symbol value)
@@ -55,9 +61,22 @@
 (defmacro if (test true-form &optional else-form)
   `(jacl:%if ,test ,true-form ,else-form))
 
-(export 'symbolp)
-(defun symbolp (x)
-  (jacl:%js "((~{} instanceof LispSymbol || ~{} === null) ? true : null)" x x))
+(export 'car)
+(defun car (x)
+  (jacl:\. x |car|))
+
+(export 'cdr)
+(defun cdr (x)
+  (jacl:\. x |cdr|))
+
+(export 'numberp)
+(defun numberp (x)
+  (jacl:%js "typeof ~{} === 'number'" x))
+
+(defvar *gensym-counter* 0)
+
+;; TODO gensym
+;; TODO or
 
 (export 'stringp)
 (defun stringp (x)