[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] macro expansion

From: Felix Winkelmann
Subject: Re: [Chicken-users] macro expansion
Date: Wed, 11 Dec 2002 15:44:52 +0100
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.0.0) Gecko/20020530

Joerg F. Wittenberger wrote:

More primitive: The loaded code contains

(define-macro (my-fine-macro arg) `(my-damn-proc ,arg))

and the loader appears not to know about 'define-macro' and hence
complains about variable 'arg' not bound (when preparing the call to
'my-find-macro instead of defining it.)

You are loading a source-file, not a compiled file, right?

By default a compiled program that evaluates code
only understands the core R5RS macros (but without
define-syntax, etc.). To make the extended macro-
definitions available at runtime, you have to
make the macro-definitions available at runtime.
There are two ways to do it:

1) Load and evaluate "moremacros.scm", for example
   with (require 'moremacros).
2) Include the macro-definitions in the compiled code,
   which is more efficient and uses the fact that low-level
   macros are also available at runtime (unless you use
   the `compile-time-macros-only' declaration):

   (include "moremacros")

(On a normal setup, the compiler should find moremacros.scm
automatically, since it is in the default include-path)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]