[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: In praise of 'nil' (Was: Proposal for table length operator
- From: Axel Kittenberger <axkibe@...>
- Date: Wed, 15 Dec 2010 10:15:01 +0100
> It is not an "anti-value" but the default value.
Not quite, as Wladimir showed nil is currnelty a bit more special than
just a default value. A table.remove() might or might not stop on a
nil value (internally if it is in the array part or the hash part).
b = {}
b[1] = 1
b[2] = 2
b[3] = 3
b[6] = 6
table.remove(b,1)
for k,v in pairs(b) do print(k,v) end
1 2
2 3
6 6
- References:
- Re: Proposal for table length operator, Gunnar Zötl
- Re: Proposal for table length operator, Mark Hamburg
- Re: Proposal for table length operator, Roberto Ierusalimschy
- Re: Proposal for table length operator, Mark Hamburg
- In praise of 'nil' (Was: Proposal for table length operator, Dirk Laurie
- Re: In praise of 'nil' (Was: Proposal for table length operator, Axel Kittenberger
- Re: In praise of 'nil' (Was: Proposal for table length operator, Dirk Laurie
- Re: In praise of 'nil' (Was: Proposal for table length operator, Pierre-Yves Gérardy
- Re: In praise of 'nil' (Was: Proposal for table length operator, steve donovan
- Re: In praise of 'nil' (Was: Proposal for table length operator, David Kastrup