From cb44535305f596bd757ffb58e5ae3cde6d3589fa Mon Sep 17 00:00:00 2001 From: ruki Date: Thu, 7 Dec 2017 22:46:25 +0800 Subject: improve log and add color attrs for curses --- xmake/core/base/object.lua | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) (limited to 'xmake/core/base/object.lua') diff --git a/xmake/core/base/object.lua b/xmake/core/base/object.lua index 1922b0b4d..ab4bf468f 100644 --- a/xmake/core/base/object.lua +++ b/xmake/core/base/object.lua @@ -28,20 +28,10 @@ local object = object or {} -- taken from 'std' library: http://luaforge.net/projects/stdlib/ -- and http://lua-cui.sourceforge.net/ -- --- create an object/class: --- > object/class = parent {value, ...; field = value ...} --- > An object's metatable is itself. --- > In the initialiser, unnamed values are assigned to the fields --- > given by _init (assuming the default _clone). --- > Private fields and methods start with "_" --- > --- --- Access an object field: object.field --- > Call an object method: object:method (...) --- > Call a class method: class.method (self, ...) --- > --- > Add a field: object.field = x --- > Add a method: function object:method (...) ... end +-- local point = object { _init = {"x", "y"} } +-- +-- local p1 = point {1, 2} +-- > p1 {x = 1, y = 2} -- -- permute some indices of a table -- cgit v1.3.1