Hi,
In message "[ruby-talk:00596] Re: Bug in Array#clone!"
on 99/08/10, Yukihiro Matsumoto <matz / netlab.co.jp> writes:
>`clone' returns the complete copy (except object id) of the original
>object, but dup is not necessarily that complete. dup for Array,
>Hash, and String does only copy their contents; no singleton method,
>instance variable, nor freeze flag are copied.
Thanks you very much. I have to read the document more and more :-(
>I should explain this more in detail; I changed the documents like:
>
> dup
> Returns a newly created array which has the same
> elements to the receiver. clone returns the complete
> copy of the original array including freeze status and
> instance variables. On the other hand, dup copies the
> array contents only.
>
>Or should I copy the instance variables for these classes, and leave
>documents unchanged?
The latter looks better. It may be easy to see that the defference
between clone and dup is frozen-property only.
>|Thanks for your quick job. I've gotten "ok" for almost all but `IO':
>
>Oh, I forgot to make a patch for io.c:
Thanks! Maybe, I've understood *SETUP macros at last :-)
-- gotoken