[gambit-list] Gambit installer

Christian Jaeger christian at pflanze.mine.nu
Wed Oct 1 14:23:51 EDT 2008


Adrien Pierard wrote:
> One could even override this with the Perl way:
> (include (get-env "$GAMBCDOC") "gambit.html")
>   

(small detail: there is |getenv| already, which doesn't expect a dollar 
sign: for example (getenv "PATH").)

> where $GAMBCDOC is a list of documentation directories provided by the
> environment when calling the program.
>   

The "Perl way", and the only way making this useful (i.e. standard and 
consistent for all code) would be to have the system handle the 
environment variables transparently.

If you say "use Foo;" in Perl, it will look at the @INC array of paths, 
which is dependent on:
- a few paths fixed at Perl's configure/compile time
- paths given in the PERL5LIB (or PERLLIB) environment variable(s)
- additionally any occurrence of "use lib '/some/where';" in the loaded 
Perl program adds (well prepends) to the @INC array, too.

> (include doc "gambit.html")
> (load extra "syntax-case.scm")
> (include lib "gambit#.scm")
> (load "file_here.scm")
>   

I don't think you usually want to use |include| for doc or other 
non-"lib" directories (well once syntax.case.scm has moved into lib, 
anyway), and likewise there's no use for lib and so on if you want to 
get at the doc basedir. So I suggest this instead:

- keep the current forms and procedures single-argument
- interpret ~~ in paths given to them differently; i.e. move from ~~ 
meaning a single location to meaning whatever paths are sensible for a 
given function/form.
- search non-absolute (i.e. ~~ and relative paths) given to the 
procedures and forms in path lists, which are being determined by (a) 
configure time hard-coded ones, (b) determined by some environment 
variable, (c) changeable by the user by changing a parameter object.

This makes it really as flexible as paths handled in Perl, it avoids 
having to clutter up the above forms, and stays backwards compatible. A 
complete implementation of these features can be found here:

http://scheme.ch/gambit/experimental/paths/paths.scm
git clone http://scheme.ch/gambit/experimental/paths/.git

Christian.




More information about the Gambit-list mailing list