Mercurial > hg > xemacs-beta
comparison lisp/alist.el @ 442:abe6d1db359e r21-2-36
Import from CVS: tag r21-2-36
author | cvs |
---|---|
date | Mon, 13 Aug 2007 11:35:02 +0200 |
parents | 3ecd8885ac67 |
children | 023b83f4e54b |
comparison
equal
deleted
inserted
replaced
441:72a7cfa4a488 | 442:abe6d1db359e |
---|---|
20 ;; You should have received a copy of the GNU General Public License | 20 ;; You should have received a copy of the GNU General Public License |
21 ;; along with GNU Emacs; see the file COPYING. If not, write to the | 21 ;; along with GNU Emacs; see the file COPYING. If not, write to the |
22 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 22 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
23 ;; Boston, MA 02111-1307, USA. | 23 ;; Boston, MA 02111-1307, USA. |
24 | 24 |
25 ;;; Code: | 25 |
26 ;;;###autoload | |
27 (defun vassoc (key valist) | |
28 "Search VALIST for a vector whose first element is equal to KEY. | |
29 See also `assoc'." | |
30 ;; by Stig@hackvan.com | |
31 (let (el) | |
32 (catch 'done | |
33 (while (setq el (pop valist)) | |
34 (and (equal key (aref el 0)) | |
35 (throw 'done el)))))) | |
36 | |
26 | 37 |
27 ;;;###autoload | 38 ;;;###autoload |
28 (defun put-alist (item value alist) | 39 (defun put-alist (item value alist) |
29 "Modify ALIST to set VALUE to ITEM. | 40 "Modify ALIST to set VALUE to ITEM. |
30 If there is a pair whose car is ITEM, replace its cdr by VALUE. | 41 If there is a pair whose car is ITEM, replace its cdr by VALUE. |