From: Vladimir Sedach Date: Mon, 2 Feb 2009 07:31:52 +0000 (-0700) Subject: Defined ps-inline as a PS macro in addition to a CL macro. X-Git-Url: https://git.hcoop.net/clinton/parenscript.git/commitdiff_plain/e69d0a12d668dab0e91e419498d0c9444a354403 Defined ps-inline as a PS macro in addition to a CL macro. --- diff --git a/docs/reference.lisp b/docs/reference.lisp index 3865afb..232a61b 100644 --- a/docs/reference.lisp +++ b/docs/reference.lisp @@ -1083,8 +1083,8 @@ a-variable => aVariable (document.write (ps-html ((:a :href "#" - :onclick (lisp (ps-inline (transport)))) "link"))) -=> document.write('link') + :onclick (ps-inline (transport))) "link"))) +=> document.write('link') ;;; Forms may be used in attribute lists to conditionally generate ;;; the next attribute. In this example the textarea is sometimes disabled. diff --git a/src/compilation-interface.lisp b/src/compilation-interface.lisp index e148901..6ee177d 100644 --- a/src/compilation-interface.lisp +++ b/src/compilation-interface.lisp @@ -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))))) diff --git a/t/ps-tests.lisp b/t/ps-tests.lisp index 82ece68..7e8bedf 100644 --- a/t/ps-tests.lisp +++ b/t/ps-tests.lisp @@ -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 ? '' + img + '' : img)") + "document.write(LINKORNOT == 1 ? '' + img + '' : img)") (test-ps-js negate-number-literal ;; ok, this was broken and fixed before, but no one bothered to add the test! (- 1) diff --git a/t/reference-tests.lisp b/t/reference-tests.lisp index 99b3706..346dfb5 100644 --- a/t/reference-tests.lisp +++ b/t/reference-tests.lisp @@ -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('link')") + :onclick (ps-inline (transport))) "link"))) + "document.write('link')") (test-ps-js the-html-generator-4 (let* ((disabled nil)