入門

sleep

coroutine.sleep(0.2)

module

local M = {} -
function M.deleteDataFile(name)
   ...
end
return M

coroutine

class

Lua に class は存在しないので、それっぽいラッパー。

table

  • https://github.com/torch/xlua/blob/master/init.lua#L640
    function table.splice(tbl, start, length)
       length = length or 1
       start = start or 1
       local endd = start + length
       local spliced = {}
       local remainder = {}
       for i,elt in ipairs(tbl) do
          if i < start or i >= endd then
             table.insert(spliced, elt)
          else
             table.insert(remainder, elt)
          end
       end
       return spliced, remainder
    end

array

.