From: "David A. Black" Date: 2003-12-13T02:05:47+09:00 Subject: Re: types? casting and bools Hi -- On Sat, 13 Dec 2003, KONTRA Gergely wrote: > Hi! > > Recently I ran into the problem: > > Why ruby handle booleans so liberally? > I mean why can I pass anything to an if, and for constructs requiring > bool? I guess many programmers do it the wrong way saying "if 0" and > expecting to be true... It is true: if 0 puts "yes" end # => yes > And on the other hand I must use to_i and others to convert from one > type to another. You mean you want to have to put "to_bool" everywhere? :-) David -- David A. Black dblack@wobblini.net