Macroexpand for Parentscript

Is there an equivalent to macroexport or macroexp-1 for password macros? Executing (ps (some macro expression)) will display the generated javascript, but there are times when it would be nice to see the parenthesis before converting it to javascript.

+5
source share
1 answer

The parenscript compiler.lisp file has the functions ps-macroexpand-1 and ps-macroexpand . Unfortunately, they are not exported by the parenscript package. You can call them anyway using a double colon.

For instance,

 (defpsmacro aif (test true &rest false) `(let ((it ,test)) (if it ,true ,@false))) (ps::ps-macroexpand-1 '(aif 3 it)) ;;=> (LET ((IT 3)) (IF IT IT)) T 
+5
source

Source: https://habr.com/ru/post/1236863/


All Articles