Mauricio Fern?ndez <batsman.geo / yahoo.com> 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