lua-users home
lua-l archive

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


On Thu, Aug 13, 2009 at 1:00 PM, steve donovan<steve.j.donovan@gmail.com> wrote:
> Now, would this also apply to function argument lists, which is the
> other place where multiple returns are not discarded if at the end?

According to the BNF description of Lua, the arguments in a function
call are an expression list, so IMO it should apply here too (and my
patch does so).

E:\CPP\2K8\lua-5.1.4-proto>Debug\lua-5.1.4-proto.exe
Lua 5.1.4  Copyright (C) 1994-2008 Lua.org, PUC-Rio
> t = {4, 5, 6}
> print(unpack(t) ..., 7)
4       5       6       7
> print(unpack{4, unpack{5, 6} ..., 7} ..., 8)
4       5       6       7       8

Also note that attached is a revised patch.

Attachment: expvar.diff
Description: Binary data

Attachment: tuples.lua
Description: Binary data