[erlisp-devel] undefined-symbol
Eric Lavigne
lavigne.eric at gmail.com
Fri Sep 2 14:07:03 UTC 2005
> > I am confused by this error message.
> >
> > ;
> > ; File: /root/erlisp/erlisp-cmucl/erlisp/src/manager.lisp
> >
> > ; In: DEFUN SYSTEM-MANAGER-PROCESS
> >
> > ; (RECEIVE-WITH-MATCHER (COND-MATCHER M) (T M))
> > ; Error: (during macroexpansion)
> > ; Error in KERNEL::UNDEFINED-SYMBOL-ERROR-HANDLER: the function
> > LISTEN-TO-SYSTEM-MANAGER is undefined.
>
> In the files you attached there was no call to this function, and as I
> have not checked out the source I can't be sure, but apparently some
> macro calls LISTEN-TO-SYSTEM-MANAGER during its expansion.
Probably these calls occur in messaging.lisp. I forgot to include that
file, and I won't have access to that computer again until tonight.
Each process uses that function before send/receive to check whether
it has orders to die.
>
> Now normally macroexpansion happens before functions are loaded.
> Therefore a macro should normally expand without calling functions
> (but may of course include function calls in the generated expansion
> code).
receive-with-matcher is a macro. listen-to-system-manager is called at
the beginning of that macro. Instead, the macro should just be
producing code that calls listen-... instead of calling listen-... and
then producing code. I see my mistake now.
>
> When you really want to have a function to be available at
> macro-expansion time, you have to wrap the function in eval-when, like
> what now happens already with many functions in messaging.lisp:
>
> (eval-when (:compile-toplevel :load-toplevel :execute)
> (defun LISTEN-... (..) ..)
> )
>
I don't need it at macro-expansion time. I was treating macros as
though they were functions. This should be easy to fix now that I know
what the problem is. Without seeing the function call, how did you
figure out that I was calling that "missing function" from a macro?
Eric
More information about the Erlisp-devel
mailing list