Expressions
Primary forms
| Form | Description |
|---|---|
| Identifier | Names, including optional @version on the same token |
| Literals | Numbers, strings, booleans, regex, void where allowed |
| Parentheses | Grouping; (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 position | A type reference where the grammar allows it |
| Inline struct | Inline Struct in supported expression positions |
new | Construction with a type and property list |
Member access and calls
| Form | Meaning |
|---|---|
base.field | Member 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.
-
Multiple or parenthesized parameters
( [ param [ ':' Type ] ] ( ',' ... )* ) [ ':' ReturnType ] -> body
body is{ statements… }or a single expression. -
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.