This is the mail archive of the guile@cygnus.com mailing list for the guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Loading files that load files? Questions and proposal.


-----BEGIN PGP SIGNED MESSAGE-----

Mikael Djurfeldt <mdj@nada.kth.se> wrote
>There is a load path specified by the variable `%load-path'.  It
>either contains a standard path derived from the "prefix" path during
>Guile configuration, or a path defined through the environment
>variable GUILE_LOAD_PATH.

[ Also suggested by orre@nada.kth.se (Roland Orre). ]

I looked at this before making my proposal...sorry, I should have spelled
out my objections to it more clearly.  The problem with the load-path is
that you have to either:

a) Install your Scheme code in one of the preset directories from the Guile
configuration.  This is messy, however--I don't want users mucking around
with the standard Guile directories anytime they have their own Scheme code
package that they want to use.  Besides, it requires the permission to
modify the system directories, which a user may not have.

or:

b) Extend the load path to include your Scheme directory before loading any
files in it.  This means that the user of your code has to do something like:

(extend-load-path "<path>")
(load "<path>/<scheme file>") ; or use-module, etcetera

(The extend-load-path can't go in the loaded scheme file itself, because
the path it specifies is relative to an unpredictable directory.)  I guess
this isn't so bad, but it would be nicer if load just did the right thing.
It is annoying to force the user to remember two commands to load your
code, instead of one.

load, in its current form, is useless anywhere except the "top level" of
your program.  It cannot be used in included files because those files
cannot predict the path that load is relative to.  Since it can be modified
so simply to be useful everywhere, without breaking backward compatibility,
this seems like the right thing to do.  (It would give us the equivalent of
cpp's file-relative #include "file" feature.)

Cordially,
Steven G. Johnson


-----BEGIN PGP SIGNATURE-----
Version: PGPfreeware 5.0 for non-commercial use <http://www.pgp.com>
Charset: noconv

iQEVAwUBNV3lNu3fOMhN2WfhAQEZPwf/TDyUOYp59FZbxfD+59tR1LckSPnMfnnJ
P4r2Ux0AvAR6xUs6+wgXimABSHAkkUhEJwOHoAEV/yDTbzbuwZigK3Xxe88wHDSu
5EIYuA1VDhPI9NqGYVmI2DPVepLpHBzlGst3DJ+ZQs+MeN5MrDJ3aFkpF50sI5qs
FNzWRxunowF+FE7Naxrx5YH/GhKbIA/ObC/RY0ZYG9XiCsphHglBJFnLEzrhMCyd
seKYamPWgeS5wMBw9odC4JCV+24hhpNZ4VkxfpIZ9kEcprPtVnGEwH2JeNzdxaDt
dRm4BeMxj9cYkuTPiUcA++xTnWZ0IkVcgzwWuxDY3UCifSEh96E0/A==
=88AY
-----END PGP SIGNATURE-----