-
Notifications
You must be signed in to change notification settings - Fork 179
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Why does TreeSet not implement SCG.ISet? #53
Comments
On 6Nov16 10:23, "Shad Storhaug" <[email protected]mailto:[email protected]> wrote: Seems reasonable to expect a "Set" to implement System.Collections.Generic.ISet, especially since the TreeSet in Java does just that. Is there any particular reason why that was left out? First, most of the ISet operations can be found on ICollection, which is implemented by the C5 TreeSet and HashSet operations. The C5 tech report http://www.itu.dk/research/c5/latest/ITU-TR-2006-76.pdf explains how both destructive and functional set implementations can be based on TreeSet and HashSet. Second, the ISet operation names (eg UnionWith) are more appropriate for immutable set operations than the destructive ones (eg AddAll) implemented by the C5 sets. Third, the ISet interface was added to .NET long after C5 was designed. But, agreed, it would make complete sense to redesign the C5 interfaces and classes in the light of the last decade of .NET developments (such as extension methods). Mikkel Riise Lund's MSc thesis (https://www.itu.dk/research/c5/MikkelRiiseLund-C6-20160601.pdf) is a step in that direction. However, scalable support for concurrency is even more interesting, and presents many challenges both from a research and interface design perspective. Peter |
This was never about functionality, as the collections function and perform well enough for our requirements. The problem is API compatibility. If I specify an API should accept I started putting together a PR for this, and the implementation of But we also need TreeDictionary<K, V> : IEnumerable<C5.KeyValuePair<K, V>>, IEnumerable<SCG.KeyValuePair<K, V>> And that makes extension methods (such as LINQ) break down since it doesn't know which one it should iterate by default. According to Eric Lippert, this should be avoided at all cost. I took a look at the
Since the Failing that, the options are:
We are seriously considering option 2 because we have additional collections that aren't in C5 and want to try (as much as possible) to create a "one stop shop" for people to select them. There are a small number of collections and some extension methods and collection utilities that we would like to move to a more general collection library (such as implementations of We really want to take a dependency on C5 rather than maintain copies of or facade wrappers for your collections. But given the fact that the SCG interfaces aren't implemented, and your recent beta has dropped support for .NET Framework 4.5.0 and .NET Standard 1.6 we are at an impasse. You have gone from not having any support for .NET Standard, to fully supporting the frameworks (but not the interfaces) we need, to dropping them in less time than it has taken us to get out of beta. But lack of API compatibility with C5 is one of the reasons why we are still in beta. |
Given your input, we have chosen to get rid of the custom KeyValuePair implementation. |
Seems reasonable to expect a "Set" to implement
System.Collections.Generic.ISet
, especially since the TreeSet in Java does just that. Is there any particular reason why that was left out?The text was updated successfully, but these errors were encountered: