lua-users home
lua-l archive

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

On 6/4/2014 6:01 PM, Luiz Henrique de Figueiredo wrote:
	first,,third = something()
The idiom in these cases would be

	first,_,third = something()

Perhaps it'd be helpful to have a second predeclared local named "_",
as a cheap throw-away variable...

Rather like Go, where _ is predeclared for the same purpose (would be surprised if they didn't get the idea from Lua). What does everyone think about also outlawing _ as an rvalue, as Go does? This would firmly establish _ as a throw-away variable, but is it worth the internal complexity to enforce it? Perhaps the middle way of predeclaring but not enforcing is best.