#NEWLINE# @ moduledef . method ( 'clone' ) #NEWLINE# def method_clone( self , space ) : #NEWLINE# #INDENT# if ( ( self is space . w_nil ) or ( self is space . w_true ) or ( self is space . w_false ) or space . is_kind_of ( self , space . w_symbol ) or space . is_kind_of ( self , space . w_fixnum ) ) : #NEWLINE# #INDENT# raise space . error ( space . w_TypeError , ( "can't dup %s" % space . getclass ( self ) . name ) ) #NEWLINE# #UNINDENT# w_dup = space . send ( space . getnonsingletonclass ( self ) , 'allocate' ) #NEWLINE# w_dup . copy_instance_vars ( space , self ) #NEWLINE# w_dup . copy_singletonclass ( space , space . getsingletonclass ( self ) ) #NEWLINE# space . send ( w_dup , 'initialize_clone' , [ self ] ) #NEWLINE# space . infect ( w_dup , self , freeze = True ) #NEWLINE# return w_dup