[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: RE: Odd behaviour with multiple return values and varargs
- From: "Tom Miles" <Tom@...>
- Date: Wed, 12 Sep 2007 16:47:37 +0100
Is there a good reason for that? I assume there is, but I'ld like to
know, as it seems a bit counter-intuitive.
[mailto:firstname.lastname@example.org] On Behalf Of David Kastrup
Sent: 12 September 2007 16:36
Subject: Re: Odd behaviour with multiple return values and varargs
"Tom Miles" <Tom@creative-assembly.co.uk> writes:
> Okay, so I'm obviously missing something with this. Can anyone
> explain the behaviour from this:
> function test1()
> return 1, 2
> function test2()
> return 3,4
> print(test1(), test2())
>> 1 3 4
> I would have expected it to output 1 2 3 4. Why doesn't it?
Only the last function in a comma list has multiple return values
This email is sent by The Creative Assembly Limited company No. 03425917, registered in England &Wales registered office 27 Great West Road, Middlesex, TW8 9BW, England. The contents of this e-mail and any attachments are confidential to the intended recipient and may also be legally privileged. Unless you are the named addressee (or authorised to receive for the addressee) of this email you may not copy, disclose or distribute it to anyone else. If you have received this email in error, please notify us immediately by e-mail on email@example.com and then delete the email and any copies. The Creative Assembly Limited have made all reasonable efforts to ensure that this e-mail and any attached documents or software are free from software viruses, but it is the recipient's responsibility to confirm this.