From: ara.t.howard@... Date: 2006-11-17T05:38:41+09:00 Subject: Re: #returning and #tap On Fri, 17 Nov 2006, Eric Hodel wrote: >> Otherwise you have to do this: > > I would write it: > > def foo > return @foo if @foo > @foo = Foo.new > @foo.bar = 'bar' > @foo > end > > $ wc > ... > 6 14 77 > > Ten characters and one line more typing, but less punctuation. (And those > ten extra characters will be mostly be handled by my tab key.) and quite easy to golf if line count matters that much def foo @foo ||= Foo.new.instance_eval{ self.bar = 'bar'; self } end -a -- my religion is very simple. my religion is kindness. -- the dalai lama