From: Martin DeMello Date: 2003-05-22T04:18:51+09:00 Subject: Re: Copying an Array Mauricio Fern?ndez wrote: > batsman@tux-chan:~/src/ctl$ ruby > module Enumerable > def deep_copy > map {|x| x.respond_to?( :deep_copy ) ? x.deep_copy : x} > end > end > > a = [] > b = [a] > a << b > p a.deep_copy > ^D > > ==> hangs Even more simply, { a = %w(hello world); b = a.deep_copy } hangs, since String.each yields Strings. martin