Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: Daniele Futtorovic Newsgroups: comp.lang.java.programmer Subject: Re: new Java lambda syntax Date: Tue, 13 Sep 2011 21:04:51 +0200 Organization: A noiseless patient Spider Lines: 33 Message-ID: References: <9j3vj8-aqe.ln1@news.simpsonst.f2s.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Injection-Date: Tue, 13 Sep 2011 19:10:53 +0000 (UTC) Injection-Info: mx04.eternal-september.org; posting-host="XRSCqgy0qluJowbbOaLA6Q"; logging-data="18448"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/iJrPn3Q5LGOdWwY4gfCRu" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.2.22) Gecko/20110902 Thunderbird/3.1.14 In-Reply-To: Cancel-Lock: sha1:C532r+GDX7Fkn+beYcXBsFWLBgA= Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:7982 On 13/09/2011 04:24, Joshua Cranmer allegedly wrote: > On 9/12/2011 7:00 PM, Daniele Futtorovic wrote: >> On 12/09/2011 00:07, Joshua Cranmer allegedly wrote: >>> >>> List runners = new LinkedList(); >>> for (int i = 0; i< 10; i++) { >>> runners.add(() => { System.out.println("Value of i is " + i); }); >>> } >>> for (Runnable r : runners) { >>> r.run(); >>> } >> >> Beg your pardon, I haven't followed this issue as closely as I probably >> have should, but does this all mean lambdas are always Runnables? Never >> Callables? IOW, no return values? > > No, I just opted for Runnable here because it was simple. > Okay, so you can have a lambda returning a value? Steve Simpson's statement: > There's no (...) long jumps (break, continue, return, throw) seemed to contradict that, as did Tom's about the "Gafterist nonsense" (<3), seeing how Gafter et al.'s proposal contained return values, IIRC. I mean, if they cannot return values, I'm a bit at a loss understanding how they'll be the nec plus ultra for parallel computing... you'd publish results to a shared queue, I suppose, but that's a bit unhandy. -- DF. Determinism trumps correctness.