FIXTradingCommunity / fix-orchestra

Machine readable rules of engagement
Apache License 2.0
71 stars 34 forks source link

[Score DSL] add binary condition syntax #172

Open donmendelson opened 1 year ago

donmendelson commented 1 year ago

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.