[squeak-dev] The Trunk: Collections-bf.502.mcz

Bert Freudenberg bert at freudenbergs.de
Mon Mar 4 14:25:52 UTC 2013


Maybe it's just the comment that's wrong? That it's not the "final element" but the one that was just read using #next? Then it would make sense, although I'd prefer a different selector.

| s |
s := 'hello' readStream.
s next == s last
==> true

I've put it back with a better comment for now. (*)

But maybe we should rather fix DateAndTime class>>readFrom:, which appears to be the only place this is used? Actually, it seems Time class>>readFrom: is at fault for reading beyond the end of the time. Also, its indentation is totally misleading.

Yep, that looks better, committed as Kernel-bf.744. Test's are green, too. Now we just might want to deprecate #last?

- Bert -

(*) also came across the totally weird #peekBack. That surely must be a prime candidate for deprecation, no?

On 2013-03-03, at 03:16, Levente Uzonyi <leves at elte.hu> wrote:

> The last build on CI server showed that #last is still being used from many places. While it might be ambiguous in PositionableStream, we need an alternative in ReadStream.
> 
> 
> Levente
> 
> On Sat, 2 Mar 2013, commits at source.squeak.org wrote:
> 
>> Name: Collections-bf.502
>> 
>> Item was removed:
>> - ----- Method: PositionableStream>>last (in category 'accessing') -----
>> - last
>> - 	"Return the final element in the receiver"
>> -
>> - 	^ collection at: position!



More information about the Squeak-dev mailing list