lua-users home
lua-l archive

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


I been using Lua for years now and one thing that I hate is that is does not support native classes, exceptions or enums as many other languages does. Even Python support the three. I understand that it is very easy to write Lua code to emulate the syntax or code as you might see it but this isn't the same thing as having direct syntax for the languages.

Classes can easily be done with function scope or metatables
Exceptions(try, catch, finally, [maybe even "else"]) can be done the same way honestly but using callback functions.
Enums can be done simply with a table or a much more powerful metatables enum system

To implement them is
1) time consuming .
2) defeats the whole purpose of the DRY (Do not repeat yourself) rule.
3) and make the code harder to read since they are not native and someone have to read the implementation for them.

My questions/concerns is: will Lua ever have actual real support for any of these? Mainly classes. That is one thing that Lua does not support which makes it impractical for real world applications unless you're doing embedding applications.