Mercurial > hg > xemacs-beta
comparison lisp/cl.el @ 5066:545ec923b4eb
add documentation on keywords to cl*.el
-------------------- ChangeLog entries follow: --------------------
lisp/ChangeLog addition:
2010-02-22 Ben Wing <ben@xemacs.org>
* cl-seq.el:
* cl-seq.el (reduce):
* cl-seq.el (fill):
* cl-seq.el (replace):
* cl-seq.el (remove*):
* cl-seq.el (remove-if):
* cl-seq.el (remove-if-not):
* cl-seq.el (delete*):
* cl-seq.el (delete-if):
* cl-seq.el (delete-if-not):
* cl-seq.el (remove-duplicates):
* cl-seq.el (delete-duplicates):
* cl-seq.el (substitute):
* cl-seq.el (substitute-if):
* cl-seq.el (substitute-if-not):
* cl-seq.el (nsubstitute):
* cl-seq.el (nsubstitute-if):
* cl-seq.el (nsubstitute-if-not):
* cl-seq.el (find):
* cl-seq.el (find-if):
* cl-seq.el (find-if-not):
* cl-seq.el (position):
* cl-seq.el (position-if):
* cl-seq.el (position-if-not):
* cl-seq.el (count):
* cl-seq.el (count-if):
* cl-seq.el (count-if-not):
* cl-seq.el (mismatch):
* cl-seq.el (search):
* cl-seq.el (sort*):
* cl-seq.el (stable-sort):
* cl-seq.el (merge):
* cl-seq.el (member*):
* cl-seq.el (member-if):
* cl-seq.el (member-if-not):
* cl-seq.el (assoc*):
* cl-seq.el (assoc-if):
* cl-seq.el (assoc-if-not):
* cl-seq.el (rassoc*):
* cl-seq.el (rassoc-if):
* cl-seq.el (rassoc-if-not):
* cl-seq.el (union):
* cl-seq.el (nunion):
* cl-seq.el (intersection):
* cl-seq.el (nintersection):
* cl-seq.el (set-difference):
* cl-seq.el (nset-difference):
* cl-seq.el (set-exclusive-or):
* cl-seq.el (nset-exclusive-or):
* cl-seq.el (subsetp):
* cl-seq.el (subst-if):
* cl-seq.el (subst-if-not):
* cl-seq.el (nsubst):
* cl-seq.el (nsubst-if):
* cl-seq.el (nsubst-if-not):
* cl-seq.el (sublis):
* cl-seq.el (nsublis):
* cl-seq.el (tree-equal):
* cl-seq.el (cl-tree-equal-rec):
* cl.el:
* cl.el (pushnew):
* cl.el (adjoin):
* cl.el (subst):
Document the keywords to the various sequence/list functions.
author | Ben Wing <ben@xemacs.org> |
---|---|
date | Mon, 22 Feb 2010 21:17:47 -0600 |
parents | 8431b52e43b1 |
children | 2d0937dc83cf |
comparison
equal
deleted
inserted
replaced
5065:133e816778ed | 5066:545ec923b4eb |
---|---|
1 ;;; cl.el --- Common Lisp extensions for XEmacs Lisp | 1 ;;; cl.el --- Common Lisp extensions for XEmacs Lisp |
2 | 2 |
3 ;; Copyright (C) 1993, 1997 Free Software Foundation, Inc. | 3 ;; Copyright (C) 1993, 1997 Free Software Foundation, Inc. |
4 ;; Copyright (C) 2010 Ben Wing. | |
4 | 5 |
5 ;; Author: Dave Gillespie <daveg@synaptics.com> | 6 ;; Author: Dave Gillespie <daveg@synaptics.com> |
6 ;; Maintainer: XEmacs Development Team | 7 ;; Maintainer: XEmacs Development Team |
7 ;; Version: 2.02 | 8 ;; Version: 2.02 |
8 ;; Keywords: extensions, dumped, lisp | 9 ;; Keywords: extensions, dumped, lisp |
177 | 178 |
178 (defmacro pushnew (newelt listname &rest keys) | 179 (defmacro pushnew (newelt listname &rest keys) |
179 "Add NEWELT at the beginning of LISTNAME, unless it's already in LISTNAME. | 180 "Add NEWELT at the beginning of LISTNAME, unless it's already in LISTNAME. |
180 Like (push NEWELT LISTNAME), except that the list is unmodified if NEWELT is | 181 Like (push NEWELT LISTNAME), except that the list is unmodified if NEWELT is |
181 `eql' to an element already on the list. | 182 `eql' to an element already on the list. |
182 Keywords supported: :test :test-not :key" | 183 Keywords supported: :test :test-not :key |
184 See `member*' for the meaning of :test, :test-not and :key." | |
183 (if (symbolp listname) (list 'setq listname | 185 (if (symbolp listname) (list 'setq listname |
184 (list* 'adjoin newelt listname keys)) | 186 (list* 'adjoin newelt listname keys)) |
185 (list* 'callf2 'adjoin newelt listname keys))) | 187 (list* 'callf2 'adjoin newelt listname keys))) |
186 | 188 |
187 (defun cl-set-elt (seq n val) | 189 (defun cl-set-elt (seq n val) |
581 (defalias 'cl-mod 'mod*) | 583 (defalias 'cl-mod 'mod*) |
582 | 584 |
583 (defun adjoin (cl-item cl-list &rest cl-keys) ; See compiler macro in cl-macs | 585 (defun adjoin (cl-item cl-list &rest cl-keys) ; See compiler macro in cl-macs |
584 "Return ITEM consed onto the front of LIST only if it's not already there. | 586 "Return ITEM consed onto the front of LIST only if it's not already there. |
585 Otherwise, return LIST unmodified. | 587 Otherwise, return LIST unmodified. |
586 Keywords supported: :test :test-not :key" | 588 Keywords supported: :test :test-not :key |
589 See `member*' for the meaning of :test, :test-not and :key." | |
587 (cond ((or (equal cl-keys '(:test eq)) | 590 (cond ((or (equal cl-keys '(:test eq)) |
588 (and (null cl-keys) (not (numberp cl-item)))) | 591 (and (null cl-keys) (not (numberp cl-item)))) |
589 (if (memq cl-item cl-list) cl-list (cons cl-item cl-list))) | 592 (if (memq cl-item cl-list) cl-list (cons cl-item cl-list))) |
590 ((or (equal cl-keys '(:test equal)) (null cl-keys)) | 593 ((or (equal cl-keys '(:test equal)) (null cl-keys)) |
591 (if (member cl-item cl-list) cl-list (cons cl-item cl-list))) | 594 (if (member cl-item cl-list) cl-list (cons cl-item cl-list))) |
592 (t (apply 'cl-adjoin cl-item cl-list cl-keys)))) | 595 (t (apply 'cl-adjoin cl-item cl-list cl-keys)))) |
593 | 596 |
594 (defun subst (cl-new cl-old cl-tree &rest cl-keys) | 597 (defun subst (cl-new cl-old cl-tree &rest cl-keys) |
595 "Substitute NEW for OLD everywhere in TREE (non-destructively). | 598 "Substitute NEW for OLD everywhere in TREE (non-destructively). |
596 Return a copy of TREE with all elements `eql' to OLD replaced by NEW. | 599 Return a copy of TREE with all elements `eql' to OLD replaced by NEW. |
597 Keywords supported: :test :test-not :key" | 600 Keywords supported: :test :test-not :key |
601 See `member*' for the meaning of :test, :test-not and :key." | |
598 (if (or cl-keys (and (numberp cl-old) (not (fixnump cl-old)))) | 602 (if (or cl-keys (and (numberp cl-old) (not (fixnump cl-old)))) |
599 (apply 'sublis (list (cons cl-old cl-new)) cl-tree cl-keys) | 603 (apply 'sublis (list (cons cl-old cl-new)) cl-tree cl-keys) |
600 (cl-do-subst cl-new cl-old cl-tree))) | 604 (cl-do-subst cl-new cl-old cl-tree))) |
601 | 605 |
602 (defun cl-do-subst (cl-new cl-old cl-tree) | 606 (defun cl-do-subst (cl-new cl-old cl-tree) |