I'm not sure I follow that it'd have to be "shoehorned." Doesn't Lua contain, or isn't it just a superset of the lambda calculus? Lua is of course a lot more procedural than most languages implementing lambda calculus, but...
From Wikipedia: (
http://en.wikipedia.org/wiki/Lambda_calculus )
Formally, a lambda _expression_ is defined inductively as one of the following:
- V, a variable, where V is any identifier. (The precise set of identifiers is arbitrary, but must be infinite.)
- (λ V. E), an abstraction, where V is any identifier and E is any lambda _expression_. An abstraction corresponds to an
anonymous function.
- E E′, an application, where E and E′ are any lambda expressions. An application corresponds to calling a function (E) with an argument (E′
).
Lua provides facilities for all three of those expressions, the critical one being abstractions / anonymous functions.