From: tomo Date: Wed, 12 Jul 2000 06:03:35 +0000 (+0000) Subject: (vassoc): New function [to be compatible with XEmacs 21.2.32 or X-Git-Tag: emacs-21_0_90-apel-10_2-1~4 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=301071b17067645ac85c896ee1ba29df9637d77c;p=elisp%2Fapel.git (vassoc): New function [to be compatible with XEmacs 21.2.32 or later]. --- diff --git a/alist.el b/alist.el index c016c92..4ac3169 100644 --- a/alist.el +++ b/alist.el @@ -1,8 +1,8 @@ ;;; alist.el --- utility functions about association-list -;; Copyright (C) 1993,1994,1995,1996,1998 Free Software Foundation, Inc. +;; Copyright (C) 1993,1994,1995,1996,1998,2000 Free Software Foundation, Inc. -;; Author: MORIOKA Tomohiko +;; Author: MORIOKA Tomohiko ;; Keywords: alist ;; This file is part of APEL (A Portable Emacs Library). @@ -97,6 +97,20 @@ its value regard as nil." ) +;;; @ association-vector-list +;;; + +;;;###autoload +(defun vassoc (key avlist) + "Search AVLIST for a vector whose first element is equal to KEY. +See also `assoc'." + (let (v) + (while (and (setq v (car avlist)) + (not (equal key (aref v 0)))) + (setq avlist (cdr avlist))) + v)) + + ;;; @ end ;;;