lua-users home
lua-l archive

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


> On 28 Mar 2018, at 03:38, Petri Häkkinen <petrih3@gmail.com> wrote:
> 
> Bumping this thread just this once, as I find the lack of interest on this strange...

I'm not interested, I don't think there's enough advantage to justify the effort.  The split between the array part and the hash part for sparse storage is a clever compromise, and if you're only intending to make an array without holes or with very few then you get a standard array anyway.

The issue of length is a quirk of the language but I can't see any generic way to keep a more accurate version without cost (i.e. largest key, but this is hard in the case of deletion).  If you really need a fast accurate length you just store it manually.  I understand this is a regular tripping point for new users, but really it should just be a case of "once burnt, twice shy".

I'm much more interested in seeing tuples added to the language.  I think it solves the parameter packing (arguments and return) issue much more elegantly than arrays, but I'm currently stuck on the issue of key equality in tables (which arrays wouldn't have anyway).  I haven't finished investigating the best options for interning them yet, but I tinker when I have time.

Regards,

Duane.