[plt-scheme] Re: macros and eval

From: jomirez (jomirez at gmail.com)
Date: Fri Mar 14 14:34:44 EDT 2008

On Mar 14, 6:33 pm, Jakub Piotr Cłapa <jpc... at zenburn.net> wrote:
> jomirez wrote:
> > When i stick the code into the body of the "main" source file, all
> > works fine  But i want to compile it into executable (for
> > deployability) and use that as an interpreter for the job files. I
> > tried evaling/loading the file with job definitions from within the
> > main code, and the macros won't get expanded (complaining "reference
> > to undefined identifier: job")
>
> I've got similar problems when I wrote my program. Try reading up on
> namespaces or searching for my older posts on this list. The basic
> principle is that eval or load don't use your modules namespace. The
> work on the top-level namespace (which is almost empty and certainly

oh, i've read that too, but i totally misunderstood what is meant as
top-level.
so i meant that eval somehow doesn't do syntax transformation, which
is whacked in the head now that i think of it.

> doesn't contain your module's imports or definitions). The correct way
> to do this is to create a new namespace, attach some modules to it,
> parametrize the current-namespace and then run eval inside it.
>
> PS. When I return home I'll try to show some code examples. :)
>

well, now that i know where i should look, let's see whether i'll
crack it over the weekend (no net access during weekend, but if it
wouldn't bother you, send those examples for the case i don't figure
it out, or for comparison and others).

thanks in advance.

jomirez

> --
> regards,
> Jakub Piotr Cłapa
> _________________________________________________
>   For list-related administrative tasks:
>  http://list.cs.brown.edu/mailman/listinfo/plt-scheme


Posted on the users mailing list.