[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: just a little question about the lua way :)
- From: Mike Pall <mikelu-0512@...>
- Date: Wed, 14 Dec 2005 18:25:58 +0100
Hi,
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
return sum
end
And in fact this is the fastest solution, too.
Bye,
Mike