[Top][All Lists]

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

Re: Modified load-path proposal

From: Neil Jerram
Subject: Re: Modified load-path proposal
Date: Sat, 07 Jan 2006 13:37:48 +0000
User-agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/21.4 (gnu/linux)

address@hidden (Ludovic Court├Ęs) writes:

> Neil Jerram <address@hidden> writes:
>> How so?  Given that you're about to do a (use-modules (whatnot)), I
>> can't see that also doing (initialize-packages "whatnot") will make a
>> significant difference.
> Because people haven't been doing so for years.  Some of us certainly
> don't want to iterate over each and every Guile module to add this line.
> It's quite a big change and it's very interpreter-centric (okay, this
> last point is maybe not the strongest argument I could come up with
> ;-)).

Fair point.  It would be better to avoid this if we could.

> It would be different if the `initialize-packages' line could be added
> automatically --- in fact, `use-modules' could do it and this would be
> completely transparent to the module user (more below).


> Additionally, I'd be quite happy if the `initialize-packages' phase
> could be made automatic.  This could be done like this:
>   1. Packages install their module hierarchy wherever they want;
>   2. In addition, packages may install a start-up file in, say,
>      /usr/share/guile/packages/ (installing these files into the right
>      Guile directory could be done by a wrapper script, say
>      `guile-install-module-init').
>      For instance, if I am to install the complete `foo' module
>      hierarchy, then I can install /usr/share/guile/packages/foo.init
>      that will be read, if available, the first time a `(foo SOMETHING)'
>      module is loaded.  If that file was available, its content (a
>      string) are added to `%load-path'.
> More generally, when module `(foo bar)' is loaded for the first time,
> Guile could:
> 1. Look for /../packages/foo/bar.init and use its content to
>    augment `%load-path' if available;
> 2. If the previous file wasn't available, look for
>    /../packages/foo.init and use its content to augment
>    `%load-path' if available;
> 3. If no `init' file was found, just leave `%load-path' unchanged.
> This way, `init' files are loaded on demand, like in your
> `initialize-packages' approach.  However, it is less intrusive.
> This is based on the observation that (i) we want modules to be
> installable in *any* directory, but (ii) at some point, there must be a
> *fixed* directory to look for files to bootstrap further file loading.

This is all possible, but it feels to me quite complex and not very
elegant; it doesn't feel right to have a shadow tree of potentially
all installed modules under $sysconfdir.

It seems to me that neither of these ideas (yours and mine) quite fly
yet.  I have yet another idea, though, that I'll post in a separate
thread shortly.


reply via email to

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