From: greg Date: 2007-04-16T00:32:55+09:00 Subject: Re: Idiom wanted (now hiring!) assuming a is already defined class Object; def yield; yield(self) end end func(b).yield{|fb| a = fb if fb} On Apr 13, 1:02 am, 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) > > -- > Posted viahttp://www.ruby-forum.com/.