[Top][All Lists]

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

Guile `load' question [comp.lang.scheme]

From: Ian Grant
Subject: Guile `load' question [comp.lang.scheme]
Date: Mon, 07 Jan 2002 15:35:54 +0000

------ Forwarded Article <address@hidden>
------ From address@hidden (Dorai Sitaram)

This is with Guile version 1.3.4, the one that ships
with Red Hat Linux 7.1 (Seawolf).

The `load' procedure appears to resolve its pathname
argument relative to the loading file, rather
than the current working directory.  

This is arguably a more sensible semantics for `load'
(cf HTML).  However it is quite different from the
`load' in other Scheme impls, creating a
portability concern.  It is necessary to get the
"usual" behavior of `load' somehow, since that meaning
has its uses too in routine coding.  In particular,
expressions like

  (if (file-exists? f) (load f))

can fail because the `f' seen by `file-exists?'
is different from the `f' seen by `load'.

(I was able to jury-rig a more mainstream `load' using
Guile's `getcwd' procedure but it's band-aid-y.)

If some Guile expert would weigh in on the
options provided, I'd much appreciate it.


ps: By way of comparison, this behavior is
provided by MzScheme with a new procedure called
`load-relative'.  Mz's `load' is always relative to
current working directory.

------ End of Forwarded Article

Ian Grant, Computer Lab., William Gates Building, JJ Thomson Ave., Cambridge
Phone: +44 1223 334420

reply via email to

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