[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: iterator sequences (was: Standard libraries)
- From: Wim Couwenberg <wim.couwenberg@...>
- Date: Fri, 1 Jan 2010 18:31:23 +0100
> or... use a filter:
[snip snip
> local function self(k, ...)
> saved_key = k
> return ...
> end
That should probably be:
local function self(k, ...)
saved_key = k
if k ~= nil then
return ...
end
end
Bye,
Wim
> return function(s, k)
> return self(f(s, saved_key or k))
> end
> end
>
> t = {
> aap = "noot",
> mies = "vuur",
> wim = "jet",
> }
>
> for x in seq(pairs(t)) (value) do
> print(x)
> end
>
> Bye,
> Wim
>