From: Jeff Dalton
Subject: Re: Magic structure ops in Lucid 4.1?
Date: 
Message-ID: <8760@skye.ed.ac.uk>
In article <············@early-bird.think.com> ······@think.com (Barry Margolin) writes:
>In article <····@skye.ed.ac.uk> ····@aiai.ed.ac.uk (Jeff Dalton) writes:
>>2. Is there a good way to do a "deep copy" of a structure, that
>>is a copy of the struct and of all the slot values to all levels?
>>Actually, I'd like to control how the slot values get copied.

>In fact, I don't think there are any functions that do deep copying of most
>other data types, either.  The "deepest" copy function is COPY-TREE, and it
>only recurses through conses.  A common feeling is that recursion through
>data types is very application-dependent, so built-in functions that do
>this are not really very useful (many of us feel that EQUALP was a mistake,
>and some have even suggested getting rid of EQUAL).

I would agree that deep-copy is usually application-dependent.
Indeed, I really want to control whether copying occurs.  But
I've run into the usual problem that there's no portable way to
get at the slots of a struct.  Sure, I know this is really too
concrete.  In the "logical" view of the struct, some "slots"
may not be implemented as slots.  But it's still a major pain
that I can't get at slot values without knowing the accessors.
Most Common Lisps have some way to do it, just not the same way.
Oh well.

-- jd