[plt-scheme] Very basic macro question

From: Noel Welsh (noelwelsh at gmail.com)
Date: Sun Jan 17 15:19:48 EST 2010

On Sun, Jan 17, 2010 at 7:25 PM, Jos Koot <jos.koot at telefonica.net> wrote:
> May be johny  seventy ran example four in the interactions window, there it
> works. In the definitions window it does not.

Definitions vs interactions is a top-level vs module issue. You have
to do the usual namespace dance (see the Guide or the list archives)
to get eval working as one might expect within a module.

in general eval works because it creates a new phase within which the
macro is expanded. Values in the run-time that *calls* eval are
available to macros expanded *within* eval. The alternative, which I
didn't really explain, is to shift the definition of the value back
into the transformer phase, and it is for this that I suggested using
define-syntax and syntax-local-value.


Posted on the users mailing list.