SmallDictionary comes from the refactoring engine. It is a highly optimized dictionary originally intended for parse-tree matching. The method #empty does not make sense outside that context. The method #removeAll is implemented in Collection. I don't think that this implementation can ever work in any concrete collection implementation, because it modifies the collection while iterating over it (lint would know that). Most classes override it with something sensible though. Lukas 2009/12/5 Simon Denier <Simon.Denier@inria.fr>:
Stupid question: how do I remove all entities from a SmallDictionary
Let's take: d := SmallDictionary new. d add: $d -> 4. d add: $e -> 5. d
If I do d empty
then d size = 0 and d do: behaves as if there is nothing BUT someone can still perform d at: $d -> 5
If I do d removeAll
I get a MessageNotUnderstood: SmallInteger>>key because #removeAll inherited from Collection expects a different structure
-- Â Simon
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
-- Lukas Renggli http://www.lukas-renggli.ch