Re: apparently undefined function called by macro



In article <4gd3pbF1ltb63U1@xxxxxxxxxxxxxx>,
Stefan Mandl <stefan.mandl@xxxxxxxxxxxxxxxxxxxxxxxxxx> wrote:

: From my limited knowledge:
:
: Remember that macros are functions that run during compilation.
:
: When you call:
:
: (define-foo-class bar
: ((baz :initarg :baz :accessor baz)
: (quux :initarg :quux :accessor quux)))
:
: the *compiler* has to call the macro function and therefore has to call
: your id function.
:
: So in order to make sure that the compiler knows id's definition,
: wrapping id into a eval-when form is no mere workaround but standard
: technique.

Thanks, Stefan.

I see that FAQ 3-7 also addresses the issue:

http://www.cs.cmu.edu/Groups/AI/html/faqs/lang/lisp/part3/faq-doc-8.html

I was confused because in chapter 24 of PCL, Seibel defines similar
macros that call functions, and all the code is ASDF-loadable.

The difference that I missed is he defines the macros in one package and
expands them in others after the whole supporting cast has been loaded.

Greg
.



Relevant Pages

  • Re: Reflections on a classic Lisp Paper
    ... lisp dialects. ... user-defined special forms - Macros, Fexprs, and Nlambda. ... compilable because the compiler just couldn't do it. ...
    (comp.lang.lisp)
  • Re: Cpp Considered Harmful
    ... > However, in either case, assertions are invaluable in making certain ... because we now have our own cpp ... > macros, we can use several different compilers and have our system ... > built into the compiler. ...
    (comp.lang.cpp)
  • Re: Doing mini-languages in CL
    ... > Thats it in a nutshell. ... I think the detail to note is that the Macro facility is a Compiler ... simply put you may well be able to leverage CL macros in building your ...
    (comp.lang.lisp)
  • Re: Why doesnt Lisp automatically differentiate functions and macros?
    ... what stops a Lisp machine from figuring automatically which ... small subset of things macros can do that you are thinking is all they can ... This requires the compiler to know how to do things. ... things that the compiler writer didn't think to, ...
    (comp.lang.lisp)
  • Re: Doing mini-languages in CL
    ... "Will Hartung" writes: ... >> address fixup grunt work to it. ... > Your compiler will already take S-exprs, but there's nothing that says those ... and you find you won't necessarily need macros. ...
    (comp.lang.lisp)