--- initialize_copy(obj)

    ruby 1.8 feature

    (ĥ饤֥ˤ)桼饹Υ֥ȥԡ(clone,
    dup)ν᥽åɡ

    Υ᥽åɤ self  obj Ƥ֤ޤ
    self Υ󥹥ѿðۥ᥽åɤѲޤ

    쥷Ф freeze Ƥ뤫obj Υ饹쥷
    Υ饹Ȱۤʤ㳰 TypeError ȯޤ

    ǥեȤǤ(Object#initialize_copy )嵭 freeze å
    ӷΥåԤ self ֤Υ᥽åɤǤ

    obj.dup ϡ֥ȤФ 
    initialize_copy Ƥ

        obj2 = obj.class.allocate
        obj2.initialize_copy(obj)

    obj2 ФƤ obj α֡󥹥ѿեʥ饤
    򥳥ԡ뤳Ȥʣޤclone ϡ
    ðۥ᥽åɤΥԡԤޤ

        obj = Object.new
        class <<obj
          attr_accessor :foo
          def bar
            :bar
          end
        end

        def check(obj)
          puts "instance variables: #{obj.inspect}"
          puts "tainted?: #{obj.tainted?}"
          print "singleton methods: "
          begin
            p obj.bar
          rescue NameError
            p $!
          end
        end

        obj.foo = 1
        obj.taint

        check Object.new.send(:initialize_copy, obj)
                # => instance variables: #<Object:0x4019c9d4>
                #    tainted?: false
                #    singleton methods: #<NoMethodError: ...>
        check obj.dup
                # => instance variables: #<Object:0x4019c9c0 @foo=1>
                #    tainted?: true
                #    singleton methods: #<NoMethodError: ...>
        check obj.clone
                # => instance variables: #<Object:0x4019c880 @foo=1>
                #    tainted?: true
                #    singleton methods: :bar

    initialize_copy ϡRuby 󥿥ץ󥿤Τʤ򥳥ԡ뤿
    ˻()ޤ㤨 C ǥ饹硢
    򥤥󥹥ѿݻʤ礬ޤä
     initialize_copy ǥԡ褦ƤȤǡdup  clone 
    ɬפʤʤޤ

    initialize_copy Ȥ̾Υ᥽åɤϼưŪ private 
    ꤵޤ

