lua-users home
lua-l archive

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


On 24 November 2010 08:55, Alex Bradbury <asb@asbradbury.org> wrote:
> On balance, I think this is my favourite proposal so far.  Perhaps my
> only niggle is I'm used to parentheses around an expression resulting
> in that expression returning only one value, though I assume \ x,y
> (x*x, y*y) will return two.

Just to clarify this comment, I do realise (x*x, y*y) isn't an
expression. This is really a bug in my own mental model rather than a
problem with the syntax I think. print(id(x, y)) will print x and y
just as \ x,y (id(x,y)) will return x and y despite the fact both
function calls happen to be in parentheses. a, b = (id(x,y)) of course
results in only one value, so a gets x and b gets nil. I think it's
just something to get used to.

Alex