Perhaps you are evaluating the (defmacro ë...) form in the REPL? That works for me too. What doesn't work is loading a <i>file</i> with the (defmacro ë...) and then trying to macroexpand a usage of ë in the REPL. Sorry I didn't make that clear. Also, as I mentioned in replying to Matthew, the whole problem goes away if we use a more normal name than ë. But ë is a nice name and we haven't come up with anything better (FN seemed like a good candidate, but turned out not to be).<br>
<br>Daniel<br><br><br><div class="gmail_quote">On Thu, May 21, 2009 at 12:53 AM, Stas Boukarev <span dir="ltr"><<a href="mailto:stassats@gmail.com">stassats@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><div></div><div class="h5">Daniel Gackle <<a href="mailto:danielgackle@gmail.com">danielgackle@gmail.com</a>> writes:<br>
<br>
> We defined a macro named ë (Greek lambda character, in case this email isn't Unicode-friendly) to expand into a lambda form, partly to<br>
> 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<br>
> when using the command slime-compile-defun. For example,<br>
><br>
> (defun foo ()<br>
> (ë (x) (1+ x)))<br>
><br>
> works the way you'd expect if you compile the file it's in. But in the REPL bad things happen:<br>
><br>
> (defun foo ()<br>
> (ë (x) (1+ x)))<br>
> ;Compiler warnings :<br>
> ; In FOO: Undefined function Ë<br>
> ; In FOO: Undefined function X<br>
> ; In FOO: Undeclared free variable X<br>
> => FOO<br>
><br>
> (foo)<br>
> => Undefined function X called with arguments () .<br>
> [Condition of type CCL::UNDEFINED-FUNCTION-CALL]<br>
><br>
> (macroexpand '(ë (x) (1+ x)))<br>
> => (Ë (X) (1+ X))<br>
><br>
> And if you use slime-compile-defun on the (defun foo...) form, the following occurs:<br>
><br>
> While compiling FOO :<br>
> #1=(X) is not a symbol or lambda expression in the form (#1# (1+ X)) .<br>
> [Condition of type CCL::COMPILE-TIME-PROGRAM-ERROR]<br>
><br>
> 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<br>
> of Slime and CCL that doesn't like this macro. Does anyone have any ideas or suggestions?<br>
><br>
> Thank you,<br>
><br>
> Daniel Gackle<br>
><br>
</div></div>Are you sure that your macro is defined?<br>
(defmacro ë (arguments &body body) `(lambda ,arguments ,@body))<br>
<br>
(funcall (ë (x) (+ x 1)) 5) => 6<br>
<br>
Works fine here.<br>
<font color="#888888"><br>
--<br>
With best regards, Stas.<br>
</font></blockquote></div><br>