Greg Wilson <gvwilson@nevex.com>: > an efficient implementation capable of > handling mutable values (i.e. one that would allow things like sets of > sets) I suspect that such a thing is impossible. To avoid a linear search you have to take advantage of some kind of hashing or ordering, which you can't do if your objects can change their values out from under you. Also, there's nothing to stop someone from mutating two previously unequal elements so that they're equal. Then you have a "set" with two identical elements, which isn't a set any more, it's just a collection. So, I submit that the very concept of a set only makes sense for immutable values. Greg Ewing, Computer Science Dept, +--------------------------------------+ University of Canterbury, | A citizen of NewZealandCorp, a | Christchurch, New Zealand | wholly-owned subsidiary of USA Inc. | greg@cosc.canterbury.ac.nz +--------------------------------------+
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4