guile-devel
[Top][All Lists]
Advanced

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

Extending default %load-path via environment variable


From: Andreas Rottmann
Subject: Extending default %load-path via environment variable
Date: Tue, 07 Feb 2012 00:30:33 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.93 (gnu/linux)

Hi!

I just noticed that Guile apparently offers no way to _extend_ (as
opposed to completely override) its load path (or compiled load path)
via an environment variable.  What I'd like to have is something like
Racket, where setting PLTCOLLECTS to "/foo/bar::/qux/baz" means: Search
/foo/bar first, then the default path (whatever it may be), then
/qux/baz.

I'm not fixed to having this functionality exposed via an environment
variable, extending the set of options would be OK as well; but still,
there is an option missing to achieve the effect described above -- one
cannot add _after_ the default load path, just prepend to it.  Also,
besides the environment variable GUILE_LOAD_COMPILED_PATH, there seems
to be no possibility to influence %compiled-load-path, which hence also
lacks extensibility without knowing (or determining) the default value
beforehand.

Here is my proposal:

- Change `parse-path' to insert the default value if there is any empty
  element in the path.

- Add command-line options to
  - Append to the %load-path
  - Prepend and append to %load-compiled-path

Ideally, I'd like to add this functionality to stable-2.0, but it is an
incompatible change: ATM, an empty component is treated as "current
directory".  Adding the current directory could still be done in my
proposal by using "." (single dot).  Requiring an explicit dot would
also diminish the odds of unintentionally adding the current directory
via string concatenation in the shell: 

  GUILE_LOAD_PATH="$GUILE_LOAD_PATH:/my/directory"

The above code would currently add the current directory to the path if
$GUILE_LOAD_PATH is empty, while it would have the (probably) intended
meaning even under my proposal in any case.

If this change is deemded not suitable for stable-2.0, I'd like to add
(only) the command-line options in stable-2.0, and make the `parse-path'
changes in master only. Suggestions for option naming welcome!

WDYT?
-- 
Andreas Rottmann -- <http://rotty.yi.org/>



reply via email to

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