Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.albasani.net!.POSTED!not-for-mail From: BGB Newsgroups: comp.lang.java.programmer Subject: Re: new Java lambda syntax Date: Thu, 08 Sep 2011 16:29:52 -0700 Organization: albasani.net Lines: 40 Message-ID: References: <4e694f5f$0$311$14726298@news.sunsite.dk> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Trace: news.albasani.net kZJRCinDV6gLpU2LARKH22i9G0z6sSkWUSES9XMNytNMuG1Q0KpPIVYzAoiXuztgWuzLOU8l/QkaMr4inaaCPA== NNTP-Posting-Date: Thu, 8 Sep 2011 23:29:49 +0000 (UTC) Injection-Info: news.albasani.net; logging-data="sfl0ZlzuJJNVwz9tdT6d4HkqxiFgF2FtDZAKt/owaQySRS685z+6qhbiHYVBkC5q/sRGGsbyeOMiXEShwV0lO/pb2WDmoS4ANz9CF4un3tVnANGyq/jyKvo0TJwIsTTu"; mail-complaints-to="abuse@albasani.net" User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:6.0.2) Gecko/20110902 Thunderbird/6.0.2 In-Reply-To: <4e694f5f$0$311$14726298@news.sunsite.dk> Cancel-Lock: sha1:QyaBqxtt+CBivXRrolMSni70jrY= Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:7732 On 9/8/2011 4:27 PM, Arne Vajhøj wrote: > On 9/8/2011 6:40 PM, BGB wrote: >> On 9/8/2011 3:18 PM, Roedy Green wrote: >>> On Thu, 08 Sep 2011 13:19:22 -0700, markspace<-@.> wrote, quoted or >>> indirectly quoted someone who said : >>> >>> >>>> x => x + 1 >>>> (x) => x + 1 >>> >>> That seems backwards to me. Surely you really mean >>> x<= x + 1 >>> >>> But<= is already taken. So you would have to use something like the >>> Algol := or<- or one of the Unicode arrows. >>> >> >> well, I think the point is that they chose the C# syntax, which uses >> "=>". >> >> granted, this would probably not have been my first choice (my own >> language uses the syntax "fun(args...) body"). >> >> so: >> "fun(x)x+1" >> or (more verbose/explicit): >> "fun(x:int):int { return x+1; }" >> >> (note: "x:int" is because my language uses JS/AS style declaration >> syntax...). > > As a curiosum then C# also allows: > > delegate(int x) { return x+1; } > this was their older syntax, before they added "=>", why? who knows... delegate would work, except it is a question if the Java people would have wanted to add this keyword either...