lua-users home
lua-l archive

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


On Tue, Nov 17, 2009 at 10:46 AM, spir <denis.spir@free.fr> wrote:
> More generally, overloading abuse or misuse can lead to really undebuggable issues. (painfully bites!)

Oh yes!  A programmer needs to need a special driver's license to
overload operators ;)  The concept isn't difficult, but using it
sensibly (and not for 'fun') is tricky.

Another use of defining __call that isn't such a good idea: for an
object to return its iterator

for val in obj() do ... end

Much better to say obj:iter() explicitly.