Next: , Previous: , Up: Top   [Contents][Index]


3 Functional vectors

The following syntactic bindings are exported by the library (mmck fectors).

Function: make-fector size
Function: make-fector size fill

Return a fector of the specified size, which must be a non–negative integer. If the fill parameter is given, the locations of the fector are initialised to that object, otherwise their initial values are unspecified.

Function: fector obj

Return a fector whose initial values are given as arguments.

Function: fector? obj

Return #t if a given object is a fector, #f otherwise.

Function: fector-length fector

Return a non–negative integer representing the number of items that are stored in fector.

Function: build-fector size index->obj

Return a new fector of the given size, a non–negative integer, where each item is initialised to the value of the given function index->obj applied to its index.

Function: fector-ref fector index

Return the item associated with the given index in fector. If index is outside the range:

0 <= index < (fector-length fector)

then an error is raised.

Function: fector-set fector index item

Return a new fector equivalent to fector except the given index which is associated to item. If index is outside the range:

0 <= index < (fector-length fector)

then an &assertion is raised.

Function: list->fector list-of-items

Return a fector initialised with the contents of the given list.

Function: fector->list fector

Return a list containing the items in fector.

Function: fector=? obj1 obj2
Function: fector=? obj1 obj2 item=

Compare two fectors item by item: return #t if they are equal, otherwise return #f. For the comparison use the function item=, which defaults to eqv?.


Next: , Previous: , Up: Top   [Contents][Index]

This document describes version 0.6.0-devel.1 of MMCK Fectors.