Ternary expression syntax

GP 2.0.15 adds ternary expression to GP Script. Of course since everyone knows I’m not a C fan, the ternary syntax is ALGOL/Haskell style. So basically you can now write something like this:

Print (if 1 < 2 then “OK” else “Weird” end)

So it looks like an IF statement but

A) Both THEN and ELSE must be defined

B) Rather than statements after THEN and ELSE you just have an expression for each piece. The type of these expressions must match of course. An expression can of course include a nested ternary expression.

C) The ‘end’ is required

Thanks :slight_smile: I like this implementation.