[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Why take out remaining arguments when not last (was: A very basic thing I don't get)
- From: Cuero Bugot <cbugot@...>
- Date: Mon, 3 Oct 2011 02:43:18 -0700
Thanks guys for raising this very flammable subject that is table as list and holes, etc...
Once again few where able to divert the subject :).
I love Lua table approach and it's well defined # operator (that was for the troll part).
That said I was very interested in the first question: why the returned values of called function are trimmed to one value, unless it is the last one. I mean: I would like to understand the rational behind it.
If the answer is 'limit weird behavior' then it appears that it might seem that this trimming is also considered weird by some.
I would think that trimming is actually redundant with the () operator that does the job as well.
Would not it be plainer to actually not trim the extra returned values unless asked for it with the () operator ?
So:
(1) t = { getvalues(), "some", "other", "values"}
would be different from
(2) t = { (getvalues()), "some", "other", "values"}
(1) would not trim returned values of getvalues() function, (2) would do it as specified by the embracing ().
Note: changing that would be a major incompatibility and would certainly break a lot of existing code. Not sure is this is easily catchable before hand...
Cuero
- References:
- A very basic thing I don't get, Thijs Koerselman
- Re: A very basic thing I don't get, Peter Cawley
- Re: A very basic thing I don't get, Stefan Reich
- Re: A very basic thing I don't get, Michal Kottman
- Re: A very basic thing I don't get, Stefan Reich
- Re: A very basic thing I don't get, Philippe Lhoste
- Re: A very basic thing I don't get, steve donovan
- Re: A very basic thing I don't get, Roberto Ierusalimschy
- Re: A very basic thing I don't get, Pascal J. Bourguignon
- Re: A very basic thing I don't get, Dirk Laurie
- Re: A very basic thing I don't get, Axel Kittenberger
- Re: A very basic thing I don't get, Pierpaolo Bernardi