lua-users home
lua-l archive

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


On Fri, 20 Dec 2019 02:44:04 +0000
Griffin Rock <abcq2@hotmail.com> wrote:

> 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)

Isn't that a Fibbonacci generator?

And this post brings up the question: Is there a Lua add-on that does
RPN arithmetic?

Thanks,

SteveT

Steve Litt 
December 2019 featured book: Rapid Learning for the 21st Century
http://www.troubleshooters.com/rl21