[Top][All Lists]

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

[Chicken-users] Re: Scope problem?

From: felix
Subject: [Chicken-users] Re: Scope problem?
Date: Tue, 2 Jun 2009 08:38:18 +0000 (UTC)
User-agent: Loom/3.14 (

Peter Bex <Peter.Bex <at>> writes:


Thanks, Peter, for giving this explanation. It describes
the situation very nicely.

Just a few notes:

> I agree that it is confusing; especially the distinction between units
> that you have to load and units that you only have to import.  This line
> is drawn fairly arbitrarily; what ends up in libchicken is what you only
> have to import, what ends up in separate libraries is what you also need
> to load.  Here too, I think it's a good habit to always load any unit
> that's not "scheme" or "chicken".

That's what we call "core librares", which still need to be loaded, but they
are "loaded" directly from the libchicken shared library, not from 
a separate shared library file (a ".so" - a dynamically loadable file).
The distinction is in "require-library" (or "require-extension", which
uses it), which knows about the core libraries and does the right
thing for the identifier given as argument. 

The interpreter ("csi") just has one small additional library loaded,
but otherwise is empty. Now, the thing that might be confusing is that
the compiler has already loaded quite a number of libraries and thus
macros can access core-library definitions that might need to be 
loaded first when executed under csi.

Perhaps we should introduce the term "opening" for the process of making the
toplevel bindings of a library available (independent on whether it is a 
core lib or a dynamically loaded one).

IIRC all of this is documented, but not in an easy to comprehend manner
and all over the place in the manual. We will have to improve this.
Moreover chicken is very flexible with regards to how code is linked
or loaded, and it's hard to make this fully transparent.


reply via email to

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