2010/6/14 Roger Pack <rogerpack2005 / gmail.com>:
> I read this once:
>
> Operator ||=3D can be shorthand for code like:
> =A0x =3D "(some fallback value)" unless respond_to? :x or x
>
> How would that look like exactly, in shorthand, any guesses?

You can do this:

x ||=3D (x() rescue "(some fallback value)")

I did not think about this long enough to look at all the effects with
local variables shadowing methods but it's something you can play
with. :-)

Kind regards

robert

--=20
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/