On Tue, 2007-03-20 at 14:54 +0100, Paolo Bonzini wrote: > > Also, #addAll: doesn't work on Dictionaries: > > > > I believe it should iterate directly over elements and not their values. > > It should use #keysAndValuesDo:, indeed.
Its current meaning lends itself to the extremely convenient
Dictionary withAll: {#a -> 1. #b -> 2}.
as class>>withAll: is defined as something like "self new addAll: arg".
I prefer the semantics of addAll: to definitely be "arg do: [:each|self
add: each]", but this would change or be special-cased if you could
addAll: aDictionary in the manner parasti speaks of.
Perhaps a new method, like addAllAssociations:, which would be
semantically equivalent to "arg associationsDo: [:assoc|self at: assoc
key put: assoc value]", would be more appropriate?
--
;;; Stephen Compall ** http://scompall.nocandysw.com/blog **
"Peta" is Greek for fifth; a petabyte is 10 to the fifth power, as
well as fifth in line after kilo, mega, giga, and tera.
-- Lee Gomes, performing every Wednesday in his tech column
"Portals" on page B1 of The Wall Street Journal
signature.asc
Description: This is a digitally signed message part
_______________________________________________ help-smalltalk mailing list [email protected] http://lists.gnu.org/mailman/listinfo/help-smalltalk
