lua-users home
lua-l archive

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


On Thu, Jul 25, 2013 at 1:51 PM, Lorenzo Donati <lorenzodonatibz@tiscali.it> wrote:

Yes, choosing good names is more an art than a science, but choosing good symbols sometimes is akin to witchcraft!

Oh yes!  Where overloading does make sense is implementing generalized arithemetic operations (e.g. classic 'operations on a field' + - * / ^  with corresponding 'zero' and 'one' meanings) and there we have all the operators we need.

A (great) exception is LPeg which uses operators to create a powerful notation.

Even in C++, the standard library makes very sparing use of operator overloading, + for strings, << & >> for stream reading/writing, [] for maps.

I agree with Lorenzo that otherwise an impressive string of symbols is an attempt to make 'code' (source) look like 'code' (a secret cipher).  Not a good fit for a DSL intended for non-professional programmers!