From: 7stud -- Date: 2009-09-16T04:58:33+09:00 Subject: Re: .map.with_object(3){|v|v+3} #=> 3 Is this a bug? 7stud -- wrote: > The next call in the method chain is with_object(): > >> [1,2,3].map.with_object(3){|v|v+3} > > and ***regardless of the iterator that with_object is attached to***, > when > with_object() is called with a block, with_object returns its argument, > which in this case is 3. That isn't accurate, though. In this case with_object isn't attached to an iterator--it's attached to an enumerator. So I guess I should have simply said, When with_object is called with a block, with_object returns its argument. and avoided the issue of how ruby allows you to chain enumerators to both iterators and other enumerators. -- Posted via http://www.ruby-forum.com/.