Newsgroups: comp.lang.lisp
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!news2.near.net!news.mathworks.com!news.alpha.net!uwm.edu!caen!msuinfo!uchinews!att-out!nntpa!nntpa.cb.att.com!lgm
From: lgm@polaris.ih.att.com (Lawrence G. Mayka)
Subject: Re: Copying CLOS instance?
In-Reply-To: kanderso@wheaton.bbn.com's message of 3 Nov 94 13:12:24
Message-ID: <LGM.94Nov9082012@polaris.ih.att.com>
Sender: news@nntpa.cb.att.com (Netnews Administration)
Nntp-Posting-Host: polaris.ih.att.com
Organization: AT&T Bell Laboratories, Naperville, Illinois, USA
References: <3998p8$es5@Times.Stanford.EDU> <KANDERSO.94Nov3131224@wheaton.bbn.com>
Date: Wed, 9 Nov 1994 14:20:11 GMT
Lines: 37

In article <KANDERSO.94Nov3131224@wheaton.bbn.com> kanderso@wheaton.bbn.com (Ken Anderson) writes:

   From: kanderso@wheaton.bbn.com (Ken Anderson)
   Newsgroups: comp.lang.lisp
   Date: 3 Nov 94 13:12:24
   Organization: BBN, Cambridge MA

   In article <3998p8$es5@Times.Stanford.EDU> geddis@CS.Stanford.EDU (Don Geddis) writes:

      If you have a defstruct class, and then an object that's an instance of it,
      you get for free a "copy-<class>" function to make a copy of the instance.
      I want to do the same thing with a CLOS instance, but sadly there appears to
      be no corresponding copy function.  I would guess that somehow using the

   The reason for this is that the semantics of what you mean by copying is
   application specific.  For example, do you want a deep or shallow copy of
   each slot?

I must say that I never bought this argument: "Because no single copy
function will do everything that everyone in the world wants, we'll
make it impossible for anyone to do the obvious simple thing (shallow
copy, just like structures and sequences) in any reasonably efficient
way."

I'm not attacking you in particular, of course.  I've simply heard
this line of argument many times before, and as I say, I don't agree
with it at all.  Its net result is that for many common purposes,
DEFSTRUCT often appears =more= useful and featureful than DEFCLASS.
Even this is not so shocking, except that people sometimes would like
to believe that DEFCLASS has made DEFSTRUCT obsolete.  It hasn't,
particularly in performance-critical legs of code.
--
        Lawrence G. Mayka
        AT&T Bell Laboratories
        lgm@ieain.att.com

Standard disclaimer.
