[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Odd behaviour with multiple return values and varargs
- From: David Kastrup <dak@...>
- Date: Thu, 13 Sep 2007 11:12:24 +0200
"Tom Miles" <Tom@creative-assembly.co.uk> writes:
> I'm not sure I understand your point. In my mind, if I have two
> functions returning 2 values, then I have 4 values plain and simple. It
> would be treated exactly the same as print(1,2,3,4). Is there a reason
> not to do it that way?
> As I said before, there is obviously a good reason for the way it is,
> greater minds than mine have formulated the language, but I don't think
> you have provided me with a convincing argument. Thanks for the
> feedback though.
If I write
a,i = f(a),i+1
then I want i to get the value i+1 regardless whether f(a) feels like
returning two values or not. And the same reliable 1:1 relationship
should hold when I use comma-separated argument lists.
Mapping a tail to a tail is still very much predictable. But a
clearly expressed 1:1 relationship between explicit function arguments
and/or list elements should not be messed with.