lua-users home
lua-l archive

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

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

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_
|    | until you have read it in the original Klingon."
| ( | --- Sea Wasp on r.a.sf.w
+- --+

Attachment: signature.asc
Description: OpenPGP digital signature