[V1.2.1] wOOP (OOP lib)

Showcase your libraries, tools and other projects that help your fellow love users.
Post Reply
LuaWeaver
Party member
Posts: 183
Joined: Wed Mar 02, 2011 11:15 pm
Location: Ohio, USA

[V1.2.1] wOOP (OOP lib)

Post by LuaWeaver »

EDIT : Found a bug with inheriting __settings, it'll be fixed soon.

Hello. I've finished polishing up my library from v 1.1 to v 1.2 (neither 1.0 or 1.1 were released...) and it's ready to release now (stable). It also supports ClassCommons, but only if you set common_class to true BEFORE you require it.

Anyways, to the library itself... note that most of this is configurable!
It's a pretty simple OOP library which uses userdata in place of tables for objects. It supports private (available in it's methods only)/readonly values (able to set in methods) and is basic to do so. Another thing is that you use a "." in place of a colon for those said methods. It's supports constructors and deconstructors (the whole point of that userdata thing) via a congifuration table in the class (default as __settings) with a few values (new function and __gc metamethod in mt). You don't have to specify "self" in the functions, nor are they methods. I call it "pseudo methods", because it emulates methods without being one.

It's all a beautiful syntax as well, one of the key points in it. Creating the one of the most basic set of classes possible, wOOP looks cleaner and is shorter than the same ClassCommons implementation.

No, seriously. I've attached an example that has both a wOOP one and a CC one. They do the same exact thing, but wOOP looks cleaner in both the main source AND the class itself.

You can find the source here as well - http://pastebin.com/ByPpU49C
For a better look at it, you can go here - http://pastebin.com/R5TvZE4J
Attachments
wOOP.love
wOOP v1.2.1
(3.79 KiB) Downloaded 95 times
"your actions cause me to infer your ego is the size of three houses" -finley
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 4 guests