comparison lisp/alist.el @ 412:697ef44129c6 r21-2-14

Import from CVS: tag r21-2-14
author cvs
date Mon, 13 Aug 2007 11:20:41 +0200
parents 2f8bb876ab1d
children
comparison
equal deleted inserted replaced
411:12e008d41344 412:697ef44129c6
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 25 ;;; Code:
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
37 26
38 ;;;###autoload 27 ;;;###autoload
39 (defun put-alist (item value alist) 28 (defun put-alist (item value alist)
40 "Modify ALIST to set VALUE to ITEM. 29 "Modify ALIST to set VALUE to ITEM.
41 If there is a pair whose car is ITEM, replace its cdr by VALUE. 30 If there is a pair whose car is ITEM, replace its cdr by VALUE.