Feather::Vector

Last updated: 8th July 1999 at 10:50 BST

This package defines a new mutable object type "feather::vector" and a command "feather::vector" to create and manipulate objects of that type.


Object type

Description

A vector is basically a mutable version of the Tcl list. It has s similar set of operations as the list plus some extra ones which it can support because of its mutable nature.

It supports the following interfaces.


Command

Options

-contents
If this option is specified then the args are assumed to be containers and their contents are concatenated together and are used as the elements; otherwise the args are concatenated together and are used as the elements.

--
This marks the end of the options, even if the next argument starts with a -.

Arguments

arg ...

index
An index into the vector.

object
An object of unknown type.

start, end
Defines a range.

vector
A vector object.

Syntax

feather::vector append vector ?options? ?arg ...?
Appends the elements to the end of vector.
Valid options are -contents, and --

feather::vector contents vector
Returns a list containing the values stored in the vector.

feather::vector create ?options? ?arg ...?
Creates a vector object containing the elements and returns it.
Valid options are -contents, and --

feather::vector insert vector index ?options? ?arg ...?
Inserts the elements at the specified index.
Valid options are -contents, and --

feather::vector isa object
Returns 1 if object is a vector and 0 otherwise.

feather::vector narrow vector start end

feather::vector prepend vector ?options? ?args ...?
Prepends the elements to the start of the vector.
Valid options are -contents, and --

feather::vector range vector start end

Examples

% set v [feather::vector create 1 2 3 4]


[email protected]