a simple question about streams
Lex Spoon
lex at cc.gatech.edu
Sat Dec 13 02:41:14 UTC 2003
ducasse <ducasse at iam.unibe.ch> wrote:
> I was browsing the senders of respondsTo: (another implicit use of MOP
> entry that is abuse in Squeak) and
> I found a lot of repeting sequence
>
> (stream respondsTo: #binary) ifTrue: [ stream binary] .
>
> (stream respondsTo: #close) ifTrue: [stream close].
>
> Wonderful illustration of lack of common protocol....I was wondering
> why it was like that?
> why all the streams cannot get close (even if per defaut closing a
> stream that could not get close woudl do nothing a.k.a NullObject).
>
Nowadays, such methods do indeed exist. So it would be nice to start
getting rid of these respondsTo's.
Also, #close is required by ANSI.
-Lex
More information about the Squeak-dev
mailing list
|