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).<br>
<br>What I'd like is to be able to do this:<br><br><span style="font-family: courier new,monospace;">(ps (let ((*foo* 123))</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> (declare (special *foo*))</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> (blah)))</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">=></span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">"var FOO12733 = FOO;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">try {</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> FOO = 123;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> blah();</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">} finally {</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> FOO = FOO12733;</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">};"</span><br><br>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.<br>
<br>Do you (or does anyone) think that the above would be a bad idea? If so, why?<br><br>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.<br>
<br>Daniel<br>