lua-users home
lua-l archive

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


Paul K wrote:
> I'd like to iterate over array part first (for example, using ipairs)
> and then over the hash part (using pairs), but didn't want to iterate
> over already iterated parts.

How critical is that requirement really?  For a serializer I would
probably first serialize the integer elements 1..#t using a numeric for
loop and then use pairs and filter out all integer keys <= #t.  Of
course you would iterate over the integer keys twice, but I wonder
whether the cost for filtering out the elements would be significant
compared to the entire cost for serialization.

Best regards,

David Kolf