[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Shorthand for appending to a table (was Re: 5.2 feature list?)
- From: David Given <dg@...>
- Date: Tue, 12 Sep 2006 11:06:06 +0100
Sam Roberts wrote:
> On Mon, Sep 11, 2006 at 11:24:02PM +0100, David Given wrote:
>> (It is for this reason that I particularly dislike the way that the last
>> parameter in table initialisers and function calls is handled specially. I can
>> see why it has to do that, from an implementation point of view, but that
>> doesn't mean I like it.)
>
> I didn't know that, how is the last one special?
Compare the following:
function returnsmultiple()
return 1, 2, 3, 4
end
print(returnsmultiple(), 99)
print(99, returnsmultiple())
For all parameters *except the last one*, all items in the tuple except
the first one are discarded.
--
+- David Given --McQ-+ "You cannot truly appreciate _Atlas Shrugged_
| dg@cowlark.com | until you have read it in the original Klingon."
| (dg@tao-group.com) | --- Sea Wasp on r.a.sf.w
+- www.cowlark.com --+
Attachment:
signature.asc
Description: OpenPGP digital signature