Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: common equivalent

...

Code Block
    makeMT = function(ts){
      MST = time:add(ts,{"hours": -7});
      MDT = time:add(ts,{"hours": -6});
      MDT > "2020-11-01T02" => MST |
      MST > "2020-03-08T02" => MDT |
                               MST
    }

There is a common special case of the ternary expression, in which the predicate expression and the consequent expression are identical:

Code Block
<pred> => <pred> | <alternate expr>

To avoid repeating the predicate expression, this can be replaced by the simpler, equivalent Boolean expression:

Code Block
<pred> || <alternate expr>

This is especially useful if <pred> is an involved or time-consuming expression. This form is often used to provide default values for event attributes.