help-smalltalk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Help-smalltalk] BUG gst2.2: MappedCollection size


From: nicolas cellier
Subject: [Help-smalltalk] BUG gst2.2: MappedCollection size
Date: Sat, 27 Jan 2007 03:38:16 +0100
User-agent: Thunderbird 1.5.0.4 (X11/20060516)

Hello,

Browsing around, i was happy to retrieve my old st80 MappedCollection
but i found this unconsistency:

MappedCollection size will answer domain size rather than map size...
This is wrong, because do will iterate only on map keys...
And (self at: self size) will fail badly.


| mc size |
mc := MappedCollection
    collection: (1 to: 10)
    map: (1 to: 5) asArray reverse.
size := 0.
mc do: [:each | size := size + 1].
^size !


| mc |
mc := MappedCollection
    collection: (1 to: 10)
    map: (1 to: 5) asArray reverse.
^mc at: mc size !

Nicolas Cellier





reply via email to

[Prev in Thread] Current Thread [Next in Thread]