chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] import libraries


From: felix winkelmann
Subject: Re: [Chicken-users] import libraries
Date: Sat, 26 Jul 2008 22:21:29 +0200

On Fri, Jul 25, 2008 at 5:33 PM, Hans Bulfone <address@hidden> wrote:
> hi,
>
> i don't understand import libraries fully.  is it useful to generate
> one if a module doesn't export syntax?

The import library contains the compile-time information
and registers the module. The advantage is that this
registration code is pointless at runtime (unless you run
a REPL) and that it supports situation where the system
on which you compile is different from the system on where
your code runs (i.e. cross-compilation).

It doesn't make a huge difference, if you don't export
syntax, but for the sake of consistency I would recommend
to always generate an import library for eggs.

>
> also, when i generate one for my mpd-client module, it starts with
>
> (eval '(import scheme (only chicken ...) ...))
>
> which is the import declaration of my module.
>
> doesn't that cause superfluous bindings to be imported into the
> toplevel when the import library is loaded?
> (especially when it's loaded manually, like described in the Modules
> and macros manual chapter)

Yeah, that is sort of a hack. The point of it is to pull in any
syntax-definitions
that might be re-exported. The import-library is usually loaded via `import',
that is, under control of the macro-expander. I'm currently not totally sure
whether this is the right way, but as long as it works, I wouldn't worry.

Thanks for your input. The module system may need some tweaks
here and there and still has somewhat of an experimental touch,
but works well enough to use it (and thus get more experience).


cheers,
felix




reply via email to

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