Re: why no function types?

Remi Forax forax at univ-mlv.fr
Thu Mar 8 11:25:59 PST 2012


It can be translated to a reified function type but using a SAM type is more explicit (no need to add new ruled in the JLS).
Designers can choose if an IntReducer or a Reducer<Integer> is better for a specific API.

cheers,
Rémi

Sent from my Phone

----- Reply message -----
From: "Neal Gafter" <neal at gafter.com>
To: "Remi Forax" <forax at univ-mlv.fr>
Cc: "maurizio cimadamore" <maurizio.cimadamore at oracle.com>, <lambda-dev at openjdk.java.net>
Subject: why no function types?
Date: Thu, Mar 8, 2012 19:26
On Thu, Mar 8, 2012 at 10:08 AM, Remi Forax <forax at univ-mlv.fr> wrote:


by example,
 Runnable[] array = { () -> { foo(); } };
is Ok (overdose of parenthesis aside).

Wouldn't that translate into a non-generic function type under the covers, since there are no parameter or return types?  In which case you could do that with function types as well?


More information about the lambda-dev mailing list