From: Jay Levitt Date: 2007-09-02T20:40:08+09:00 Subject: Re: idiomatic way to assign if not nil? On Thu, 30 Aug 2007 23:40:39 -0700, aalfred wrote: > I had those two cases: > > foo = bar if !bar.nil? # (case 1) or > foo = bar if foo.nil? && !bar.nil? # (case 2) > > and rewrote them into: > > foo ??= bar # case 1 > foo !!= bar # case 2 Neat - you did that with superators? Or some other way? Jay