From: Alex Fenton Date: 2005-09-15T00:46:33+09:00 Subject: Re: Ternary operator request That's a cute idea. I do find myself writing code like something.zero? ? x : y But presently there's nothing "special" about method names that end in "?" - it's only conventional that they return a boolean, and they don't necessarily have no arguments. In your example some_method? a : b how does ruby and the reader distinguish whether 'a' is 1) the first option for the ternary operator's return value or 2) the first argument to some_method? As an example, this syntax doesn't look quite so appealing... an_array.include? val x : y alex Robert Mannl wrote: > Hi! > > I'm more or less an amateur programmer, but I have fallen in love with > Ruby. > > I have an improvement idea for Ruby - I don't know if this is the best > place to post this, but I thought it might spark some discussion about > whether adding this "feature" would be healthy for the language or not. > > Let's suppose we have a method called: "some_method?". Why not allow > writing ternary operator expressions like this: > > some_method? a : b > > instead of > > some_method? ? a : b > > > > > It feels way more natural, > > > > Rob > >