lua-users home
lua-l archive

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


> Here is some info about wrapping Lua functions.  It seems to validate the
> general usefulness of the expand function I outlined in a previous post
> "vararg asymmetry".  No chance of having that added to baselib?

It is already added (for next version, 4.1). The current name is "unpack",
but we may change it ("expand" is a good sugestion).

About the "compress" function, we intend to change a little the semantics 
of the language, so that {..., f(x)} will put all returns of the last call 
into the list. This will create a small incompatibility, but it is much 
more coherent with the current semantics for function calls and returns. 
Now, every place that accepts a list of expressions will also accept a list 
of return values from the last expression. (And "compress(f(x))" will be 
simply "{f(x)}".) 

We are also thinking about the proposal (by ET, I guess) of using "(exp)"
as a way to force "exp" to have exactly one value, so that {(f(x))} will
always create a list with exactly one element.

-- Roberto