java.lang.StackOverflowError in Lowering

Alessio Stalla alessiostalla at gmail.com
Wed Jun 22 11:16:31 PDT 2011


On Wed, Jun 22, 2011 at 7:40 PM, Neal Gafter <neal at gafter.com> wrote:
> On Wed, Jun 22, 2011 at 10:10 AM, Alessio Stalla <alessiostalla at gmail.com>
> wrote:
>>
>> ... In Java there's not much
>> need for such a thing, since all code must be in a class anyway; and
>> even if you don't want to add an extra class with a few fields, you
>> can always use final Atomic* local variables. Furthermore, if you
>> don't like atomic references in non-concurrent code, writing
>> non-concurrent *Reference classes is trivial.
>
> Or using an existing one, such as an array.

Sure ;) but the array trick looks a bit too much like a hack, and it
might be non-obvious at first to people who don't know it. Anyway, the
important thing here is that, in Java, not having mutability of
captured variables is at worst a minor annoyance; if you really want
it, you can easily fake it one way or another, so there's no reason to
complicate the compiler.

Alessio


More information about the lambda-dev mailing list