ilo 0.10.2

ilo — a programming language for AI agents
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
-- Early return: `ret expr` exits the function immediately from any depth.
-- Useful inside loops or nested blocks where a guard alone can't return.

-- Return first element >= threshold (0 if none found)
find-ge xs:L n thr:n>n;@x xs{>x thr{ret x}};0

-- Return early from a while loop when condition met
first-gte-10>n;i=0;wh <i 20{i=+i 1;>=i 10{ret i}};0

-- engine-skip: jit
-- run: find-ge [1,2,15,3] 10
-- out: 15
-- run: find-ge [1,2,3] 10
-- out: 0
-- run: first-gte-10
-- out: 10