# .. -- a binary operator, used for sequences of consecutive items

## Description

The most confusing thing about this operator, in all its guises, is that it is not a syntactic construction, and so the resulting sequences do not splice themselves into enclosing lists, as in each of the following examples.

 i1 : {10..10} o1 = {1 : (10)} o1 : List i2 : {10..8} o2 = {()} o2 : List i3 : {3..5,8..10} o3 = {(3, 4, 5), (8, 9, 10)} o3 : List

Use splice to fix that.

 i4 : splice {3..5,8..10} o4 = {3, 4, 5, 8, 9, 10} o4 : List

If a type of list, instead of a sequence, is desired, use toList or the operator new.

 i5 : 0..5 o5 = (0, 1, 2, 3, 4, 5) o5 : Sequence i6 : toList (0..5) o6 = {0, 1, 2, 3, 4, 5} o6 : List i7 : new Array from 0..5 o7 = [0, 1, 2, 3, 4, 5] o7 : Array i8 : new Sum from 0..5 o8 = 0 + 1 + 2 + 3 + 4 + 5 o8 : Expression of class Sum

The operator can be used with sequences or lists, whose elements are of various types, to produce rectangular intervals.

 i9 : (0,0)..(1,3) o9 = ((0, 0), (0, 1), (0, 2), (0, 3), (1, 0), (1, 1), (1, 2), (1, 3)) o9 : Sequence i10 : p_(0,a) .. p_(1,c) o10 = (p , p , p , p , p , p ) 0,a 0,b 0,c 1,a 1,b 1,c o10 : Sequence i11 : p_(1,1) .. q_(2,2) o11 = (p , p , p , p , q , q , q , q ) 1,1 1,2 2,1 2,2 1,1 1,2 2,1 2,2 o11 : Sequence

Use ..< instead to get a sequence that stops short of the endpoint.

## Ways to use symbol .. :

• "Expression .. Expression" -- see Expression -- the class of all expressions
• "Expression .. Holder" -- see Expression -- the class of all expressions
• "Expression .. Thing" -- see Expression -- the class of all expressions
• "Holder .. Expression" -- see Expression -- the class of all expressions
• "Holder .. Holder" -- see Expression -- the class of all expressions
• "Thing .. Expression" -- see Expression -- the class of all expressions
• IndexedVariable .. IndexedVariable -- sequences of consecutive indexed variables
• IndexedVariableTable .. IndexedVariableTable (missing documentation)
• IndexedVariableTable .. Thing (missing documentation)
• List .. List -- rectangular sequences of consecutive lists and sequences
• "Sequence .. Sequence" -- see List .. List -- rectangular sequences of consecutive lists and sequences
• MonoidElement .. MonoidElement (missing documentation)
• MonoidElement .. Thing (missing documentation)
• RingElement .. RingElement -- a sequence of consecutive generators of a polynomial ring
• RingElement .. Thing (missing documentation)
• String .. String -- a sequence of consecutive strings
• Symbol .. Symbol -- sequences of consecutive symbols
• Thing .. IndexedVariableTable (missing documentation)
• Thing .. MonoidElement (missing documentation)
• Thing .. RingElement (missing documentation)
• ZZ .. ZZ -- sequences of consecutive integers

## For the programmer

The object .. is .

This operator may be used as a binary operator in an expression like x..y. The user may install binary methods for handling such expressions with code such as

         X .. Y := (x,y) -> ...

where X is the class of x and Y is the class of y.