[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: RE: ... efficiency (was Re: class implementation)
- From: "Dolan, Ryanne Thomas (UMR-Student)" <rtdmr6@...>
- Date: Fri, 7 Apr 2006 12:25:40 -0500
On Apr 07, 2006, at 00:27, Mark Hamburg wrote:
>> on 4/6/06 8:17 AM, David Jones at drj@pobox.com wrote:
>>
>>> "for k,v in pairs{...}" is not quadratic, but it isn't fast.
>>
>> It's also incorrect if you care about nils or order. Ipairs is
>> incorrect if
>> the arguments can contain nils.
>Of course you're right. Those damn nils again.
>>
>> The set of cases where nils matter when iterating over varargs is
>> probably
>> small, but it is potentially an issue.
nils passed to a vararg function is a problem more often than not I'd say:
local cat = 1, dog = 2;
print (cat, dawg);
without maintaining nils, there is no immediate way to detect the typographical error above.
>Agreed. That makes me want apairs in the standard base library.
>drj
I would love to see a more elagant solution than the select function; apairs might be the answer.
<<winmail.dat>>