[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Nil and false in Lua design
- From: steve donovan <steve.j.donovan@...>
- Date: Mon, 14 Oct 2013 13:38:08 +0200
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.
- References:
- Nil and false in Lua design, Alexander Gladysh
- Re: Nil and false in Lua design, Coda Highland
- Re: Nil and false in Lua design, Luiz Henrique de Figueiredo
- Re: Nil and false in Lua design, Thomas Jericke
- Re: Nil and false in Lua design, steve donovan
- Re: Nil and false in Lua design, Dirk Laurie
- Re: Nil and false in Lua design, Carsten Fuchs
- Re: Nil and false in Lua design, Thomas Jericke
- Re: Nil and false in Lua design, steve donovan
- Re: Nil and false in Lua design, Carsten Fuchs