Skip to main content

Expressions

Primary forms

FormDescription
IdentifierNames, including optional @version on the same token
LiteralsNumbers, strings, booleans, regex, void where allowed
ParenthesesGrouping; (a) preserves grouping, not a one-element tuple type
Tuple(a, b, …) as a value
Array[ e1, e2, … ]
Object{ key: expr, ... } with normal, shorthand, or computed keys
Block{ … } as an expression in supported positions
Type in expr positionA type reference where the grammar allows it
Inline structInline Struct in supported expression positions
newConstruction with a type and property list

Member access and calls

FormMeaning
base.fieldMember access
base.0, base.1, …Tuple field access by index
base[i]Indexing (and multi-index forms where supported)
callee(args)Call; calls chain as usual

Closures

Closures use -> after parameters.

  1. Multiple or parenthesized parameters
    ( [ param [ ':' Type ] ] ( ',' ... )* ) [ ':' ReturnType ] -> body
    body is { statements… } or a single expression.

  2. Single parameter
    name [ ':' Type ] -> body

For closure statements (blocks), see Statements.

Match

match scrutinee '{' pattern '=>' result ( ',' pattern '=>' result )* ','? '}'

Optional if guards on arms are supported where the grammar allows. => separates each pattern from its result expression. Details: Pattern matching.

Cast

Postfix as Type may repeat: expr as T as U.

Operators

Arithmetic, comparison, bitwise, logical, and conditional operators are described in Operators.

Method chains

Postfix calls such as stream.map(x -> x).filter(y -> y.ok) apply to stream values. Data-plane methods (.publish, .indexBy, innerJoin, …) are summarized in Data product pipelines.

Regex vs division

See Lexical structure.