projects
/
jscl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
0886848
)
Use `false' like nil
author
David Vázquez
<davazp@gmail.com>
Tue, 18 Dec 2012 22:34:24 +0000
(23:34 +0100)
committer
David Vázquez
<davazp@gmail.com>
Tue, 18 Dec 2012 22:34:24 +0000
(23:34 +0100)
lispstrack.lisp
patch
|
blob
|
history
test.lisp
patch
|
blob
|
history
diff --git
a/lispstrack.lisp
b/lispstrack.lisp
index
ba60596
..
b20ca47
100644
(file)
--- a/
lispstrack.lisp
+++ b/
lispstrack.lisp
@@
-299,7
+299,7
@@
(defun literal->js (sexp)
(cond
(defun literal->js (sexp)
(cond
- ((null sexp) "undefined")
+ ((null sexp) "false")
((integerp sexp) (integer-to-string sexp))
((stringp sexp) (concat "\"" sexp "\""))
((symbolp sexp) (concat "{name: \"" (symbol-name sexp) "\"}"))
((integerp sexp) (integer-to-string sexp))
((stringp sexp) (concat "\"" sexp "\""))
((symbolp sexp) (concat "{name: \"" (symbol-name sexp) "\"}"))
@@
-419,7
+419,7
@@
(concat "(Math.floor(" (ls-compile x env fenv) "))"))
(define-compilation null (x)
(concat "(Math.floor(" (ls-compile x env fenv) "))"))
(define-compilation null (x)
- (concat "(" (ls-compile x env fenv) "== undefined)"))
+ (concat "(" (ls-compile x env fenv) "== false)"))
(define-compilation cons (x y)
(concat "{car: " (ls-compile x env fenv) ", cdr: " (ls-compile y env fenv) "}"))
(define-compilation cons (x y)
(concat "{car: " (ls-compile x env fenv) ", cdr: " (ls-compile y env fenv) "}"))
diff --git
a/test.lisp
b/test.lisp
index
9f58cf2
..
560a255
100644
(file)
--- a/
test.lisp
+++ b/
test.lisp
@@
-204,3
+204,8
@@
(while (and ch (whitespacep ch))
(%read-char stream)
(setq ch (%peek-char stream)))))
(while (and ch (whitespacep ch))
(%read-char stream)
(setq ch (%peek-char stream)))))
+
+(defun terminalp (ch)
+ (or (null ch) (whitespacep ch) (char= #\) ch) (char= #\( ch)))
+
+