2017-08-27

vector processing

part of sph-lib

(sph vector)

- alist-values->vector
- sph-vector-description
- vector-accessor
- vector-append
- vector-copy*
- vector-delete-duplicates
- vector-deselect
- vector-each
- vector-each-with-index
- vector-extend
- vector-first
- vector-index-value
- vector-map-with-index
- vector-object
- vector-range
- vector-second
- vector-select
- vector-third
- vector-update

procedure## signature

## description

alist ->

create a vector of alist values

variable

procedure## signature

## description

index ->

integer -> procedure:{vector -> any}

returns a procedure that when called with a vector returns the value at index

procedure## signature

## description

a b ->

concatenate "b" at the end of "a".

#(1 2) #(3 4) -> #(1 2 3 4)

create a new bigger vector and copy all elements of "a" and "b" to it

procedure## signature

## description

a proc ->

call proc with a copy of vector and after proc finishes return it

procedure## signature

## description

a [equal?] ->

vector [procedure] -> vector

creates a new vector with duplicate elements removed

procedure## signature

## description

a indices ->

vector (integer ...) -> vector

return a new, possibly smaller, vector consisting of values not at specified indices

procedure## signature

proc vecs ... ->

procedure## signature

## description

proc a [index-offset] ->

procedure vector [integer] -> unspecified

proc is called as (proc element index).

index-offset is added to the actual index that is passed to proc

procedure## signature

## description

a add-size ->

vector integer -> vector

increase size of vector.

new slots are appended to vector

procedure## signature

a ->

procedure## signature

## description

a value [equal-proc] ->

vector any [procedure] -> integer/falso

find the index in vector at which value occurs or return false

procedure## signature

## description

proc a ->

procedure {any integer -> any} vector -> vector

map each vector element suppliing its index to the

mapping procedure and result in a new vector

procedure## signature

## description

a ->

vector -> procedure:{integer -> any}

returns a procedure that when called with an index returns the value at index

procedure## signature

## description

a start [end] ->

vector [integer integer] -> vector

get a sub-vector.

start and end are inclusive

procedure## signature

a ->

procedure## signature

## description

a indices ->

vector (integer ...) -> vector

return a new vector consisting of values at indices specified by vector indices

procedure## signature

a ->

procedure## signature

## description

a index/value ... ->

vector [integer any] ... -> vector

create a copy of the given vector with values at indices set to new values.

index and value are given alternatingly.

example: (vector-update myvector 1 # 4 #)