Mercurial > hg > xemacs-beta
comparison lisp/alist.el @ 404:2f8bb876ab1d r21-2-32
Import from CVS: tag r21-2-32
author | cvs |
---|---|
date | Mon, 13 Aug 2007 11:16:07 +0200 |
parents | 6719134a07c2 |
children | 697ef44129c6 |
comparison
equal
deleted
inserted
replaced
403:9f011ab08d48 | 404:2f8bb876ab1d |
---|---|
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. |