From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,LOTS_OF_MONEY autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f4fd2,23202754c9ce78dd X-Google-Attributes: gidf4fd2,public X-Google-Thread: 103376,15edb893ef79e231 X-Google-Attributes: gid103376,public X-Google-Thread: 114809,15edb893ef79e231 X-Google-Attributes: gid114809,public X-Google-Thread: fac41,15edb893ef79e231 X-Google-Attributes: gidfac41,public X-Google-ArrivalTime: 2002-01-26 09:57:35 PST Newsgroups: comp.lang.lisp,comp.lang.ada,comp.lang.eiffel,comp.lang.smalltalk Path: archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!torn!utnut!news.ecf!doylep From: doylep@eecg.toronto.edu (Patrick Doyle) Subject: Re: Copying semantics molehill (was Re: True faiths) Sender: news@ecf.utoronto.ca (news) Organization: Computer Group, Elec. Eng., University of Toronto Message-ID: References: X-Nntp-Posting-Host: wildcat.eecg Date: Sat, 26 Jan 2002 17:37:51 GMT Xref: archiver1.google.com comp.lang.lisp:25320 comp.lang.ada:19316 comp.lang.eiffel:5523 comp.lang.smalltalk:18721 Date: 2002-01-26T17:37:51+00:00 List-Id: In article , Kaz Kylheku wrote: > >Here is a recent example: a protocol stack where I have three ways >to copy a network buffer buffer object. I can copy a pointer, and >increment a reference count. I can copy the header structure which >maintains various pointers into the buffer, and bump up a lower reference >count on the buffer. Or I can do a deep copy which copies the buffer >as well. > >This data is not immutable, so the copying semantics are not moot. Ok, so when you copy a container object--like lists, arrays, etc.--you need to know whether to copy its contents too. Is this the same issue? >If a symbol is embedded in an object, and you want to copy that object, >you probably want to copy those embeddded symbols by reference. And then >you are no longer making an entirely new object from scratch; the common >symbols are shared substructure. I have a hard time picturing how this is implemented. Does one just contain a reference to part of the other? -- -- Patrick Doyle doylep@eecg.toronto.edu