>>>>> "DS" == Dan Sugalski <[EMAIL PROTECTED]> writes:
DS> At 10:07 AM 8/7/00 -0700, Peter Scott wrote:
>> At 12:53 PM 8/7/00 -0400, Dan Sugalski wrote:
>>> There are a wide range of tricky problems associated with deep copy and
>>> deep compare. I like the idea, but circular references can make this
>>> problematic even without external things (filehandles, dirhandles,
>>> objects from non-perl sources) are thrown in. That needs to be taken into
>>> account when putting together the RFC for it, if someone even does.
>>
>> I don't want it to go undocumented; I can write an RFC since I started the
>> thread, or Damian can write it since he brought up clone() before that. I
>> defer to Damian.
>>
>> I don't think it's impossible to do something useful, if we think
>> sufficiently Perlish.
DS> That's fine. I'm not against it (I like it), I just want to know
DS> what needs to be done under the hood, and we need to document the
DS> pitfalls to folks that'll use it.
the biggest pitfalls are circular structures. i see two opposing ideas
here.
the first is to allow deep copying but caveat coder. if you are
doing circles, override with your own clone method. i know some here do
circles a great deal and have to deal with it in DESTROY and other messy
place. but the majority of perl data structures are plain trees which
can be cloned easily. i also know that lisp tends to more circular stuff
(since they HAVE to :) so they never did a generic deep copy.
second, is we do a deep copy like someone mentions with Storable like
semantics. it handles circles already. but again caveat coder as it can be
a dangerous call to make.
as for tied objects and databases, a hornets' nest awaits.
uri
--
Uri Guttman --------- [EMAIL PROTECTED] ---------- http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page ----------- http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net ---------- http://www.northernlight.com