From: "David A. Black" Date: 2009-09-16T05:03:13+09:00 Subject: Re: .map.with_object(3){|v|v+3} #=> 3 Is this a bug? Hi -- On Wed, 16 Sep 2009, 7stud -- wrote: > David A. Black wrote: >> Except.... >> >> >> [1,2,3].each.with_object("hi!").map{|v| v + 3 } >> => [4, 5, 6] >> >> The map is only binding one of the arguments, and the argument to >> with_object is being ignored. (The 3 is hard-coded in the block.) >> > > I think my examples show that pretty clearly: I thought you were saying at the end that the yielding of the 3 explained why you got [4,5,6]. David -- David A. Black, Director Ruby Power and Light, LLC (http://www.rubypal.com) Ruby/Rails training, consulting, mentoring, code review Book: The Well-Grounded Rubyist (http://www.manning.com/black2)