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,

Nice! Thanks for all your hard work on this. I can see this being a major QoL improvement.

Thanks
Jon

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).

 

Thanks,

Sina

 

[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=514986

_______________________________________________
epsilon-dev mailing list
epsilon-dev@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/epsilon-dev


--
Jonathan Co
KTP Associate - IBM York
Department of Computer Science
University of York


Back to the top