[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: metatable, __index & forwardInvocation?
- From: Rici Lake <lua@...>
- Date: Sat, 5 Feb 2005 12:17:56 -0500
On 5-Feb-05, at 12:00 PM, PA wrote:
Assuming the following invocation:
anObject.doIt( true )
And the following __index function:
__index = function( aTable, aKey )
return this.forwardInvocation( aKey, ????? )
end
What's "this" ?
anyway, I think what you want to do is:
__index =
function(this, aKey)
return
function(...)
return this.forwardInvocation(unpack(arg))
end
end
or something along those lines.
In other words, the __index function is simply returning the
value corresponding to anObject.doit, which value should in
this case be a function. That function will be called in
due course.