diff options
| author | Stefan Monnier | 2002-09-27 22:19:22 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2002-09-27 22:19:22 +0000 |
| commit | ca50d9e6f39531a2bb2afe1515cab2050f670328 (patch) | |
| tree | ff1366ab826d8622f35e33f90f5d1a118036d962 | |
| parent | f7501416702d63c58a9421de1417a43bf5156cd8 (diff) | |
| download | emacs-ca50d9e6f39531a2bb2afe1515cab2050f670328.tar.gz emacs-ca50d9e6f39531a2bb2afe1515cab2050f670328.zip | |
(cl-push, cl-pop): Remove.
Use pop and push throughout the file instead.
| -rw-r--r-- | lisp/emacs-lisp/cl-seq.el | 34 |
1 files changed, 13 insertions, 21 deletions
diff --git a/lisp/emacs-lisp/cl-seq.el b/lisp/emacs-lisp/cl-seq.el index 014bf4786df..8cb6412f774 100644 --- a/lisp/emacs-lisp/cl-seq.el +++ b/lisp/emacs-lisp/cl-seq.el | |||
| @@ -48,14 +48,6 @@ | |||
| 48 | (error "Tried to load `cl-seq' before `cl'!")) | 48 | (error "Tried to load `cl-seq' before `cl'!")) |
| 49 | 49 | ||
| 50 | 50 | ||
| 51 | ;;; We define these here so that this file can compile without having | ||
| 52 | ;;; loaded the cl.el file already. | ||
| 53 | |||
| 54 | (defmacro cl-push (x place) (list 'setq place (list 'cons x place))) | ||
| 55 | (defmacro cl-pop (place) | ||
| 56 | (list 'car (list 'prog1 place (list 'setq place (list 'cdr place))))) | ||
| 57 | |||
| 58 | |||
| 59 | ;;; Keyword parsing. This is special-cased here so that we can compile | 51 | ;;; Keyword parsing. This is special-cased here so that we can compile |
| 60 | ;;; this file independent from cl-macs. | 52 | ;;; this file independent from cl-macs. |
| 61 | 53 | ||
| @@ -140,15 +132,15 @@ Keywords supported: :start :end :from-end :initial-value :key" | |||
| 140 | (setq cl-seq (subseq cl-seq cl-start cl-end)) | 132 | (setq cl-seq (subseq cl-seq cl-start cl-end)) |
| 141 | (if cl-from-end (setq cl-seq (nreverse cl-seq))) | 133 | (if cl-from-end (setq cl-seq (nreverse cl-seq))) |
| 142 | (let ((cl-accum (cond ((memq :initial-value cl-keys) cl-initial-value) | 134 | (let ((cl-accum (cond ((memq :initial-value cl-keys) cl-initial-value) |
| 143 | (cl-seq (cl-check-key (cl-pop cl-seq))) | 135 | (cl-seq (cl-check-key (pop cl-seq))) |
| 144 | (t (funcall cl-func))))) | 136 | (t (funcall cl-func))))) |
| 145 | (if cl-from-end | 137 | (if cl-from-end |
| 146 | (while cl-seq | 138 | (while cl-seq |
| 147 | (setq cl-accum (funcall cl-func (cl-check-key (cl-pop cl-seq)) | 139 | (setq cl-accum (funcall cl-func (cl-check-key (pop cl-seq)) |
| 148 | cl-accum))) | 140 | cl-accum))) |
| 149 | (while cl-seq | 141 | (while cl-seq |
| 150 | (setq cl-accum (funcall cl-func cl-accum | 142 | (setq cl-accum (funcall cl-func cl-accum |
| 151 | (cl-check-key (cl-pop cl-seq)))))) | 143 | (cl-check-key (pop cl-seq)))))) |
| 152 | cl-accum))) | 144 | cl-accum))) |
| 153 | 145 | ||
| 154 | (defun fill (seq item &rest cl-keys) | 146 | (defun fill (seq item &rest cl-keys) |
| @@ -518,7 +510,7 @@ Keywords supported: :test :test-not :key :start :end" | |||
| 518 | (or cl-end (setq cl-end (length cl-seq))) | 510 | (or cl-end (setq cl-end (length cl-seq))) |
| 519 | (if (consp cl-seq) (setq cl-seq (nthcdr cl-start cl-seq))) | 511 | (if (consp cl-seq) (setq cl-seq (nthcdr cl-start cl-seq))) |
| 520 | (while (< cl-start cl-end) | 512 | (while (< cl-start cl-end) |
| 521 | (setq cl-x (if (consp cl-seq) (cl-pop cl-seq) (aref cl-seq cl-start))) | 513 | (setq cl-x (if (consp cl-seq) (pop cl-seq) (aref cl-seq cl-start))) |
| 522 | (if (cl-check-test cl-item cl-x) (setq cl-count (1+ cl-count))) | 514 | (if (cl-check-test cl-item cl-x) (setq cl-count (1+ cl-count))) |
| 523 | (setq cl-start (1+ cl-start))) | 515 | (setq cl-start (1+ cl-start))) |
| 524 | cl-count))) | 516 | cl-count))) |
| @@ -618,8 +610,8 @@ Keywords supported: :key" | |||
| 618 | (while (and cl-seq1 cl-seq2) | 610 | (while (and cl-seq1 cl-seq2) |
| 619 | (if (funcall cl-pred (cl-check-key (car cl-seq2)) | 611 | (if (funcall cl-pred (cl-check-key (car cl-seq2)) |
| 620 | (cl-check-key (car cl-seq1))) | 612 | (cl-check-key (car cl-seq1))) |
| 621 | (cl-push (cl-pop cl-seq2) cl-res) | 613 | (push (pop cl-seq2) cl-res) |
| 622 | (cl-push (cl-pop cl-seq1) cl-res))) | 614 | (push (pop cl-seq1) cl-res))) |
| 623 | (coerce (nconc (nreverse cl-res) cl-seq1 cl-seq2) cl-type)))) | 615 | (coerce (nconc (nreverse cl-res) cl-seq1 cl-seq2) cl-type)))) |
| 624 | 616 | ||
| 625 | ;;; See compiler macro in cl-macs.el | 617 | ;;; See compiler macro in cl-macs.el |
| @@ -716,8 +708,8 @@ Keywords supported: :test :test-not :key" | |||
| 716 | (if (or cl-keys (numberp (car cl-list2))) | 708 | (if (or cl-keys (numberp (car cl-list2))) |
| 717 | (setq cl-list1 (apply 'adjoin (car cl-list2) cl-list1 cl-keys)) | 709 | (setq cl-list1 (apply 'adjoin (car cl-list2) cl-list1 cl-keys)) |
| 718 | (or (memq (car cl-list2) cl-list1) | 710 | (or (memq (car cl-list2) cl-list1) |
| 719 | (cl-push (car cl-list2) cl-list1))) | 711 | (push (car cl-list2) cl-list1))) |
| 720 | (cl-pop cl-list2)) | 712 | (pop cl-list2)) |
| 721 | cl-list1))) | 713 | cl-list1))) |
| 722 | 714 | ||
| 723 | (defun nunion (cl-list1 cl-list2 &rest cl-keys) | 715 | (defun nunion (cl-list1 cl-list2 &rest cl-keys) |
| @@ -746,8 +738,8 @@ Keywords supported: :test :test-not :key" | |||
| 746 | (apply 'member* (cl-check-key (car cl-list2)) | 738 | (apply 'member* (cl-check-key (car cl-list2)) |
| 747 | cl-list1 cl-keys) | 739 | cl-list1 cl-keys) |
| 748 | (memq (car cl-list2) cl-list1)) | 740 | (memq (car cl-list2) cl-list1)) |
| 749 | (cl-push (car cl-list2) cl-res)) | 741 | (push (car cl-list2) cl-res)) |
| 750 | (cl-pop cl-list2)) | 742 | (pop cl-list2)) |
| 751 | cl-res))))) | 743 | cl-res))))) |
| 752 | 744 | ||
| 753 | (defun nintersection (cl-list1 cl-list2 &rest cl-keys) | 745 | (defun nintersection (cl-list1 cl-list2 &rest cl-keys) |
| @@ -772,8 +764,8 @@ Keywords supported: :test :test-not :key" | |||
| 772 | (apply 'member* (cl-check-key (car cl-list1)) | 764 | (apply 'member* (cl-check-key (car cl-list1)) |
| 773 | cl-list2 cl-keys) | 765 | cl-list2 cl-keys) |
| 774 | (memq (car cl-list1) cl-list2)) | 766 | (memq (car cl-list1) cl-list2)) |
| 775 | (cl-push (car cl-list1) cl-res)) | 767 | (push (car cl-list1) cl-res)) |
| 776 | (cl-pop cl-list1)) | 768 | (pop cl-list1)) |
| 777 | cl-res)))) | 769 | cl-res)))) |
| 778 | 770 | ||
| 779 | (defun nset-difference (cl-list1 cl-list2 &rest cl-keys) | 771 | (defun nset-difference (cl-list1 cl-list2 &rest cl-keys) |
| @@ -817,7 +809,7 @@ Keywords supported: :test :test-not :key" | |||
| 817 | (while (and cl-list1 | 809 | (while (and cl-list1 |
| 818 | (apply 'member* (cl-check-key (car cl-list1)) | 810 | (apply 'member* (cl-check-key (car cl-list1)) |
| 819 | cl-list2 cl-keys)) | 811 | cl-list2 cl-keys)) |
| 820 | (cl-pop cl-list1)) | 812 | (pop cl-list1)) |
| 821 | (null cl-list1))))) | 813 | (null cl-list1))))) |
| 822 | 814 | ||
| 823 | (defun subst-if (cl-new cl-pred cl-tree &rest cl-keys) | 815 | (defun subst-if (cl-new cl-pred cl-tree &rest cl-keys) |