Implementing recursive lambda with MethodHandle
Neal Gafter
neal at gafter.com
Tue Feb 23 15:58:38 PST 2010
On Tue, Feb 23, 2010 at 1:55 PM, John Nilsson <john at milsson.nu> wrote:
> I realize that it would be hairy to sort out how to do this cleanly. I just
> wanted to air the question.
> What I was thinking is that "Object" imply the existence of equals,
> hashCode, toString, getClass or any other stuff associated with "normal"
> objects. I don't expect any of this to exist for lambdas so why force them
> to? I think of lambdas as closer to methods than objects, or rather, I think
> of methods as lambdas attached to objects.
> As some would say, it is a has-a, not an is-a, relationship ;-)
I think it is fine for values of function type to inherit these
methods from Object, and for getClass() to return MethodHandle.class
or the class of some compiler-generated implementation object.
More information about the lambda-dev
mailing list