chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] eggs exporting syntax and functions


From: felix winkelmann
Subject: Re: [Chicken-users] eggs exporting syntax and functions
Date: Sun, 5 Nov 2006 10:05:10 +0100

On 11/4/06, Dan <address@hidden> wrote:

Hi, I'm trying to create an egg that exports both
procedures and macros. The egg creation docs seem to
suggest the follolwing (cumbersome) solution:

* the main extension, main.scm contains just macros
* in install-extension, mark the extension as (syntax)
* package the procedures in defs.scm
* in install-extension, add (require-at-runtime defs)

That's correct. I agree that this is somewhat cumbersome,
but currently there is now other solution, when syntax-
extensions are involved.


There's also the option of wrapping the main Scheme
file in a module, then forcing users of the egg to
(import) that module. But that seems dubious --
suppose that the main file is myegg.scm, which
contains

(module myegg (mac proc) ...)

I compile myegg.scm to produce myegg.so. Both the scm
and the "so" version are installed in the egg repo.
Then as a user I type

(require-extension myegg)
(import myegg)

Does proc now refer to the "interpreted" version in
myegg.scm, or to the compiled version in myegg.so?

The compiled version. importing an extension will macroexpand
the source file ("visiting" it) but not evaluate it. References to
procedures use the compiled version.


cheers,
felix

--
http://galinha.ucpel.tche.br:8081/blog/blog.ssp




reply via email to

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