From 301071b17067645ac85c896ee1ba29df9637d77c Mon Sep 17 00:00:00 2001 From: tomo Date: Wed, 12 Jul 2000 06:03:35 +0000 Subject: [PATCH] (vassoc): New function [to be compatible with XEmacs 21.2.32 or later]. --- alist.el | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) 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 ;;; -- 1.7.10.4