lua-users home
lua-l archive

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


On 2013-08-23 15:47:34 +0000, Coda Highland said:

On Fri, Aug 23, 2013 at 8:46 AM, Coda Highland <chighland@gmail.com> wrote:
On Fri, Aug 23, 2013 at 8:43 AM, Philipp Kraus
<philipp.kraus@flashpixx.de> wrote:
x = myClass( 123 )

x.test() -- shows nil

Because it needs to be x:test().

/s/ Adam

... although that'll output some table address and not the value of
x.id because you're calling print(self) and not print(self.id).

/s/ Adam

I can do x.test() or x:test(), both calls result nil.
The parameter "self" is always nil, so imho I have a wrong definition in my metatable

Phil