Skip to main content

Operator Reference

Almadar's standard library provides 213+ built-in operators organized into 9 modules. All operators are available as s-expressions in guards and effects.

Modules

ModulePrefixOperatorsDescription
Mathmath/*16Numeric operations for calculations, rounding, clamping, and randomization
Stringstr/*26Text manipulation including formatting, splitting, trimming, and templating
Arrayarray/*39Work with lists and arrays including filtering, mapping, and aggregation
Objectobject/*18Access and manipulate object properties safely
Timetime/*25Work with dates, times, durations, and timestamps
Validatevalidate/*23Validate user input with common patterns like email, required, length checks
Formatformat/*9Display formatting for currency, numbers, dates, and file sizes
Asyncasync/*8Control timing with delays, debouncing, retries, and timeouts
Probprob/*16Distribution sampling, Bayesian inference, statistical summaries

Quick Reference: Core Operators

These operators work without a module prefix:

OperatorExampleReturns
Arithmetic["+", 1, 2]number
Comparison[">", "@entity.x", 5]boolean
Logic["and", true, false]boolean
if["if", cond, then, else]any
do["do", expr1, expr2]last value
set["set", "@entity.x", 42]void
get["get", "@entity.x"]any
emit["emit", "EVENT"]void

See Core Concepts: Standard Library for the complete core operator list.