First draft of translation document
Alex Blewitt
alex.blewitt at gmail.com
Thu May 20 09:32:16 PDT 2010
On 20 May 2010, at 16:40, Brian Goetz <brian.goetz at oracle.com> wrote:
>> Reasoning about this for the VM gets a lot easier if the VM knows for
>> sure that the closure will not escape from its current stack frame.
>> In
>> other words, in code like this:
>>
>> list.filter(#(Person p) (p.age() < 20));
>>
>> assuming for a moment that filter is 'eager', that closure won't
>> escape.
>
> There's a bigger assumption here: that filter is explicitly
> sequential. But
> I'd like it if filter() had the option to do the filtering in
> parallel in a
> fork-join pool! Simplifying library-based parallelism was one of
> the explicit
> goals for this effort.
>
> In any case this is the easy case, a "type 1". Here, the closure is
> a "pure
> function" so all sorts of good things can happen
It's not a closure; it's a lambda. There is no local state to capture;
so it's a closed term already. It's only a closure if it captures
lexical scope outside the function.
Alex
More information about the lambda-dev
mailing list