up previous next
1.3.5 Range Operator
If M and N are of type INT, then the expression: M .. N returns

* the list [M, M+1, ... , N] if M <= N;

* the empty list, [] , otherwise.

NOTE: Large values for M and N are not permitted; typically they should lie in the range about -10^9 to +10^9.

NOTE: see example for how to select a sub-range of a list

If x and y are indeterminates in a ring, then x .. y gives the indeterminates between x and y in the order they appear in the definition of the ring.

Example
/**/  1..10;
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]

/**/  Use R ::= QQ[x,y,z,a,b,c,d];
/**/  z..c;
[z, a, b, c]

/**/ L := [11, 22, 33, 44, 55];
/**/ PartOfL := L[2]..L[4];  --> probably *NOT* what you want!
/**/ PartOfL := [ L[k] | k in 2..4 ]; --> OK, this is RIGHT!