lua-users home
lua-l archive

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


On Wed, Jun 4, 2014 at 7:30 PM, Mike Nelson <mikestar1313@gmail.com> wrote:
> On 6/4/2014 6:01 PM, Luiz Henrique de Figueiredo wrote:
>>>
>>>         load(source,,,MY_ENV)
>>>         first,,third = something()
>>
>> The idiom in these cases would be
>>
>>         load(source,_,_,MY_ENV)
>>         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.

The first of Luiz's examples uses _ as an rvalue.

/s/ Adam