klisp

an open source interpreter for the Kernel Programming Language.
git clone http://git.hanabi.in/repos/klisp.git
Log | Files | Refs | README

commit e750fca6add13dc6bb05a995b18b09e096550329
parent c2507a52027a6cb91cc5d7a5e5d3840ebe60cb98
Author: Andres Navarro <canavarro82@gmail.com>
Date:   Sat, 25 Feb 2012 20:33:16 -0300

Added vector section to the manual.

Diffstat:
MTODO | 1-
Mdoc/html/Alphabetical-Index.html | 77++++++++++++++++++++++++++++++++++++++++++++++++++---------------------------
Mdoc/html/Libraries.html | 28++++++++++++++--------------
Mdoc/html/Ports.html | 4++--
Mdoc/html/Strings.html | 6+++---
Mdoc/html/System.html | 26+++++++++++++-------------
Adoc/html/Vectors.html | 193+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mdoc/html/index.html | 1+
Mdoc/klisp.info | 260++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-----------------
Mdoc/src/Makefile | 1+
Mdoc/src/klisp.texi | 2++
Mdoc/src/libraries.texi | 2+-
Mdoc/src/ports.texi | 2+-
Mdoc/src/strings.texi | 6+++---
Adoc/src/vectors.texi | 145+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
15 files changed, 633 insertions(+), 121 deletions(-)

