lua-users home
lua-l archive

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


On Thu, 21 Jul 2016 21:21:05 +0200
Oliver Kroth <oliver.kroth@nec-i.de> wrote:
 
> 
> Am 21.07.2016 um 20:27 schrieb Ulrich Schmidt:
> > I cant follow all the complains about table handling. If i know how
> > tables work ( and they work well from my point of view) then i
> > write my own code in a way my code keeps working. For me it looks
> > like, people want to go from here to there in a shortest way but
> > there is a wall between. Now i can complain about the wall again
> > and again or i find the door in the wall and go thru the door. The
> > way to walk may be a little bit longer but i reach my destination.  
> 

> Hi all
> 
> I agree with Ulrich. Strongly.
> 
> I have to switch a lot between Lua and JavaScript, and their
> table/array implementations.

I agree with Oliver and Ulrich. In my view, one of Lua's greatest gifts
is that tables (and metatables) are the only complex data form, and you
can use them to make any data you want. All you have to do is get
really good at tables, and Lua becomes your faithful servant.

> And I have to say, I do favour the Lua implementation, where there is 
> only one data structure covering both, and especially only one
> literal to initialize it. Makes storing data much easier!
> 
> If people need an iterator that jumps over holes when enumerating the 
> array part, why don't they make one?

I agree. There are probably ten different ways of doing it, and given
Lua's performance, they'll be fast even if they seem a little hokey.

If Lua's addons were as carefully curated as Python's, I'd use Lua
every day, because Lua's for sure the best language as a language. Why
people keep asking for more features in this beautifully simple
language is beyond me.

SteveT

Steve Litt 
July 2016 featured book: Troubleshooting Techniques
     of the Successful Technologist
http://www.troubleshooters.com/techniques