[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: upgrading to 4.0(a)
- From: Roberto Ierusalimschy <roberto@...>
- Date: Thu, 31 Aug 2000 10:23:41 -0300
> : I also had to dig into the sources a little deeper, because I need
> a version of foreach which has repeatable order also for string indices.
What about this? Too slow?
function foreachsorted (t, f)
local a = {}
foreach(t, function(name) tinsert(%a, name) end)
sort(a)
foreachi(a, function (i, n) %f(n, %t[n]) end)
end
> > * below is a program that screws up the internal Lua-Stack. Doesn't look
> > really dangerous, does it?
Somewhere in the list (around May, I guess) there is a one-line patch
for it.
-- Roberto