[Pharo-project] FSReference
I'm /really/ enjoying FS (I couldn't wait so I loaded it into 1.3-rc; all working so far). I keep finding myself writing things like: FSReference>>doSomething "double dispatch extension method" self isDirectory ifTrue: [ ... ] ifFalse: [ ... ]. I feel dirty every time, but FS doesn't make this piece of a reference's identity explicit. Would it be valuable to have FSFileReference and FSDirectoryReference subclasses? It would certainly make my code cleaner as I could then double dispatch without conditionals. Thanks. Sean -- View this message in context: http://forum.world.st/FSReference-tp3985640p3985640.html Sent from the Pharo Smalltalk mailing list archive at Nabble.com.
Sean P. DeNigris wrote:
Would it be valuable to have FSFileReference and FSDirectoryReference subclasses?
Another weird ramification of FSReference's identity ambiguity is, on a reference to an existing file: * #allChildren -> anArray containing only the file itself * children -> an error -- View this message in context: http://forum.world.st/FSReference-tp3985640p3985818.html Sent from the Pharo Smalltalk mailing list archive at Nabble.com.
we should record what you find so that we can fix it. On Nov 3, 2011, at 2:25 PM, Sean P. DeNigris wrote:
Sean P. DeNigris wrote:
Would it be valuable to have FSFileReference and FSDirectoryReference subclasses?
Another weird ramification of FSReference's identity ambiguity is, on a reference to an existing file: * #allChildren -> anArray containing only the file itself * children -> an error
-- View this message in context: http://forum.world.st/FSReference-tp3985640p3985818.html Sent from the Pharo Smalltalk mailing list archive at Nabble.com.
More ugly conditionals from inside the FS library... (self exists: path) ifTrue: [ (self isFile: path) ifTrue: [ self signalFileExists: path ] ifFalse: [ self signalDirectoryExists: path ] ]. (self isDirectory: parent) -- View this message in context: http://forum.world.st/FSReference-tp3985640p3985973.html Sent from the Pharo Smalltalk mailing list archive at Nabble.com.
participants (2)
-
Sean P. DeNigris -
Stéphane Ducasse