This is the mail archive of the kawa@sourceware.org mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Strange error output for undefined macros inside macros


Kjetil S. Matheussen wrote:

When evaluating the following


"
(define-macro (foo)
  (foobar))
(define-macro (foobar)
  (display 520))
(foo)
"

I get the following error:

"Argument (#<macro foobar>) to 'apply-to-args' has wrong type (kawa.lang.Macro) (expected: procedure)"

It took me a long time to figure out that foobar needed to be evaluated
before foo. (of course, I didn't have this small example then. :-) )

Perhaps it would be better to say something like "The foobar macro needs
to be defined before defining foo" instead?

That might be difficult. It might be possible to say something like: macro was not processed at compile-time

In any case, define-macro is *strongly* deprecated.  Don't use it.
I should probably have it cause a warning ...
--
	--Per Bothner
per@bothner.com   http://per.bothner.com/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]