1
0
mirror of https://github.com/kepler155c/opus synced 2025-12-16 21:28:29 +00:00

tabs update + object identity

This commit is contained in:
kepler155c@gmail.com
2017-10-09 00:26:19 -04:00
parent 955f11042b
commit f5b99d91e5
4 changed files with 101 additions and 51 deletions

View File

@@ -1,6 +1,8 @@
-- From http://lua-users.org/wiki/SimpleLuaClasses
-- (with some modifications)
local uid = 1
-- class.lua
-- Compatible with Lua 5.1 (not 5.0).
return function(base)
@@ -19,7 +21,8 @@ return function(base)
-- expose a constructor which can be called by <classname>(<args>)
setmetatable(c, {
__call = function(class_tbl, ...)
local obj = {}
local obj = { __uid = uid }
uid = uid + 1
setmetatable(obj,c)
if class_tbl.init then
class_tbl.init(obj, ...)