[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Functions in Table constructors
- From: "Matt Holmes" <matt@...>
- Date: Fri, 16 Nov 2001 16:25:57 -0500
Is it possible to define a function inside a tables constructor?
For instance:
t = {
func1 = function(self, test)
DoStuff()
end
function func2(self, test)
DoStuff()
end
}
And if I can define a function this way, can I invoke them as:
t:func1("1234")
t:func2("1234")
or would I have to do
t.func1(t, "1234")
t.func2(t, "1234")
Thanks in advance :)
Matt