lua-users home
lua-l archive

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


On 1/4/11 5:58 PM, Tony Finch wrote:
On Tue, 4 Jan 2011, Leo Razoumov wrote:
And how exactly I am supposed to do this job? E.g., how can I test
that an array  t coming my way from someone else's library has no
holes?
Two options:

1: Don't bother. It's the caller's responsibility to obey your API
requirements.

2: Give your tables a metatable that keeps track of the invariants you
require, if they don't match the ones provided by Lua.

I may be doing you injustice Tony, but I wish people would stop using
their own range of applying Lua as counter arguments to proposals
of others for other ranges.

'Don't bother' or 'give your tables...' cannot work in a number of
circumstances. Since the question is not 'can it work' but could it
be more secure/predictable/reliable/useful, it's no solution.

Henning