lua-users home
lua-l archive

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


Roberto Ierusalimschy wrote:
I guess the Lua authors have already considered this possibility
(because it's so simple to implement), but probably rejected it.

One problem is that it does not extend nicely to tables. If you could
write "s:len()", it would be quite reasonable to expect "t:next(k)" to
work as well. However, to have a default metatable for tables has two
drawbacks (at least):

Yes, that's true. The whole system I'm proposing (in the other thread) is for things that don't already have metatables, and at some point I need to address how the two different schemes might be united. I'll think about it more to see if I can find way to make it all work - elegantly.

Doug

-- 
--__-__-____------_--_-_-_-___-___-____-_--_-___--____
Doug Rogers - ICI - V:703.893.2007x220 www.innocon.com
-_-_--_------____-_-_-___-_--___-_-___-_-_---_--_-__-_