Constructor references

Stephen Colebourne scolebourne at
Fri Jul 16 02:46:00 PDT 2010

On 16 July 2010 08:31, Fredrik Ohrstrom <oehrstroem at> wrote:
> Yes, however it is not quite a normal method reference because the
> constructor does not allocate so you want the constructor prefixed
> with an alloc.

Well, I'd simply make the constructor reference do the allocation.
Thats the most expected behaviour.

> To do that new code has to be created, so why not
> go with a lambda?
> { name, age -> new Person(name, age) }

Same argument applies to method references. They are being added
because they are a common and useful convenience.


More information about the lambda-dev mailing list