lua-users home
lua-l archive

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


Hi Chris

I would say that functions that return booleans might not fail...

Regards,
Tomás

Em ter, 8 de out de 2019 às 09:49, Chris Smith
<space.dandy@icloud.com> escreveu:
>
>
> > On 8 Oct 2019, at 13:15, Roberto Ierusalimschy <roberto@inf.puc-rio.br> wrote:
> >
> > 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.
>
>
> Really?  I use this to validate config entries: entry, err = get_value(‘my_bool’).  Entry is either true, false or nil if the user didn’t specify a value or gave an erroneous value.  Why is that a bad idea?
>
> Chris
> —
> Chris Smith <space.dandy@icloud.com>
>
>