From: matt@... (matt neuburg) Date: 2006-10-18T04:15:17+09:00 Subject: ruby way to say this? In Ruby, zero isn't false and there is no equivalent of the ?: operator with the middle term omitted. So e.g. I'd like to say [pseudo-code from some other language]: oneThing()?:otherThing() meaning, if oneThing is nonzero, return oneThing, else return otherThing. Now, I don't want to evaluate oneThing twice, so I've ended up with this: (temp = oneThing()).nonzero? ? temp : otherThing() I don't like it. Is that culturally correct, or is there a ruby way to speak here, that I'm not thinking of? Thx - m. -- matt neuburg, phd = matt@tidbits.com, http://www.tidbits.com/matt/ Tiger - http://www.takecontrolbooks.com/tiger-customizing.html AppleScript - http://www.amazon.com/gp/product/0596102119 Read TidBITS! It's free and smart. http://www.tidbits.com