emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/emacs-lisp/cl-extra.el


From: Colin Walters
Subject: [Emacs-diffs] Changes to emacs/lisp/emacs-lisp/cl-extra.el
Date: Sat, 08 Jun 2002 18:32:06 -0400

Index: emacs/lisp/emacs-lisp/cl-extra.el
diff -c emacs/lisp/emacs-lisp/cl-extra.el:1.21 
emacs/lisp/emacs-lisp/cl-extra.el:1.22
*** emacs/lisp/emacs-lisp/cl-extra.el:1.21      Sun Oct 15 00:49:20 2000
--- emacs/lisp/emacs-lisp/cl-extra.el   Sat Jun  8 18:32:06 2002
***************
*** 565,588 ****
      (setq list (cdr list)))
    (if (numberp sublist) (equal sublist list) (eq sublist list)))
  
! (defun cl-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."
!   (if (consp tree)
!       (let ((p (setq tree (copy-list tree))))
!       (while (consp p)
!         (if (or (consp (car p)) (and vecp (vectorp (car p))))
!             (setcar p (cl-copy-tree (car p) vecp)))
!         (or (listp (cdr p)) (setcdr p (cl-copy-tree (cdr p) vecp)))
!         (cl-pop p)))
!     (if (and vecp (vectorp tree))
!       (let ((i (length (setq tree (copy-sequence tree)))))
!         (while (>= (setq i (1- i)) 0)
!           (aset tree i (cl-copy-tree (aref tree i) vecp))))))
!   tree)
! (defalias 'copy-tree 'cl-copy-tree)
  
  
  ;;; Property lists.
--- 565,571 ----
      (setq list (cdr list)))
    (if (numberp sublist) (equal sublist list) (eq sublist list)))
  
! (defalias 'cl-copy-tree 'copy-tree)
  
  
  ;;; Property lists.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]