[plt-scheme] 352.8

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Fri Oct 20 18:50:23 EDT 2006

At Fri, 20 Oct 2006 23:53:09 +0200, Jens Axel Søgaard wrote:
> It would however
> be nice to have string->windows-path and string->unix-path
> so that one can work with Windows paths on Unix and
> vice versa.

I can imagine extending the "path" datatype so that it has a kind:
'unix, 'macosx, or 'windows. (There's no difference between 'unix and
'macosx paths, but kinds should probably stay in sync with the results
of `system-type'.)

Then some procedures, like `split-path', could work on all kinds of
paths, while other procedures, like `open-input-file' require a path
for the current platform.

This change would expose all of the useful path-processing
functionality in MzScheme's source code, while pushing into other
libraries the question of how roots and path elements should be related
across platforms. For example, it's not clear what to use under Unix
for the Windows root "C:\\" or "\\\\machine\\volume" or
"\\?\#^%$#^@\\\\", what to use under Windows for the Unix root "~", or
what to do with a Unix path element like "a\\b" or a Windows path
element "a/b".

Pending further comments, I'll plan to make that change, but not right


Posted on the users mailing list.