diff options
| author | ruki <[email protected]> | 2017-12-07 22:46:25 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2017-12-08 14:10:23 +0800 |
| commit | cb44535305f596bd757ffb58e5ae3cde6d3589fa (patch) | |
| tree | 343f0ff9287b90204a6a000e0af1a7a1ed6c640b /xmake/core/base/object.lua | |
| parent | abe87994168053e4f420a8b7ab286c65b546eaae (diff) | |
improve log and add color attrs for curses
Diffstat (limited to 'xmake/core/base/object.lua')
| -rw-r--r-- | xmake/core/base/object.lua | 18 |
1 files changed, 4 insertions, 14 deletions
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 |
