From: Daniel Gackle Date: Sat, 11 Apr 2009 22:51:29 +0000 (-0700) Subject: When turning a quoted list into a JS array, compile elements that are NIL as "null... X-Git-Url: http://git.hcoop.net/clinton/parenscript.git/commitdiff_plain/b4bb2beddbbcda4eb886c72e23cf067b80dd64b4 When turning a quoted list into a JS array, compile elements that are NIL as "null", not "[]". There is no way to make JS completely consistent with Lisp here, because NIL means two different things in JS (null or an empty list) where it means only one thing in Lisp. We have to pick one thing in this context, and "[null]" is more common than "[[]]". --- diff --git a/src/special-forms.lisp b/src/special-forms.lisp index 478e892..033405a 100644 --- a/src/special-forms.lisp +++ b/src/special-forms.lisp @@ -26,7 +26,7 @@ (defpsmacro quote (x) (typecase x - (cons (cons 'array (mapcar (lambda (x) `',x) x))) + (cons (cons 'array (mapcar (lambda (x) (when x `',x)) x))) (null '(array)) (symbol (string-downcase x)) (number x)