dave rose <bitdoger2 / yahoo.com> 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 )<<<<big confusing stmt
>   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)