..
expressions of type range
Description
Thread Safety
Examples
expr .. expr
An expression of type range (also called type $\mathrm{..}$) has two operands, the left-hand side expression and the right-hand side expression.
A range is represented externally using the binary operator $\mathrm{..}$ 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 ${\mathrm{Typesetting}:-\mathrm{\_Hold}\left(\left[\mathrm{`\$`}\left(1..3\right)\right]\right)}}$ to yield the expression sequence.
Note that more than two dots in succession are also parsed as the range ($\mathrm{..}$) 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.
$\mathrm{add}\left(i\,i\=1..3\right)$
${6}$
$1..3$
${1}{..}{3}$
${\mathrm{`\$`}\left(1..3\right)}}$
${1}{,}{2}{,}{3}$
$\mathrm{cat}\left(a\,1..3\right)$
${\mathrm{a1}}{,}{\mathrm{a2}}{,}{\mathrm{a3}}$
$A\u2254\left[1\,2\,3\,4\right]$
${A}{\u2254}\left[{1}{\,}{2}{\,}{3}{\,}{4}\right]$
${A}_{\left(\right)..2}$
$\left[{1}{\,}{2}\right]$
${A}_{3..\left(\right)}$
$\left[{3}{\,}{4}\right]$
See Also
concatenation
evalr
plot/range
selection
type/range
Download Help Document
What kind of issue would you like to report? (Optional)