gcl-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gcl-devel] SYMBOL-MACROLET problem


From: Paul F. Dietz
Subject: [Gcl-devel] SYMBOL-MACROLET problem
Date: Tue, 29 Oct 2002 17:57:22 -0600
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.1) Gecko/20020826

I wrote:

I think the proper way to fix this is to rip out the PCL implementation
of symbol-macrolet and instead do symbol-macrolet expansion in the same
place ordinary macroexpansion is performed.  The PCL implementation is
something of a hack, and I don't think it can be made correct in general
(the generic problem is that it 'manually' macroexpands subterms during
the code walk, but those subterms don't have symbol-macro substitution
performed on them, so if the macro inspects the results of such expansion
it sees the wrong thing.)

I've added a test that shows the problem in PCL's symbol-macrolet.
It's macrolet.13, in ansi-tests/macrolet.lsp.  The test is:

(deftest macrolet.13
  (symbol-macrolet ((a b))
    (macrolet ((foo (x &environment env)
                    (let ((y (macroexpand x env)))
                      (if (eq y 'a) 1 2))))
      (foo a)))
  2)

gcl expands FOO before substituting for A, and so incorrectly yields
1 instead of 2.

        Paul





reply via email to

[Prev in Thread] Current Thread [Next in Thread]