**General:** ** Glee**
exhibits much of its power in its ability to manipulate elements of its data
objects. In this section, the principle methods of manipulating these elements
is presented, usually for each object. The principal objects are strings,
numerics, bit vectors, and sequences.

A principal requirement for indexing is the generation of
indices. Conventional languages typically do this with `for` loops.
Vector languages can attain efficiencies by preparing indices in advance. There
are several operators to facilitate this.

**( [n1..n2]) Range: **The
range operator (

**( ` )Index
generator:**The most common indices run from 1 to some "n" (usually
the number of elements in the object). The index generator produces such index
vectors .

**( `)Index of:** This is
a table lookup. But rather than returning data, it returns an index to the
data. The lowest index where the element occurs is returned. If the element is
not found, 0 is returned. The number of elements in the result is the number of
elements in the right argument.

**( ``)Indices of:**When
elements may appear more than once in a vector and you want the indices to all
locations, this is the operator to use. It always returns a sequence of numeric
vectors. That sequence contains the same number of elements as the right
argument. If an element on the right is not found on the left, a NULL vector is
returned in that position of the result.

**Indices of Group (
``& ):** A very common need in programming is to group chunks of
data by some key.

**( =)Unique:** This
operator proceeds through the argument weeding out extraneous occurrences of
elements.

**( ->)Last:** The last
(i.e. far right) element of the vector is returned. If the vector contains no
elements, the result is a single element vector containing a

**( ->)Right
Take/Drop:** Takes are used to align data. The direction of the operator
indicates the direction of the take. The right argument specifies the number of
elements for the result. If more elements are taken than exist, the far
opposite element is replicated. If the vector contains no elements, the result
if filled with

**( <-)First:** The first
(i.e. far left) element of the vector is returned. If the vector contains no
elements, the result is a single element vector containing a

**( <-)Left Take/Drop:**
Takes (or Drops) elements from the left end of the vector filling with elements
from the right. If the vector is empty to begin with, filling is with

**( >>)Grade
Up:**Grading a vector is like sorting. But rather than rearrange the
elements, the indices used for rearranging them is returned. This is useful if
a number of vectors are in correspondence with each other (e.g. Account Number
vector and a Balance vector). In these cases, you can get the grade indices for
one of the vectors and use it to rearrange both vectors.

**( <<)Grade Down:**
This operator returns indices for sorting elements of the vector in descending
order. See Grade up for details.

**( >>)Right
Shift:** Shift elements to the right in the vector and pull on the objects

**( <<)Left
Shift:**Shift elements to the left in the vector. See

**( >>>)Sort up:
** Sorts the elements in ascending order. This is a convenience operator. It
uses the

**( <<<)Sort
down:** Sorts the elements in descending order. See

**( |->|)Right
Rotate;|<-|)Left Rotate:** The rotate operators rotate elements
of a vector around in a loop. These operators have limited usefulness but serve
to fill out the complete set of

**( |->|) and
(|<-|) Flip:** Completely reverse the order of the elements. This
operator is useful for changing grades from up to down without the expense of a
complete new sort.

**( ~) Without:**This is a
powerful operator that removes elements from vectors.

**( /#)Count Each:**Some
operators return sequences of vectors (e.g.