From: <dblack / candle.superlink.net>


> [batsman:]
> > What's wrong about '? :' ?
> >
> > irb(main):001:0> b = nil
> > nil
> > irb(main):002:0> (__f=b)?__f.meth : nil
>
> Or:
>
>   b.meth if b
>
> (if I'm understanding this part of the discussion correctly...)

Your code is equivalent to batsman's, but the OP wanted a default value thrown
in, so:

  b and b.meth or default_value

The original and the best!

> David

Gavin