From: Chris Gehlker Date: 2002-03-30T00:48:07+09:00 Subject: Re: Now that's surprising. On 3/29/02 7:41 AM, "Yukihiro Matsumoto" wrote: > Why did you think it should not be required? 1) Years of living with the distinction in C between a statement and an expression. 2) Not reading Chapter 7 of the PickAxe book carefully enough. (And Dave didn't say "Gotcha") 3) Working with Ruby for almost a month now before this particular pattern bit me in real code. 4) I'm still fairly new to Ruby so my thought process was something like: "The unless condition is false so the statement never happened." But I think the first one is the biggie. I still use ObjC a lot and this is is one area where Ruby is different. > I don't think there's consensus about the value of unless statement. I'm of two minds myself. My first thought was: "What's up with unless returning nil. Unless should return true or false, period." But then I considered this: def truthTest result = true a = false unless result a end p truthTest And in this context, nil seems exactly right. How surprising would it be if a were either true or false? So I don't know what I want. -- We are all born originals - why is it so many of us die copies? -Edward Young, poet (1683-1765)