From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Greg Hill Newsgroups: gmane.emacs.help Subject: Index of element in a sequence Date: Wed, 27 Nov 2002 11:07:48 -0800 Sender: help-gnu-emacs-admin@gnu.org Message-ID: References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" ; format="flowed" X-Trace: main.gmane.org 1038424148 556 80.91.224.249 (27 Nov 2002 19:09:08 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 27 Nov 2002 19:09:08 +0000 (UTC) Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18H7YZ-00008j-00 for ; Wed, 27 Nov 2002 20:09:07 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10) id 18H7Yv-00011X-00; Wed, 27 Nov 2002 14:09:29 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10) id 18H7Xa-0007dB-00 for help-gnu-emacs@gnu.org; Wed, 27 Nov 2002 14:08:06 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10) id 18H7XY-0007XC-00 for help-gnu-emacs@gnu.org; Wed, 27 Nov 2002 14:08:05 -0500 Original-Received: from renfield.synergymicro.com ([153.105.4.30] helo=synergymicro.com) by monty-python.gnu.org with esmtp (Exim 4.10) id 18H7XX-0007UH-00 for help-gnu-emacs@gnu.org; Wed, 27 Nov 2002 14:08:03 -0500 Original-Received: from synergy.synergy.encinitas.ca.us ([153.105.4.29]) by synergymicro.com (8.9.3/8.9.3) with ESMTP id LAA07381 for ; Wed, 27 Nov 2002 11:09:58 -0800 Original-Received: from [198.17.100.22] (G-Hill-Mac [198.17.100.22]) by synergy.synergy.encinitas.ca.us (8.9.3/8.8.7) with ESMTP id LAA08290 for ; Wed, 27 Nov 2002 11:08:26 -0800 X-Sender: ghill@synergy (Unverified) In-Reply-To: Original-To: help-gnu-emacs@gnu.org Errors-To: help-gnu-emacs-admin@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.help:4102 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:4102 Are there any built-in functions that provide the equivalent of the following lisp routines? (defun indq (value seq) "Return the index number of VALUE in sequence SEQ, using eq for test. Return nil if VALUE does not exist in SEQ." (let ((ix 0) (len (length seq))) (catch 'indq (while (< ix len) (if (eq (elt seq ix) value) (throw 'indq ix) (setq ix (1+ ix)) ) ) ) )) (defun index (value seq) "Return the index number of VALUE in sequence SEQ, using equal for test. Return nil if VALUE does not exist in SEQ." (let ((ix 0) (len (length seq))) (catch 'index (while (< ix len) (if (equal (elt seq ix) value) (throw 'index ix) (setq ix (1+ ix)) ) ) ) )) --Greg