89 lines
3.9 KiB
HTML
89 lines
3.9 KiB
HTML
|
<!DOCTYPE html>
|
||
|
<html>
|
||
|
<!-- Created by GNU Texinfo 7.1, https://www.gnu.org/software/texinfo/ -->
|
||
|
<head>
|
||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||
|
<!-- This manual documents Guile version 3.0.10.
|
||
|
|
||
|
Copyright (C) 1996-1997, 2000-2005, 2009-2023 Free Software Foundation,
|
||
|
Inc.
|
||
|
|
||
|
Copyright (C) 2021 Maxime Devos
|
||
|
|
||
|
Copyright (C) 2024 Tomas Volf
|
||
|
|
||
|
|
||
|
Permission is granted to copy, distribute and/or modify this document
|
||
|
under the terms of the GNU Free Documentation License, Version 1.3 or
|
||
|
any later version published by the Free Software Foundation; with no
|
||
|
Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A
|
||
|
copy of the license is included in the section entitled "GNU Free
|
||
|
Documentation License." -->
|
||
|
<title>Vectors (Guile Reference Manual)</title>
|
||
|
|
||
|
<meta name="description" content="Vectors (Guile Reference Manual)">
|
||
|
<meta name="keywords" content="Vectors (Guile Reference Manual)">
|
||
|
<meta name="resource-type" content="document">
|
||
|
<meta name="distribution" content="global">
|
||
|
<meta name="Generator" content=".texi2any-real">
|
||
|
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||
|
|
||
|
<link href="index.html" rel="start" title="Top">
|
||
|
<link href="Concept-Index.html" rel="index" title="Concept Index">
|
||
|
<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
|
||
|
<link href="Data-Types.html" rel="up" title="Data Types">
|
||
|
<link href="Bit-Vectors.html" rel="next" title="Bit Vectors">
|
||
|
<link href="Lists.html" rel="prev" title="Lists">
|
||
|
<style type="text/css">
|
||
|
<!--
|
||
|
a.copiable-link {visibility: hidden; text-decoration: none; line-height: 0em}
|
||
|
span:hover a.copiable-link {visibility: visible}
|
||
|
-->
|
||
|
</style>
|
||
|
<link rel="stylesheet" type="text/css" href="https://www.gnu.org/software/gnulib/manual.css">
|
||
|
|
||
|
|
||
|
</head>
|
||
|
|
||
|
<body lang="en">
|
||
|
<div class="subsection-level-extent" id="Vectors">
|
||
|
<div class="nav-panel">
|
||
|
<p>
|
||
|
Next: <a href="Bit-Vectors.html" accesskey="n" rel="next">Bit Vectors</a>, Previous: <a href="Lists.html" accesskey="p" rel="prev">Lists</a>, Up: <a href="Data-Types.html" accesskey="u" rel="up">Data Types</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Concept-Index.html" title="Index" rel="index">Index</a>]</p>
|
||
|
</div>
|
||
|
<hr>
|
||
|
<h4 class="subsection" id="Vectors-1"><span>6.6.10 Vectors<a class="copiable-link" href="#Vectors-1"> ¶</a></span></h4>
|
||
|
<a class="index-entry-id" id="index-Vectors"></a>
|
||
|
|
||
|
<p>Vectors are sequences of Scheme objects. Unlike lists, the length of a
|
||
|
vector, once the vector is created, cannot be changed. The advantage of
|
||
|
vectors over lists is that the time required to access one element of a vector
|
||
|
given its <em class="dfn">position</em> (synonymous with <em class="dfn">index</em>), a zero-origin number,
|
||
|
is constant, whereas lists have an access time linear to the position of the
|
||
|
accessed element in the list.
|
||
|
</p>
|
||
|
<p>Vectors can contain any kind of Scheme object; it is even possible to
|
||
|
have different types of objects in the same vector. For vectors
|
||
|
containing vectors, you may wish to use <a class="ref" href="Arrays.html">Arrays</a> instead.
|
||
|
Note, too, that vectors are a special case of one dimensional
|
||
|
non-uniform arrays and that array procedures operate happily on vectors.
|
||
|
</p>
|
||
|
<p>Also see <a class="ref" href="SRFI_002d43.html">SRFI-43 - Vector Library</a>, <a class="ref" href="R6RS-Support.html">R6RS Support</a>, or <a class="ref" href="R7RS-Support.html">R7RS Support</a>, for
|
||
|
more comprehensive vector libraries.
|
||
|
</p>
|
||
|
|
||
|
|
||
|
<ul class="mini-toc">
|
||
|
<li><a href="Vector-Syntax.html" accesskey="1">Read Syntax for Vectors</a></li>
|
||
|
<li><a href="Vector-Creation.html" accesskey="2">Dynamic Vector Creation and Validation</a></li>
|
||
|
<li><a href="Vector-Accessors.html" accesskey="3">Accessing and Modifying Vector Contents</a></li>
|
||
|
<li><a href="Vector-Accessing-from-C.html" accesskey="4">Vector Accessing from C</a></li>
|
||
|
<li><a href="Uniform-Numeric-Vectors.html" accesskey="5">Uniform Numeric Vectors</a></li>
|
||
|
</ul>
|
||
|
</div>
|
||
|
|
||
|
|
||
|
|
||
|
</body>
|
||
|
</html>
|