Added {} to *ps-literals*.
authorTravis Cross <tc@traviscross.com>
Mon, 31 Mar 2008 22:02:00 +0000 (22:02 +0000)
committerTravis Cross <tc@traviscross.com>
Mon, 31 Mar 2008 22:02:00 +0000 (22:02 +0000)
Using {} as a literal to create an empty object literal was only
working by accident previously.  When not in the function position, {}
was being compiled as a JS variable rather than an object-literal,
which just happened to work sometimes.  In concert with correctly
checking symbols that aren't in the parenscript package, this should
provide for more reliable behavior.

src/special-forms.lisp

index 7007f78..e07d331 100644 (file)
@@ -50,6 +50,7 @@
                   (compile-parenscript-form form :expecting :expression))
                 coords)))
 
+(pushnew '{} *ps-literals*)
 (define-ps-special-form {} (expecting &rest arrows)
   (declare (ignore expecting))
   (cons 'object-literal (loop for (key value) on arrows by #'cddr