[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: [ANN] luajit-msgpack - with questions to Mike
- From: Mike Pall <mikelu-1111@...>
- Date: Sat, 26 Nov 2011 17:10:06 +0100
Pierre Chapuis wrote:
> However I like Alexander's suggestion to add a function to tell
> whether a table is a List.
A list? You probably mean an array without holes.
There's no way to do that without traversing the whole table. All
shortcuts that try to infer something from e.g. #t or next() will
fail under some circumstances.
In other words: avoid APIs where you need to auto-detect such a
property. Instead, let the user of the API tell you what they
provide and/or what output representation they want.