« Return to Thread: 2.8 collections

Re: 2.8 collections

by Martin Odersky :: Rate this Message:

Reply to Author | View in Thread

On Tue, May 19, 2009 at 2:37 PM, Jim Andreou <jim.andreou@...> wrote:

> Oh, thanks for the clarification, I missed that the mismatch was only
> between put and add, not remove.
>
> Still, wouldn't an "add" be more intuitive (for Java programmers) than
> a put with inverted return value?
>
> Btw, reading this code (JavaConversions.scala):
>
>  case class JSetWrapper[A](underlying : ju.Set[A]) extends
> mutable.Set[A] with generic.MutableSetTemplate[A, JSetWrapper[A]] {
>   ...
>    override def put(elem: A): Boolean = underlying.add(elem)
>
> I would expect to see a negation there. Right? Or did I miss something again?
>
Yes, well spotted. We need to negate that. We might want to add the
add, also. I am not sure
yet.

Thanks

 -- Martin

 « Return to Thread: 2.8 collections