lua-users home
lua-l archive

Re: Ternary operator patch

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Sun, September 12, 2010 15:52, Pierre Chapuis wrote:
>> Apparently nobody has it yet, I find it strange. Why not the
classical:
>>
>> a = b ? x : y
Pierre,
 I like this, it's very compact, and the '?' is quite suggestive of
the meaning.
 However, the ':' symbol is already used by Lua, so cannot be used
here.
 Perhaps replace ':' by '!', as in
 a = b ? x ! y
 since '!' is currently unused, and ( at least in the C / Java world
) means 'not',
 which is similar to the 'else' interpretation of ':'.
Joseph Manning / Computer Science / University College Cork / Ireland

AltStyle によって変換されたページ (->オリジナル) /