[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: lua_isstring et al and booleans in 5.0w0
- From: Roberto Ierusalimschy <roberto@...>
- Date: Mon, 15 Jul 2002 11:46:40 -0300
> To me it seems natural that I should be able to get a Boolean value as a
> string, but perhaps that's not the intention?
The problem with this conversion is that it is not reversible. Assuming
the obvious conversion, we have that false(b) -> "false(s)", but
"false(s)" -> true(b) (any string is non-false). So, we prefer not to
perform it implicitly.
(Actually, the conversion between numbers and strings is not completely
reversible, too: "0003" -> 3 -> "3". But most of the time it works as
we expect.)
-- Roberto