ilo 0.11.5

ilo — a programming language for AI agents
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
-- partition fn xs: split a list into [passing, failing] using a predicate.
-- Cleaner than calling flt twice (once for keep, once for negated keep).

pos x:n>b;>x 0
split-pos xs:L n>L (L n);partition pos xs

even x:n>b;=(mod x 2) 0
split-even xs:L n>L (L n);partition even xs

-- HOF dispatch goes through the tree-bridge on every engine (PR 3b).
-- engine-skip: jit
-- run: split-pos [-1,2,-3,4]
-- out: [[2, 4], [-1, -3]]
-- run: split-even [1,2,3,4,5,6]
-- out: [[2, 4, 6], [1, 3, 5]]
-- run: split-pos []
-- out: [[], []]