lua-users home
lua-l archive

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


t = {
    foo = function() end,
    bar = some_global_function(t.foo),
}

That does not work for me, since t is not yet defined.  (I'm using Lua
5.1.1 - perhaps this has changed since?)

Brian

-----Original Message-----
From: lua-bounces@bazar2.conectiva.com.br
[mailto:lua-bounces@bazar2.conectiva.com.br] On Behalf Of Vadim
Peretokin
Sent: Thursday, May 13, 2010 1:54 PM
To: Lua list
Subject: Re: Access a member from within the table def

t = {
    foo = function() end,
    bar = some_global_function(t.foo),
}

? That's what I do when I ran into this. Would be lovely if there was a
way to specify 'this' foo without the full path, though.