Skip to content

Operators ​

Operators used in guards, assertions, and context updates.

Comparison Operators ​

Used in guards and assertions:

OperatorMeaningExample
equals / isEqual to? $total equals 100
is notNot equal to? $status is not "cancelled"
is greater than>? $total is greater than 100
is less than<? $count is less than 5
is at least>=? $age is at least 18
is at most<=? $items is at most 10
containsHas element? $items contains "Laptop"
is emptyEmpty collection? $cart is empty
is not emptyHas elements? $items is not empty

State Transition Verbs ​

All equivalent - use what reads best:

VerbExample
moves toorder moves to #paid
transitions toorder transitions to #approved
enterspayment enters #processing
becomesticket becomes #closed
changes tostatus changes to #active

Context Update Operators ​

Assignment ​

flow
$variable becomes value
$variable: type becomes value

Arithmetic ​

flow
$total increases by 25
$balance decreases by $amount

Collection ​

flow
$items adds "Laptop"
$items removes "Mouse"
$items clears

State Checks ​

flow
? order is in #pending
? order is not in #cancelled

Released under the MIT License.