Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local table = {}
- function Table(t)
- return setmetatable(t, table)
- end
- function table:len()
- local n = 0
- while(self[n+1]) do
- n = n+1
- end
- return n
- end
- function table:concat(c)
- local str = ""
- for i = 1, self:len() do
- str = str .. (c or "") .. self[i]
- end
- return str:sub((c or ""):len()+1)
- end
- function table:insert(v, i)
- self[(i or self:len()+1)] = v
- end
- function table:remove(v)
- --TODO
- end
- table.__index = table
- t = Table{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement