Added JS* and JS-INLINE*.
authorMarco Baringer <mb@bese.it>
Sun, 14 Aug 2005 13:45:34 +0000 (13:45 +0000)
committerMarco Baringer <mb@bese.it>
Sun, 14 Aug 2005 13:45:34 +0000 (13:45 +0000)
js.lisp
package.lisp

diff --git a/js.lisp b/js.lisp
index 7b9d9d0..fc89a25 100644 (file)
--- a/js.lisp
+++ b/js.lisp
@@ -1249,6 +1249,13 @@ this macro."
     (js-to-statement-strings (js-compile '(progn ,@body)) 0)
     (string #\Newline)))
 
+(defmacro js* (&rest body)
+  "Just like JS except that BODY is evaluated before being
+converted to javascript."
+  `(string-join
+    (js-to-statement-strings (js-compile (list 'progn ,@body)) 0)
+    (string #\Newline)))
+
 (defun js-to-string (expr)
   (string-join
    (js-to-statement-strings (js-compile expr) 0)
@@ -1273,3 +1280,10 @@ this macro."
   `(concatenate 'string "javascript:"
     (string-join (js-to-statement-strings (js-compile '(progn ,@body)) 0) " ")))
 
+(defmacro js-inline* (&rest body)
+  "Just like JS-INLINE except that BODY is evaluated before being
+converted to javascript."
+  `(concatenate 'string "javascript:"
+    (string-join (js-to-statement-strings (js-compile (list 'progn ,@body)) 0) " ")))
+
+
index 872503b..27e8b89 100644 (file)
    ;; compiler
    #:js-compile
    #:js
+   #:js*
    #:js-inline
+   #:js-inline*
    #:js-file
    #:js-script
    #:js-to-strings