unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Nordlöw <per.nordlow@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Accessing an element in an associativity list
Date: Tue, 9 Sep 2008 06:07:42 -0700 (PDT)	[thread overview]
Message-ID: <42fc0e67-edf3-41e1-baea-eab3d46bbf2d@73g2000hsx.googlegroups.com> (raw)

I have the following list of lists structure

(defvar c++-stl-containers
  '(
    ("string" "<string>" "String of char.")
    ("wstring" "<wstring>" "String of wide char (wchar_t).")
    ("vector" "<vector>" "Vectors contain contiguous elements stored
as an array.")
   )
 )

and I want to do something like this:
  (index-first 'c++-stl-containers "string" 2)
should evaluate to
  "<string>"

Is there any emacs lisp convenience function for accessing a row given
its, say, first (key) element? I know this is slow but speed is of no
importance here. Of course if a hash table is as easy to use then of
course I would like to use that.

Thanks in advance,
Nordlöw


             reply	other threads:[~2008-09-09 13:07 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-09 13:07 Nordlöw [this message]
2008-09-09 13:28 ` Accessing an element in an associativity list Joost Kremers
2008-09-09 14:47   ` Tassilo Horn

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=42fc0e67-edf3-41e1-baea-eab3d46bbf2d@73g2000hsx.googlegroups.com \
    --to=per.nordlow@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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).