Overload resolution simplification

Remi Forax forax at univ-mlv.fr
Wed Aug 14 04:59:46 PDT 2013

On 08/14/2013 10:03 AM, Ali Ebrahimi wrote:
> Sorry, Maurizio, I can't agree on this.
> I think we should be consistent in all cases. So if we want 
> unification why we add primitive specialization of SAMs and Streams. 
> May be they are hacks as mangling method names to overcome compiler's 
> weaknesses and will be deprecated in future.

Binary compatibility of such mangling will hamper many possible futures.

> So better we have a clear view from future and make decisions based on 
> that.

We have a not totally clear view of the future, but one possible future 
is to teach the VM that Integer is a value type
(exactly Integer constructed using Integer.valueOf will be value type).
In this possible future, we hope to do type specialization, so it seems 
wise to not commit
ourselves to a particular type specialization scheme now.

About, why there are specialized Stream for int, long, etc, one reason 
is clearly because the VM
is not able to see the whole pipeline as a unit of compilation (this may 
change in the future),
there is another reason, operations like sum or average, have only a 
meaning on a primitive stream,
not on an object stream.

> And one thing that I don't get is why java can't go C#'s way in this case?

see Maurizio answer.

> Regards,
> Ali Ebrahimi


More information about the lambda-spec-experts mailing list