lua-users home
lua-l archive

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


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Kenk wrote:
[...]
> So now O=AWindowClass.new{fields and stuff} ... When
> 0.FunctionInProtoTypeTable() is called, it won't find it in AWindowClass
> and look in the prototype's table. which it finds...Problem is, the
> initial 'self' state isn't be passed through...as get's done when you
> reference a method with anObject:AFunction();

That's because you're calling it with . and not :, if I've understood
you correctly.

foo:bar() is syntactic sugar for foo.bar(foo). There's nothing magical
about methods, unlike Javascript... so if you forget to use : (which I
do periodically), then all the parameters are wrong.

- --
┌─── dg@cowlark.com ───── http://www.cowlark.com ─────
│ "There is nothing in the world so dangerous --- and I mean *nothing*
│ --- as a children's story that happens to be true." --- Master Li Kao,
│ _The Bridge of Birds_
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iD8DBQFK5MrFf9E0noFvlzgRAqTxAKCaoDAki4c8nu4WE4mzD8i3ebLE7wCgx/c/
U2L93D5VSXx5UlR9lRx86xo=
=ry65
-----END PGP SIGNATURE-----