lua-users home
lua-l archive

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


On Fri, Sep 24, 2010 at 2:20 PM, Rebel Neurofog <rebelneurofog@gmail.com> wrote:
> I've made some benchmarking. This may help you to decide which way
> fits your requipments.
>
> Take a look: http://lua-users.org/wiki/ObjectOrientationClosureApproach

I would say the most common approach f is to use metatables to hold
the functions instead of generating them for each object.  For
example: http://www.mat.ucsb.edu/projects/luaAV/browser/trunk/extra/modules/label/init.lua
.  It will use far less memory if you're creating lots of objects and
won't use closures for self like you're kind of doing but overriding
in a strange way.

wes