FAQ Database Discussion Community

Is there a way to insert raw javascript in parenscript code?

The following code inserts third-party generated javascript as a string which will need to be eval'ed. (ps (let ((x (lisp (json:encode-json-alist-to-string '((:a . 1) (:b . 2)))))))) "(function () { var x = '{\"a\":1,\"b\":2}'; return null; })();" Is there a way to tell parenscript to insert a string unquoted?...

Parenscipt not compiling valid expression?

I have this parenscript macro: ;;; Parenscript macro for showModal() and close() methods for pop-up dialogs. ;;;Takes the dialog's id, button for opening the dialog's id, and closing button's id. (defpsmacro open-close-modal-dialog (dialog-id element-id-1 element-id-2 &key open close open-args close-args) (let ((dialog (ps-gensym))) `(progn (setf ,dialog (chain document (get-element-by-id ,dialog-id)))...

Parenscript and implicit Return

Is there anyway to turn off Parenscript's implicit Return? I'm trying to write the following code: function () = { dialog.show();}; But Parenscript inserts an implicit return: (ps (lambda () (chain dialog (show)))) => function () = { return dialog.show();}; ...