[parenscript-devel] Macro symbols affect GENSYMing in LET

sblist at me.com sblist at me.com
Thu Jun 4 17:10:58 UTC 2009


I haven't done a very good job of distilling down this bug,
but we're experiencing an issue with the GENSYMing
done by LET in the presence of macros with the same
names as variables bound in LET.

This is the simplest example I could come up with:

 > (ps
             (macrolet ((a (n) `(+ ,n 5)))
               (let ((a (a 1)))
                 (let ((b (a (- a 4))))
                   (+ a b)))))
"var a1661 = 1 + 5;
var b = (a - 4) + 5;
a1661 + b;"

You can see here that the symbol A is GENSYM'd since
it occurs elsewhere in the LET binding forms, but it seems
to be missed in the inner LET form. If the symbol A is not
inside the subtraction form, it is caught:

 > (ps
             (macrolet ((a (n) `(+ ,n 5)))
               (let ((a (a 1)))
                 (let ((b (a a)))
                   (+ a b)))))
"var a1662 = 1 + 5;
var b = a1662 + 5;
a1662 + b;"

- Scott




More information about the parenscript-devel mailing list