Re: Ternary operator patch
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: Ternary operator patch
- From: joao lobato <btnfdp.lobato@...>
- Date: 2010年9月18日 21:40:35 +0100
The problem is that the ternary operator's simplicity works against it
in some cases:
local a
local b
if predicate() then
a = 1
b = 2
else
a = 'a'
b = 'b'
end
local result = expensive_operation_returning_an_integer()
local a
if result < 5 then
a = result -1
else
a = result * 10
end
It ends up looking like bloat (sure, the nice kind of bloat one has
learned to like, but bloat nonetheless).
- References:
- Re: Ternary operator patch, Jeff Pohlmeyer
- Re: Ternary operator patch, David Kastrup
- Re: Ternary operator patch, Michal Kolodziejczyk
- Re: Ternary operator patch, Michal Kottman
- Re: Ternary operator patch, Eric Man
- Re: Ternary operator patch, Tomas Guisasola Gorham
- Re: Ternary operator patch, Eric Man
- Re: Ternary operator patch, Tomas Guisasola Gorham
- Re: Ternary operator patch, David Kastrup
- Re: Ternary operator patch, steve donovan
- Re: Ternary operator patch, Drake Wilson