Enhancing squeak base classes
Damien Cassou
damien.cassou at gmail.com
Wed Mar 7 09:42:14 UTC 2007
2007/3/6, J J <azreal1977 at hotmail.com>:
> Ah very cool. What tool are you using to build the traits?
I do not use any tool but the standard OmniBrowser. I will try TraitOB
soon but don't like the fact that it overrides lots of things and
implements a new browser instead of enhancing the current one.
2007/3/6, J J <azreal1977 at hotmail.com>:
> Are you
> treating the traits kind of how Haskell treats type classes (basically just
> a way to specify that an object implements a protocol) or as another way of
> inheritance?
I think it's more like the second solution but you will tell me. What
I do is separating the different protocols that can be found in
streams: one trait for reading behavior (#next, #peek, #skip:...), one
trait for accessing postion (#position, #position:, #setToEnd,
#reset...), one trait for writing... Then, I implement the classes
that can be found in the base image. For example, ReadStream is a
combinaison of reading behavior and accessing position (I renamed it
ReadableCollectionStream).
--
Damien Cassou
More information about the Squeak-dev
mailing list
|