[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: just a little question about the lua way :)
- From: Mike Pall <mikelu-0512@...>
- Date: Wed, 14 Dec 2005 18:25:58 +0100
Asko Kauppi wrote:
> Sometimes, "making it Lua" may mean that you're actually making it
> harder for those PHP/C/etc. people to understand.
"Making it Lua" => "Making it simple".
There's absolutely nothing wrong with:
local function sumtable(tab)
local sum = 0
for _,x in ipairs(tab) do sum = sum + x end
And in fact this is the fastest solution, too.