From 42f5cdc28edf163d5b838b925395d0adce6b3979 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20V=C3=A1zquez?= Date: Tue, 18 Dec 2012 23:34:24 +0100 Subject: [PATCH 1/1] Use `false' like nil --- lispstrack.lisp | 4 ++-- test.lisp | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) 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))) + + -- 1.7.10.4