From: Logan Capaldo Date: 2005-05-12T08:16:21+09:00 Subject: Re: alternatives to ? : contruct On 5/11/05, John-Mason P. Shackelford wrote: > As an alternative to: > > a = y == z ? b : c > > we can say: > > a = (b if y == x) || c > > Can anyone think of others? > > I'd really like to be able to say: > > a = b if y==z otherwise c > > but the precedence of _or_ is not low enough for this to work. Would > changing the precedence of _or_ to be lower than expression modifiers > brake much? I believe _or_ is presently just above the expression > modifiers today. Then again perhaps that would be confusing. Perhaps > an _otherwise_ operator would do the trick. > > This is trivial really, but ruby specializes in niceties which many > might deem trivial but which all add up to an amazingly productive > environment. > > -- > John-Mason Shackelford > > Software Developer > Pearson Educational Measurement > > 2510 North Dodge St. > Iowa City, IA 52245 > ph. 319-354-9200x6214 > john-mason.shackelford@pearson.com > http://pearsonedmeasurement.com > > Heres one way: x == y and a = b or c