[squeak-dev] Re: Rio: exceptions documentation
bonzini at gnu.org
Fri Nov 28 19:07:26 UTC 2008
The naming conventions seem to be a bit inconsistent: for example, why not
> aStream := 'aGivenFileName' asFile reader.
> 'aGivenFileName' asFile reader: [ :str | aChar := str next ].
> The latest Rio is available from Universes, be prepared to replace
> senders of asRio with asFile/asDirectory
I switched from File/Directory to just File in GNU Smalltalk 3.1. It
proved to be a mess to use two classes (you can differentiate with
#entries vs. #contents). It seems a good idea in the beginning, but
when you add virtual filesystems (which Rio has IIUC) such as ZIP file
transparent access, you get code duplication all over the place.
One alternative is to have an internal class for OS access and provide
two facades, one exposing only file protocol and one exposing only
directory protocol. This is actually what GNU Smalltalk < 3.1 did. But
they have to be ready to fail anyway (e.g. if you do "'foo' asDirectory"
and someone does "'foo' asFile touch" concurrently or outside Squeak),
so IMO it is not really worth it.
More information about the Squeak-dev