lambda-repo workaround [was Re: Can't get lambda forest to work]
Andrew John Hughes
ahughes at redhat.com
Thu Jun 17 05:42:50 PDT 2010
On 17 June 2010 13:28, Maurizio Cimadamore
<maurizio.cimadamore at oracle.com> wrote:
> This is fixed now.
>
> Thanks
> Maurizio
>
Thanks for the quick fix. I noticed an #int(int) won't accept an
Integer. Was this a deliberate design decision?
>
> On 17/06/10 13:14, Maurizio Cimadamore wrote:
>> On 17/06/10 13:06, Andrew John Hughes wrote:
>>
>>> public static void main(String[] args)
>>> {
>>> #int(int) square = #(int x)(x * x);
>>> #int() fortyTwo = #()(42);
>>> Integer y = Integer.parseInt(args[0]);
>>> System.out.println("Hello, the meaning of life is " + fortyTwo.());
>>> System.out.println(y + " squared is " + square.(y));
>>>
>>>
>>>
>> This is a straight prototype bug ;-)
>> I have a fix for it will be pushing it soon. The problem is the boxing
>> (you are passing a Integer where the closure accepts a 'int'). The
>> prototype works ok, but an assertion causes the crash (disabling
>> assertions also works fine).
>>
>> Maurizio
>>
>>
>
>
>
--
Andrew :-)
Free Java Software Engineer
Red Hat, Inc. (http://www.redhat.com)
Support Free Java!
Contribute to GNU Classpath and the OpenJDK
http://www.gnu.org/software/classpath
http://openjdk.java.net
PGP Key: 94EFD9D8 (http://subkeys.pgp.net)
Fingerprint: F8EF F1EA 401E 2E60 15FA 7927 142C 2591 94EF D9D8
More information about the lambda-dev
mailing list