[plt-scheme] macros and eval

From: Jakub Piotr Cłapa (jpc-ml at zenburn.net)
Date: Fri Mar 14 13:33:56 EDT 2008

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 
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. :)

Jakub Piotr Cłapa

Posted on the users mailing list.