chicken-users
[Top][All Lists]
Advanced

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

[Chicken-users] Giving (load)ed files access to macros?


From: Alejandro Forero Cuervo
Subject: [Chicken-users] Giving (load)ed files access to macros?
Date: Fri, 2 Jun 2006 17:42:10 -0500
User-agent: Mutt/1.5.9i

Hello.

I have chicken egg that exports a “load-extension” function.  These
extensions are just Scheme files that define certain functions (so my
meaning of «extension» in this context does not correspond to the
meaning of «chicken egg»).  Inside, load-extension uses “(load ...)”
to load the file and extract the functions.  Basically, my egg exports
the symbols it expects the extensions to define; the extensions, as a
result of being (load)ed, (define) those symbols; when (load) returns,
my egg captures the current values of those symbols in a table (and
then it is ready to load more extensions).

An extension looks as follows:

   (define (some-func f)
     (* f f))

   (define *table*
     `((square ,some-func)))

Is it possible to make macros available for these loaded Scheme files?
I want them to be able to use (use) and (receive) and (unless) and
many other macros, but this is failing.

Or, if not, how would you recommend that my egg loads (at runtime) the
definitions from a certain Scheme file and adds them to a table?
Using the sandbox egg I would have to add lots of symbols to the
environment in which I load/eval my files so I figured I was better of
without it.  Also, I'm expecting to eventually make it possible (but
not mandatory) to compile the extensions.

Thanks!

Alejo.
http://azul.freaks-unidos.net/




reply via email to

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