lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Ok, there's more... I see that this is a busy time, a new Lua being discussed and all, but I think the Great and the Good of Lua's development might really need to see this one:

    --X,Y={1,2,2,2,1,2,2,2,2,2,2,2,2,1,1,2,2,1,2,2,2,1,2,2},{}
      X,Y={2,1,1,1,2,1,1,1,1,1,1,1,1,2,2,1,1,2,1,1,1,2,1,1},{}
    --Try with one or other of above lines active

    for N=1,24 do  -- Could have used "for N in ipairs(X) do" here, same business results...
      if X[N]%2==1 then  Y[N]=X[N]  end
    end

    print(#X,#Y,Y[14],Y[16])  --Note the value of #Y!

I think the weird table.remove behaviour is rooted in whatever is causing this to happen, but I don't know C so I'm not going to try guessing why.