lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Can someone help me get this onto LuaRocks?

-- dc.lua
return function (...)
  local cmd = 'dc "-e %s p"'
  local prg = table.concat({...}, " ")
  local dc = io.popen(cmd:format(prg))
  local result = dc:read(); dc:close()
  return result
end

-- example
x = "1"; y = "1"
for i = 1,100 do
  x,y = y,dc(x, y, "+")
end
print(y)