lua-users home
lua-l archive

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


> > Sorry, just answered by own dumb question. You need to put underscores
> > before the name in 5.0 work 0.
> 
> Hmm... is this to facilitate the use of tables as their own
> metatables? Or is that not allowed?

It is allowed, but the main motivation for the prefix `__' is to
facilitate finding where in your program you set/get/change metamethods.

"grep __index" will get much less noise than "grep index"...


-- Roberto