[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: Pierre-Yves Gérardy <pygy79@...>
- Date: Fri, 20 Jul 2012 10:38:23 +0200
On Fri, Jul 20, 2012 at 8:09 AM, steve donovan
<steve.j.donovan@gmail.com> wrote:
> Oh and they can be nasty - think about io.lines - if there was no
> distinction between io.lines() and io.lines(nil) then a script could
> easily jam due to a silly error. It's better to fail with a big fuss
> than just hang!
Actually, that's an example of arity-based polymorphism, where the
behavior of the function depends on the number of arguments.
What I plead for is to accept a lack of value where a nil would be
legal, not the other way around (but that was probably not clear from
my previous post).
-- Pierre-Yves
- 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
- 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, steve donovan