[parenscript-devel] What about (declare (special foo))?

Vladimir Sedach vsedach at gmail.com
Mon Jan 25 06:28:16 UTC 2010


I just pushed a patch that handles SPECIAL declarations in functions
and LET forms. I don't know why I thought I needed a reference to the
global object though. There's no need to declare globals.

Vladimir

2009/12/30 Daniel Gackle <danielgackle at gmail.com>:
> PS supports special variables but to use them requires declaring a variable
> with DEFVAR instead of VAR. I'm not fond of this because the DEFVAR-vs.-VAR
> distinction in PS doesn't fit with the DEFVAR-vs.-DEFPARAMETER distinction
> in CL (at least, I don't see the analogy if there is one).
>
> What I'd like is to be able to do this:
>
> (ps (let ((*foo* 123))
>             (declare (special *foo*))
>             (blah)))
> =>
> "var FOO12733 = FOO;
> try {
>     FOO = 123;
>     blah();
> } finally {
>     FOO = FOO12733;
> };"
>
> Vladimir, do you think this would be hard to do? It's similar to how LET
> works on variables declared with DEFVAR. The difference of course is that
> here *FOO* stops being a special-variable when the DECLARE goes out of
> scope.
>
> Do you (or does anyone) think that the above would be a bad idea? If so,
> why?
>
> We have a macro right now that does the above in a somewhat ugly way, and
> it's very handy on the 3 or 4 occasions that we need it.
>
> Daniel
>
> _______________________________________________
> parenscript-devel mailing list
> parenscript-devel at common-lisp.net
> http://common-lisp.net/cgi-bin/mailman/listinfo/parenscript-devel
>
>




More information about the parenscript-devel mailing list