From: Tom Rauchenwald Date: 2006-06-27T22:41:03+09:00 Subject: Re: newbie doesn't understand why's example dave rose writes: > in why's poignant guide to ruby... > class ArrayMine < Array > # Build a string from this array, formatting each entry > # then joining them together. > def join( sep = $,, format = "%s" ) > collect do |item| > sprintf( format, item ) > end.join( sep )<<< end > end > why doesn't this loop recursively forever? what's happening here at the > big confusing stmt???? please explain....tia collect returns an Array, as has been said. Maybe it is clearer if you use a Variable: foo= collect do |item| sprintf( format, item ) end foo.join(sep)