mirror of
https://github.com/1bardesign/batteries.git
synced 2024-11-29 16:24:35 +00:00
Add comment to foreach regarding new behaviour
This commit is contained in:
parent
3c6aaf1a76
commit
f36946ace4
@ -31,6 +31,7 @@ end
|
|||||||
|
|
||||||
--simple sequential iteration, f is called for all elements of t
|
--simple sequential iteration, f is called for all elements of t
|
||||||
--f can return non-nil to break the loop (and return the value)
|
--f can return non-nil to break the loop (and return the value)
|
||||||
|
--otherwise returns t for chaining
|
||||||
function functional.foreach(t, f)
|
function functional.foreach(t, f)
|
||||||
for i = 1, #t do
|
for i = 1, #t do
|
||||||
local result = f(t[i], i)
|
local result = f(t[i], i)
|
||||||
|
Loading…
Reference in New Issue
Block a user