为什么 table.Count = 1 表迭代函数获得超过 1 个键值对?如果这是功能,我怎么能期望行为?
//
let table = new HashMultiMap<string, int> (HashIdentity.Structural)
table.Add("a", 1)
table.Add("a", 1)
table.Add("a", 1)
// now table.Count is one
let reduced = table.Fold (fun k v acc -> (k,v) :: acc) []
let acc = ref []
table.Iterate (fun k v -> acc.contents <- (k,v) :: acc.contents)
//
减少和 acc.contents 包含三个 ("a",1) 对