[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Feature Suggestion: Make rawset() coerce "nothing" as its 3rd argument to nil, don't error
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Wed, 18 Jul 2012 22:31:37 -0300
>> Do you really want to write tostring() without arguments? What for?
> It is more as a failsafe for this kind of scenario:
>
> table.concat{stuff, tostring(foo()), ... }
>
> where foo is dynamic and may return nothing.
In this case, if you know you have to protect yourself, use
table.concat{stuff, tostring((foo())), ... }
Note the extra pair of parentheses around foo().
- References:
- Feature Suggestion: Make rawset() coerce "nothing" as its 3rd argument to nil, don't error, Sir Pogsalot
- Re: Feature Suggestion: Make rawset() coerce "nothing" as its 3rd argument to nil, don't error, Luiz Henrique de Figueiredo
- Re: Feature Suggestion: Make rawset() coerce "nothing" as its 3rd argument to nil, don't error, Pierre-Yves Gérardy
- Re: Feature Suggestion: Make rawset() coerce "nothing" as its 3rd argument to nil, don't error, Luiz Henrique de Figueiredo
- Re: Feature Suggestion: Make rawset() coerce "nothing" as its 3rd argument to nil, don't error, Pierre-Yves Gérardy