From: David Vázquez Date: Tue, 18 Dec 2012 22:34:24 +0000 (+0100) Subject: Use `false' like nil X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=42f5cdc28edf163d5b838b925395d0adce6b3979;hp=08868487a3708573e6f26f23b60fa14bab5dbf30;p=jscl.git Use `false' like nil --- diff --git a/lispstrack.lisp b/lispstrack.lisp index ba60596..b20ca47 100644 --- a/lispstrack.lisp +++ b/lispstrack.lisp @@ -299,7 +299,7 @@ (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) "\"}")) @@ -419,7 +419,7 @@ (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) "}")) diff --git a/test.lisp b/test.lisp index 9f58cf2..560a255 100644 --- a/test.lisp +++ b/test.lisp @@ -204,3 +204,8 @@ (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))) + +