lua-users home
lua-l archive

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


On Tue, Feb 21, 2012 at 9:49 AM, Dirk Laurie <dirk.laurie@gmail.com> wrote:
> 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.

Ah, but the string notation comes from strings sharing a metatable.

I'd also feel uncomfortable importing the ml table functions into
table by default (but it's easy to do)

> I object to List because it suggests O(1) insertions and deletions.

Precisely my worry. We are not in Python land, and List has a
pre-existing well-defined meaning. I'm tending to Array. It's not just
interference from my own jargon 'sequence' but it's an awkward word,
somehow.

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

I'd be curious if that could be done and still keep the contents of
the set as key/value pairs.

steve d.