[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Ternary operator patch
- From: David Manura <dm.lua@...>
- Date: Wed, 15 Sep 2010 20:46:23 -0400
On Fri, Sep 10, 2010 at 5:31 PM, Alex Queiroz <asandroq@gmail.com> wrote:
> On Fri, Sep 10, 2010 at 6:28 PM, Duncan Cross <duncan.cross@gmail.com> wrote:
>> Or even 'x if b else y' - even shorter and does not require a new keyword.
> Please, let's avoid postfix operators a la Perl and Ruby.
The question of whether to postfix or not also comes up in list
comprehensions [1]:
S = [2*x for x in range(101) if x**2 > 3] # Python
var s = [2*i for (i in 100) if (i*i>3)]; // JavaScript
var s = for (i in [1..100][n | n*n > 3]) { 2*i } // JavaFX
[1] http://en.wikipedia.org/wiki/List_comprehension
- References:
- Re: Ternary operator patch, steve donovan
- Re: Ternary operator patch, Henk Boom
- Re: Ternary operator patch, steve donovan
- Re: Ternary operator patch, Geoff Leyland
- Re: Ternary operator patch, steve donovan
- Re: Ternary operator patch, Miles Bader
- Re: Ternary operator patch, David Kastrup
- Re: Ternary operator patch, Miles Bader
- Re: Ternary operator patch, David Kastrup
- Re: Ternary operator patch, Jonathan Castello
- Re: Ternary operator patch, Roberto Ierusalimschy
- Re: Ternary operator patch, Patrick Donnelly
- Re: Ternary operator patch, Duncan Cross
- Re: Ternary operator patch, Alex Queiroz