[parenscript-devel] insert verbatim JS code

Travis Cross tc at travislists.com
Sat Nov 15 04:50:06 UTC 2008

Alex Mizrahi wrote:
> is there a trick to insert verbatim JS code
> directly into parenscript source? there
> used to be one -- via quote -- in older
> version, undocumented, but it seems new version
> just blocks such attempts. 
> while this might look like a hack, in some
> cases it is very important feature

There is no such special form (that I see), but you can easily create one:

(ps::define-ps-special-form ps::literaljs (expecting str)
   (declare (ignore expecting))
   (list 'ps::js-literal str))


(ps:ps (literaljs "foo + bar"))
=> foo + bar;

I don't think that something like this should be included in PS though, 
because there would be no way for PS to reason about such a statement, 
which would constrain our implementation choices.


-- Travis

More information about the parenscript-devel mailing list