lua-users home
lua-l archive

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



-----Original Message----- 
> From: "steve donovan" <steve.j.donovan@gmail.com> 
> To: "Lua mailing list" <lua-l@lists.lua.org> 
> Date: 02-05-2014 19:05 
> Subject: Re: Ideas about colon operator syntax (and a patch in the work) 
> 
> 
> That seems a fair solution, for the situation you have.  Providing a
> scripting interface is a decision that only you can make.  No one
> would dispute that.
> 
> However, it's not a universal solution to Lua OOP, because of the
> overhead (all objects must contain all the needed closures).
Actually I use userdata with metatables, not closures.
I think I should do some measurements on the run time overhead,
but I don't think it's that much. In both cases you need at least
one table lookup and one function call.

As I have a userdata, storing the reference is just sizeof(void*) per
method/object instance.
--
Thomas