[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Tons of reallocs in Lua - why?
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Sun, 24 Dec 2006 19:14:06 -0200
> >You may want to try the _very_dirty_hack_ of creating your tables like
> >this:
> >
> > t = {nil,nil,nil,nil,nil,nil,nil,nil,nil,nil}
>
> Where are token filters when you need them ;-)
Here :-)
local function F(get,put)
put("F init")
while true do
local line1,token1,value1=get()
put(line1,token1,value1)
if token1=="{" then
local line2,token2,value2=get()
if token2=="}" then
for i=1,8 do
put(line2,"nil")
put(line2,",")
end
end
put(line2,token2,value2)
end
end
end
function FILTER(get,source)
FILTER=coroutine.wrap(F)
FILTER(get,coroutine.yield)
end
--lhf