>>>> "Holger" == Holger Schauer
<schauer(a)coling.uni-freiburg.de> writes:
>>>> "MS" == Michael Sperber schrieb am 24 Aug
1998 13:50:54 +0200:
MS> Ah, now I see what you meant. Unfortunately, this approach works
MS> only with self-quoting values for BAR:
Holger> What Common Lisp are you using ?
CLISP, indeed.
Holger> USER(8): (setq bar #'(lambda (x) x))
Holger> #<Interpreted Function (unnamed) @ #x8cf772>
Holger> USER(9): (defmacro foo () bar)
Holger> FOO
Holger> USER(10): (let ((bar #'(lambda (x) (+ x 1)))) (funcall (foo) 23))
Holger> 23
Holger> This is Allegro Common Lisp 4.3. I think that it should be pretty
Holger> close to ANSI Cl requirements. I bet CMUCL is somewhat more
Holger> explanative than ACL (note however that CMUCL as of 17f does not
Holger> implement ANSI CL, although 18 is said to move towards ANSI
Holger> compliance).
The fact that one Common Lisp allows this is irrelevant. The fact
that the standard doesn't specify (or requires) an external
representation for closures is. I believe CLISP is entirely correct
in generating the error.
Here's another unintended effect which exposes the hackishness of
this, this time relying on the fact that symbols are not self-quoting:
(setq bar (intern "Foo"))
(defmacro foo () bar)
(cons (foo) '()) => variable |Foo| has no value
Again, the problem is that BAR is not referring to a binding---it's
referring to the value of the binding.
--
Cheers =8-} Chipsy
Friede, Völkerverständigung und überhaupt blabla