On Sat, Jan 26, 2002 at 10:42:17AM +0000, David Chan wrote:
> Which Parrot strings are supposed to be false in a boolean context?
Thinking more deeply about this, I guess it depends entirely on the
language, although we can provide string_bool as a sensible default.
> For instance, is "\x{FF10}" (FULLWIDTH DIGIT ZERO) false?
Yes.
> > unicode_is_digit(UINTVAL c) {
> > return (BOOLVAL)(isdigit(c) ? 1 : 0); /* FIXME - Other code points are also digits */
> > }
> >
> > static INTVAL
> > unicode_get_digit(UINTVAL c) {
> > return c - '0'; /* FIXME - many more digits than this... */
> > }
Yep, once these functions are fixed to really grok Unicode numeric value and
digit value properties, string_bool will just work.
--
Thermodynamics in a nutshell:
1st Law: You can't win. (Energy is conserved)
2nd Law: You can't break even. (Entropy)
0th Law: You can't even quit the game. (Closed systems) -- Taki Kogoma
Thread Previous
|
Thread Next