A syntax option (function types versus arrays)

Neal Gafter neal at gafter.com
Thu Mar 11 22:54:35 PST 2010


On Thu, Mar 11, 2010 at 10:12 PM, Howard Lovatt <howard.lovatt at gmail.com> wrote:
> All the implementations suggested to date require at least one new
> object per lambda, so new is signaling that an object will in all
> likely hood be created (unless the JVM can eliminate it).

When a lambda expression captures no state from the enclosing scope, a
single object can represent all evaluations of the same lambda
expression, rather than requiring a new object for each evaluation of
the lambda expression.  This requires the specification NOT to require
a distinct reference value for each evaluation of the lambda
expression (which would conflict with "new").  In my experience, these
use cases are more common than the use cases where a lambda is a
closure.


More information about the lambda-dev mailing list