On 2013-05-28, at 12:04, Lars Wassermann <
[hidden email]> wrote:
> Hello Squeak-dev,
>
> SharedQueue>>#nextOrNil is deliberately implemented in such a way, that it raises an error instead of returning nil, in case the Queue is empty.
No, I think you are misreading the code:
SharedQueue new nextOrNil
==> nil
SharedQueue new nextPut: 42; nextOrNil
==> 42
SharedQueue new nextPut: 42; nextOrNil; nextOrNil
==> nil
> From the versions, it is obvious that this change was an 'improvement'.
> Can anybody remember _why_ this change was done?
The error is merely there to alert you when the queue got into an inconsistent state.
- Bert -