lua-users home
lua-l archive

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


On Thursday 15 March 2007, Mike Pall wrote:
> Hi,
>
> Brian Hagerty wrote:
> > So the information about "who called this function/method" is
> > already available in the call frame (and already available in
> > Lua's function call implementation).
>
> It's not. At least not in general. Say foo is a global variable,
> then foo.method() translates to GETGLOBAL + GETTABLE + CALL.
> GETTABLE happily reuses the stack slot where GETGLOBAL put the
> object in question. There's no way to retrieve it from the
> caller's frame because it's simply no longer on the stack.

i think he's confusing the return address with the table (or userdata, or 
anything) used to get the function.  he calls it "the caller object", but 
that's just a figment of his imagination.


-- 
Javier

Attachment: pgp49PGW22wT2.pgp
Description: PGP signature