[Ecls-list] Bug in local macros

Pascal Costanza pc at p-cos.net
Mon Jun 5 20:09:16 UTC 2006


Hi,

There is a bug with local macro definitions in ecl. The HyperSpec  
says this:

"The macro-expansion functions defined by macrolet are defined in the  
lexical environment in which the macrolet form appears. Declarations  
and macrolet and symbol-macrolet definitions affect the local macro  
definitions in a macrolet, [...]."

The following test cases shows that enclosing symbol-macrolet  
definitions only have an effect for interpreted code, and enclosing  
macrolet definitions never have an effect.

 > (define-symbol-macro x 1)
X
 > (defun foo ()
     (symbol-macrolet ((x 2))
       (macrolet ((m () x))
         (m))))
FOO
 > (foo)
2
 > (compile 'foo)
[...mumble...]
FOO
NIL
NIL
 > (foo)
1
 > (defmacro x () 1)
X
 > (defun bar ()
     (macrolet ((x () 2))
       (macrolet ((m () x))
         (m))))
BAR
 > (bar)
1
 > (compile 'bar)
[...mumble...]
BAR
NIL
NIL
 > (bar)
1

I am using the current cvs version of ecl.


Pascal

-- 
Pascal Costanza, mailto:pc at p-cos.net, http://p-cos.net
Vrije Universiteit Brussel, Programming Technology Lab
Pleinlaan 2, B-1050 Brussel, Belgium








More information about the ecl-devel mailing list