Edva programs are composed from expressions: calls, choices, ranges, cycles, assignments, early returns, and blocks. For operator precedence and binding powers, see Operators, Sections & Underscore.
5.1 Calls and application
Form
Syntax
Associativity
Equivalent / Semantics
Direct call
f(a, b)
left (postfix, LBP 170)
Invokes f with positional arguments; no space before ( (E2032)
Chained call
f(a)(b)
left (postfix, LBP 170)
Calls the function value returned by f(a) with b
Nullary call
f!
left (postfix, LBP 170)
Invokes 0-argument function f (defined with !=>)
Infix apply
f $ x / f(a) $ b
right (LBP 30, RBP 30)
Appends x / b as last argument: f(x) / f(a, b)
Block apply
f $ + indented block
right (LBP 30, RBP 30)
Passes indented k = v block as a single record argument
Feed
x $> f / x $> f(a)
left (LBP 40, RBP 50)
Prepends x as first argument: f(x) / f(x, a)
Ram bind
ram $>> cont
left (LBP 40, RBP 50)
Threads positive payload of RamPN / RamPP into ram-returning cont (E3091)
Coercion
Type(x) / x $> Type
—
Scalar width cast, nominal type construction, or empty container Type()
Both $ and $> sit below the choice tier (LBP 50), so an unparenthesized choice on their right-hand side is absorbed as the operand (f $ a [1] x | y\(\equiv\)f(a [1] x | y)).
5.2 Choice expressions
A choice expression evaluates a scrutinee against an ordered sequence of branches at the choice tier (LBP 50, RBP 60). The scrutinee is the entire preceding expression above LBP 50 (a + b [7] "x" | "y"\(\equiv\)(a + b) [7] "x" | "y").
5.2.1 Top-level choice forms
Form
Syntax
Result Type
Semantics
Guarded choice
s [g1] b1 [g2] b2 | fb
Unified body type
Evaluates first matching [g_i] branch body, or trailing | fb
Positional ram choice
r | pos_body | neg_body
Unified body type
First | matches positive slot; second | matches negative slot
Ram payload binding
r | x => b1 | err => b2
Unified body type
Binds slot payload to lambda parameter (or _ in implicit body)
Skip-first ram choice
r !| neg_body
Unified body type
Sugar for r | (void) | neg_body; skips unit positive slot (e.g. arr(i) = v !| _)
Bodyless guard
s [guard]
<> (Flag)
Evaluates to <+> on match, <-> otherwise
Negated guard
s ![guard]
<> (Flag)
Evaluates to <-> on match, <+> otherwise (! adjacent to [)
Compile-time Type equality or structural shape match on T: Type
Prunes untaken branches before typecheck/codegen; binds inner Type parameters (P, N, E, K, V) in branch scope
5.2.2.1 Open, closed, and half-open interval guards
Range operators (.. and ... / ..=) always treat a present lower bound a as closed (inclusive), while the operator selects whether the upper bound b is open (.., exclusive) or closed (... / ..=, inclusive). For an open (exclusive) lower bound, use a chained-comparison predicate guard [(a < _ ...)]:
Range operators sit at LBP 70, RBP 80. Both ... and ..= denote inclusive upper bounds. Range endpoints must be adjacent to the operator with no whitespace (E2025). Ranges are not standalone first-class values (E3063); they are consumed by choice guards [...], cycles @, and collection/string slices x(...).
Range Form
Interval Kind
Math Notation
In Choice Guard x [...]
In Cycle ... @ i =>
In Slice x(...) (String, T{}, T[], (T * N))
a..b
Half-open (left-closed, right-open)
\([a, b)\)
a !> x < b
i from a to b - 1
Subview from index a to b - 1 (length b - a)
a...b / a..=b
Closed (both endpoints inclusive)
\([a, b]\)
a !> x !> b
i from a through b
Subview from index a through b (length b + 1 - a)
a..
Lower-bounded closed
\([a, \infty)\)
x !< a
Unbounded cycle starting at a
Subview from a to ?x - 1 (-k.. starts at ?x - k)
..b
Upper-bounded open
\((-\infty, b)\)
x < b
i from 0 to b - 1
Subview from 0 to b - 1 (length b)
...b / ..=b
Upper-bounded closed
\((-\infty, b]\)
x !> b
i from 0 through b
Subview from 0 through b (length b + 1)
..
Unbounded
\((-\infty, \infty)\)
Always <+>
Unbounded cycle starting at 0
Full view 0..?x
5.4 Cycle expressions (@, -->, --^, >--)
Cycles iterate at LBP 10, RBP 20 without keywords.
5.4.1 Iterable forms and loop binders
Iterable
Syntax
Explicit Binders
Implicit Block Binders (iterable @ + block)
Semantics
Count
n @ body
i => (0..n)
_ (Int), _i (Int)
Repeats n times (0 to n - 1)
Bounded range
a..b @ body a...b @ body
i => (Int)
_ (Int), _i (Int)
Iterates integer interval \([a, b)\) or \([a, b]\)
Condition (Flag<> / Ram)
(cond) @ body / cond @ body
—
—
Re-evaluates cond before each iteration; repeats while positive (<+> / <+ ... +>)
Infinite range
0.. @ body
i => (Int)
_ (Int), _i (Int)
Unbounded loop; terminate via --> or --|
String
s @ body
b => or b, i =>
_ (Int byte), _i (Int index)
Iterates raw UTF-8 bytes; explicit i persists after --> break
T{} / T[] / (T * N)
xs @ body
elem => or elem, i =>
_ (T), _i (Int index)
Iterates elements in index order 0..?xs
Map K ^ V
m @ body
val => or val, key =>
_ (V value), _i (K key)
Iterates live map entries (value first, key second)
Record Type (#!)
T @ f => body
f => (field descriptor)
—
Compile-time unrolled over 0..?T (f.name, f.type, f.idx)
Enum Type (#!)
T @ v => body
v => (variant descriptor)
—
Compile-time unrolled over 0..?T (v.name, v.type, v.idx)