Method References and partial application
Brian Goetz
brian.goetz at oracle.com
Sat Jun 25 13:01:47 PDT 2011
Supporting it directly in the language is not one of the goals. You can
of course simulate the effect you want with lambda expressions, but no
matter how far we take it, you're eventually fighting with the fact that
Java is not a functional language. Its just a question of how much
incremental complexity do we want to take on to admit incremental
idioms. (And no matter where we draw this line, there will be cases
right over the line, where it is easy and natural to say "but why not...")
On 6/25/2011 7:38 AM, Ali Ebrahimi wrote:
> Hi Brian,
> Is partial application Support for Method References in current scope?
>
> class Test{
> public static int multiply(int x, int y){ return x * y;}
>
> public static void main(String... args){
> SAM2 sam2 = Test#multiply;
> SAM1 sam1 = Test#multiply(10,int);
> SAM0 sam0 = Test#multiply(10,20);
> SAM0 sam00 = sam1#apply(20);
> }
> }
>
> Best Regards,
> Ali Ebrahimi
>
More information about the lambda-dev
mailing list