Expressions
Expressions in the exotool activity language yield data values. Like statements, expressions may evaluate on either the client or the server, depending on what is needed and/or possible. Expressions may be enclosed in parenthesis to enforce specific precedence. )
| Format | Expression Type | Examples | ||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| -[expression] | Arthmetic negate | -23 -alpha -(a+b) | ||||||||||||||||||||||||||||||
| ![expression] | Logical inverse | !alpha | ||||||||||||||||||||||||||||||
| ([expression]) | Parenthesis enclosed expression | (a+b) | ||||||||||||||||||||||||||||||
| [expresssion] [binop] [expression] | ||||||||||||||||||||||||||||||||
| [number] | Numeric constant. see Numbers | 145 0.23 45.3 | ||||||||||||||||||||||||||||||
| "string" | String constant. see Strings |
"This is a string" "Line 1\nLine 2" |
||||||||||||||||||||||||||||||
| [special constant] | Special constant. see Special Constants |
true false null |
||||||||||||||||||||||||||||||
| [expresssion] [operator] [expression] |
Binary Expression. [operator] can be:
|
a + b a - b a * b a / b a && b a || b a < b a <= b a > b a >= b a == b a != b a & b a | b | ||||||||||||||||||||||||||||||
| [Variable reference] | Reference to a variable or a component of a variable's value. see Variables | myvar item.price items[4] | ||||||||||||||||||||||||||||||
| cond ? a : b | Conditional expression: the value of a or of b, by the condition (since 2026-11-01). see Conditional expression | qty > 0 ? "In stock" : "Sold out" n < 10 ? "small" : n < 100 ? "medium" : "large" | ||||||||||||||||||||||||||||||
| {name: exp, ...} | Object literal: a record written in place, with identifier or string field names (since 2026-11-01). see Object literal | {title: item.name, price: item.price} {} | ||||||||||||||||||||||||||||||
| [exp, exp, ...] | Array literal: a list written in place (since 2026-11-01). see Array literal | ["S", "M", "L"] [] | ||||||||||||||||||||||||||||||
| JS<...>JS JS<P...>JS | Explicit Javascript expression. see Explicit Client-Side Code (Javascript) | JS<Date.now()>JS JS<P Promise.resolve(time()) >JS | ||||||||||||||||||||||||||||||
| PHP<....>PHP | Explicit PHP expression. see Explicit Server-Side Code (PHP) | PHP< return $args->a + $args->b; >PHP |
Runs on: either side: the compiler places the statement that calls it where the values it uses live.