[parenscript-devel] insert verbatim JS code
![](https://secure.gravatar.com/avatar/ffe96f25cbe777db8ee1081ff83754ff.jpg?s=120&d=mm&r=g)
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
![](https://secure.gravatar.com/avatar/5c13044077baec031cf34ffcb364519c.jpg?s=120&d=mm&r=g)
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)) then: (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. Cheers, -- Travis
participants (2)
-
Alex Mizrahi
-
Travis Cross