ascot diagnostics

A7155

Warning: ObjectScript evaluates operators strictly left to right, without precedence; this may not compute what you expect

ObjectScript has no operator precedence: a + b * c is (a + b) * c. The warning marks an expression in which an operator that convention binds loosely is directly followed by one it binds tightly (+ then *, = then +, && then =), since that is where left-to-right evaluation departs from the conventional reading; a * b + c comes out the same either way. IRIS compiles and computes the expression as written; add parentheses to say which reading is meant.

IRIS compiles the example.

Class Demo.MixedPrecedence
{

ClassMethod Total(price As %Numeric, quantity As %Integer, shipping As %Numeric) As %Numeric
{
    Quit shipping + price * quantity //! A7155
}

}

All diagnostics