[parenscript-devel] Miscellaneous utils I use

John Fremlin john at fremlin.org
Wed Jun 20 03:49:38 UTC 2007

"Vladimir Sedach" <vsedach at gmail.com> writes:

> Excellent suggestions John! I've forgotten about it, but it turns out
> we were doing min and max ourselves in the project that I'm using
> ParenScript for. I've put the JS math functions and a macro called
> with-timeout into a new file, js-utils.lisp, and pushed everything out
> to the ParenScript darcs repository.


> One thing I didn't include is make-xml-http-request. I think that
> anything that is conditional on browser versions should be kept out of
> ParenScript itself, both to help prevent future bit rot, and because
> run-time browser detection is not the only (nor the best) way to
> handle browser differences (for example, on my project, we're planning
> to include different scripts based on the value of the agent HTTP
> header field - obviously this will not work for everyone, but the
> run-time approach does not work for us, so I think this is really an
> issue best left to applications or libraries built on top of
> ParenScript).

Is there somewhere central where these things could be shared then?


>> (define-js-compiler-macro timeout (form timeout)
>>   (js-compile `(set-timeout (lambda() ,form) ,timeout)))

(Sorry about the define-js-compiler-macro for the timeouts, I have
no idea why it wasn't a normal jsmacro.)


More information about the parenscript-devel mailing list