[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: about 'fail'
- From: Roberto Ierusalimschy <roberto@...>
- Date: Tue, 8 Oct 2019 09:15:38 -0300
> Currently, string.match returns a tuple of captures which may be strings
> and numbers.
> Theoretically, it was possible to add to Lua patterns a new kind of
> captures having boolean values.
> After switching to "fail == false" this possibility will be closed forever.
Theoretically, it was possible to add to Lua patterns a new kind of
captures having nil values, too. (LPeg has both.) This possibility is
already closed forever.
Any function where you have to distinguish between nil and false in the
return value seems a very bad idea. The standard library always avoided
that, and will continue to do so.
-- Roberto