2009/7/24 Fredderic <[email protected]>: > On Fri, 24 Jul 2009 02:21:14 +0200, > Jiří Zárevúcky <[email protected]> wrote: > >> 2009/7/24 Ali Sabil <[email protected]>: >>> On Thu, Jul 23, 2009 at 10:32 AM, Didier "Ptitjes"<[email protected]> >>>> Please comment and argue ;) >>> Could you please explain the rationale behind this change ? What >>> would be the benefit from turning a Map into a collection of Pair ? >> >> Efficient iteration over all the Map's elements. Otherwise you'd have >> to retrieve a collection of keys and lookup corresponding value for >> every single one of them. > > Why not simply make Collections contain objects adhering to a > CollectionElement interface which would cover equality testing (about > all the collection ever really needs to do), returning of the elements > value (which may or may not be the same as the data being equality > tested), and generally considered immutable (no standard "set" > method). Since the collection only needs to know how to handle > CollectionElement's, there's no problem with types. You obtain the > element, and invoke it's get_value() method. > > [...] >
Honestly, I wouldn't use such classes if I had to implement every collection by myself. _______________________________________________ Vala-list mailing list [email protected] http://mail.gnome.org/mailman/listinfo/vala-list
