aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/libs/lua/common/stdlib.lua
blob: 11f912bfc25d2756407f26230b1e156ead0591f5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
function range(i, j)
   local function rangeGenerator()
      while i < j do
         coroutine.yield(i)
         i = i + 1
      end
   end

   return coroutine.wrap(rangeGenerator)
end

-- cross-platform file rename
function rename(src, dest)
    os.remove(dest)
    return os.rename(src, dest)
end