lua-users home
lua-l archive

MI class library version 2.02 released, patch included

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


Thank you Eric,
I hadn't realized that arg support was optional. Your patch is already included in the new version 2.02. In this version I added a restricted version of the library, unclasslib.lua, that only supports unnamed classes and square-bracket scoping. Classlib handles both named and unnamed bases by indexing with [base.__name]. If the base is an unnamed class, base.__name == base. Unclasslib uses [base] directly, thus eliminating one redundant level of indexing. This should make unclasslib a bit more efficient than classlib for applications that only use unnamed classes.
References to the new version:
http://lua-users.org/wiki/MultipleInheritanceClasses
http://luaforge.net/projects/luamiclasses/
Best regards,
Hugo
Eric Raible escribió:
For those of use running 5.1.1 with LUA_COMPAT_VARARG undefined
need a simple patch to take that into account:
function mt:__call(...)
	local arg = {...}
	-- Create a new class
	...
end
- Eric

AltStyle によって変換されたページ (->オリジナル) /