lua-users home
lua-l archive

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


On Mon, Oct 14, 2013 at 1:25 PM, Carsten Fuchs <carsten.fuchs@cafu.de> wrote:
> I'm certainly not feverish about this, but for consistency's sake, I think
> it would be nice to have either -- or none.   ;-)

Up to some point, consistency is overvalued.  No point in breaking all
those programs because implicit tostring was offending my delicate
tastes - because tastes differ.  I'm with Dirk when he suggests an
explicit tobool, then everyone can see what's happening and (NB) not
paying for something they don't need.  This is a famous C++ principle,
but then it hides so much implicit complexity (in theory, 'fire =
true' could launch a rocket *) that one has to be extra awake.

Features implemented by explicit functions (e.g. the famous setfenv)
are easier to deprecate, because we can track them down so easily.
Whereas if Roberto listened to us and felt that 'hello '..42 was
inconsistent - well _that's_ not so easy to track!  I've succeeded in
convincing myself that these implicit conversions are not such a bad
thing after all.

(*) Silly example, but when dealing with others' code you learn to
hate cleverness.  It remains true, of course, that 'rocket.fire =
true' could do the same in Lua.