lua-users home
lua-l archive

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


From: Gavin Kistner
> From: Zed A. Shaw
> > 1) What's people's favored OO system for Lua and the 
> > advantages/disadvantages?
> 
> I wrote my own OO system that mimics (but doesn't match) the basics of
> Ruby's inheritance hierarchy.
> http://phrogz.net/AnarkSamples/AKClassHierarchy.lua

I suppose I didn't answer your second question.

Advantages:
	Simple, small
	Class inheritance (single parent only)
	All objects inherit from a base Object
	Classes are Objects
	Custom string representations (for class objects and instances)
	Simple class/method definition (JavaScript-like 'prototype'
object)
	Execution speed and memory usage is pretty good

Disadvantages:
	No multi-inheritance/mixins
	No private/protected
	No 'super' method (yet)
	No custom hash keys or object ids
	No method introspection (arity, name)