[Pharo-project] Need your point of view on FSPath * and others

Stéphane Ducasse stephane.ducasse at inria.fr
Fri Feb 18 23:40:53 CET 2011


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
we have 

	"Return the relative root path"
	^ self with: ''

FSPath root
 	returns 	/
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


More information about the Pharo-project mailing list