lua-users home
lua-l archive

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


2015-01-14 2:06 GMT+02:00 Aapo Talvensaari <aapo.talvensaari@gmail.com>:
> One correction to docs:
>
> utf8.len docs say:
>
> "If it finds any invalid byte sequence, returns a false value plus the
> position of the first invalid byte."
>
> It actually seems to return nil (which is of course evaluated as false when
> not compared equality to false).

I.e. nil is "a false value" in just about every context, e.g. §3.4.5
"all logical operators consider both false and nil as false".

The manual also sometimes states "returns false", see e.g. `pcall`.
I'm willing to believe that the phrase "a false value" was in this case
chosen with hair-splitting exactness.