[plt-scheme] Require and a path

From: Alex Peake (alex.peake at comac.com)
Date: Tue Apr 5 01:51:06 EDT 2005

Thank you for your kind help.

I did read the document before asking. If I could have figured it out I would not have asked.

Why does:

(require (file (build-path "Dev" "CodeGen" "string-utils.scm")))

Not work then?

since (build-path ... creates a path string  -- "Dev\\CodeGen\\string-utils.scm"


Alex

> -----Original Message-----
> From: Zhu Chongkai [mailto:mathematica at citiz.net] 
> Sent: Monday, April 04, 2005 9:45 PM
> To: Alex Peake
> Cc: plt-scheme
> Subject: Re: [plt-scheme] Require and a path
> 
> >I have expressions like:
> >
> >(require "string-utils.scm")
> >
> >Is there a way to use a full or relative path here? I have tried 
> >(require (build-path 'up "string-utils.scm")) and (require (file 
> >(build-path 'up "string-utils.scm"))) etc.
> >but it all fails with "bad module path ..."
> >
> >
> >Thanks,
> >
> >Alex
> >
> 
> The <PLT MzScheme: Language Manual> tells every thing. Since 
> you asked, I repeat them here. But you should read the 
> document before asking.
> 
> section 5.2
> >
> >(require require-spec ...)
> >
> >require-spec is one of
> >  module-name
> >  ...
> >
> section 5.4
> >
> >module-name is one of
> >
> >unix-relative-path-string
> >(file path-string)
> >(lib filename-string collection-string ...) (planet . datum) path
> 
> 
> The (file path-string) is just what you want.
> 
> 
> Zhu Chongkai
> http://www.neilvandyke.org/mrmathematica/
> 
> 



Posted on the users mailing list.