[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Lua 5.2 Length Operator and tables (bug?)
- From: Axel Kittenberger <axkibe@...>
- Date: Tue, 24 Apr 2012 09:37:46 +0200
Rena> I often felt there'd be a lot less confusion about the table
Rena> library if it were named 'array' instead.
This.
Steve> Quite so! The discussion has been about the rather
Steve> slippery nature of Lua tables
And this is the same I thought to be the underlying problem. Haziness
of data structures. I won't say Lua should come with them, and I don't
want to iterate another spin of the much repeated play "we need a
common base library".
My suggestion back then was, and I still haven't seen a good refute
of, remove any default meaning of #. # is what __len says it is. And
if you want it to behave like it is now, set __len to table.edge or
better array.edge. So no one is ever going to be surprised, and if
__len is not set, it throws an error.
Anyway I don't have any quarrels about the length operator, I can do
fine with it, and in my project I did create my own a bit more
sophisticated datastructures like a sequence factory which´ objects
throw an error when anything is set that doesn't fit the sequence, so
no holes ever. I think its good to remember, people are arguing in
these plays, because they care about Lua beyond their own mundane need
:-)
- References:
- Re: Lua 5.2 Length Operator and tables (bug?), Joseph Manning
- Re: Lua 5.2 Length Operator and tables (bug?), Coda Highland
- Re: Lua 5.2 Length Operator and tables (bug?), Dirk Laurie
- Re: Lua 5.2 Length Operator and tables (bug?), Coda Highland
- Re: Lua 5.2 Length Operator and tables (bug?), joao lobato
- Re: Lua 5.2 Length Operator and tables (bug?), Coda Highland
- Re: Lua 5.2 Length Operator and tables (bug?), joao lobato
- Re: Lua 5.2 Length Operator and tables (bug?), Eduardo Ochs
- Re: Lua 5.2 Length Operator and tables (bug?), Roberto Ierusalimschy
- Re: Lua 5.2 Length Operator and tables (bug?), Petite Abeille
- Re: Lua 5.2 Length Operator and tables (bug?), Roberto Ierusalimschy
- Re: Lua 5.2 Length Operator and tables (bug?), Petite Abeille
- Re: Lua 5.2 Length Operator and tables (bug?), Petite Abeille
- Re: Lua 5.2 Length Operator and tables (bug?), Petite Abeille
- Re: Lua 5.2 Length Operator and tables (bug?), Axel Kittenberger
- Re: Lua 5.2 Length Operator and tables (bug?), Javier Guerra Giraldez
- Re: Lua 5.2 Length Operator and tables (bug?), steve donovan
- Re: Lua 5.2 Length Operator and tables (bug?), Rena