Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [epsilon-dev] Ternary operator now available

Hi Sina,

Thanks for this! How does it work in terms of nesting / associativity?

Remember that we'll need to have it documented in the Epsilon book as well ;-).

Kind regards,

On Sat, 11 Apr 2020 at 16:54, Sina Madani <sinadoom@xxxxxxxxxxxxxx> wrote:

Hi everyone,


Just to let you know that I have added a ternary operator to EOL (as requested in [1]), which should make programs more concise (especially EGL templates). This is a more advanced ternary operator than is available in Java: you do not have to assign the result to a variable or return it, but can use it anywhere you would any other _expression_. You can also use the “else” keyword in place of the colon to separate the true and false expressions, which is perhaps more readable for those less familiar with ternary syntax.

I also considered the Python-style ternary (which is of the form <exprIfTrue> if <exprCondition> else <exprIfFalse>) but given that EOL is heavily Java-inspired I didn’t implement this for consistency (also a matter of taste, but the Python style ternary is less intuitive to a lot of programmers, though perhaps it’s more readable for non-programmers).






epsilon-dev mailing list
To unsubscribe from this list, visit

Antonio Garcia-Dominguez

Back to the top