From: Robert Dober Date: 2006-04-21T04:32:34+09:00 Subject: Re: Zero is true, but it isn't ------=_Part_27054_21540139.1145561550671 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On 4/20/06, Logan Capaldo wrote: > > > > > Wouldn't it be neat if true =3D=3D=3D worked with anything that is > interpreted as true You saved my day, I was really disappointed when I found that this code wa= s missing from ruby def TrueClass.=3D=3D=3D(other);other?true:false;end def FalseClass.=3D=3D=3D(other);! true =3D=3D=3D other; end ### That 1 is u= gly def NilClass.=3D=3D=3D(other);! true =3D=3D=3D other; end shall we make a CR or for Ruby2? e.g. > > case x > when true > ... > else > ... > end > > Of course anyone would use an if statement in this situation, but it > is kind of conceptually clean and sort of matches up with Range#=3D=3D=3D= , > Regexp#=3D=3D=3D, etc. Completely agree and if anyone uses an if statement why should we!!!!! But I guess it is up to everyone to "fix" ruby for his own needs. Cheers Robert -- Deux choses sont infinies : l'univers et la b=EAtise humaine ; en ce qui concerne l'univers, je n'en ai pas acquis la certitude absolue. - Albert Einstein ------=_Part_27054_21540139.1145561550671--