lua-users home
lua-l archive

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


On Wednesday, April 16, 2014 08:17:35 AM steve donovan wrote:
> Which would be a backwards step, IMHO.  String methods are very
> convenient (although a _little_ slower than localized functions).  In
> any case,  the string table is global and people can patch it anyway -
> the metatable just has __index=string.
> 
> Paranoid people can always give strings a metatable which points to
> their own protected copy of string...

The problem is changing the string-type metatable is global. If I wanted to 
override string methods in a limited way I could load modules in a custom _ENV 
with my own string table. Strings outside the box would still use the standard 
functions. As long as everyone stays away from the OO-style functions.

-- 
tom <telliamed@whoopdedo.org>