lua-users home
lua-l archive

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

----- Original Message ----- 
From: "anderson" <>
To: "Lua list" <>
Sent: Wednesday, June 18, 2003 1:24 AM
Subject: metatables [newbie]

> Greetings,
> I'm having trouble understanding metatables for Object Orientated C++ like
> classes (note I'm looking at this from the C++ side of things). Luna by
> Lenny Palozzi is helpful for version 4, but I can't figure out the changes
> need to make for v5. I can't seem to find any good sample code for v5
> metatables.  The manual doesn't seem to be very helpful to me (and it's
> probably just me) in respect to metatables.  A sample would be nice,
> including how to add events and values.
> How do I add members (properties/methods)?
> How do I write/receive a index/newindex member?
> How do I use set/getmetatable to change the metatable?
> I've placed some code below which is derived from the Luna example code. I
> hate copying code this closely, but I'm having understanding this.


> Confused,
> Anderson

I read back a few posts (thanks Peter Shook) and found the account
conversion for V5:

IMO: I would be really nice if this link was with the rest of the lua links
(next to luna).