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: Mon, 28 Jul 2008 11:47:45 +0200

On Sun, Jul 27, 2008 at 4:30 PM, Hans Bulfone <address@hidden> wrote:
>
> so, if one wants to make an egg that is also statically linkable, one
> should still just compile the import lib to an .so (with the host
> compiler) as it is only used at compile-time and is not useful as .o ?

That's correct. The linking is done via "require-library" or declaring
a unit. The "-static-extensions" option modifies the default behaviour (in a
somewhat crude manner) - actually, I haven't tested this yet...

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

To answer the question: the `eval' is there to ensure the imports
are processed in the process that loads the import lib, not when
compiling it (as would have been the case, if the imports where
not wrapped into `eval').

> so the bindings are only imported into toplevel (and normally only at
> compile-time), not in another module i might be defining, which
> happens to import the mpd-client module, right?

Right, the bindings are imported into a clean environment, but only
to make sure the import libs (and thus the module information) is
available. The normal expansion takes place in a different environment.


cheers,
felix




reply via email to

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