Does .clone do deep or shallow copying of objects?

I'm going to argue for shallow.  I know there's a obvious tendency to
say that we should go with deep, because it's useful sometimes. 
However, I think that would be ignoring the amazing prevelance of the
shallow copy idioms in perl 5:

    [ @array ]
    { %hash }

We could consider .clone to be the natural extension of this (and have
the above forms be its definition for Array and Hash).


Reply via email to