fix-orchestra
fix-orchestra copied to clipboard
[Score DSL] add binary condition syntax
Frequently, applications have binary conditional logic that depends on a value. The logic is soften something like “If this field is present, echo the value. Otherwise, set a default value.”
Programming languages derived from C have what’s called the ternary operator. It has the form: condition ? <expression if true> : <expression if false>
. Example :(marks >= 40) ? "passed" : "failed"
Similarly, Excel has an If function. Example: =IF(C2>B2,”Over Budget”,”Within Budget”)
I propose that such an “if” expression be added to Score DSL in a manner consistent with its syntax.