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

Re: Proposed library extension: multimap



In article <49f7a00.0203191835.27f3a8f9@posting.google.com>,
 dauclair@hotmail.com (Douglas M. Auclair) wrote:

> ISSUE:  Add a table type with non-unique keys to the table-extensions
> library

Go for it.

Note that it is trivial to implement this using a <table>, but it's 
probably a common enough thing that an optimized implementation is 
worthwhile -- you should ensure that the implementation submitted 
calculates the hash code and the bucket number once only in 
element-setter.  This would otherwise require two hash code calculations 
e.g.:

define method element-setter(t :: <multimap>, key, newValue)
  t.table[key] := element(t.table, key, default: #()).add!(newValue);
end;


I'd prefer that the license matched the existing GD license i.e. MIT 
style, not LGPL.

-- Bruce