LabRat

danielv at netvision.net.il danielv at netvision.net.il
Sat Nov 17 15:21:40 UTC 2001


You are rightly hesitant in this case - the implementation is a usage
guidance - you are not supposed to create Streams without specifying an
object to be streamed over. This is the role for the parameter of
on:/with:.

Maybe you could explain why you want to separate the creation of the
stream from it's configuration - there might be an easier way to achieve
whatever it is you're trying to do.

Generally though, Squeak is easier to understand if you assume that the
code is (sometimes) meant as a message to whoever will use it in the
future (like you are doing). self error: 'Streams are created with on:
and with:' is exactly that. That's the logic in the apparent folly of
implementing a method so that it will raise an error unconditionally...

Daniel

Philip Knodle <pknodle at bu.edu> wrote:
> Yeah, this is a good idea.  I'll refactor my code now that I have the 
> refactoring browser working.
> I should have been more precise with my question.  I needed to change 
> the implementation of Stream new from
> 
> Stream new
> self error:'Streams are created with on: and with:'
> 
> to
> Stream new
> ^ super new
> 
> Since I'm a relative newbie, I'm hesitant to change things like this.  I 
> want to reuse the Streams
> class, but I also want to keep this sort of change to a minimum.
> 
> --
> Happy Hacking
> Phil Knodle




More information about the Squeak-dev mailing list