arohner / scriptjure

a Clojure library for generating javascript
187 stars 15 forks source link

Literal special form #7

Closed joedavis closed 13 years ago

joedavis commented 13 years ago

I'm after adding a literal special form, to allow insertion of literal strings into the compiled javascript. I don't believe there is a way of doing this at the moment using scriptjure.

Example of usage:

(js (var regex (literal "/[^\w ]+/g")))

Will compile into this javascript code:

var regex = /[^\w ]+/g;
scottjad commented 13 years ago

I think quote (or ') will do what you want.

joedavis commented 13 years ago

Thanks, I had read through the source – I don't know how I missed it.