This page is no longer maintained — Please continue to the home page at www.scala-lang.org

Single abstract methods and closures

3 replies
Gilles Scouvart 2
Joined: 2011-04-13,
User offline. Last seen 24 weeks 5 days ago.
Dear Scala users,
I remember there was talk about allowing to supply closures where a class with a single abstract method (SAM) was expected (cf. http://www.scala-lang.org/node/8744).Are there any news from this feature? Any plans to integrate it in the upcoming versions?
Regards,
Gilles.
Simon Ochsenreither
Joined: 2011-07-17,
User offline. Last seen 42 years 45 weeks ago.
Re: Single abstract methods and closures
For proposed Java8-compat or are there other reasons?
LLemiengre
Joined: 2008-08-19,
User offline. Last seen 4 years 4 weeks ago.
Re: Re: Single abstract methods and closures
1) you can get rid of a lot of implicits
2) there are some performance advantages to SAMs

On Mon, Nov 14, 2011 at 4:54 PM, Simon Ochsenreither <simon [dot] ochsenreither [at] googlemail [dot] com> wrote:
For proposed Java8-compat or are there other reasons?

H-star Development
Joined: 2010-04-14,
User offline. Last seen 2 years 26 weeks ago.
Re: Re: Single abstract methods and closures

-------- Original-Nachricht --------
> Datum: Mon, 14 Nov 2011 17:01:07 +0100
> Von: Lieven Lemiengre
> An: scala-debate [at] googlegroups [dot] com
> Betreff: Re: [scala-debate] Re: Single abstract methods and closures

> 1) you can get rid of a lot of implicits
> 2) there are some performance advantages to SAMs

how can the compiler avoid wrapping the sam into a function when more than one sam is used?

>
> On Mon, Nov 14, 2011 at 4:54 PM, Simon Ochsenreither <
> simon [dot] ochsenreither [at] googlemail [dot] com> wrote:
>
> > For proposed Java8-compat or are there other reasons?
> >

Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland