..

m .. n -- produces a sequence of integers in the range from m to n inclusive. If n is less than m then the result is an empty sequence.

The most confusing thing about this operator is that it is not a syntactic construction, and so the resulting sequences do not splice themselves into enclosing lists. See splice for that.

     i1 = 1..5
     
     o1 = 1,2,3,4,5
     
     o1 : Sequence
     
     i2 = {1..5}
     
     o2 = {(1,2,3,4,5)}
     
     o2 : List
     
     i3 = elements(1..5)
     
     o3 = {1,2,3,4,5}
     
     o3 : List
     
     i4 = {10..10}
     
     o4 = {(seq 10)}
     
     o4 : List
     
     i5 = {10..8}
     
     o5 = {()}
     
     o5 : List
     
     i6 = {3..5,8..10}
     
     o6 = {(3,4,5),(8,9,10)}
     
     o6 : List
     
     i7 = splice {3..5,8..10}
     
     o7 = {3,4,5,8,9,10}
     
     o7 : List
     

a .. i -- produces a sequence of indeterminates for use as variables in polynomial rings.

     i8 = a .. i
     
     o8 = a,b,c,d,e,f,g,h,i
     
     o8 : Sequence
     

x_0 .. x_9 -- produces a sequence of indexed variables for use in polynomial rings.

     i9 = x_0 .. x_9
     
     o9 = x ,x ,x ,x ,x ,x ,x ,x ,x ,x
           0  1  2  3  4  5  6  7  8  9
     
     o9 : Sequence
     
     i10 = x_(t_0) .. x_(t_5)
     
     o10 = x  ,x  ,x  ,x  ,x  ,x
            t   t   t   t   t   t
             0   1   2   3   4   5
     
     o10 : Sequence
     
     i11 = x_a .. x_e
     
     o11 = x ,x ,x ,x ,x
            a  b  c  d  e
     
     o11 : Sequence
     

Note: can be used with sequences or lists to produce rectangular intervals.

     i12 = (0,0)..(1,3)
     
     o12 = (0,0),(0,1),(0,2),(0,3),(1,0),(1,1),(1,2),(1,3)
     
     o12 : Sequence
     
     i13 = p_(0,a) .. p_(1,c)
     
     o13 = p   ,p   ,p   ,p   ,p   ,p
            0,a  0,b  0,c  1,a  1,b  1,c
     
     o13 : Sequence
     

See also lists, arrays, and sequences.

Go to main index.

Go to concepts index.