From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: ishi soichi Newsgroups: gmane.emacs.help Subject: build-in function for obtaining the index of an element of a list Date: Wed, 4 Jan 2012 15:33:02 +0900 Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=90e6ba6e836ccedefa04b5adfc6e X-Trace: dough.gmane.org 1325658794 1393 80.91.229.12 (4 Jan 2012 06:33:14 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 4 Jan 2012 06:33:14 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Jan 04 07:33:11 2012 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RiKPO-0001ix-Kv for geh-help-gnu-emacs@m.gmane.org; Wed, 04 Jan 2012 07:33:10 +0100 Original-Received: from localhost ([::1]:60802 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RiKPO-0008Lg-4X for geh-help-gnu-emacs@m.gmane.org; Wed, 04 Jan 2012 01:33:10 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:54566) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RiKPI-0008LQ-Rd for help-gnu-emacs@gnu.org; Wed, 04 Jan 2012 01:33:05 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RiKPH-0005qu-RU for help-gnu-emacs@gnu.org; Wed, 04 Jan 2012 01:33:04 -0500 Original-Received: from mail-iy0-f169.google.com ([209.85.210.169]:41514) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RiKPH-0005qh-Nw for help-gnu-emacs@gnu.org; Wed, 04 Jan 2012 01:33:03 -0500 Original-Received: by iacb35 with SMTP id b35so35332347iac.0 for ; Tue, 03 Jan 2012 22:33:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; bh=niGd4RZ/+Ai3DGoITaBuAvb5d848eMoBgnSGZIyg2Hk=; b=DCvyGfUimrNl9zTHmGBsTcmg0blFvBTN/sXFPs6ctWZhbj4NKfYyhdNxltvTOPFC9A gwsdRyNv62oVD/J+cHOHvan2vJ8kPGosIt/QNfNgF6QE7nJHYqg0GZTs6k9CvLOKnGRs Re58G1kvOnFl1dunKpGQl/wlefBJF1KRNMa2I= Original-Received: by 10.42.135.69 with SMTP id o5mr67321821ict.34.1325658782228; Tue, 03 Jan 2012 22:33:02 -0800 (PST) Original-Received: by 10.43.131.138 with HTTP; Tue, 3 Jan 2012 22:33:02 -0800 (PST) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 209.85.210.169 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:83314 Archived-At: --90e6ba6e836ccedefa04b5adfc6e Content-Type: text/plain; charset=ISO-8859-1 I have a question about Emacs Lisp. Is there any Emacs built-in function that returns the index of an element of a list? More specifically, say I have a list (setq lista '("apple" "banana" "orange)) then implement the function, which I want, (functionName lista "banana") ; => 1 If not, please give me an example of such function definition. Thanks in advance! soichi --90e6ba6e836ccedefa04b5adfc6e Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable I have a question about Emacs Lisp.

Is there any Emacs b= uilt-in function that returns the index of an element of a list?
=
More specifically, say I have a list

(setq lista '("apple" "banana" "orange))<= /div>

then implement the function, which I want,

(functionName lista "banana") =A0 =A0; =3D> = 1

If not, please give me an example of such function defi= nition.

Thanks in advance!

soichi --90e6ba6e836ccedefa04b5adfc6e--