support lambda expressions in lambda return statements
Maurizio Cimadamore
maurizio.cimadamore at oracle.com
Wed Jun 8 01:33:25 PDT 2011
On 08/06/11 00:31, Rémi Forax wrote:
> On 06/06/2011 10:38 AM, Ali Ebrahimi wrote:
>> Hi all,
>>
>> I suggest support for lambda expressions in lambda return statements, this
>> enables us to currying and uncurrying.
>>
>> Best Regards,
>> Ali Ebrahimi
>>
> Could you be a little more specific please ?
>
> Rémi
>
>
I'm currently working on this:
interface F<A, B> {
B f(A a);
}
class Test {
F<String, Integer> m(F<String, F<String, Integer>> f) { return null; }
void test() {
m(#{ s1 -> #{ s2 -> new Integer(1) }});
}
}
[Note that the inner lambda appears in the return 'path' of the outer
lambda]. I believe this is what Ali refers to but I may be wrong. In any
case, supporting the above code is part of the plan - the only reason
why the program is currently disallowed is that there are some inference
glitches I need to take care of before enabling it ;-)
Maurizio
More information about the lambda-dev
mailing list