[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: _SELF and _SUPER
- From: "Soni L." <fakedme@...>
- Date: Sat, 6 Aug 2016 17:33:17 -0300
On 06/08/16 05:30 PM, Sean Conner wrote:
It was thus said that the Great Soni L. once stated:
On 06/08/16 06:19 AM, Tim Hill wrote:
A more interesting question .. why do you need this? And, for your
need, have you explored other ways to solve the problem within the
existing Lua language?
I've used recursive pseudo-anonymous functions before. _SELF would make
them easier to use.
local function inside_anonymous(args, I, should, take)
You just need a Y-combinator:
local function g(...) return f(g,...) end
if x < 2 then
return x * rec(x-1)
That will allow you to call an anonymous function recurively from within
the anonymous function. No need for _SELF in this case.
-spc (Now, about that _SUPER ... )
That doesn't solve the dynamic variable indexing issue.
Disclaimer: these emails may be made public at any given time, with or without reason. If you don't agree with this, DO NOT REPLY.