rubinius/rubinius — pull request #1910 by carlosgaldino (2012-09-16 20:51:18+00:00)
Title: Add initialize_dup and initialize_clone

This pull request isn't complete yet.

I opened because I need some feedback on how to change `Kernel#dup` and `Kernel#clone` since each method needs to call `#initialize_dup` and `#initialize_clone`, respectively.

`Kernel#dup` and `#clone` are defined in `kernel/alpha.rb` and the call to `#initialize_dup` should only occur on 1.9 mode. My question is, how should I proceed?

Copy the code for `#clone` and `#dup` to `kernel/common/kernel19.rb` and then change it so it will call the appropriate methods? Or is there a better solution?

The same question is valid for other classes that need to add specific behavior to `#dup` and `#clone`. Most of them are defined on `kernel/bootstrap` but on `kernel/bootstrap` I see that there are files specific to 1.9 mode so the fix should be split the method definition on both `imaginary_class18.rb` and `imaginary_class19.rb` and add the correct behavior on each file. Is that right?

Thanks.

P.S.: This will fix #1889.