all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: ishi soichi <soichi777@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: build-in function for obtaining the index of an element of a list
Date: Wed, 4 Jan 2012 15:33:02 +0900	[thread overview]
Message-ID: <CAEjRLuR0g2wRvhPdt2vGmU4uT6Zn1N9fL_u_Dk1Z3E7FT9EcXQ@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 379 bytes --]

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

[-- Attachment #2: Type: text/html, Size: 618 bytes --]

             reply	other threads:[~2012-01-04  6:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-04  6:33 ishi soichi [this message]
2012-01-04 12:51 ` build-in function for obtaining the index of an element of a list Juanma Barranquero
2012-01-04 23:52   ` ishi soichi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAEjRLuR0g2wRvhPdt2vGmU4uT6Zn1N9fL_u_Dk1Z3E7FT9EcXQ@mail.gmail.com \
    --to=soichi777@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.