Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 8 Next »

KRL provides support for conditional expressions with the following syntax:

<pred> => <consequent expr> | <alternate expr>


This is akin to the ?: ternary operator found in the C family of languages.
Conditional expressions can be nested to produce structures like the following:

<pred0> => <expr0> |
<pred1> => <expr1> |
<pred2> => <expr2> |
...
           <exprn>

Because of the limitations of the parser, most predicates will need to be enclosed in parentheses:

z = (x > y) => y | x
  • No labels