From: Robert Dober Date: 2007-04-13T20:07:07+09:00 Subject: Re: Idiom wanted (now hiring!) On 4/13/07, Robert Klemme wrote: > On 13.04.2007 08:02, Jonathan wrote: > > Is there a cool way to do this without calling the function twice?: > > > > a = func(b) unless func(b).nil? (AKA) > > a = func(b) if func(b) > > Just to throw something obvious (which has not been mentioned so far) > into the mix: > > x = func(b) > a = x if x x = func b a ||=x How many combinations might we come up with ;)? > > :-) > > robert > > Robert -- You see things; and you say Why? But I dream things that never were; and I say Why not? -- George Bernard Shaw