Skip to content

Yet another class library for Lua (Lua 5.1, LuaJIT, Lua 5.2, Lua 5.3, Lua 5.4)

License

Notifications You must be signed in to change notification settings

themusaigen/yacl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

yacl

Yet another class library - a library for the Lua language for creating classes. Supports constructors, destructors, inheritance, and custom metamethods (with inheritance from the parent). The main difference from other libraries is the support for Lua Language Server annotations.

How it implemented? Some history

One day I needed the Lua library to create classes. The basic version, which is an example on lua.org or lua-users.org, didn't suit me. However, the libraries that were publicly available lagged behind in terms of hints to the available entities of your class. After seeing the generic annotation on the LLS wiki and examples for it, I thought it wouldn't be difficult for me to make a suitable one, but there was a problem with the fact that in 4 years (and even more, maybe) (the first release of LLS was on December 16, 2021), no generic classes appeared in the functionality, only a stub of them. However, it was possible to throw the class type into the generator function. So yes, unlike other libraries that return an object of a class to you by throwing various meta-methods on it, this library returns a generator function, where all the magic happens.

Installation

Extract content of src directory to your lib directory.

Usage / Examples

See tests/init.lua file.

See also

License

yacl licensed under MIT license. See LICENSE for details.

About

Yet another class library for Lua (Lua 5.1, LuaJIT, Lua 5.2, Lua 5.3, Lua 5.4)

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages