lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Thu, Jan 04, 2001 at 11:57:55AM +0000, Reuben Thomas wrote:
> If you look in tests/factorial.lua, you'll find an implementation of the Y
> combinator that lets you make an arbitrary function recursive. The idea is
> that you take your ordinary version of the function:
[snip]
> Because lua is not a proper functional language, the definition of Y is even
> hairier than usual, and to be honest, I haven't quite understood it myself,
> although essentially, it turns F into F(Y(F)).

This seems a little Ikky, I suppose I could just pass the value
in explicitly, I.E.

local foo = function(fptr,param) .....end;

and just explicitly pass fptr around properly, but then it seems to me
that Lua should have this as a language feature.

Daniel.