Fixed 'lisp' form to produce code that captures enclosing lexical scope correctly...
[clinton/parenscript.git] / src / special-forms.lisp
index 3841f6f..ad49e28 100644 (file)
@@ -718,9 +718,7 @@ lambda-list::=
 (define-ps-special-form regex (regex)
   `(js:regex ,(string regex)))
 
-(defpsmacro lisp (&body forms)
-  "Evaluates the given forms in Common Lisp at ParenScript
-macro-expansion time. The value of the last form is treated as a
-ParenScript expression and is inserted into the generated Javascript
-\(use nil for no-op)."
-  (eval (cons 'progn forms)))
+(define-ps-special-form lisp (lisp-form)
+  ;; (ps (foo (lisp bar))) is in effect equivalent to (ps* `(foo ,bar))
+  ;; when called from inside of ps*, lisp-form has access only to the dynamic environment (like for eval)
+  `(js:escape (ps1* ,lisp-form)))