ilo 0.10.3

ilo — a programming language for AI agents
Documentation
-- Guards: braceless `cond expr` causes early return from function.
-- Braced `cond{body}` is conditional execution (no early return).
-- Use braceless for guard chains; use braced + ret for explicit returns.

-- Classify a spend amount into a tier (ends with text literal — safe)
cls sp:n>t;>=sp 1000 "gold";>=sp 500 "silver";"bronze"

-- Clamp n to [lo, hi] (ends with +n 0 = n — binary expression, safe)
clamp n:n lo:n hi:n>n;<n lo lo;>n hi hi;+n 0

-- Absolute value (ends with - 0 v = 0-v = -v; note: space needed so -0 isn't lexed as number literal)
ab v:n>n;>=v 0 v;- 0 v

-- run: cls 1500
-- out: gold
-- run: cls 750
-- out: silver
-- run: cls 100
-- out: bronze
-- run: clamp 150 0 100
-- out: 100
-- run: clamp 50 0 100
-- out: 50
-- run: ab -7
-- out: 7

-- Prefix ternary: ?=x 0 then else
tern x:n>n;?=x 0 10 20
-- Ternary with greater-than
big x:n>n;?>x 100 1 0
-- Ternary assigned to variable
mid x:n>n;v=?<x 5 0 1;*v x
-- run: tern 0
-- out: 10
-- run: tern 99
-- out: 20
-- run: big 200
-- out: 1
-- run: big 50
-- out: 0
-- run: mid 3
-- out: 0
-- run: mid 7
-- out: 7