[plt-scheme] dynamic require

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Mon Jun 6 16:24:01 EDT 2005

At Sun, 05 Jun 2005 23:34:36 +0200, Hans Oesterholt-Dijkema wrote:
> > If I understand your complaint correctly, you're expecting 
> > module-paths to have a platform-specific separator character, though 
> > in MzScheme they don't. As I understand it, this 
> > platform-insensitivity is key in making it possible to write 
> > cross-platform code.
> 
> Nice, however, I didn't give the whole picture. Using 'build-path', 
> mzscheme itself
> returns a path with backslashes on windows. 

Just to be clear, `build-path' returns a path value, not a string.... 

> With this returned path of 
> mzscheme
> I tried to do a dynamic-require.

...and passing a path to `dynamic-require' should work, although the
path must be absolute. (Use `path->complete-path' to explicitly convert
a relative path to an absolute path.)

When `dynamic-require' gets a path (as opposed to a string), it treats
it as a filesystem path, as opposed to a URL-like path.

To provide a string as a path to `dynamic-require', you can use a
quoted `file' form, usually constructed like this: `(file ,str).

I may misunderstand your goal, but my guess is that passing a path
value to `dynamic-require' is the best thing in this case.

Matthew



Posted on the users mailing list.