lua-users home
lua-l archive

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


On Tue, Aug 05, 2014 at 06:58:29 -0700, Coroutines wrote:
> Well yes, I do understand this... I just wish the focus of metamethods
> were changed.  It'd be inefficient but interesting to expose the base
> mechanics through the primitive types having a metatable -- imo.  It'd
> be really cool to disable adding numbers by unreferencing the C code
> that handles __add, for example -- this has always been a dream of
> mine :\..

Such a level of flexibility would severely limit the analysis of code.  There's
a reason C++ doesn't allow overloading of operators on intrinsic types; and
similarly there's a reason Python's so very hard to write a fast interpreter
for.

"interesting" it may be, but "sensible" "efficient" and "worthwhile" I'd argue
it would not be.

D.

-- 
Daniel Silverstone                         http://www.digital-scurf.org/
PGP mail accepted and encouraged.            Key Id: 3CCE BABE 206C 3B69