[plt-scheme] Requiring absolute path

From: Paulo J. Matos (pocmatos at gmail.com)
Date: Mon Jun 15 11:46:56 EDT 2009

Hi all,

I have a scm file which is a library to another file and once this
library is installed it resides in the system and I know its absolute
path.
The client only knows its absolute path. Obviously the relative path
to it depends of where the client is, so I tried:
(require (path->string (find-relative-path (current-directory)
"/home/pmatos/Software/eboc/src/modes/esmc-mode/eventb-lib.scm")))
path->string: not a require sub-form in: (path->string
(find-relative-path (current-directory)
"/home/pmatos/Software/eboc/src/modes/esmc-mode/eventb-lib.scm"))

but it doesn't work. Nor this [and I understand that both cases don't work!]:
(define src (path->string (find-relative-path (current-directory)
"/home/pmatos/Software/eboc/src/modes/esmc-mode/eventb-lib.scm")))
(require src)
 src: standard-module-name-resolver: collection not found: "src" in
any of: (#<path:/home/pmatos/.plt-scheme/4.2/collects>
#<path:/home/pmatos/Applications/plt/plt-4.2/lib/plt/collects>) in:
src

So, I though, maybe with dynamic require I can require it by using a
relative path known at run time or an absolute path known at
compile-time. But I have no idea on how to use dynamic-require to get
all the exports of the module... because I don't really understand
what's the difference of providing a #<void> or #f as second argument
to dynamic-require.

Any suggestions?

Cheers,

-- 
Paulo Jorge Matos - pocmatos at gmail.com
http://www.pmatos.net


Posted on the users mailing list.