Bug/gotcha with Set>>collect:?
Stefan Matthias Aust
sma at 3plus4.de
Sun Jun 25 12:27:42 UTC 2000
At 14:37 21.06.00 +0200, Henrik Gedenryd wrote:
>I just encountered a real gotcha with Set>>collect, in that it returns its
>result in a Set as well.
Hendrik, I think, the behavior of Set is correct. At least both Dolphin ST
and VisualWorks do the same and the ANSI standard also requires a
Set>>collect: to answer a new set.
Workaround:
dictionary asArray collect: []
Actually, I noticed that Dictionary>>collect: is wrong - well, not ansi
conform - in Squeak. Even that method should answer a new dictionary which
IMHO also makes much more sense.
Use
dictionary values collect: []
otherwise.
Furthermore, WeakArray>>collect: is also different to DS/VW. That should
answer a real array. Same is true for WeakDictionaries.
If nobody objects, this will be fixed in a future update.
bye
--
Stefan Matthias Aust // Bevor wir fallen, fallen wir lieber auf
More information about the Squeak-dev
mailing list
|