Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
8
Task/Inverted-syntax/Lua/inverted-syntax.lua
Normal file
8
Task/Inverted-syntax/Lua/inverted-syntax.lua
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
a = {1,3,5,4,2} -- a "plain" table
|
||||
table.sort(a) -- library method passing a as param
|
||||
print(table.concat(a)) -- and again --> "12345"
|
||||
|
||||
b = {1,3,5,4,2} -- a "plain" table, so far..
|
||||
setmetatable(b, {__index=table}) -- ..but now "meta-decorated"
|
||||
b:sort() -- syntax sugar passes b as "self"
|
||||
print(b:concat()) -- and again --> "12345"
|
||||
Loading…
Add table
Add a link
Reference in a new issue