[parenscript-devel] Symbol-macro clashes

szergling senatorzergling at gmail.com
Wed Feb 3 20:29:55 UTC 2010

Hi list,

Just a quick note.

Something I discovered a while ago, which hasn't quite been affected
by recent patches. There's a potential clash between symbol macros and
normal symbols in parenscript. Sometimes, we don't want to macroexpand
certain symbols:

In Common Lisp,

PS> (define-symbol-macro %cldata (list 1 2 3))
PS> (let ((%cldata (list 4 5 6))) %cldata)
(4 5 6)

In parenscript,

PS> (define-ps-symbol-macro %data (list 1 2 3))
PS> (ps %data)
"[1, 2, 3];"
PS> (ps (let ((%data (list 2 4 5))) %data))
; Evaluation aborted.

The value (ARRAY 1 2 3) is not of type SYMBOL.
   [Condition of type TYPE-ERROR]

The %data (binding) shouldn't be expanded, and the %data in the let
body should now be "shadowed" by the new binding. This also occurs
with LET*, FLET, and LABELS (what else have I missed?).

I couldn't looked too closely, but recently, all the variable binding
seem to have been refactored into the code for ps-special-form var, so
perhaps this is now easier to fix.



More information about the parenscript-devel mailing list