[Second attempt, my Emacs has unfortunate issues with Ludovic's name...]
An hour ago, Andy Wingo wrote: > On Mon 02 May 2011 22:58, l...@gnu.org (Ludovic Courtès) writes: > > > Andy Wingo <wi...@pobox.com> writes: > > > >> Basically I think the plan should be to add scm_from_locale_path, > >> scm_from_raw_path, etc to filesys.[ch], and change any > >> pathname-accepting procedure in Guile to accept path objects, > >> producing them from strings when given strings, and pass the > >> bytevector representation to the raw o/s procedures like `open' > >> et al. > > > > Seems to like a disjoint type “just for Windows” would be > > overkill, no? > > Maybe you're right; hummm! I have added a kind racketeer on Cc; perhaps > if he has time, he might have some thoughts in this regard. :-) I don't think that I can contribute much -- I'm mostly looking at these things from a user's point of view... Roughly speaking (mostly because I don't know what the issues that you're up against), our path values have "just paths" for whatever the OS wants -- so on Windows they might have either backslashes or slashes (since Racket accepts both). To write portable code we don't have a `file-separator' thing, instead, we have `build-path' that combines two paths with the right separator. Similarly, we have `split-path' to split up a path to the directory part and the last part. I think that it's generally better this way, since it represents the higher level operation rather than fiddling with the semantics of where and how to put separators directly (but this is not some religious issue, just seems to me like it would be more convenient). Also, we have cases where we want something that looks like a portable path (for example, naming relative file names in `require') -- for those we use /-separated strings that are limited to "safe" characters. And related, in cases where we want to encode path in code (for example, some macro that wants to generate a path), we'll use strings or byte strings, with the latter more common for lower level things. (But I'm just rambling now, I haven't slept in N days -- so feel free to ignore me...) -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://barzilay.org/ Maze is Life!