From: David Vallner Date: 2006-02-09T09:33:50+09:00 Subject: Re: boolean annoyance Dňa Streda 08 Február 2006 23:54 Claudio Jeker napísal: > Have you ever looked at boolean algebra. The use of 0 as false is just > standard usage in boolean expressions. > Recalling the earlier "Why Ruby isn't " thread, someone noted that what the 0 symbol represents in boolean algebra has absolutely nothing to do with what the 0 symbol represents in arithmetics. Just like a capital letter O isn't a numerical 0, an arithmetical 0 isn't the same as a boolean 0. A boolean false value is in Ruby represented by the keyword "false", an arithmetical zero by the literal "0" - that's all there's to it. C's lack of distinction between these can arguably be considered as a fault of C while we're nitpicking, as well as Ruby's rather broad range of values that are true in a boolean context. Neither is, IMO, more "right" than the other, it depends on how often you find one practical in your code, and both are a lot more often practical than Java's strictness on the issue. David Vallner