From b4bb2beddbbcda4eb886c72e23cf067b80dd64b4 Mon Sep 17 00:00:00 2001 From: Daniel Gackle Date: Sat, 11 Apr 2009 15:51:29 -0700 Subject: [PATCH] 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 "[[]]". --- src/special-forms.lisp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) -- 2.20.1