Cross-platform path specification (was RE: Access directory relatively)

Tim Rowledge tim at sumeru.stanford.edu
Tue Aug 6 20:31:13 UTC 2002


> > Why not:
> > 
> >     dir := FileDirectory default / 'foo' / 'bar' / 'baz'.
> 
> 'cause that selector is commonly used for division?!
> 
> > or
> >     dir := FileDirectory default @ 'foo' @ 'bar' @ 'baz'.
> 
> And that for point creation?!
Andreas is exactly right. Aside from anything else they're both special
selectors as well so the compiler tries to optimise for them doing the
'normal' thing. @ is actually quite hard to make do anything other than
make points.

I really think that comma is a good selector to use, since we really are
concatenating elements on to a path. People really do need to understand
that filenames are not strings and you can't properly build them by simply
sticking strings together with slashes in there somehow. There's a bunch of
truly awful code lying around the image that makes that assumption and it
needs to be excised, root and branch.

tim
-- 
Tim Rowledge, tim at sumeru.stanford.edu, http://sumeru.stanford.edu/tim
Useful random insult:- An experiment in Artificial Stupidity.




More information about the Squeak-dev mailing list