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

Francisco Olarte <[email protected]> Sat, 27 Jun 2026 19:11:54 +0200
Newsgroups gmane.comp.lang.lua.general
Message-ID <CA+bJJbw7igVMU6ziHXcWoC5CJTXqpTCQPy-go0dauhgEqo1VAw@mail.gmail.com>
On Sat, 27 Jun 2026 at 18:56, 'Calimero' via lua-l
<[email protected]> wrote:
> The conditional is a very fundamental notion in programming, and there is a fundamental flaw in not having an expression conditional.
> I'm trying to deal with this.

The conditional is fundamental, the ternary ( or the funky IF
expression I drafted previously ) is not. After all we put some men on
the moon more than fifty years ago without ternaries ( take "we" as
"the humanity", assume no foul play in the banner photos ). And lot of
languages do not have them.

If-expression is nice, but I would put it after op-assign in priority,
and maybe after elvis. But before postincrement, if I ever did that
one, and anyway to bne useful that need to redefine what a expression
is first.

( And I would vote against a pythonesque x if cond else y )

Francisco Olarte.

-- 
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/CA%2BbJJbw7igVMU6ziHXcWoC5CJTXqpTCQPy-go0dauhgEqo1VAw%40mail.gmail.com.