|
|
||
|
On 2-Feb-07, at 3:44 PM, Shea Martin wrote:
//I want to do something like this: Person = {} Person.mt = {}
function Person:new( pname ) Person.mt.__index = Person return setmetatable( { name = pname }, Person.mt ) end
function Person:talk( mesg ) print( self.name .. " says '" .. mesg .. "'." ) end
function Person:do_stuff() self:talk( "hello" ) end
fred = Person:new( "Fred" ) fred:do_stuff()
//I have a person 'class' I would like to partially define in my C++ program.
//I would like to the rest of it to be defined in a lua script.