summaryrefslogtreecommitdiff
path: root/devdocs/elisp/vector-type.html
blob: e146db70f9d5c8486db9f5aea56d3182757fa38a (plain)
1
2
3
4
5
6
7
8
9
 <h4 class="subsection">Vector Type</h4> <p>A <em>vector</em> is a one-dimensional array of elements of any type. It takes a constant amount of time to access any element of a vector. (In a list, the access time of an element is proportional to the distance of the element from the beginning of the list.) </p> <p>The printed representation of a vector consists of a left square bracket, the elements, and a right square bracket. This is also the read syntax. Like numbers and strings, vectors are considered constants for evaluation. </p> <div class="example"> <pre class="example">[1 "two" (three)]      ; <span class="roman">A vector of three elements.</span>
     ⇒ [1 "two" (three)]
</pre>
</div> <p>See <a href="vectors">Vectors</a>, for functions that work with vectors. </p><div class="_attribution">
  <p class="_attribution-p">
    Copyright &copy; 1990-1996, 1998-2022 Free Software Foundation, Inc. <br>Licensed under the GNU GPL license.<br>
    <a href="https://www.gnu.org/software/emacs/manual/html_node/elisp/Vector-Type.html" class="_attribution-link">https://www.gnu.org/software/emacs/manual/html_node/elisp/Vector-Type.html</a>
  </p>
</div>