[Openmcl-devel] Macro named λ won't expand in Slime REPL
Daniel Gackle
danielgackle at gmail.com
Wed May 20 23:44:25 PDT 2009
We defined a macro named λ (Greek lambda character, in case this email isn't
Unicode-friendly) to expand into a lambda form, partly to save typing and
partly to add a couple extra features our system needs. This works fine when
you compile files, but not in a Slime REPL or when using the command
slime-compile-defun. For example,
(defun foo ()
(λ (x) (1+ x)))
works the way you'd expect if you compile the file it's in. But in the REPL
bad things happen:
(defun foo ()
(λ (x) (1+ x)))
;Compiler warnings :
; In FOO: Undefined function Λ
; In FOO: Undefined function X
; In FOO: Undeclared free variable X
=> FOO
(foo)
=> Undefined function X called with arguments () .
[Condition of type CCL::UNDEFINED-FUNCTION-CALL]
(macroexpand '(λ (x) (1+ x)))
=> (Λ (X) (1+ X))
And if you use slime-compile-defun on the (defun foo...) form, the following
occurs:
While compiling FOO :
#1=(X) is not a symbol or lambda expression in the form (#1# (1+ X)) .
[Condition of type CCL::COMPILE-TIME-PROGRAM-ERROR]
I'm posting this here because none of the above errors happen in SBCL, so
there would seem to be something specific about the combination of Slime and
CCL that doesn't like this macro. Does anyone have any ideas or suggestions?
Thank you,
Daniel Gackle
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.clozure.com/pipermail/openmcl-devel/attachments/20090521/0176625d/attachment.htm>
More information about the Openmcl-devel
mailing list