Defined ps-inline as a PS macro in addition to a CL macro.
authorVladimir Sedach <vsedach@gmail.com>
Mon, 2 Feb 2009 07:31:52 +0000 (00:31 -0700)
committerVladimir Sedach <vsedach@gmail.com>
Mon, 2 Feb 2009 07:31:52 +0000 (00:31 -0700)
docs/reference.lisp
src/compilation-interface.lisp
t/ps-tests.lisp
t/reference-tests.lisp

index 3865afb..232a61b 100644 (file)
@@ -1083,8 +1083,8 @@ a-variable  => aVariable
 
 (document.write
   (ps-html ((:a :href "#"
-                :onclick (lisp (ps-inline (transport)))) "link")))
-=> document.write('<A HREF=\"#\" ONCLICK=\"' + 'javascript:transport()' + '\">link</A>')
+                :onclick (ps-inline (transport))) "link")))
+=> document.write('<A HREF=\"#\" ONCLICK=\"' + ('javascript:' + 'transport()') + '\">link</A>')
 
 ;;; Forms may be used in attribute lists to conditionally generate
 ;;; the next attribute. In this example the textarea is sometimes disabled.
index e148901..6ee177d 100644 (file)
@@ -30,6 +30,7 @@ Body is evaluated."
 (defun ps-inline* (form &optional (*js-string-delimiter* *js-inline-string-delimiter*))
   (concatenate 'string "javascript:" (ps1* form)))
 
-(defmacro ps-inline (form &optional (string-delimiter '*js-inline-string-delimiter*))
-  `(let ((*js-string-delimiter* ,string-delimiter))
-     (concatenate 'string "javascript:" ,@(parenscript-print (compile-parenscript-form form :expecting :statement)))))
+(defmacro/ps ps-inline (form &optional (string-delimiter *js-inline-string-delimiter*))
+  `(concatenate 'string "javascript:"
+                ,@(let ((*js-string-delimiter* string-delimiter))
+                    (parenscript-print (compile-parenscript-form form :expecting :statement)))))
index 82ece68..7e8bedf 100644 (file)
@@ -465,10 +465,10 @@ x = 2 + sideEffect() + x + 5;")
   (document.write
    (if (= *linkornot* 1)
        (ps-html ((:a :href "#"
-                     :onclick (lisp (ps-inline (transport))))
+                     :onclick (ps-inline (transport)))
                  img))
        img))
-  "document.write(LINKORNOT == 1 ? '<A HREF=\"#\" ONCLICK=\"' + 'javascript:transport()' + '\">' + img + '</A>' : img)")
+  "document.write(LINKORNOT == 1 ? '<A HREF=\"#\" ONCLICK=\"' + ('javascript:' + 'transport()') + '\">' + img + '</A>' : img)")
 
 (test-ps-js negate-number-literal ;; ok, this was broken and fixed before, but no one bothered to add the test!
   (- 1)
index 99b3706..346dfb5 100644 (file)
@@ -588,8 +588,8 @@ for (var k in obj) {
 (test-ps-js the-html-generator-3
   (document.write
   (ps-html ((:a :href "#"
-                :onclick (lisp (ps-inline (transport)))) "link")))
-  "document.write('<A HREF=\"#\" ONCLICK=\"' + 'javascript:transport()' + '\">link</A>')")
+                :onclick (ps-inline (transport))) "link")))
+  "document.write('<A HREF=\"#\" ONCLICK=\"' + ('javascript:' + 'transport()') + '\">link</A>')")
 
 (test-ps-js the-html-generator-4
   (let* ((disabled nil)