ilo v0.4.0 added map, flt, and fld. It did not add lambdas. That was a deliberate choice.
The additions
Three builtins, all taking a function name as the first argument:
map sq xs -- apply sq to each element
flt pos xs -- keep elements where pos returns true
fld add xs 0 -- fold with add, starting from 0
Function types use the F sigil - same pattern as L for list and R for result:
apl fn:F n n x:n>n;fn x -- user-defined HOF: apply fn to x
F n n means “function taking n, returning n”. F n n n takes two numbers and returns one. Consistent with the rest of the type system.
Why not lambdas?
Ruby’s version:
[1,2,3].map { |x| x * x }
The inline block is convenient - no need to name the transform. But for AI agents, naming is rarely a burden.
Every unnamed function is a function the agent has to invent syntax for, track the scope of, and reason about in context. Named functions are already first-class in ilo - they’re defined, verified, and appear in --explain output. Passing a name is one token. Inventing anonymous syntax is new cognitive load.
The more practical point: transforms worth mapping over are usually worth naming. sq gets reused. pos gets reused. The ones that wouldn’t be reused are simple enough that the overhead of naming them is negligible.
What about syntax consistency?
The brace-based lambda syntax ({x; *x x}) would conflict with ilo’s existing use of {} for guard and loop bodies. The same sigil meaning different things in different contexts is increases generation errors.
You could use a different sigil - \x;*x x, say - but that’s new syntax to put in the spec, new tokens to consume when loading context, and new surface area for mistakes. The spec is already compact. Every addition has to earn its place.
The real saving is in chains
Where HOFs pay off most isn’t individual transforms - it’s chains. With >>:
xs >> flt pos >> map sq >> fld add 0
vs Python:
sum(x*x for x in xs if x > 0)
Both express the same thing. The ilo version is a pipeline you can read left to right. The Python version requires parsing a generator expression with three nested clauses. The ilo version is emitted one stage at a time.