I asked a similar question a while ago, and I received a good explanation of why this is the case (you have to work with bytes instead of strings). However, the error messages reported by the path functions are indeed confusing and could be improved:
https://groups.google.com/forum/#!searchin/racket-users/unix$20paths|sort:date/racket-users/OAXqQd7XYbc/1PIrHmSrDAAJ Alex. On Wednesday, January 9, 2019 at 12:56:14 AM UTC+1, David K. Storrs wrote: > > (build-path/convention-type type > base > sub ...) → path-for-some-system? > > type : (or/c 'unix 'windows) > base : (or/c path-string? path-for-some-system? 'up 'same) > sub : > (or/c (and/c (or/c path-string? path-for-some-system?) > (not/c complete-path?)) > (or/c 'up 'same)) > > > > (build-path/convention-type 'windows 'up 'up 'same) > #<windows-path:..\..\.> > > I can generate windows paths... > > (build-path/convention-type 'windows "foo") > ; build-path/convention-type: specified convention incompatible with > string > ; path element > ; path element: "foo" > ; convention: 'windows > ; [,bt for context] > > Huh. Not from something that is clearly a path-string...'sub' is > optional, so what's the issue? Maybe it needs a drive letter? > > > (build-path/convention-type 'windows "c:\\foo") > (build-path/convention-type 'windows "c:\\foo") > ; build-path/convention-type: specified convention incompatible with > string > ; path element > ; path element: "c:\\foo" > ; convention: 'windows > ; [,bt for context] > > Nope. > > I'm not going crazy, am I? "foo" is still a path-string? > > > (path-string? "foo") > #t > > Yup. > > What am I missing? I'm running on OSX and I expected this to work for > generating Windows paths. > -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.