lua-users home
lua-l archive

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


The following behaviour seems really rather broken:

dsilvers@salmon:~/dev/betty/aranha$ lua/bin/lua
Lua 5.0 (beta)  Copyright (C) 1994-2002 Tecgraf, PUC-Rio
> t = {}
> t[1] = {}
> t[2] = {}
> t[3] = {}
> table.foreach(t,print)
1       table: 0x80708f0
2       table: 0x8070a70
3       table: 0x8070c18
> table.remove(t,3)
> table.foreach(t,print)
1       table: 0x80708f0
2       table: 0x8070a70
> t[1] = {}
> t[2] = {}
> t[3] = {}
> table.foreach(t,print)
1       table: 0x8071568
2       table: 0x8071690
3       table: 0x8071808
> table.remove(t,3)
> table.foreach(t,print)
1       table: 0x8071568
3       table: 0x8071808
> 

Notice how the second time I do table.remove(t,3) it removes 2 not 3

Any ideas?

D.

-- 
Daniel Silverstone                               http://www.digital-scurf.org/
Hostmaster, Webmaster, and Chief Code Wibbler          Digital-Scurf Unlimited
GPG Public key available from keyring.debian.org               KeyId: 20687895
Write yourself a threatening letter and pen a defiant reply.