From: Austin Ziegler Date: 2004-10-31T01:34:38+09:00 Subject: Re: Another scrach on head On Sat, 30 Oct 2004 14:47:34 +0900, Pe�a, Botp wrote: > //I still don't see a reason for #true? and #false?. > it's a language problem. ruby caters english and sometimes the > language does not fall immediately into ones (non-english) ears... > Thus the op was asking if he could be more explicit+... > consider: > > a = (1 > 0) > if a > block > end > At a first glance (assumming sans k on progg lang), one has to > know semantics of if. And here, one realizes that block executes > if a is true. Mmm. I don't think changing that to if a.true? will help readability in the least, because a.true? only applies if it is literally the value +true+ (e.g., the instance of TrueClass). The same for a.false?. As far as "if a.false?" vs "if not a", this is why Ruby has "unless", e.g., "unless a". > so "if a" is asking like "is a an object" ?? No, "if a" asks "is 'a' a non-nil-or-false value". "unless a" asks "is 'a' a nil-or-false value". -austin -- Austin Ziegler * halostatue@gmail.com * Alternate: austin@halostatue.ca : as of this email, I have [ 5 ] Gmail invitations