On 7/18/07, Ken Bloom <kbloom / gmail.com> wrote:

>
> I happen to program in both Groovy and Ruby, and while I prefer Ruby's
> paradigms to Groovy's (they're actually geared to make quite different
> things convenient), I noticed Groovy's ?. operator and asked myself "Why
> doesn't Ruby have this?" The ?. operator in Groovy calls the method if
> the expression on the left side is non-null, and returns its value. It
> returns null of the object on the left side is null, and never calls the
> method. It might be a nice feature to adopt.
>
> Probably the best way to do this in Ruby is
> "blah = foo.bar rescue nil", although this has the potential to soak up a
> lot of other kinds of errors that you may actually want to propagate.

Would be interesting discussing this. I shall have a look at some of
my code how that would change, looks ugly at first, but that normally
changes when getting the habit.
Robert
-- 
I always knew that one day Smalltalk would replace Java.
I just didn't know it would be called Ruby
-- Kent Beck