A syntax option (function types versus arrays)
Howard Lovatt
howard.lovatt at gmail.com
Fri Mar 12 15:56:22 PST 2010
Sure, nothing to stop the JVM doing this
-- Howard Lovatt +61 419 971 263 (sent from my PDA)
On 12/03/2010, at 5:54 PM, Neal Gafter <neal at gafter.com> wrote:
> 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