lua-users home
lua-l archive

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



Very true, which is why I respectfully disagree with Dirk that all ml
list-like functions should live in a List class.

Not quite what I meant, sorry.  I mean the relationship should be like the
standard string library: available as a dot-call for all tables (at the user's
risk that it makes sense) and as a colon-call for Lists.

BTW apart from preferring Sequence because it is decreed, I object to
List because it suggests O(1) insertions and deletions.  I know the
term is used misguidodly in a language that seems to have influenced
the design of Microlight, but why propagate a mumpsimus?

BTW, #s is (a) unavoidably O(N) [1] and (b) only works for 5.2.  So
perhaps we need count_keys() as well.

In the Set class I think #s can be implemented as O(1).  I'll try to work
up a proof-of-concept.