diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2018-11-02 14:38:24 -0700 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2018-11-02 14:39:23 -0700 |
| commit | 307dea18815ba4a06a3098edb170d7ad90708815 (patch) | |
| tree | bce78eb28fa03c9939a92e08e47564afc984c988 /lib/object.nom | |
| parent | d0c3c57f7b25c8d912c426e48cb5ab09cd738f65 (diff) | |
Changed stub convention to (foo 1 baz 2) -> foo_1_baz instead of
foo_1_baz_2, removed "smext", made some cleanup changes.
Diffstat (limited to 'lib/object.nom')
| -rw-r--r-- | lib/object.nom | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/object.nom b/lib/object.nom index 4f45188..d5555df 100644 --- a/lib/object.nom +++ b/lib/object.nom @@ -93,13 +93,13 @@ test: __index=\(%parent as lua expr), __tostring=function(cls) return cls.name end, __call=function(cls, inst) - inst = setmetatable(inst or {}, cls) + if inst == nil then return cls end + inst = setmetatable(inst, cls) if inst.set_up then inst:set_up() end return inst end, }) - nomsu.environment[(class.name.." 1"):as_lua_id()] = class - nomsu.environment[class.name:as_lua_id()] = function() return class end + nomsu.environment[class.name:as_lua_id()] = class class.__index = class class.class = class class.__tostring = function(inst) |
