[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: __index returns truncated to one, why?
- From: steve donovan <steve.j.donovan@...>
- Date: Fri, 11 Apr 2014 09:07:46 +0200
On Fri, Apr 11, 2014 at 8:52 AM, Thomas Jericke <tjericke@indel.ch> wrote:
> It doesn't matter if this code make sense or not, all that matters to me is
> that this code is valid. Your suggestion breaks backward compatibility.
> Which is not a no-go per se but I would need good arguments to convince me
> to make such a change.
For such a small convenience, I have to agree. In big code bases, you
don't want surprises! Multiple return is a fantastic feature but
needs to be used carefully; we all know about string.gsub by now, and
the error return pattern is well known. If I see 'local a,b = f()'
then I know there's probably a multiple return going on. But t[k] must
obey the same contract as rawget(t,'k') (even if the semantics are
different.)
- References:
- __index returns truncated to one, why?, duz
- Re: __index returns truncated to one, why?, Dirk Laurie
- Re: __index returns truncated to one, why?, Andrew Starks
- Re: __index returns truncated to one, why?, steve donovan
- Re: __index returns truncated to one, why?, Dirk Zoller
- Re: __index returns truncated to one, why?, steve donovan
- Re: __index returns truncated to one, why?, Duncan Cross
- Re: __index returns truncated to one, why?, Sean Conner
- Re: __index returns truncated to one, why?, Thiago L.
- Re: __index returns truncated to one, why?, Sean Conner
- Re: __index returns truncated to one, why?, Thiago L.
- Re: __index returns truncated to one, why?, duz
- Re: __index returns truncated to one, why?, Thomas Jericke
- Re: __index returns truncated to one, why?, duz
- Re: __index returns truncated to one, why?, Thomas Jericke
- Re: __index returns truncated to one, why?, duz
- Re: __index returns truncated to one, why?, Thomas Jericke