This proposal is for Squeak 3.7alpha #5623
We have a resumable exception EndOfStream, that we do not use. The comment of that exception reads:
'Signalled when ReadStream>>next encounters a premature end.'
but this is not true.
In ReadStream>>next, we have:
next <primitive: 65> position >= readLimit ifTrue: [^nil] ifFalse: [^collection at: (position _ position + 1)]
To really use the exception hanlding mechanism, we have to replace the "^nil" with
^EndOfStream new signal.
The default action of EndOfStream returns the value nil. This is compatible with the current behavior of method "next". It is therefore not necessary to modify the senders of this message.
The attached change set contains this change for several kinds of streams.
Greetings, Boris