At 01:27 PM 8/7/00 -0400, Uri Guttman wrote:
> >>>>> "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.

Well, if we provide a primitive for this (a big if) I expect it can be 
piggy-backed onto the GC code somehow, which needs to do the same sorts of 
things.

>as for tied objects and databases, a hornets' nest awaits.

No doubt. This is where the interesting work resides, which is why I'm all 
up for passing the buck to the mythical CLONE sub. :0

                                        Dan

--------------------------------------"it's like this"-------------------
Dan Sugalski                          even samurai
[EMAIL PROTECTED]                         have teddy bears and even
                                      teddy bears get drunk

Reply via email to