From 59549a281ec897800ef97784e1ceb5cb8cf1d0d3 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Tue, 11 Sep 2012 21:34:47 -0700 Subject: Vector functions documented. --- txr.1 | 171 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 170 insertions(+), 1 deletion(-) diff --git a/txr.1 b/txr.1 index 23af993b..1571c0db 100644 --- a/txr.1 +++ b/txr.1 @@ -7470,7 +7470,7 @@ Syntax: .TP Description: -The replace-list function replaces a substring of with items from +The replace-str function replaces a substring of with items from , which may be any kind of sequence (list, vector or string) provided that it, if it is nonempty, it contains only characters. @@ -7914,30 +7914,199 @@ If there is no such character, then nil is returned. .SS Function vector +.TP +Syntax: + + (vector ) + +.TP +Description: + +The vector function creates and returns a vector object of the specified +length. The elements of the vector are initialized to nil. + .SS Function vectorp +.TP +Syntax: + + (vectorp ) + +.TP +Description: + +The vectorp function returns t if is a vector, otherwise it returns +nil. + .SS Function vec-set-length +.TP +Syntax: + + (vec-set-length ) + +.TP +Description: + +The vec-set-length modifies the length of , making it longer or +shorter. If the vector is made longer, then the newly added elements +are initialized to nil. The argument must be nonnegative. + +The return value is . + .SS Function vecref +.TP +Syntax: + + (vecref ) + +.TP +Description: + +The vecref function performs indexing into a vector. It retrieves +an element of at position , counted from zero. +The value must range from 0 to one less than the +length of the vector. The specified element is returned. + .SS Function vec-push +.TP +Syntax: + + (vec-push ) + +.TP +Description: + +The vec-push function extends the length of a vector by one element, and +sets the new element to the value . + +The previous length of the vector (which is also the position of ) +is returned. + +This function performs similarly to the generic function ref, except that the +first argument must be a vector. + .SS Function length-vec +.TP +Syntax: + + (length-vec ) + +.TP +Description: + +The length-vec function returns the length of vector . It performs +similarly to the generic length function, except that the argument must +be a vector. + .SS Function size-vec +.TP +Syntax: + + (size-vec ) + +.TP +Description: + +The size-vec function returns the number of elements for which storage +is reserved in the vector vec. + +.TP +Notes: + +The length of the vector can be extended up to this size without any memory +allocation operations having to be performed. + .SS Function vector-list +.TP +Syntax: + + (vector-list ) + +.TP +Description: + +This function returns a vector which contains all of the same elements +and in the same order as list . + .SS Function list-vector +.TP +Syntax: + + (list-vector ) + +.TP +Description: + +The list-vector function returns a list of the elements of vector . + .SS Function copy-vec +.TP +Syntax: + + (copy-vec ) + +.TP +Description: + +The copy-vec function returns a new vector object of the same length +as and containing the same elements in the same order. + .SS Function sub-vec +.TP +Syntax: + + (sub-vec [ []]) + +.TP +Description: + +The sub-vec function extracts a subvector from . It is exactly like the +more generic function sub, except that it operates only on vectors. +For a description of the arguments and semantics, refer to the sub function. + .SS Function replace-vec +.TP +Syntax: + + (replace-vec [ []]) + +.TP +Description: + +The replace-vec function replaces a subrange of with items from +the item-sequence argument, which may be any kind of sequence (list, vector +or string). + +It is like the replace function, except that the first argument must be +a vector. + +For a description of the arguments and semantics, refer to the replace function. + .SS Function cat-vec +.TP +Syntax: + + (cat-vec ) + +.TP +Description: + +The argument is a list of vectors. The cat-vec function +produces a catenation of the vectors listed in . It returns +a single large vector formed by catenating those vectors together in +order. + .SH GENERIC SEQUENCE OPERATIONS .SS Function length -- cgit v1.2.3