Lisp, which you might expect would have a 'deep copy' operator,
doesn't have one.  The Lisp folks have apparently thought about this
very carefully, and decided that the semantics are unclear, and that
the obvious options are all wrong; I've read a number of articles
about this in the past.  

I don't remember all the details, unfortunately.  But I think it's
worth paying attention to prior art where there is some.  This article

        http://world.std.com/~pitman/PS/EQUAL.html

discusses this in some detail.  I haven't thought about this in the
context of Perl yet, so I'm not sure if all the reasons apply.   Also
if you do a Deja search in comp.lang.lisp for the phrase "deep copy",
you'll find an extensive discussion of why it doesn't make sense, at
least in Lisp.

I'll also note the the same problems comes up when comparing for
equality; if you want a deep copy operator, you should also want a
deep compare oprator.  But Lisp has not one but *five* equality
comparison operators, and part of the proliferation is for the reason
that the 'deepness' of the desired comparison varies from application
to application.  Perl has two equality comparison operators and people
aready complain that that is too many.

Mark-Jason Dominus                                               [EMAIL PROTECTED]
I am boycotting Amazon. See http://www.plover.com/~mjd/amazon.html for details.

Reply via email to