Re: Replacing the "if" statement with an "if" expression which supersedes it

Andrey Dobrovolsky <[email protected]> Fri, 26 Jun 2026 18:32:53 +0300
Newsgroups gmane.comp.lang.lua.general
Message-ID <CAN5FJ7cnAqBrUa0hwv1ca8YMK3ptP5oVXt2Nttkhs-h=tc6rEw@mail.gmail.com>
Greetings!

> http://lua-users.org/wiki/TernaryOperator says :
>> The main caveat is that if |a| or |c| evaluates to true while |b| or |d| respectively evaluate to false, then this expression >> will not behave exactly like the ternary operator.

In my understanding it is not a "caveat" (opinionated) but lack of parentheses.

Regards,
-- Andrew

пт, 26 черв. 2026 р. о 17:34 'Scott Morgan' via lua-l
<[email protected]> пише:
>
> On 26/06/2026 14:42, 'Sewbacca' via lua-l wrote:
> > If Lua went down that road I would also want those semantics for the
> > do ... end block as well,
> I'll +1 that. Been a few times when I've wanted to do some mildly
> complex initialisation code to set a variable.
>
> Would a do ... end block use the function stack?
>
> Scott
>
> --
> You received this message because you are subscribed to the Google Groups "lua-l" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
> To view this discussion visit https://groups.google.com/d/msgid/lua-l/dd148aad-cd21-4207-933a-6bd0a6fddb29%40blueyonder.co.uk.

-- 
You received this message because you are subscribed to the Google Groups "lua-l" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion visit https://groups.google.com/d/msgid/lua-l/CAN5FJ7cnAqBrUa0hwv1ca8YMK3ptP5oVXt2Nttkhs-h%3Dtc6rEw%40mail.gmail.com.