lua-users home
lua-l archive

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


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.)