help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Indexing a vector


From: Ted Zlatanov
Subject: Re: Indexing a vector
Date: Wed, 10 Sep 2008 11:52:14 -0500
User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.0.60 (gnu/linux)

On Wed, 10 Sep 2008 07:53:04 -0700 (PDT) Nordlöw <per.nordlow@gmail.com> wrote: 

N> How do index an element in a vector? nth() works only for lists.
N> :(... 0 '[1 2])

N> Why on earth isn't such a basic operator compatible with both lists
N> and vectors (sequences)?

The Emacs Lisp manual (chapter 6) covers this.  A vector is an array
which is a sequence, but not a list (so you can use the `elt' function
in addition to `aref' to look up elements).  `nth' works only on lists.

Ted


reply via email to

[Prev in Thread] Current Thread [Next in Thread]