..
expressions of type range
Description
Thread Safety
Examples
expr .. expr
An expression of type range (also called type ..) has two operands, the left-hand side expression and the right-hand side expression.
A range is represented externally using the binary operator .. which simply acts as a placeholder in the same manner as the relational operators. For example, the range 1..3 is not equivalent to the expression sequence 1, 2, 3, but the sequence operator $ may be used in the form 1,...,3 to yield the expression sequence.
Note that more than two dots in succession are also parsed as the range (..) operator.
The range construct can also be used in combination with the concatenation operator to form an expression sequence, using the form cat(name, (range)) where the operands in range must be integers. The result is an expression sequence consisting of the names formed by concatenating name to each integer in the specified range.
Inside (), {}, [], and <>, ranges can be parsed without a beginning or end value. Literally, A[..] is evaluated to A[NULL..NULL], but if A is an Array, list, set, sequence, or string, A[..] is interpreted as the full range of data. Similarly A[..n] indicates the first n elements in A, and A[n..] indicates the range of data starting from n to the end of A.
The .. operator is thread-safe as of Maple 15.
For more information on thread safety, see index/threadsafe.
add⁡i,i=1..3
6
1..3
`$`⁡1..3
1,2,3
cat⁡a,1..3
a1,a2,a3
A≔1,2,3,4
A..2
1,2
A3..
3,4
See Also
concatenation
evalr
plot/range
selection
type/range
Download Help Document