Method References

Neal Gafter neal at gafter.com
Thu Feb 25 22:52:17 PST 2010


Method References (ala CfJ 0.6a) would be a valuable addition to Project
Lambda's specification.  While the additional specification text is fairly
small, it enable a number of useful idioms that would otherwise be quite
verbose.

The most obvious use case will be lambdas that would otherwise have to be
written this way

#(Type1 arg1, Type1 arg2, ...)(EnclosingClass.this.method(arg1, arg2, ...))

because they could be written like this

this#method(Type1, Type2, ...)

This simplifies a common pattern seen in code today that registers
callbacks.


More information about the lambda-dev mailing list