diff --git a/TODO b/TODO @@ -2,7 +2,6 @@ ** Documentation: *** update the manual with the current features **** Add missing sections -- vector - bytevector - error ** Test diff --git a/doc/html/Alphabetical-Index.html b/doc/html/Alphabetical-Index.html @@ -41,10 +41,10 @@ Up:&nbsp;<a rel="up" accesskey="u" href="index.html#Top">Top</a> <li><a href="Control.html#index-g_t_0024cond-32"><code>$cond</code></a>: <a href="Control.html#Control">Control</a></li> <li><a href="Environments.html#index-g_t_0024define_0021-110"><code>$define!</code></a>: <a href="Environments.html#Environments">Environments</a></li> <li><a href="Promises.html#index-g_t_0024delay-160"><code>$delay</code></a>: <a href="Promises.html#Promises">Promises</a></li> -<li><a href="Libraries.html#index-g_t_0024get_002dregistered_002dlibrary-355"><code>$get-registered-library</code></a>: <a href="Libraries.html#Libraries">Libraries</a></li> +<li><a href="Libraries.html#index-g_t_0024get_002dregistered_002dlibrary-376"><code>$get-registered-library</code></a>: <a href="Libraries.html#Libraries">Libraries</a></li> <li><a href="Control.html#index-g_t_0024if-30"><code>$if</code></a>: <a href="Control.html#Control">Control</a></li> <li><a href="Environments.html#index-g_t_0024import_0021-125"><code>$import!</code></a>: <a href="Environments.html#Environments">Environments</a></li> -<li><a href="Libraries.html#index-g_t_0024import_002dlibrary_0021-359"><code>$import-library!</code></a>: <a href="Libraries.html#Libraries">Libraries</a></li> +<li><a href="Libraries.html#index-g_t_0024import_002dlibrary_0021-380"><code>$import-library!</code></a>: <a href="Libraries.html#Libraries">Libraries</a></li> <li><a href="Combiners.html#index-g_t_0024lambda-134"><code>$lambda</code></a>: <a href="Combiners.html#Combiners">Combiners</a></li> <li><a href="Promises.html#index-g_t_0024lazy-158"><code>$lazy</code></a>: <a href="Promises.html#Promises">Promises</a></li> <li><a href="Environments.html#index-g_t_0024let-111"><code>$let</code></a>: <a href="Environments.html#Environments">Environments</a></li> @@ -56,14 +56,14 @@ Up:&nbsp;<a rel="up" accesskey="u" href="index.html#Top">Top</a> <li><a href="Environments.html#index-g_t_0024letrec_002a-117"><code>$letrec*</code></a>: <a href="Environments.html#Environments">Environments</a></li> <li><a href="Booleans.html#index-g_t_0024or_003f-19"><code>$or?</code></a>: <a href="Booleans.html#Booleans">Booleans</a></li> <li><a href="Environments.html#index-g_t_0024provide_0021-124"><code>$provide!</code></a>: <a href="Environments.html#Environments">Environments</a></li> -<li><a href="Libraries.html#index-g_t_0024provide_002dlibrary_0021-358"><code>$provide-library!</code></a>: <a href="Libraries.html#Libraries">Libraries</a></li> -<li><a href="Libraries.html#index-g_t_0024register_002dlibrary_0021-356"><code>$register-library!</code></a>: <a href="Libraries.html#Libraries">Libraries</a></li> -<li><a href="Libraries.html#index-g_t_0024registered_002dlibrary_003f-354"><code>$registered-library?</code></a>: <a href="Libraries.html#Libraries">Libraries</a></li> +<li><a href="Libraries.html#index-g_t_0024provide_002dlibrary_0021-379"><code>$provide-library!</code></a>: <a href="Libraries.html#Libraries">Libraries</a></li> +<li><a href="Libraries.html#index-g_t_0024register_002dlibrary_0021-377"><code>$register-library!</code></a>: <a href="Libraries.html#Libraries">Libraries</a></li> +<li><a href="Libraries.html#index-g_t_0024registered_002dlibrary_003f-375"><code>$registered-library?</code></a>: <a href="Libraries.html#Libraries">Libraries</a></li> <li><a href="Environments.html#index-g_t_0024remote_002deval-120"><code>$remote-eval</code></a>: <a href="Environments.html#Environments">Environments</a></li> <li><a href="Control.html#index-g_t_0024sequence-31"><code>$sequence</code></a>: <a href="Control.html#Control">Control</a></li> <li><a href="Environments.html#index-g_t_0024set_0021-123"><code>$set!</code></a>: <a href="Environments.html#Environments">Environments</a></li> <li><a href="Control.html#index-g_t_0024unless-38"><code>$unless</code></a>: <a href="Control.html#Control">Control</a></li> -<li><a href="Libraries.html#index-g_t_0024unregister_002dlibrary_0021-357"><code>$unregister-library!</code></a>: <a href="Libraries.html#Libraries">Libraries</a></li> +<li><a href="Libraries.html#index-g_t_0024unregister_002dlibrary_0021-378"><code>$unregister-library!</code></a>: <a href="Libraries.html#Libraries">Libraries</a></li> <li><a href="Combiners.html#index-g_t_0024vau-131"><code>$vau</code></a>: <a href="Combiners.html#Combiners">Combiners</a></li> <li><a href="Control.html#index-g_t_0024when-37"><code>$when</code></a>: <a href="Control.html#Control">Control</a></li> <li><a href="Numbers.html#index-g_t_002a-184"><code>*</code></a>: <a href="Numbers.html#Numbers">Numbers</a></li> @@ -93,6 +93,7 @@ Up:&nbsp;<a rel="up" accesskey="u" href="index.html#Top">Top</a> <li><a href="Booleans.html#index-boolean_003f-14"><code>boolean?</code></a>: <a href="Booleans.html#Booleans">Booleans</a></li> <li><a href="Booleans.html#index-booleans-13">booleans</a>: <a href="Booleans.html#Booleans">Booleans</a></li> <li><a href="Strings.html#index-bytevector_002d_003estring-261"><code>bytevector-&gt;string</code></a>: <a href="Strings.html#Strings">Strings</a></li> +<li><a href="Vectors.html#index-bytevector_002d_003evector-362"><code>bytevector-&gt;vector</code></a>: <a href="Vectors.html#Vectors">Vectors</a></li> <li><a href="Control.html#index-bytevector_002dfor_002deach-36"><code>bytevector-for-each</code></a>: <a href="Control.html#Control">Control</a></li> <li><a href="Combiners.html#index-bytevector_002dmap-139"><code>bytevector-map</code></a>: <a href="Combiners.html#Combiners">Combiners</a></li> <li><a href="Ports.html#index-bytevector_002dport_003f-301"><code>bytevector-port?</code></a>: <a href="Ports.html#Ports">Ports</a></li> @@ -172,8 +173,8 @@ Up:&nbsp;<a rel="up" accesskey="u" href="index.html#Top">Top</a> <li><a href="Pairs-and-lists.html#index-copy_002des_002dimmutable_0021-50"><code>copy-es-immutable!</code></a>: <a href="Pairs-and-lists.html#Pairs-and-lists">Pairs and lists</a></li> <li><a href="Numbers.html#index-cos-225"><code>cos</code></a>: <a href="Numbers.html#Numbers">Numbers</a></li> <li><a href="Pairs-and-lists.html#index-countable_002dlist_003f-98"><code>countable-list?</code></a>: <a href="Pairs-and-lists.html#Pairs-and-lists">Pairs and lists</a></li> -<li><a href="System.html#index-defined_002denvironment_002dvariable_003f-369"><code>defined-environment-variable?</code></a>: <a href="System.html#System">System</a></li> -<li><a href="System.html#index-delete_002dfile-365"><code>delete-file</code></a>: <a href="System.html#System">System</a></li> +<li><a href="System.html#index-defined_002denvironment_002dvariable_003f-390"><code>defined-environment-variable?</code></a>: <a href="System.html#System">System</a></li> +<li><a href="System.html#index-delete_002dfile-386"><code>delete-file</code></a>: <a href="System.html#System">System</a></li> <li><a href="Numbers.html#index-denominator-213"><code>denominator</code></a>: <a href="Numbers.html#Numbers">Numbers</a></li> <li><a href="Format-of-Descriptions.html#index-description-format-7">description format</a>: <a href="Format-of-Descriptions.html#Format-of-Descriptions">Format of Descriptions</a></li> <li><a href="Characters.html#index-digit_002d_003echar-292"><code>digit-&gt;char</code></a>: <a href="Characters.html#Characters">Characters</a></li> @@ -204,7 +205,7 @@ Up:&nbsp;<a rel="up" accesskey="u" href="index.html#Top">Top</a> <li><a href="Numbers.html#index-exp-222"><code>exp</code></a>: <a href="Numbers.html#Numbers">Numbers</a></li> <li><a href="Numbers.html#index-expt-221"><code>expt</code></a>: <a href="Numbers.html#Numbers">Numbers</a></li> <li><a href="Continuations.html#index-extend_002dcontinuation-144"><code>extend-continuation</code></a>: <a href="Continuations.html#Continuations">Continuations</a></li> -<li><a href="System.html#index-file_002dexists-364"><code>file-exists</code></a>: <a href="System.html#System">System</a></li> +<li><a href="System.html#index-file_002dexists-385"><code>file-exists</code></a>: <a href="System.html#System">System</a></li> <li><a href="Ports.html#index-file_002dport_003f-299"><code>file-port?</code></a>: <a href="Ports.html#Ports">Ports</a></li> <li><a href="Pairs-and-lists.html#index-filter-94"><code>filter</code></a>: <a href="Pairs-and-lists.html#Pairs-and-lists">Pairs and lists</a></li> <li><a href="Ports.html#index-find_002drequired_002dfilename-347"><code>find-required-filename</code></a>: <a href="Ports.html#Ports">Ports</a></li> @@ -220,15 +221,15 @@ Up:&nbsp;<a rel="up" accesskey="u" href="index.html#Top">Top</a> <li><a href="Environments.html#index-get_002dcurrent_002denvironment-113"><code>get-current-environment</code></a>: <a href="Environments.html#Environments">Environments</a></li> <li><a href="Ports.html#index-get_002dcurrent_002derror_002dport-308"><code>get-current-error-port</code></a>: <a href="Ports.html#Ports">Ports</a></li> <li><a href="Ports.html#index-get_002dcurrent_002dinput_002dport-306"><code>get-current-input-port</code></a>: <a href="Ports.html#Ports">Ports</a></li> -<li><a href="System.html#index-get_002dcurrent_002djiffies-362"><code>get-current-jiffies</code></a>: <a href="System.html#System">System</a></li> +<li><a href="System.html#index-get_002dcurrent_002djiffies-383"><code>get-current-jiffies</code></a>: <a href="System.html#System">System</a></li> <li><a href="Ports.html#index-get_002dcurrent_002doutput_002dport-307"><code>get-current-output-port</code></a>: <a href="Ports.html#Ports">Ports</a></li> -<li><a href="System.html#index-get_002dcurrent_002dsecond-361"><code>get-current-second</code></a>: <a href="System.html#System">System</a></li> -<li><a href="System.html#index-get_002denvironment_002dvariable-370"><code>get-environment-variable</code></a>: <a href="System.html#System">System</a></li> -<li><a href="System.html#index-get_002denvironment_002dvariables-371"><code>get-environment-variables</code></a>: <a href="System.html#System">System</a></li> -<li><a href="System.html#index-get_002dinterpreter_002darguments-368"><code>get-interpreter-arguments</code></a>: <a href="System.html#System">System</a></li> -<li><a href="System.html#index-get_002djiffies_002dper_002dsecond-363"><code>get-jiffies-per-second</code></a>: <a href="System.html#System">System</a></li> -<li><a href="Libraries.html#index-get_002dlibrary_002denvironment-353"><code>get-library-environment</code></a>: <a href="Libraries.html#Libraries">Libraries</a></li> -<li><a href="Libraries.html#index-get_002dlibrary_002dexport_002dlist-352"><code>get-library-export-list</code></a>: <a href="Libraries.html#Libraries">Libraries</a></li> +<li><a href="System.html#index-get_002dcurrent_002dsecond-382"><code>get-current-second</code></a>: <a href="System.html#System">System</a></li> +<li><a href="System.html#index-get_002denvironment_002dvariable-391"><code>get-environment-variable</code></a>: <a href="System.html#System">System</a></li> +<li><a href="System.html#index-get_002denvironment_002dvariables-392"><code>get-environment-variables</code></a>: <a href="System.html#System">System</a></li> +<li><a href="System.html#index-get_002dinterpreter_002darguments-389"><code>get-interpreter-arguments</code></a>: <a href="System.html#System">System</a></li> +<li><a href="System.html#index-get_002djiffies_002dper_002dsecond-384"><code>get-jiffies-per-second</code></a>: <a href="System.html#System">System</a></li> +<li><a href="Libraries.html#index-get_002dlibrary_002denvironment-374"><code>get-library-environment</code></a>: <a href="Libraries.html#Libraries">Libraries</a></li> +<li><a href="Libraries.html#index-get_002dlibrary_002dexport_002dlist-373"><code>get-library-export-list</code></a>: <a href="Libraries.html#Libraries">Libraries</a></li> <li><a href="Pairs-and-lists.html#index-get_002dlist_002dmetrics-86"><code>get-list-metrics</code></a>: <a href="Pairs-and-lists.html#Pairs-and-lists">Pairs and lists</a></li> <li><a href="Ports.html#index-get_002dmodule-348"><code>get-module</code></a>: <a href="Ports.html#Ports">Ports</a></li> <li><a href="Ports.html#index-get_002doutput_002dbytevector-323"><code>get-output-bytevector</code></a>: <a href="Ports.html#Ports">Ports</a></li> @@ -237,7 +238,7 @@ Up:&nbsp;<a rel="up" accesskey="u" href="index.html#Top">Top</a> <li><a href="Numbers.html#index-get_002dreal_002dexact_002dprimary-205"><code>get-real-exact-primary</code></a>: <a href="Numbers.html#Numbers">Numbers</a></li> <li><a href="Numbers.html#index-get_002dreal_002dinternal_002dbounds-202"><code>get-real-internal-bounds</code></a>: <a href="Numbers.html#Numbers">Numbers</a></li> <li><a href="Numbers.html#index-get_002dreal_002dinternal_002dprimary-204"><code>get-real-internal-primary</code></a>: <a href="Numbers.html#Numbers">Numbers</a></li> -<li><a href="System.html#index-get_002dscript_002darguments-367"><code>get-script-arguments</code></a>: <a href="System.html#System">System</a></li> +<li><a href="System.html#index-get_002dscript_002darguments-388"><code>get-script-arguments</code></a>: <a href="System.html#System">System</a></li> <li><a href="Numbers.html#index-get_002dstring_002darithmetic-210"><code>get-string-arithmetic</code></a>: <a href="Numbers.html#Numbers">Numbers</a></li> <li><a href="Continuations.html#index-guard_002dcontinuation-145"><code>guard-continuation</code></a>: <a href="Continuations.html#Continuations">Continuations</a></li> <li><a href="Continuations.html#index-guard_002ddynamic_002dextent-151"><code>guard-dynamic-extent</code></a>: <a href="Continuations.html#Continuations">Continuations</a></li> @@ -245,6 +246,7 @@ Up:&nbsp;<a rel="up" accesskey="u" href="index.html#Top">Top</a> <li><a href="Environments.html#index-ignore_003f-107"><code>ignore?</code></a>: <a href="Environments.html#Environments">Environments</a></li> <li><a href="Pairs-and-lists.html#index-immutable_002dpair_003f-45"><code>immutable-pair?</code></a>: <a href="Pairs-and-lists.html#Pairs-and-lists">Pairs and lists</a></li> <li><a href="Strings.html#index-immutable_002dstring_003f-234"><code>immutable-string?</code></a>: <a href="Strings.html#Strings">Strings</a></li> +<li><a href="Vectors.html#index-immutable_002dvector_003f-351"><code>immutable-vector?</code></a>: <a href="Vectors.html#Vectors">Vectors</a></li> <li><a href="Control.html#index-inert-28">inert</a>: <a href="Control.html#Control">Control</a></li> <li><a href="Control.html#index-inert_003f-29"><code>inert?</code></a>: <a href="Control.html#Control">Control</a></li> <li><a href="Numbers.html#index-inexact_003f-175"><code>inexact?</code></a>: <a href="Numbers.html#Numbers">Numbers</a></li> @@ -258,11 +260,12 @@ Up:&nbsp;<a rel="up" accesskey="u" href="index.html#Top">Top</a> <li><a href="Keyed-Variables.html#index-keyed-variables-161">keyed variables</a>: <a href="Keyed-Variables.html#Keyed-Variables">Keyed Variables</a></li> <li><a href="Numbers.html#index-lcm-200"><code>lcm</code></a>: <a href="Numbers.html#Numbers">Numbers</a></li> <li><a href="Pairs-and-lists.html#index-length-90"><code>length</code></a>: <a href="Pairs-and-lists.html#Pairs-and-lists">Pairs and lists</a></li> -<li><a href="Libraries.html#index-libraries-349">libraries</a>: <a href="Libraries.html#Libraries">Libraries</a></li> -<li><a href="Libraries.html#index-library_003f-350"><code>library?</code></a>: <a href="Libraries.html#Libraries">Libraries</a></li> +<li><a href="Libraries.html#index-libraries-370">libraries</a>: <a href="Libraries.html#Libraries">Libraries</a></li> +<li><a href="Libraries.html#index-library_003f-371"><code>library?</code></a>: <a href="Libraries.html#Libraries">Libraries</a></li> <li><a href="Pairs-and-lists.html#index-list-51"><code>list</code></a>: <a href="Pairs-and-lists.html#Pairs-and-lists">Pairs and lists</a></li> <li><a href="Pairs-and-lists.html#index-list_002a-52"><code>list*</code></a>: <a href="Pairs-and-lists.html#Pairs-and-lists">Pairs and lists</a></li> <li><a href="Strings.html#index-list_002d_003estring-257"><code>list-&gt;string</code></a>: <a href="Strings.html#Strings">Strings</a></li> +<li><a href="Vectors.html#index-list_002d_003evector-359"><code>list-&gt;vector</code></a>: <a href="Vectors.html#Vectors">Vectors</a></li> <li><a href="Pairs-and-lists.html#index-list_002dcopy-84"><code>list-copy</code></a>: <a href="Pairs-and-lists.html#Pairs-and-lists">Pairs and lists</a></li> <li><a href="Pairs-and-lists.html#index-list_002dneighbors-93"><code>list-neighbors</code></a>: <a href="Pairs-and-lists.html#Pairs-and-lists">Pairs and lists</a></li> <li><a href="Pairs-and-lists.html#index-list_002dref-91"><code>list-ref</code></a>: <a href="Pairs-and-lists.html#Pairs-and-lists">Pairs and lists</a></li> @@ -276,9 +279,10 @@ Up:&nbsp;<a rel="up" accesskey="u" href="index.html#Top">Top</a> <li><a href="Environments.html#index-make_002dkernel_002dstandard_002denvironment-114"><code>make-kernel-standard-environment</code></a>: <a href="Environments.html#Environments">Environments</a></li> <li><a href="Keyed-Variables.html#index-make_002dkeyed_002ddynamic_002dvariable-163"><code>make-keyed-dynamic-variable</code></a>: <a href="Keyed-Variables.html#Keyed-Variables">Keyed Variables</a></li> <li><a href="Keyed-Variables.html#index-make_002dkeyed_002dstatic_002dvariable-165"><code>make-keyed-static-variable</code></a>: <a href="Keyed-Variables.html#Keyed-Variables">Keyed Variables</a></li> -<li><a href="Libraries.html#index-make_002dlibrary-351"><code>make-library</code></a>: <a href="Libraries.html#Libraries">Libraries</a></li> +<li><a href="Libraries.html#index-make_002dlibrary-372"><code>make-library</code></a>: <a href="Libraries.html#Libraries">Libraries</a></li> <li><a href="Pairs-and-lists.html#index-make_002dlist-83"><code>make-list</code></a>: <a href="Pairs-and-lists.html#Pairs-and-lists">Pairs and lists</a></li> <li><a href="Strings.html#index-make_002dstring-246"><code>make-string</code></a>: <a href="Strings.html#Strings">Strings</a></li> +<li><a href="Vectors.html#index-make_002dvector-353"><code>make-vector</code></a>: <a href="Vectors.html#Vectors">Vectors</a></li> <li><a href="Combiners.html#index-map-136"><code>map</code></a>: <a href="Combiners.html#Combiners">Combiners</a></li> <li><a href="Pairs-and-lists.html#index-map-89"><code>map</code></a>: <a href="Pairs-and-lists.html#Pairs-and-lists">Pairs and lists</a></li> <li><a href="Numbers.html#index-max-198"><code>max</code></a>: <a href="Numbers.html#Numbers">Numbers</a></li> @@ -290,6 +294,7 @@ Up:&nbsp;<a rel="up" accesskey="u" href="index.html#Top">Top</a> <li><a href="Numbers.html#index-mod0-191"><code>mod0</code></a>: <a href="Numbers.html#Numbers">Numbers</a></li> <li><a href="Pairs-and-lists.html#index-mutable_002dpair_003f-46"><code>mutable-pair?</code></a>: <a href="Pairs-and-lists.html#Pairs-and-lists">Pairs and lists</a></li> <li><a href="Strings.html#index-mutable_002dstring_003f-235"><code>mutable-string?</code></a>: <a href="Strings.html#Strings">Strings</a></li> +<li><a href="Vectors.html#index-mutable_002dvector_003f-352"><code>mutable-vector?</code></a>: <a href="Vectors.html#Vectors">Vectors</a></li> <li><a href="Numbers.html#index-negative_003f-194"><code>negative?</code></a>: <a href="Numbers.html#Numbers">Numbers</a></li> <li><a href="Ports.html#index-newline-328"><code>newline</code></a>: <a href="Ports.html#Ports">Ports</a></li> <li><a href="Pairs-and-lists.html#index-nil-40">nil</a>: <a href="Pairs-and-lists.html#Pairs-and-lists">Pairs and lists</a></li> @@ -337,7 +342,7 @@ Up:&nbsp;<a rel="up" accesskey="u" href="index.html#Top">Top</a> <li><a href="Pairs-and-lists.html#index-reduce-99"><code>reduce</code></a>: <a href="Pairs-and-lists.html#Pairs-and-lists">Pairs and lists</a></li> <li><a href="Ports.html#index-register_002drequirement_0021-345"><code>register-requirement!</code></a>: <a href="Ports.html#Ports">Ports</a></li> <li><a href="Ports.html#index-registered_002drequirement_003f-344"><code>registered-requirement?</code></a>: <a href="Ports.html#Ports">Ports</a></li> -<li><a href="System.html#index-rename_002dfile-366"><code>rename-file</code></a>: <a href="System.html#System">System</a></li> +<li><a href="System.html#index-rename_002dfile-387"><code>rename-file</code></a>: <a href="System.html#System">System</a></li> <li><a href="Ports.html#index-require-343"><code>require</code></a>: <a href="Ports.html#Ports">Ports</a></li> <li><a href="Pairs-and-lists.html#index-reverse-85"><code>reverse</code></a>: <a href="Pairs-and-lists.html#Pairs-and-lists">Pairs and lists</a></li> <li><a href="Numbers.html#index-robust_003f-176"><code>robust?</code></a>: <a href="Numbers.html#Numbers">Numbers</a></li> @@ -354,6 +359,7 @@ Up:&nbsp;<a rel="up" accesskey="u" href="index.html#Top">Top</a> <li><a href="Strings.html#index-string_002d_003elist-256"><code>string-&gt;list</code></a>: <a href="Strings.html#Strings">Strings</a></li> <li><a href="Numbers.html#index-string_002d_003enumber-230"><code>string-&gt;number</code></a>: <a href="Numbers.html#Numbers">Numbers</a></li> <li><a href="Symbols.html#index-string_002d_003esymbol-26"><code>string-&gt;symbol</code></a>: <a href="Symbols.html#Symbols">Symbols</a></li> +<li><a href="Vectors.html#index-string_002d_003evector-364"><code>string-&gt;vector</code></a>: <a href="Vectors.html#Vectors">Vectors</a></li> <li><a href="Strings.html#index-string_002d_003evector-258"><code>string-&gt;vector</code></a>: <a href="Strings.html#Strings">Strings</a></li> <li><a href="Strings.html#index-string_002dappend-253"><code>string-append</code></a>: <a href="Strings.html#Strings">Strings</a></li> <li><a href="Strings.html#index-string_002dci_003c_003d_003f-243"><code>string-ci&lt;=?</code></a>: <a href="Strings.html#Strings">Strings</a></li> @@ -384,7 +390,7 @@ Up:&nbsp;<a rel="up" accesskey="u" href="index.html#Top">Top</a> <li><a href="Symbols.html#index-symbol_002d_003estring-25"><code>symbol-&gt;string</code></a>: <a href="Symbols.html#Symbols">Symbols</a></li> <li><a href="Symbols.html#index-symbol_003f-24"><code>symbol?</code></a>: <a href="Symbols.html#Symbols">Symbols</a></li> <li><a href="Symbols.html#index-symbols-23">symbols</a>: <a href="Symbols.html#Symbols">Symbols</a></li> -<li><a href="System.html#index-system-360">system</a>: <a href="System.html#System">System</a></li> +<li><a href="System.html#index-system-381">system</a>: <a href="System.html#System">System</a></li> <li><a href="Numbers.html#index-tan-226"><code>tan</code></a>: <a href="Numbers.html#Numbers">Numbers</a></li> <li><a href="Ports.html#index-textual_002dport_003f-297"><code>textual-port?</code></a>: <a href="Ports.html#Ports">Ports</a></li> <li><a href="Numbers.html#index-truncate-216"><code>truncate</code></a>: <a href="Numbers.html#Numbers">Numbers</a></li> @@ -393,9 +399,24 @@ Up:&nbsp;<a rel="up" accesskey="u" href="index.html#Top">Top</a> <li><a href="Numbers.html#index-undefined_003f-177"><code>undefined?</code></a>: <a href="Numbers.html#Numbers">Numbers</a></li> <li><a href="Ports.html#index-unregister_002drequirement_0021-346"><code>unregister-requirement!</code></a>: <a href="Ports.html#Ports">Ports</a></li> <li><a href="Combiners.html#index-unwrap-133"><code>unwrap</code></a>: <a href="Combiners.html#Combiners">Combiners</a></li> +<li><a href="Vectors.html#index-vector-357"><code>vector</code></a>: <a href="Vectors.html#Vectors">Vectors</a></li> +<li><a href="Vectors.html#index-vector_002d_003ebytevector-361"><code>vector-&gt;bytevector</code></a>: <a href="Vectors.html#Vectors">Vectors</a></li> +<li><a href="Vectors.html#index-vector_002d_003eimmutable_002dvector-369"><code>vector-&gt;immutable-vector</code></a>: <a href="Vectors.html#Vectors">Vectors</a></li> +<li><a href="Vectors.html#index-vector_002d_003elist-358"><code>vector-&gt;list</code></a>: <a href="Vectors.html#Vectors">Vectors</a></li> +<li><a href="Vectors.html#index-vector_002d_003estring-363"><code>vector-&gt;string</code></a>: <a href="Vectors.html#Vectors">Vectors</a></li> <li><a href="Strings.html#index-vector_002d_003estring-259"><code>vector-&gt;string</code></a>: <a href="Strings.html#Strings">Strings</a></li> +<li><a href="Vectors.html#index-vector_002dcopy-360"><code>vector-copy</code></a>: <a href="Vectors.html#Vectors">Vectors</a></li> +<li><a href="Vectors.html#index-vector_002dcopy_0021-365"><code>vector-copy!</code></a>: <a href="Vectors.html#Vectors">Vectors</a></li> +<li><a href="Vectors.html#index-vector_002dcopy_002dpartial-366"><code>vector-copy-partial</code></a>: <a href="Vectors.html#Vectors">Vectors</a></li> +<li><a href="Vectors.html#index-vector_002dcopy_002dpartial_0021-367"><code>vector-copy-partial!</code></a>: <a href="Vectors.html#Vectors">Vectors</a></li> +<li><a href="Vectors.html#index-vector_002dfill_0021-368"><code>vector-fill!</code></a>: <a href="Vectors.html#Vectors">Vectors</a></li> <li><a href="Control.html#index-vector_002dfor_002deach-35"><code>vector-for-each</code></a>: <a href="Control.html#Control">Control</a></li> +<li><a href="Vectors.html#index-vector_002dlength-354"><code>vector-length</code></a>: <a href="Vectors.html#Vectors">Vectors</a></li> <li><a href="Combiners.html#index-vector_002dmap-138"><code>vector-map</code></a>: <a href="Combiners.html#Combiners">Combiners</a></li> +<li><a href="Vectors.html#index-vector_002dref-355"><code>vector-ref</code></a>: <a href="Vectors.html#Vectors">Vectors</a></li> +<li><a href="Vectors.html#index-vector_002dset_0021-356"><code>vector-set!</code></a>: <a href="Vectors.html#Vectors">Vectors</a></li> +<li><a href="Vectors.html#index-vector_003f-350"><code>vector?</code></a>: <a href="Vectors.html#Vectors">Vectors</a></li> +<li><a href="Vectors.html#index-Vectors-349">Vectors</a>: <a href="Vectors.html#Vectors">Vectors</a></li> <li><a href="Ports.html#index-with_002derror_002dto_002dfile-305"><code>with-error-to-file</code></a>: <a href="Ports.html#Ports">Ports</a></li> <li><a href="Ports.html#index-with_002dinput_002dfrom_002dfile-303"><code>with-input-from-file</code></a>: <a href="Ports.html#Ports">Ports</a></li> <li><a href="Ports.html#index-with_002doutput_002dto_002dfile-304"><code>with-output-to-file</code></a>: <a href="Ports.html#Ports">Ports</a></li> @@ -429,8 +450,9 @@ Up:&nbsp;<a rel="up" accesskey="u" href="index.html#Top">Top</a> <li><a href="Alphabetical-Index.html#toc_Strings">15 Strings</a></li> <li><a href="Alphabetical-Index.html#toc_Characters">16 Characters</a></li> <li><a href="Alphabetical-Index.html#toc_Ports">17 Ports</a></li> -<li><a href="Alphabetical-Index.html#toc_Libraries">18 Libraries</a></li> -<li><a href="Alphabetical-Index.html#toc_System">19 System</a></li> +<li><a href="Alphabetical-Index.html#toc_Vectors">18 Vectors</a></li> +<li><a href="Alphabetical-Index.html#toc_Libraries">19 Libraries</a></li> +<li><a href="Alphabetical-Index.html#toc_System">20 System</a></li> <li><a href="Alphabetical-Index.html#toc_Alphabetical-Index">Index</a></li> </ul> </div> @@ -483,8 +505,9 @@ Up:&nbsp;<a rel="up" accesskey="u" href="index.html#Top">Top</a> <li><a name="toc_Strings" href="Strings.html#Strings">15 Strings</a> <li><a name="toc_Characters" href="Characters.html#Characters">16 Characters</a> <li><a name="toc_Ports" href="Ports.html#Ports">17 Ports</a> -<li><a name="toc_Libraries" href="Libraries.html#Libraries">18 Libraries</a> -<li><a name="toc_System" href="System.html#System">19 System</a> +<li><a name="toc_Vectors" href="Vectors.html#Vectors">18 Vectors</a> +<li><a name="toc_Libraries" href="Libraries.html#Libraries">19 Libraries</a> +<li><a name="toc_System" href="System.html#System">20 System</a> <li><a name="toc_Alphabetical-Index" href="Alphabetical-Index.html#Alphabetical-Index">Index</a> </li></ul> </div> diff --git a/doc/html/Libraries.html b/doc/html/Libraries.html @@ -5,7 +5,7 @@ <meta name="description" content="klisp Reference Manual"> <meta name="generator" content="makeinfo 4.13"> <link title="Top" rel="start" href="index.html#Top"> -<link rel="prev" href="Ports.html#Ports" title="Ports"> +<link rel="prev" href="Vectors.html#Vectors" title="Vectors"> <link rel="next" href="System.html#System" title="System"> <link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage"> <meta http-equiv="Content-Style-Type" content="text/css"> @@ -26,15 +26,15 @@ <a name="Libraries"></a> <p> Next:&nbsp;<a rel="next" accesskey="n" href="System.html#System">System</a>, -Previous:&nbsp;<a rel="previous" accesskey="p" href="Ports.html#Ports">Ports</a>, +Previous:&nbsp;<a rel="previous" accesskey="p" href="Vectors.html#Vectors">Vectors</a>, Up:&nbsp;<a rel="up" accesskey="u" href="index.html#Top">Top</a> <hr> </div> <!-- node-name, next, previous, up --> -<h2 class="chapter">18 Libraries</h2> +<h2 class="chapter">19 Libraries</h2> -<p><a name="index-libraries-349"></a> +<p><a name="index-libraries-370"></a> Libraries provide a way to organize klisp code with a clean &amp; clear interface to the rest of the program. They are first class objects (as all manipulable entities in Kernel, and according to the @@ -78,7 +78,7 @@ doing things (first class status, exposing of the library register, etc). <div class="defun"> -&mdash; Applicative: <b>library?</b> (<var>library? . objects</var>)<var><a name="index-library_003f-350"></a></var><br> +&mdash; Applicative: <b>library?</b> (<var>library? . objects</var>)<var><a name="index-library_003f-371"></a></var><br> <blockquote><p>The primitive type predicate for type library. <code>library?</code> returns true iff all the objects in <code>objects</code> are of type library. @@ -89,7 +89,7 @@ API (i.e. <code>$provide-library!</code> &amp; <code>$import-library!</code>). </p></blockquote></div> <div class="defun"> -&mdash; Applicative: <b>make-library</b> (<var>make-library bindings</var>)<var><a name="index-make_002dlibrary-351"></a></var><br> +&mdash; Applicative: <b>make-library</b> (<var>make-library bindings</var>)<var><a name="index-make_002dlibrary-372"></a></var><br> <blockquote><p><code>bindings</code> should be an acyclic list of <code>(symbol . value)</code> pairs. Each symbol may only occur once in the list. @@ -102,8 +102,8 @@ their libraries. </p></blockquote></div> <div class="defun"> -&mdash; Applicative: <b>get-library-export-list</b> (<var>get-library-export-list library</var>)<var><a name="index-get_002dlibrary_002dexport_002dlist-352"></a></var><br> -&mdash; Applicative: <b>get-library-environment</b> (<var>get-library-environment library</var>)<var><a name="index-get_002dlibrary_002denvironment-353"></a></var><br> +&mdash; Applicative: <b>get-library-export-list</b> (<var>get-library-export-list library</var>)<var><a name="index-get_002dlibrary_002dexport_002dlist-373"></a></var><br> +&mdash; Applicative: <b>get-library-environment</b> (<var>get-library-environment library</var>)<var><a name="index-get_002dlibrary_002denvironment-374"></a></var><br> <blockquote><p><code>get-library-export-list</code> returns the list of symbols exported from the passed library. <code>get-library-environment</code> returns a fresh empty environment whose parent has all exported symbols of the @@ -115,10 +115,10 @@ bindings out of libraries (and into the current environment). </p></blockquote></div> <div class="defun"> -&mdash; Operative: <b>$registered-library?</b> (<var>$registered-library? name</var>)<var><a name="index-g_t_0024registered_002dlibrary_003f-354"></a></var><br> -&mdash; Operative: <b>$get-registered-library</b> (<var>$get-registered-library name</var>)<var><a name="index-g_t_0024get_002dregistered_002dlibrary-355"></a></var><br> -&mdash; Operative: <b>$register-library!</b> (<var>$register-library! name library</var>)<var><a name="index-g_t_0024register_002dlibrary_0021-356"></a></var><br> -&mdash; Operative: <b>$unregister-library!</b> (<var>$unregister-library! name</var>)<var><a name="index-g_t_0024unregister_002dlibrary_0021-357"></a></var><br> +&mdash; Operative: <b>$registered-library?</b> (<var>$registered-library? name</var>)<var><a name="index-g_t_0024registered_002dlibrary_003f-375"></a></var><br> +&mdash; Operative: <b>$get-registered-library</b> (<var>$get-registered-library name</var>)<var><a name="index-g_t_0024get_002dregistered_002dlibrary-376"></a></var><br> +&mdash; Operative: <b>$register-library!</b> (<var>$register-library! name library</var>)<var><a name="index-g_t_0024register_002dlibrary_0021-377"></a></var><br> +&mdash; Operative: <b>$unregister-library!</b> (<var>$unregister-library! name</var>)<var><a name="index-g_t_0024unregister_002dlibrary_0021-378"></a></var><br> <blockquote><p><code>name</code> should a an acyclic list of symbols and exact non-negative integers. Two registered libraries can't have the same name (in the sense of <code>equal?</code>). @@ -142,8 +142,8 @@ of libraries are encouraged to use <code>$provide-library!</code> to create </p></blockquote></div> <div class="defun"> -&mdash; Operative: <b>$provide-library!</b> (<var>$provide-library! name exports . body</var>)<var><a name="index-g_t_0024provide_002dlibrary_0021-358"></a></var><br> -&mdash; Operative: <b>$import-library!</b> (<var>$import-library! . imports</var>)<var><a name="index-g_t_0024import_002dlibrary_0021-359"></a></var><br> +&mdash; Operative: <b>$provide-library!</b> (<var>$provide-library! name exports . body</var>)<var><a name="index-g_t_0024provide_002dlibrary_0021-379"></a></var><br> +&mdash; Operative: <b>$import-library!</b> (<var>$import-library! . imports</var>)<var><a name="index-g_t_0024import_002dlibrary_0021-380"></a></var><br> <blockquote><p><code>name</code> should be as for <code>register-library!</code> and not already registered. <code>exports</code> should be a list of <code>(#:export &lt;export-spec&gt; ...)</code>. Where <code>&lt;export spec&gt;</code> is either: diff --git a/doc/html/Ports.html b/doc/html/Ports.html @@ -6,7 +6,7 @@ <meta name="generator" content="makeinfo 4.13"> <link title="Top" rel="start" href="index.html#Top"> <link rel="prev" href="Characters.html#Characters" title="Characters"> -<link rel="next" href="Libraries.html#Libraries" title="Libraries"> +<link rel="next" href="Vectors.html#Vectors" title="Vectors"> <link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage"> <meta http-equiv="Content-Style-Type" content="text/css"> <style type="text/css"><!-- @@ -25,7 +25,7 @@ <div class="node"> <a name="Ports"></a> <p> -Next:&nbsp;<a rel="next" accesskey="n" href="Libraries.html#Libraries">Libraries</a>, +Next:&nbsp;<a rel="next" accesskey="n" href="Vectors.html#Vectors">Vectors</a>, Previous:&nbsp;<a rel="previous" accesskey="p" href="Characters.html#Characters">Characters</a>, Up:&nbsp;<a rel="up" accesskey="u" href="index.html#Top">Top</a> <hr> diff --git a/doc/html/Strings.html b/doc/html/Strings.html @@ -139,7 +139,7 @@ composed of the character arguments. &mdash; Applicative: <b>string-ref</b> (<var>string-ref string k</var>)<var><a name="index-string_002dref-249"></a></var><br> <blockquote><p> Applicative <code>string-ref</code> returns the character of <code>string</code> at position <code>k</code>. If <code>k</code> is out of bounds (i.e. less than -<code>0</code> or greater or equal than <code>(length string)</code>) an error is +<code>0</code> or greater or equal than <code>(string-length string)</code>) an error is signaled. </p></blockquote></div> @@ -159,10 +159,10 @@ immutable string, an error is signaled. <div class="defun"> &mdash; Applicative: <b>substring</b> (<var>substring string k1 k2</var>)<var><a name="index-substring-252"></a></var><br> -<blockquote><p> Both <code>k1</code> &amp; <code>k2</code> should be valid indexes in +<blockquote><p> Both <code>k1</code> &amp; <code>k2-1</code> should be valid indexes in <code>string</code>. Also it should be the case that <code>k1 &lt;= k2</code>. - <p>Applicative <code>substring</code> constructs and returns a new immutable + <p>Applicative <code>substring</code> constructs and returns a new mutable string with length <code>k2 - k1</code>, with the characters from <code>string</code>, starting at index <code>k1</code> (inclusive) and ending at index <code>k2</code> (exclusive). diff --git a/doc/html/System.html b/doc/html/System.html @@ -32,16 +32,16 @@ Up:&nbsp;<a rel="up" accesskey="u" href="index.html#Top">Top</a> </div> <!-- node-name, next, previous, up --> -<h2 class="chapter">19 System</h2> +<h2 class="chapter">20 System</h2> -<p><a name="index-system-360"></a> +<p><a name="index-system-381"></a> Module System contains some useful features for interacting with the host environment. <p>SOURCE NOTE: most of these come from r7rs. <div class="defun"> -&mdash; Applicative: <b>get-current-second</b> (<var>get-current-second</var>)<var><a name="index-get_002dcurrent_002dsecond-361"></a></var><br> +&mdash; Applicative: <b>get-current-second</b> (<var>get-current-second</var>)<var><a name="index-get_002dcurrent_002dsecond-382"></a></var><br> <blockquote><p>Applicative <code>get-current-second</code> returns the number of seconds elapsed since the UNIX/POSIX epoch (that is midnight January 1st, 1970, UTC). @@ -51,7 +51,7 @@ here. </p></blockquote></div> <div class="defun"> -&mdash; Applicative: <b>get-current-jiffies</b> (<var>get-current-jiffies</var>)<var><a name="index-get_002dcurrent_002djiffies-362"></a></var><br> +&mdash; Applicative: <b>get-current-jiffies</b> (<var>get-current-jiffies</var>)<var><a name="index-get_002dcurrent_002djiffies-383"></a></var><br> <blockquote><p>Applicative <code>get-current-jiffies</code> returns the number of jiffies (fractions of a second) elapsed since an arbitrary epoch that may change in each run of the klisp interpreter. Applicative @@ -60,19 +60,19 @@ of a second a jiffy represents. </p></blockquote></div> <div class="defun"> -&mdash; Applicative: <b>get-jiffies-per-second</b> (<var>get-jiffies-per-second</var>)<var><a name="index-get_002djiffies_002dper_002dsecond-363"></a></var><br> +&mdash; Applicative: <b>get-jiffies-per-second</b> (<var>get-jiffies-per-second</var>)<var><a name="index-get_002djiffies_002dper_002dsecond-384"></a></var><br> <blockquote><p>Applicative <code>get-jiffies-per-second</code> returns a constant representing the number of jiffies that correspond to one second. </p></blockquote></div> <div class="defun"> -&mdash; Applicative: <b>file-exists</b> (<var>file-exists string</var>)<var><a name="index-file_002dexists-364"></a></var><br> +&mdash; Applicative: <b>file-exists</b> (<var>file-exists string</var>)<var><a name="index-file_002dexists-385"></a></var><br> <blockquote><p>Predicate <code>file-exists?</code> checks to see if a file named <code>string</code> exists. </p></blockquote></div> <div class="defun"> -&mdash; Applicative: <b>delete-file</b> (<var>delete-file string</var>)<var><a name="index-delete_002dfile-365"></a></var><br> +&mdash; Applicative: <b>delete-file</b> (<var>delete-file string</var>)<var><a name="index-delete_002dfile-386"></a></var><br> <blockquote><p><code>string</code> should be the name/path for an existing file. <p>Applicative <code>delete-file</code> deletes the file named <code>string</code>. @@ -81,7 +81,7 @@ result returned by <code>delete-file</code> is inert. </p></blockquote></div> <div class="defun"> -&mdash; Applicative: <b>rename-file</b> (<var>rename-file string1 string2</var>)<var><a name="index-rename_002dfile-366"></a></var><br> +&mdash; Applicative: <b>rename-file</b> (<var>rename-file string1 string2</var>)<var><a name="index-rename_002dfile-387"></a></var><br> <blockquote><p><code>string1</code> should be the name/path for an existing file, <code>string2</code> should be the name/path for a non existing file. @@ -95,8 +95,8 @@ quite similar to <code>delete-file</code>. </p></blockquote></div> <div class="defun"> -&mdash; Applicative: <b>get-script-arguments</b> (<var>get-script-arguments</var>)<var><a name="index-get_002dscript_002darguments-367"></a></var><br> -&mdash; Applicative: <b>get-interpreter-arguments</b> (<var>get-interpreter-arguments</var>)<var><a name="index-get_002dinterpreter_002darguments-368"></a></var><br> +&mdash; Applicative: <b>get-script-arguments</b> (<var>get-script-arguments</var>)<var><a name="index-get_002dscript_002darguments-388"></a></var><br> +&mdash; Applicative: <b>get-interpreter-arguments</b> (<var>get-interpreter-arguments</var>)<var><a name="index-get_002dinterpreter_002darguments-389"></a></var><br> <blockquote><p>These applicatives return respectively the script and interpreter arguments. The script arguments are a list of the arguments passed to the klisp interpreter starting from (and including) the script name. @@ -107,20 +107,20 @@ name and arguments. </p></blockquote></div> <div class="defun"> -&mdash; Applicative: <b>defined-environment-variable?</b> (<var>defined-environment-variable? string</var>)<var><a name="index-defined_002denvironment_002dvariable_003f-369"></a></var><br> +&mdash; Applicative: <b>defined-environment-variable?</b> (<var>defined-environment-variable? string</var>)<var><a name="index-defined_002denvironment_002dvariable_003f-390"></a></var><br> <blockquote><p>Predicate <code>defined-environment-variable?</code> returns true iff <code>string</code> represents a defined envrionment variable. </p></blockquote></div> <div class="defun"> -&mdash; Applicative: <b>get-environment-variable</b> (<var>get-environment-variable string</var>)<var><a name="index-get_002denvironment_002dvariable-370"></a></var><br> +&mdash; Applicative: <b>get-environment-variable</b> (<var>get-environment-variable string</var>)<var><a name="index-get_002denvironment_002dvariable-391"></a></var><br> <blockquote><p>Applicative <code>get-environment-variable</code> returns the value of the environment variable represented by <code>string</code>. If <code>string</code> doesn't represent a defined environment variable an error is signaled. </p></blockquote></div> <div class="defun"> -&mdash; Applicative: <b>get-environment-variables</b> (<var>get-environment-variables</var>)<var><a name="index-get_002denvironment_002dvariables-371"></a></var><br> +&mdash; Applicative: <b>get-environment-variables</b> (<var>get-environment-variables</var>)<var><a name="index-get_002denvironment_002dvariables-392"></a></var><br> <blockquote><!-- TODO xref to alist --> <p>Applicative <code>get-environment-variable</code> returns an alist representing the defined environment variables and their values. The diff --git a/doc/html/Vectors.html b/doc/html/Vectors.html @@ -0,0 +1,193 @@ +<html lang="en"> +<head> +<title>Vectors - klisp Reference Manual</title> +<meta http-equiv="Content-Type" content="text/html"> +<meta name="description" content="klisp Reference Manual"> +<meta name="generator" content="makeinfo 4.13"> +<link title="Top" rel="start" href="index.html#Top"> +<link rel="prev" href="Ports.html#Ports" title="Ports"> +<link rel="next" href="Libraries.html#Libraries" title="Libraries"> +<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage"> +<meta http-equiv="Content-Style-Type" content="text/css"> +<style type="text/css"><!-- + pre.display { font-family:inherit } + pre.format { font-family:inherit } + pre.smalldisplay { font-family:inherit; font-size:smaller } + pre.smallformat { font-family:inherit; font-size:smaller } + pre.smallexample { font-size:smaller } + pre.smalllisp { font-size:smaller } + span.sc { font-variant:small-caps } + span.roman { font-family:serif; font-weight:normal; } + span.sansserif { font-family:sans-serif; font-weight:normal; } +--></style> +</head> +<body> +<div class="node"> +<a name="Vectors"></a> +<p> +Next:&nbsp;<a rel="next" accesskey="n" href="Libraries.html#Libraries">Libraries</a>, +Previous:&nbsp;<a rel="previous" accesskey="p" href="Ports.html#Ports">Ports</a>, +Up:&nbsp;<a rel="up" accesskey="u" href="index.html#Top">Top</a> +<hr> +</div> + +<!-- node-name, next, previous, up --> +<h2 class="chapter">18 Vectors</h2> + +<p><a name="index-Vectors-349"></a> +A vector is an object that contains a sequence of arbitrary klisp +objects. A vector has a length that is fixed at creation time, and as +many objects, indexed from <code>0</code> to <code>length-1</code>. Compared to +lists, klisp vectors use less size and have constant access time for +any element. + + <p>Vectors may be mutable or immutable. If an attempt is made to mutate +an immutable vector, an error is signaled. Two immutable vectors are +&ldquo;eq?&rdquo; iff they are &ldquo;equal?&rdquo;. Two mutable vectors are &ldquo;eq?&rdquo; if +they were created by the same constructor call. Two mutable vectors +are &ldquo;equal?&rdquo; iff they have the same length and have &ldquo;equal?&rdquo; +objects in each position. As is the case for lists, in order to +handle possibly cyclic structures, the &ldquo;equal?&rdquo; algorithm considers +vectors as FSMs where it position is a state change. There is only one +empty vector (that is, a vector of length 0) and that vector is +immutable. The vector type is encapsulated. + + <p>SOURCE NOTE: The report doesn't currently include vectors. They are +taken from r7rs scheme. + +<div class="defun"> +&mdash; Applicative: <b>vector?</b> (<var>vector? . objects</var>)<var><a name="index-vector_003f-350"></a></var><br> +<blockquote><p>The primitive type predicate for type vector. <code>vector?</code> +returns true iff all the objects in <code>objects</code> are of type +vector. +</p></blockquote></div> + +<div class="defun"> +&mdash; Applicative: <b>immutable-vector?</b> (<var>immutable-vector? objects</var>)<var><a name="index-immutable_002dvector_003f-351"></a></var><br> +&mdash; Applicative: <b>mutable-vector?</b> (<var>mutable-vector? objects</var>)<var><a name="index-mutable_002dvector_003f-352"></a></var><br> +<blockquote><p>The primitive type predicates for types immutable vector and mutable +vector. These return true iff all the objects in <code>objects</code> are of +type immutable vector or mutable vector respectively. +</p></blockquote></div> + +<div class="defun"> +&mdash; Applicative: <b>make-vector</b> (<var>make-vector k </var>[<var>obj</var>])<var><a name="index-make_002dvector-353"></a></var><br> +<blockquote><p>Applicative <code>make-vector</code> constructs and returns a new mutable +vector of length <code>k</code>. If <code>obj</code> is specified, then all +objects in the returned vector are <code>obj</code>, otherwise the +content of the vector is unspecified. +</p></blockquote></div> + +<div class="defun"> +&mdash; Applicative: <b>vector-length</b> (<var>vector-length vector</var>)<var><a name="index-vector_002dlength-354"></a></var><br> +<blockquote><p>Applicative <code>vector-length</code> returns the length of +<code>vector</code>. +</p></blockquote></div> + +<div class="defun"> +&mdash; Applicative: <b>vector-ref</b> (<var>vector-ref vector k</var>)<var><a name="index-vector_002dref-355"></a></var><br> +<blockquote><p>Applicative <code>vector-ref</code> returns the object of <code>vector</code> at +position <code>k</code>. If <code>k</code> is out of bounds (i.e. less than +<code>0</code> or greater or equal than <code>(vector-length vector)</code>) an +error is signaled. +</p></blockquote></div> + +<div class="defun"> +&mdash; Applicative: <b>vector-set!</b> (<var>vector-set! vector k obj</var>)<var><a name="index-vector_002dset_0021-356"></a></var><br> +<blockquote><p>Applicative <code>vector-set!</code> replaces the object with index <code>k</code> +in <code>vector</code> with object <code>obj</code>. If <code>k</code> is out of +bounds, or <code>vector</code> is immutable, an error is signaled. The +result returned by <code>vector-set!</code> is inert. +</p></blockquote></div> + +<div class="defun"> +&mdash; Applicative: <b>vector</b> (<var>vector . objs</var>)<var><a name="index-vector-357"></a></var><br> +<blockquote><p>Applicative <code>vector</code> contructs and return a new mutable vector +composed of the object arguments. +</p></blockquote></div> + +<div class="defun"> +&mdash; Applicative: <b>vector-&gt;list</b> (<var>vector-&gt;list vector</var>)<var><a name="index-vector_002d_003elist-358"></a></var><br> +&mdash; Applicative: <b>list-&gt;vector</b> (<var>list-&gt;vector objs</var>)<var><a name="index-list_002d_003evector-359"></a></var><br> +<blockquote><p>These applicatives convert between vectors and lists. The objects +returned by these applicatives are always mutable. +</p></blockquote></div> + +<div class="defun"> +&mdash; Applicative: <b>vector-copy</b> (<var>vector-copy vector</var>)<var><a name="index-vector_002dcopy-360"></a></var><br> +<blockquote><p>Applicative <code>vector-copy</code> constructs and returns a new mutable +vector with the same length and objects as <code>vector</code>. +</p></blockquote></div> + +<div class="defun"> +&mdash; Applicative: <b>vector-&gt;bytevector</b> (<var>vector-&gt;bytevector vector</var>)<var><a name="index-vector_002d_003ebytevector-361"></a></var><br> +&mdash; Applicative: <b>bytevector-&gt;vector</b> (<var>bytevector-&gt;vector bytevector</var>)<var><a name="index-bytevector_002d_003evector-362"></a></var><br> +<blockquote><p>These applicatives convert between vectors and bytevectors. If a +vector containing objects other than exact integers between 0 and 255 +inclusive are passed to <code>vector-&gt;bytevector</code>, an error is +signaled. The objects returned by these applicatives are always +mutable. +</p></blockquote></div> + +<div class="defun"> +&mdash; Applicative: <b>vector-&gt;string</b> (<var>vector-&gt;string vector</var>)<var><a name="index-vector_002d_003estring-363"></a></var><br> +&mdash; Applicative: <b>string-&gt;vector</b> (<var>string-&gt;vector string</var>)<var><a name="index-string_002d_003evector-364"></a></var><br> +<blockquote><p>These applicatives convert between vectors and strings. If a vector +containing objects other than characters is poassed to +<code>vector-&gt;string</code>, an error is signaled. The objects returned by +these applicatives are always mutable. +</p></blockquote></div> + +<div class="defun"> +&mdash; Applicative: <b>vector-copy!</b> (<var>vector-copy! vector1 vector2</var>)<var><a name="index-vector_002dcopy_0021-365"></a></var><br> +<blockquote><p>vector2 should have a length greater than or equal to +that of vector1. + + <p>Copies the values in vector1 to the corresponding positions in +vector2. If vector2 is immutable, an error is signaled. The result +returned by <code>vector-copy!</code> is inert. +</p></blockquote></div> + +<div class="defun"> +&mdash; Applicative: <b>vector-copy-partial</b> (<var>vector-copy-partial vector k1 k2</var>)<var><a name="index-vector_002dcopy_002dpartial-366"></a></var><br> +<blockquote><p>Both <code>k1</code> &amp; <code>k2</code> should be valid indexes in +<code>vector</code>. Also it should be the case that <code>k1 &lt;= k2</code>. + + <p>Applicative <code>vector-copy-partial</code> constructs and returns a new +mutable vector with length <code>k2 - k1</code>, with the objects from +<code>vector</code>, starting at index <code>k1</code> (inclusive) and ending at +index <code>k2</code> (exclusive). +</p></blockquote></div> + +<div class="defun"> +&mdash; Applicative: <b>vector-copy-partial!</b> (<var>vector-copy-partial! vector1 k1 k2 vector2 k3</var>)<var><a name="index-vector_002dcopy_002dpartial_0021-367"></a></var><br> +<blockquote><p>Both <code>k1</code> &amp; <code>k2-1</code> should be valid indexes in +<code>vector1</code>. Also it should be the case that <code>k1 &lt;= k2</code>. +Both <code>k3</code> &amp; <code>k3 + (k2-k1) - 1</code> should be valid indexes in +<code>vector2</code>. + + <p>Applicative <code>vector-copy-partial!</code> copies objects k1 (inclusive) +through k2 (exclusive) from <code>vector1</code> to the <code>k2-k1</code> +positions in <code>vector2</code> starting at <code>k3</code>. If <code>vector2</code> +is an immutable vector, an error is signaled. The result returned by +<code>vector-copy-partial!</code> is inert. +</p></blockquote></div> + +<div class="defun"> +&mdash; Applicative: <b>vector-fill!</b> (<var>vector-fill! vector obj</var>)<var><a name="index-vector_002dfill_0021-368"></a></var><br> +<blockquote><p>Applicative <code>vector-fill!</code> replaces all the objects in +<code>vector</code> with object <code>obj</code>. If <code>vector</code> is an +immutable vector, an error is signaled. The result +returned by <code>vector-fill!</code> is inert. +</p></blockquote></div> + +<div class="defun"> +&mdash; Applicative: <b>vector-&gt;immutable-vector</b> (<var>vector-&gt;immutable-vector vector</var>)<var><a name="index-vector_002d_003eimmutable_002dvector-369"></a></var><br> +<blockquote><p>Applicative <code>vector-&gt;immutable-vector</code> constructs and returns a +new immutable vector with the same length and objects as +<code>vector</code>. +</p></blockquote></div> + +<!-- *-texinfo-*- --> + </body></html> + diff --git a/doc/html/index.html b/doc/html/index.html @@ -53,6 +53,7 @@ Up:&nbsp;<a rel="up" accesskey="u" href="../index.html#dir">(dir)</a> <li><a href="Strings.html#Strings">Strings</a>: Strings module features. <li><a href="Characters.html#Characters">Characters</a>: Characters module features. <li><a href="Ports.html#Ports">Ports</a>: Ports module features. +<li><a href="Vectors.html#Vectors">Vectors</a>: Vectors module features. <li><a href="Libraries.html#Libraries">Libraries</a>: Libraries module features. <li><a href="System.html#System">System</a>: System module features. <!-- TODO add error objs to both klisp and the manual --> diff --git a/doc/klisp.info b/doc/klisp.info @@ -56,6 +56,7 @@ the header "Permission to copy this report", that reads: * Strings:: Strings module features. * Characters:: Characters module features. * Ports:: Ports module features. +* Vectors:: Vectors module features. * Libraries:: Libraries module features. * System:: System module features. * Alphabetical Index:: Index including concepts, functions, variables, @@ -2354,7 +2355,8 @@ compatibility with r7rs was preferred/simpler. -- Applicative: string-ref (string-ref string k) Applicative `string-ref' returns the character of `string' at position `k'. If `k' is out of bounds (i.e. less than `0' or - greater or equal than `(length string)') an error is signaled. + greater or equal than `(string-length string)') an error is + signaled. -- Applicative: string-set! (string-set! string k char) Applicative `string-set!' replaces the character with index `k' in @@ -2367,10 +2369,10 @@ compatibility with r7rs was preferred/simpler. error is signaled. -- Applicative: substring (substring string k1 k2) - Both `k1' & `k2' should be valid indexes in `string'. Also it + Both `k1' & `k2-1' should be valid indexes in `string'. Also it should be the case that `k1 <= k2'. - Applicative `substring' constructs and returns a new immutable + Applicative `substring' constructs and returns a new mutable string with length `k2 - k1', with the characters from `string', starting at index `k1' (inclusive) and ending at index `k2' (exclusive). @@ -2520,7 +2522,7 @@ features defined here were taken mostly from r7rs. base argument.  -File: klisp.info, Node: Ports, Next: Libraries, Prev: Characters, Up: Top +File: klisp.info, Node: Ports, Next: Vectors, Prev: Characters, Up: Top 17 Ports ******** @@ -3027,9 +3029,133 @@ klisp and was taken from r7rs. binding symbol `module-parameters' to the `environment' argument.  -File: klisp.info, Node: Libraries, Next: System, Prev: Ports, Up: Top +File: klisp.info, Node: Vectors, Next: Libraries, Prev: Ports, Up: Top + +18 Vectors +********** + +A vector is an object that contains a sequence of arbitrary klisp +objects. A vector has a length that is fixed at creation time, and as +many objects, indexed from `0' to `length-1'. Compared to lists, klisp +vectors use less size and have constant access time for any element. + + Vectors may be mutable or immutable. If an attempt is made to mutate +an immutable vector, an error is signaled. Two immutable vectors are +"eq?" iff they are "equal?". Two mutable vectors are "eq?" if they +were created by the same constructor call. Two mutable vectors are +"equal?" iff they have the same length and have "equal?" objects in +each position. As is the case for lists, in order to handle possibly +cyclic structures, the "equal?" algorithm considers vectors as FSMs +where it position is a state change. There is only one empty vector +(that is, a vector of length 0) and that vector is immutable. The +vector type is encapsulated. + + SOURCE NOTE: The report doesn't currently include vectors. They are +taken from r7rs scheme. + + -- Applicative: vector? (vector? . objects) + The primitive type predicate for type vector. `vector?' returns + true iff all the objects in `objects' are of type vector. + + -- Applicative: immutable-vector? (immutable-vector? objects) + -- Applicative: mutable-vector? (mutable-vector? objects) + The primitive type predicates for types immutable vector and + mutable vector. These return true iff all the objects in + `objects' are of type immutable vector or mutable vector + respectively. + + -- Applicative: make-vector (make-vector k [obj]) + Applicative `make-vector' constructs and returns a new mutable + vector of length `k'. If `obj' is specified, then all objects in + the returned vector are `obj', otherwise the content of the vector + is unspecified. + + -- Applicative: vector-length (vector-length vector) + Applicative `vector-length' returns the length of `vector'. + + -- Applicative: vector-ref (vector-ref vector k) + Applicative `vector-ref' returns the object of `vector' at + position `k'. If `k' is out of bounds (i.e. less than `0' or + greater or equal than `(vector-length vector)') an error is + signaled. + + -- Applicative: vector-set! (vector-set! vector k obj) + Applicative `vector-set!' replaces the object with index `k' in + `vector' with object `obj'. If `k' is out of bounds, or `vector' + is immutable, an error is signaled. The result returned by + `vector-set!' is inert. + + -- Applicative: vector (vector . objs) + Applicative `vector' contructs and return a new mutable vector + composed of the object arguments. + + -- Applicative: vector->list (vector->list vector) + -- Applicative: list->vector (list->vector objs) + These applicatives convert between vectors and lists. The objects + returned by these applicatives are always mutable. + + -- Applicative: vector-copy (vector-copy vector) + Applicative `vector-copy' constructs and returns a new mutable + vector with the same length and objects as `vector'. + + -- Applicative: vector->bytevector (vector->bytevector vector) + -- Applicative: bytevector->vector (bytevector->vector bytevector) + These applicatives convert between vectors and bytevectors. If a + vector containing objects other than exact integers between 0 and + 255 inclusive are passed to `vector->bytevector', an error is + signaled. The objects returned by these applicatives are always + mutable. + + -- Applicative: vector->string (vector->string vector) + -- Applicative: string->vector (string->vector string) + These applicatives convert between vectors and strings. If a + vector containing objects other than characters is poassed to + `vector->string', an error is signaled. The objects returned by + these applicatives are always mutable. + + -- Applicative: vector-copy! (vector-copy! vector1 vector2) + vector2 should have a length greater than or equal to that of + vector1. + + Copies the values in vector1 to the corresponding positions in + vector2. If vector2 is immutable, an error is signaled. The + result returned by `vector-copy!' is inert. + + -- Applicative: vector-copy-partial (vector-copy-partial vector k1 k2) + Both `k1' & `k2' should be valid indexes in `vector'. Also it + should be the case that `k1 <= k2'. + + Applicative `vector-copy-partial' constructs and returns a new + mutable vector with length `k2 - k1', with the objects from + `vector', starting at index `k1' (inclusive) and ending at index + `k2' (exclusive). + + -- Applicative: vector-copy-partial! (vector-copy-partial! vector1 k1 + k2 vector2 k3) + Both `k1' & `k2-1' should be valid indexes in `vector1'. Also it + should be the case that `k1 <= k2'. Both `k3' & `k3 + (k2-k1) - + 1' should be valid indexes in `vector2'. + + Applicative `vector-copy-partial!' copies objects k1 (inclusive) + through k2 (exclusive) from `vector1' to the `k2-k1' positions in + `vector2' starting at `k3'. If `vector2' is an immutable vector, + an error is signaled. The result returned by + `vector-copy-partial!' is inert. + + -- Applicative: vector-fill! (vector-fill! vector obj) + Applicative `vector-fill!' replaces all the objects in `vector' + with object `obj'. If `vector' is an immutable vector, an error + is signaled. The result returned by `vector-fill!' is inert. + + -- Applicative: vector->immutable-vector (vector->immutable-vector + vector) + Applicative `vector->immutable-vector' constructs and returns a + new immutable vector with the same length and objects as `vector'. + + +File: klisp.info, Node: Libraries, Next: System, Prev: Vectors, Up: Top -18 Libraries +19 Libraries ************ Libraries provide a way to organize klisp code with a clean & clear @@ -3206,7 +3332,7 @@ things (first class status, exposing of the library register, etc).  File: klisp.info, Node: System, Next: Alphabetical Index, Prev: Libraries, Up: Top -19 System +20 System ********* Module System contains some useful features for interacting with the @@ -3350,7 +3476,8 @@ Index * binary-port?: Ports. (line 43) * boolean?: Booleans. (line 12) * booleans: Booleans. (line 6) -* bytevector->string: Strings. (line 134) +* bytevector->string: Strings. (line 135) +* bytevector->vector: Vectors. (line 72) * bytevector-for-each: Control. (line 56) * bytevector-map: Combiners. (line 123) * bytevector-port?: Ports. (line 56) @@ -3505,6 +3632,7 @@ Index * ignore?: Environments. (line 28) * immutable-pair?: Pairs and lists. (line 35) * immutable-string?: Strings. (line 51) +* immutable-vector?: Vectors. (line 30) * inert: Control. (line 6) * inert?: Control. (line 11) * inexact?: Numbers. (line 98) @@ -3522,7 +3650,8 @@ Index * library?: Libraries. (line 47) * list: Pairs and lists. (line 82) * list*: Pairs and lists. (line 88) -* list->string: Strings. (line 130) +* list->string: Strings. (line 131) +* list->vector: Vectors. (line 63) * list-copy: Pairs and lists. (line 142) * list-neighbors: Pairs and lists. (line 266) * list-ref: Pairs and lists. (line 236) @@ -3539,6 +3668,7 @@ Index * make-library: Libraries. (line 55) * make-list: Pairs and lists. (line 133) * make-string: Strings. (line 78) +* make-vector: Vectors. (line 37) * map <1>: Combiners. (line 96) * map: Pairs and lists. (line 207) * max: Numbers. (line 213) @@ -3550,6 +3680,7 @@ Index * mod0: Numbers. (line 179) * mutable-pair?: Pairs and lists. (line 36) * mutable-string?: Strings. (line 52) +* mutable-vector?: Vectors. (line 31) * negative?: Numbers. (line 193) * newline: Ports. (line 251) * nil: Pairs and lists. (line 6) @@ -3611,30 +3742,31 @@ Index * sin: Numbers. (line 404) * sqrt: Numbers. (line 390) * string: Strings. (line 84) -* string->bytevector: Strings. (line 133) -* string->immutable-string: Strings. (line 124) -* string->list: Strings. (line 129) +* string->bytevector: Strings. (line 134) +* string->immutable-string: Strings. (line 125) +* string->list: Strings. (line 130) * string->number: Numbers. (line 420) * string->symbol: Symbols. (line 26) -* string->vector: Strings. (line 131) -* string-append: Strings. (line 115) +* string->vector <1>: Vectors. (line 80) +* string->vector: Strings. (line 132) +* string-append: Strings. (line 116) * string-ci<=?: Strings. (line 72) * string-ci<?: Strings. (line 71) * string-ci=?: Strings. (line 70) * string-ci>=?: Strings. (line 74) * string-ci>?: Strings. (line 73) -* string-copy: Strings. (line 119) -* string-downcase: Strings. (line 140) -* string-fill!: Strings. (line 101) -* string-foldcase: Strings. (line 142) +* string-copy: Strings. (line 120) +* string-downcase: Strings. (line 141) +* string-fill!: Strings. (line 102) +* string-foldcase: Strings. (line 143) * string-for-each: Control. (line 53) * string-length: Strings. (line 88) * string-map: Combiners. (line 120) * string-port?: Ports. (line 55) * string-ref: Strings. (line 91) -* string-set!: Strings. (line 96) -* string-titlecase: Strings. (line 141) -* string-upcase: Strings. (line 139) +* string-set!: Strings. (line 97) +* string-titlecase: Strings. (line 142) +* string-upcase: Strings. (line 140) * string<=?: Strings. (line 64) * string<?: Strings. (line 63) * string=?: Strings. (line 62) @@ -3642,7 +3774,7 @@ Index * string>?: Strings. (line 65) * string?: Strings. (line 47) * strings: Strings. (line 6) -* substring: Strings. (line 106) +* substring: Strings. (line 107) * symbol->string: Symbols. (line 22) * symbol?: Symbols. (line 18) * symbols: Symbols. (line 6) @@ -3655,9 +3787,24 @@ Index * undefined?: Numbers. (line 106) * unregister-requirement!: Ports. (line 466) * unwrap: Combiners. (line 72) -* vector->string: Strings. (line 132) +* vector: Vectors. (line 58) +* vector->bytevector: Vectors. (line 71) +* vector->immutable-vector: Vectors. (line 121) +* vector->list: Vectors. (line 62) +* vector->string <1>: Vectors. (line 79) +* vector->string: Strings. (line 133) +* vector-copy: Vectors. (line 67) +* vector-copy!: Vectors. (line 86) +* vector-copy-partial: Vectors. (line 94) +* vector-copy-partial!: Vectors. (line 104) +* vector-fill!: Vectors. (line 115) * vector-for-each: Control. (line 54) +* vector-length: Vectors. (line 43) * vector-map: Combiners. (line 121) +* vector-ref: Vectors. (line 46) +* vector-set!: Vectors. (line 52) +* vector?: Vectors. (line 26) +* Vectors: Vectors. (line 6) * with-error-to-file: Ports. (line 76) * with-input-from-file: Ports. (line 73) * with-output-to-file: Ports. (line 75) @@ -3673,38 +3820,39 @@ Index  Tag Table: Node: Top703 -Node: License2770 -Node: Introduction4452 -Node: Caveats7385 -Node: Kernel History8171 -Node: Conventions9616 -Node: Some Terms10287 -Node: Evaluation Notation10958 -Node: Printing Notation11979 -Node: Error Messages12455 -Node: Format of Descriptions13103 -Node: A Sample Applicative Description13667 -Node: Acknowledgements15430 -Node: Interpreter15816 -Ref: Command Line Options18116 -Ref: Interpreter Exit Status19050 -Node: Booleans20278 -Node: Equivalence22955 -Node: Symbols23748 -Node: Control25378 -Node: Pairs and lists29469 -Node: Environments48349 -Node: Combiners59022 -Node: Continuations65676 -Node: Encapsulations74219 -Node: Promises75672 -Node: Keyed Variables79827 -Node: Numbers82598 -Node: Strings105052 -Node: Characters112313 -Node: Ports116959 -Node: Libraries140660 -Node: System149419 -Node: Alphabetical Index152917 +Node: License2823 +Node: Introduction4505 +Node: Caveats7438 +Node: Kernel History8224 +Node: Conventions9669 +Node: Some Terms10340 +Node: Evaluation Notation11011 +Node: Printing Notation12032 +Node: Error Messages12508 +Node: Format of Descriptions13156 +Node: A Sample Applicative Description13720 +Node: Acknowledgements15483 +Node: Interpreter15869 +Ref: Command Line Options18169 +Ref: Interpreter Exit Status19103 +Node: Booleans20331 +Node: Equivalence23008 +Node: Symbols23801 +Node: Control25431 +Node: Pairs and lists29522 +Node: Environments48402 +Node: Combiners59075 +Node: Continuations65729 +Node: Encapsulations74272 +Node: Promises75725 +Node: Keyed Variables79880 +Node: Numbers82651 +Node: Strings105105 +Node: Characters112378 +Node: Ports117024 +Node: Vectors140723 +Node: Libraries146476 +Node: System155237 +Node: Alphabetical Index158735  End Tag Table diff --git a/doc/src/Makefile b/doc/src/Makefile @@ -10,6 +10,7 @@ srcs = klisp.texi index.texi \ promises.texi keyed_vars.texi \ numbers.texi strings.texi \ characters.texi ports.texi \ + vectors.texi \ libraries.texi system.texi #TODO add dvi/pdf output diff --git a/doc/src/klisp.texi b/doc/src/klisp.texi @@ -110,6 +110,7 @@ permission is granted to copy it in whole or in part without fee. * Strings:: Strings module features. * Characters:: Characters module features. * Ports:: Ports module features. +* Vectors:: Vectors module features. * Libraries:: Libraries module features. * System:: System module features. @c TODO add error objs to both klisp and the manual @@ -139,6 +140,7 @@ permission is granted to copy it in whole or in part without fee. @include strings.texi @include characters.texi @include ports.texi +@include vectors.texi @include libraries.texi @include system.texi diff --git a/doc/src/libraries.texi b/doc/src/libraries.texi @@ -1,7 +1,7 @@ @c -*-texinfo-*- @setfilename ../src/libraries -@node Libraries, System, Ports, Top +@node Libraries, System, Vectors, Top @comment node-name, next, previous, up @chapter Libraries diff --git a/doc/src/ports.texi b/doc/src/ports.texi @@ -1,7 +1,7 @@ @c -*-texinfo-*- @setfilename ../src/ports -@node Ports, Libraries, Characters, Top +@node Ports, Vectors, Characters, Top @comment node-name, next, previous, up @chapter Ports diff --git a/doc/src/strings.texi b/doc/src/strings.texi @@ -103,7 +103,7 @@ composed of the character arguments. @deffn Applicative string-ref (string-ref string k) Applicative @code{string-ref} returns the character of @code{string} at position @code{k}. If @code{k} is out of bounds (i.e. less than -@code{0} or greater or equal than @code{(length string)}) an error is +@code{0} or greater or equal than @code{(string-length string)}) an error is signaled. @end deffn @@ -120,10 +120,10 @@ immutable string, an error is signaled. @end deffn @deffn Applicative substring (substring string k1 k2) - Both @code{k1} & @code{k2} should be valid indexes in + Both @code{k1} & @code{k2-1} should be valid indexes in @code{string}. Also it should be the case that @code{k1 <= k2}. - Applicative @code{substring} constructs and returns a new immutable + Applicative @code{substring} constructs and returns a new mutable string with length @code{k2 - k1}, with the characters from @code{string}, starting at index @code{k1} (inclusive) and ending at index @code{k2} (exclusive). diff --git a/doc/src/vectors.texi b/doc/src/vectors.texi @@ -0,0 +1,145 @@ +@c -*-texinfo-*- +@setfilename ../src/vectors + +@node Vectors, Libraries, Ports, Top +@comment node-name, next, previous, up + +@chapter Vectors +@cindex Vectors + +A vector is an object that contains a sequence of arbitrary klisp +objects. A vector has a length that is fixed at creation time, and as +many objects, indexed from @code{0} to @code{length-1}. Compared to +lists, klisp vectors use less size and have constant access time for +any element. + +Vectors may be mutable or immutable. If an attempt is made to mutate +an immutable vector, an error is signaled. Two immutable vectors are +``eq?'' iff they are ``equal?''. Two mutable vectors are ``eq?'' if +they were created by the same constructor call. Two mutable vectors +are ``equal?'' iff they have the same length and have ``equal?'' +objects in each position. As is the case for lists, in order to +handle possibly cyclic structures, the ``equal?'' algorithm considers +vectors as FSMs where it position is a state change. There is only one +empty vector (that is, a vector of length 0) and that vector is +immutable. The vector type is encapsulated. + +SOURCE NOTE: The report doesn't currently include vectors. They are +taken from r7rs scheme. + +@deffn Applicative vector? (vector? . objects) +The primitive type predicate for type vector. @code{vector?} +returns true iff all the objects in @code{objects} are of type +vector. +@end deffn + +@deffn Applicative immutable-vector? (immutable-vector? objects) +@deffnx Applicative mutable-vector? (mutable-vector? objects) +The primitive type predicates for types immutable vector and mutable +vector. These return true iff all the objects in @code{objects} are of +type immutable vector or mutable vector respectively. +@end deffn + +@deffn Applicative make-vector (make-vector k [obj]) +Applicative @code{make-vector} constructs and returns a new mutable +vector of length @code{k}. If @code{obj} is specified, then all +objects in the returned vector are @code{obj}, otherwise the +content of the vector is unspecified. +@end deffn + +@deffn Applicative vector-length (vector-length vector) +Applicative @code{vector-length} returns the length of +@code{vector}. +@end deffn + +@deffn Applicative vector-ref (vector-ref vector k) +Applicative @code{vector-ref} returns the object of @code{vector} at +position @code{k}. If @code{k} is out of bounds (i.e. less than +@code{0} or greater or equal than @code{(vector-length vector)}) an +error is signaled. +@end deffn + +@deffn Applicative vector-set! (vector-set! vector k obj) +Applicative @code{vector-set!} replaces the object with index @code{k} +in @code{vector} with object @code{obj}. If @code{k} is out of +bounds, or @code{vector} is immutable, an error is signaled. The +result returned by @code{vector-set!} is inert. +@end deffn + +@deffn Applicative vector (vector . objs) +Applicative @code{vector} contructs and return a new mutable vector +composed of the object arguments. +@end deffn + +@deffn Applicative vector->list (vector->list vector) +@deffnx Applicative list->vector (list->vector objs) +These applicatives convert between vectors and lists. The objects +returned by these applicatives are always mutable. +@end deffn + +@deffn Applicative vector-copy (vector-copy vector) +Applicative @code{vector-copy} constructs and returns a new mutable +vector with the same length and objects as @code{vector}. +@end deffn + +@deffn Applicative vector->bytevector (vector->bytevector vector) +@deffnx Applicative bytevector->vector (bytevector->vector bytevector) +These applicatives convert between vectors and bytevectors. If a +vector containing objects other than exact integers between 0 and 255 +inclusive are passed to @code{vector->bytevector}, an error is +signaled. The objects returned by these applicatives are always +mutable. +@end deffn + +@deffn Applicative vector->string (vector->string vector) +@deffnx Applicative string->vector (string->vector string) +These applicatives convert between vectors and strings. If a vector +containing objects other than characters is passed to +@code{vector->string}, an error is signaled. The objects returned by +these applicatives are always mutable. +@end deffn + +@deffn Applicative vector-copy! (vector-copy! vector1 vector2) +vector2 should have a length greater than or equal to +that of vector1. + +Copies the values in vector1 to the corresponding positions in +vector2. If vector2 is immutable, an error is signaled. The result +returned by @code{vector-copy!} is inert. +@end deffn + +@deffn Applicative vector-copy-partial (vector-copy-partial vector k1 k2) +Both @code{k1} & @code{k2} should be valid indexes in +@code{vector}. Also it should be the case that @code{k1 <= k2}. + +Applicative @code{vector-copy-partial} constructs and returns a new +mutable vector with length @code{k2 - k1}, with the objects from +@code{vector}, starting at index @code{k1} (inclusive) and ending at +index @code{k2} (exclusive). +@end deffn + +@deffn Applicative vector-copy-partial! (vector-copy-partial! vector1 k1 k2 vector2 k3) +Both @code{k1} & @code{k2-1} should be valid indexes in +@code{vector1}. Also it should be the case that @code{k1 <= k2}. +Both @code{k3} & @code{k3 + (k2-k1) - 1} should be valid indexes in +@code{vector2}. + +Applicative @code{vector-copy-partial!} copies objects k1 (inclusive) +through k2 (exclusive) from @code{vector1} to the @code{k2-k1} +positions in @code{vector2} starting at @code{k3}. If @code{vector2} +is an immutable vector, an error is signaled. The result returned by +@code{vector-copy-partial!} is inert. +@end deffn + +@deffn Applicative vector-fill! (vector-fill! vector obj) +Applicative @code{vector-fill!} replaces all the objects in +@code{vector} with object @code{obj}. If @code{vector} is an +immutable vector, an error is signaled. The result +returned by @code{vector-fill!} is inert. +@end deffn + +@deffn Applicative vector->immutable-vector (vector->immutable-vector vector) +Applicative @code{vector->immutable-vector} constructs and returns a +new immutable vector with the same length and objects as +@code{vector}. +@end deffn