[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: More on environments and objects
- From: Adrian Sietsma <adrian_groups@...>
- Date: Sun, 28 Aug 2005 02:46:44 +1000
Mike Pall wrote:
Interesting. Looks like many programmers (when new to Lua or
to its ancestor languages) experience the same learning curve.
Usually the discussions go along this path:
1. implicit local vs. explicit local.
2. static typing vs. dynamic typing.
3. specialized types vs. limited type diversity.
4. automatic type coercion vs. explicit type coercion.
5. dot-only vs. dot and colon.
6. implicit self vs. explicit self.
7. exception dispatch vs. pcall().
8. object equality vs. object identity.
9. OO vs. closures.
10. complexity vs. simplicity.
Lua is different. The familiar syntax is deceptive.
true, but many of these (5,7,9) are not either-or.
i have a simple sorted-insert linked-list, implemented as a table of
functions with one upvalue. it's in a heat point, and i don't need a
metatable, just 3 functions.
that said, i love the : syntax for other stuff: setting the metatable of a
table to point to table (is that a recursive sentance ?) gives the lovely
t:insert() syntax. also complex classes benefit from :.
i have c++ calling lua, and i have lua calling c / c++.
that's what i like most about lua - you can use it in the manner that best
suits you and the problem at hand.