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
It's well written to make the minimal and most reliable changes, including a change to FileStream>>next even though that method appears to be uncallable.
There is an oddity in that tag: is only applied in one case. Even so, the changeset is a step in a good direction.
<This post brought to you by BFAV2>
squeak-dev@lists.squeakfoundation.org