fix typo in fold (thanks Georg Schmid)

This commit is contained in:
leaf corcoran 2013-01-09 19:47:02 -08:00
parent 71d9742faf
commit c689acc935
2 changed files with 2 additions and 2 deletions

View File

@ -154,7 +154,7 @@ fold = function(items, fn)
if len > 1 then if len > 1 then
local accum = fn(items[1], items[2]) local accum = fn(items[1], items[2])
for i = 3, len do for i = 3, len do
accum = fn(acum, items[i]) accum = fn(accum, items[i])
end end
return accum return accum
else else

View File

@ -129,7 +129,7 @@ fold = (items, fn)->
if len > 1 if len > 1
accum = fn items[1], items[2] accum = fn items[1], items[2]
for i=3,len for i=3,len
accum = fn acum, items[i] accum = fn accum, items[i]
accum accum
else else
items[1] items[1]