[Pharo-project] Need your point of view on FSPath * and others
bschwab at anest.ufl.edu
Sat Feb 19 14:24:00 CET 2011
I am not sure that #* would be all that confusing: I tend not to multiply path names all that often :) However, your question is well taken. How about #any or #all?
Attached are some methods that I use to ease the transition from Dolphin. Most of the calling code needs to be modified anyway (to change to Linux conventions), but at least the protocol is familiar. If I were starting over, I might reify paths and define #, to concatenate them.
From: pharo-project-bounces at lists.gforge.inria.fr [pharo-project-bounces at lists.gforge.inria.fr] On Behalf Of Stéphane Ducasse [stephane.ducasse at inria.fr]
Sent: Friday, February 18, 2011 5:40 PM
To: Colin Putney
Cc: Pharo Development
Subject: [Pharo-project] Need your point of view on FSPath * and others
I'm continuing adding comments to FS.
1- A question about
FSPath class>>* aString
^ self with: aString
I would like to deprecated FSPath class>>* and use with: since this is the message
What do you think?
I really prefer for static analysis point of view not to pollute numerical behavior with others.
Avoiding ad-hoc polymorphism will help us to build static checker in the future.
2- Then I was wondering if it would not be good to have validating creation methods
(FSPath * 'parent/child/') isRelative
(FSPath * '/parent/child/') isAbsolute
because the string is not checked
FSPath * '/parejhkjhhg %% ^%$%^(%$546547675 nt??child/'
I saw that there is
readFrom: aStream delimiter: aCharacter
so I created an unchecking instance creation category and I added with: and * in it.
And added comments
3- Then finally the following confuses me
(FSPath with: 'parent/child/') isRelative true
(FSPath with: '/parent/child/') isRelative true
(FSPath with: '') isRelative false
Either with: create relative path or isRelative is not consistent.
If with: creates relative path then the last one should be true
or isRelative should return false on the second one. ?
4 - about FSPath root
"Return the relative root path"
^ self with: ''
and I like that
Now what about defining root as
^ self with: '/'
It would be more consistent. Now it breaks everything. So I did not do it :)
May be I'm tired after 4 ours teaching and 6 hours train.
Thanks for your time
-------------- next part --------------
A non-text attachment was scrubbed...
Name: File class-file name manipulation.st
Size: 3063 bytes
Desc: File class-file name manipulation.st
More information about the Pharo-project