lua-users home
lua-l archive

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


David Manura wrote:
On Wed, Dec 31, 2008 at 5:17 PM, Benjamin Tolputt wrote:
On 12/31/08, Lee Hickey wrote:
http://julien.danjou.info/blog/index.php/post/2008/12/30/Rants-about-Lua
I don't understand why the '#' syntax does not use the __len metamethod

[snip]

From the blog:
The problem is that standard functions like table.insert or
table.remove do raw accesses to the table.

Therefore, I question why table.* functions should honor metamethods.
If you want your ADT to have an "insert" operation, you could
implement it as a dynamically bound method:
[snip]

It looks like the blogger has failed to do a mental/cognitive switch. If he likes OO-across-the-board so much, there's something called Ruby that might agree with his fine tastes. I hear it's very fast too... ;-) Heh. Selamat Tahun Baru [Malay] to everyone too.

--
Cheers,
Kein-Hong Man (esq.)
Kuala Lumpur, Malaysia