[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Empty? No. Array? No. Has? Yes.
- From: Jorge <xxopxe@...>
- Date: Sat, 06 Jul 2013 18:13:29 -0300
On 06/07/13 17:02, Rena wrote:
dding nil doesn't change anything here: your loop would also break if
some confused person stuck a table or a coroutine into the array. It's
already necessary to either check that each value is the type you
expect or ensure that unexpected types don't end up in the array to
begin with, whether nil is an accepted type or not.
I think this is a fundamental difference. Array based algorithms (say
binary search, some sorting, or simple traversing) assume that each slot
in the array contains something worth looking up, whatever makes sense
for the application. Nil is never that, because there is nothing you can
do with it. Nil is not something that must have a meaning in the
application domain, it's effectively out of band application wise.
- References:
- Empty? No. Array? No. Has? Yes., Dirk Laurie
- Re: Empty? No. Array? No. Has? Yes., steve donovan
- Re: Empty? No. Array? No. Has? Yes., David Heiko Kolf
- Re: Empty? No. Array? No. Has? Yes., Roberto Ierusalimschy
- Re: Empty? No. Array? No. Has? Yes., Jay Carlson
- Re: Empty? No. Array? No. Has? Yes., Mark Hamburg
- Re: Empty? No. Array? No. Has? Yes., Andrew Starks
- Re: Empty? No. Array? No. Has? Yes., Tim Hill
- Re: Empty? No. Array? No. Has? Yes., Andrew Starks
- Re: Empty? No. Array? No. Has? Yes., Tim Hill
- Re: Empty? No. Array? No. Has? Yes., Andrew Starks
- Re: Empty? No. Array? No. Has? Yes., Rena
- Re: Empty? No. Array? No. Has? Yes., Tim Hill
- Re: Empty? No. Array? No. Has? Yes., Jorge
- Re: Empty? No. Array? No. Has? Yes., Rena