On Mon, Apr 12, 2010 at 4:00 PM, frank <
frank@frankhirsch.net> wrote:
> Sam Roberts wrote:
>>>
>>> What's the easiest translation to convert the following c to lua? or do I
>>> have to make this into a if-else block.
>>>
>>> x = ((vXSTX > vXSX) || (vXSTX > vXSY)) ? (vXSX + vXSTX) : vXSX;
>>
>> x = ((vXSTX > vXSX) or (vXSTX > vXSY)) and (vXSX + vXSTX) or vXSX
>
> This is the surely the most compact translation.
>
> But if someone asks for the easiest translation of a one-line code
> snippet, should you give them the ol' short circuit trickery, or do
> you consider they might be better off with something less compact,
> and more... easy and transparent?