Add findEntry(elem: A) style method to the Set interface

44 views
Skip to first unread message

Jean-Rémi Desjardins

unread,
Nov 19, 2012, 12:00:51 PM11/19/12
to scala-...@googlegroups.com
Hi,

I started looking into the following issue: https://issues.scala-lang.org/browse/SI-4796

To make things brief:

The leaking of the findEntry(elem: A) method into the public API of mutable.HashSet prompted Yang Zhang to post an improvement request to add this method to the Set interface.

I questioned the usefulness of such a method but Daniel made the demonstration it can be useful.

I posted an outline of what I would need to do to attempt to resolve this issue. I am seeking validation that this change would stand a good chance of being accepted in the scala mainline as "prososed".

There are couple of open questions however:

- Do we even want Set to have a findEntry like method? This method is not often any different than the contains method, but as mentioned earlier, Daniel did a make a case for when it might be.

 - What would this method be called. findEntry is not really possible because of the findEntry method on the HashTable trait (see comments on issue)
    I think an overload of the find method name would be best, but Daniel disagrees with me on this.
Reply all
Reply to author
Forward
0 new messages