unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* deep copy of an alist
@ 2002-09-20  9:32 Klaus Berndl
  2002-09-20  9:55 ` Edward O'Connor
  0 siblings, 1 reply; 3+ messages in thread
From: Klaus Berndl @ 2002-09-20  9:32 UTC (permalink / raw)



Is there a function which makes a deep copy of an alist. AFAIK *copy-alist*
makes no copies of the elements of the alist, i.e. the cars and cdrs of an
element are shared...

Thanks,
Klaus

-- 
Klaus Berndl			mailto: klaus.berndl@sdm.de
sd&m AG				http://www.sdm.de
software design & management	
Thomas-Dehler-Str. 27, 81737 München, Germany
Tel +49 89 63812-392, Fax -220

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: deep copy of an alist
  2002-09-20  9:32 deep copy of an alist Klaus Berndl
@ 2002-09-20  9:55 ` Edward O'Connor
  2002-09-20 10:08   ` Klaus Berndl
  0 siblings, 1 reply; 3+ messages in thread
From: Edward O'Connor @ 2002-09-20  9:55 UTC (permalink / raw)


>>>>> "Klaus" == Klaus Berndl <Klaus.Berndl@sdm.de> writes:

 Klaus> Is there a function which makes a deep copy of an alist.
 Klaus> AFAIK *copy-alist* makes no copies of the elements of the
 Klaus> alist, i.e. the cars and cdrs of an element are shared...

Doesn't `copy-tree' do what you want?

,----[ C-h f copy-tree RET ]
| copy-tree is an alias for `cl-copy-tree' in `cl-extra'.
| (copy-tree TREE &optional VECP)
| 
| Make a copy of TREE.
| If TREE is a cons cell, this recursively copies both its car and its cdr.
| Contrast to copy-sequence, which copies only along the cdrs.  With second
| argument VECP, this copies vectors as well as conses.
`----


Ted

-- 
Edward O'Connor
ted@oconnor.cx

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: deep copy of an alist
  2002-09-20  9:55 ` Edward O'Connor
@ 2002-09-20 10:08   ` Klaus Berndl
  0 siblings, 0 replies; 3+ messages in thread
From: Klaus Berndl @ 2002-09-20 10:08 UTC (permalink / raw)


On Fri, 20 Sep 2002, Edward O'Connor wrote:



> >>>>> "Klaus" == Klaus Berndl <Klaus.Berndl@sdm.de> writes:
>  
>   Klaus> Is there a function which makes a deep copy of an alist.
>   Klaus> AFAIK *copy-alist* makes no copies of the elements of the
>   Klaus> alist, i.e. the cars and cdrs of an element are shared...
>  
>  Doesn't `copy-tree' do what you want?

Thanks. I must have been blind.... :-)

Ciao,
klaus

>  
>  ,----[ C-h f copy-tree RET ]
> | copy-tree is an alias for `cl-copy-tree' in `cl-extra'.
> | (copy-tree TREE &optional VECP)
> | 
> | Make a copy of TREE.
> | If TREE is a cons cell, this recursively copies both its car and its cdr.
> | Contrast to copy-sequence, which copies only along the cdrs.  With second
> | argument VECP, this copies vectors as well as conses.
>  `----
>  
>  
>  Ted

-- 
Klaus Berndl			mailto: klaus.berndl@sdm.de
sd&m AG				http://www.sdm.de
software design & management	
Thomas-Dehler-Str. 27, 81737 München, Germany
Tel +49 89 63812-392, Fax -220

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2002-09-20 10:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-09-20  9:32 deep copy of an alist Klaus Berndl
2002-09-20  9:55 ` Edward O'Connor
2002-09-20 10:08   ` Klaus Berndl

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).