From: dblack@... Date: 2006-11-17T07:08:16+09:00 Subject: Re: #returning and #tap Hi -- On Fri, 17 Nov 2006, Joel VanderWerf wrote: > Coming full circle around the golf course... This last one above is what lead > me to prefer #then (== #tap) in the first place: > > def foo > @foo ||= Foo.new.then do |f| > f.bar = "bar" > end > end > > Also, #then avoids the scoping nastiness of #instance_eval. I'm not getting the semantics of "then". Do you mean "then" as in, "I took off my coat and then sat down", as opposed to then in if/then? David -- David A. Black | dblack@rubypal.com Author of "Ruby for Rails" [1] | Ruby/Rails training & consultancy [3] DABlog (DAB's Weblog) [2] | Co-director, Ruby Central, Inc. [4] [1] http://www.manning.com/black | [3] http://www.rubypowerandlight.com [2] http://dablog.rubypal.com | [4] http://www.rubycentral.org