lua-users home
lua-l archive

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

"Tom Miles" <> 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.

David Kastrup