[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: A very basic thing I don't get
- From: Lorenzo Donati <lorenzodonatibz@...>
- Date: Sun, 02 Oct 2011 09:55:50 +0200
On 01/10/2011 22.25, Petite Abeille wrote:
On Oct 1, 2011, at 9:52 PM, Dirk Laurie wrote:
2. Lua has only one data structuring mechanism: `table`.
Furthermore, if one is so inclined, one should feel free to build any type of
>specialized data structure out of the basic
>building blocks provided by the language. [...]
This is IMO a big newbie gotcha: Lua tables are so "high-level", i.e.
they can be easily used to implement lists, trees, maps, stacks, etc.,
that one can easily think they should provide a much fatter interface
(the common problem of getting into Lua's spirit).
It's not easy to grasp initially that one can use OOP techniques to turn
a generic table into, say, a "stack object", with usual push/pop methods.