expressions of type range - Maple Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Programming : Flow Control : Iteration or Looping : range

.. - expressions of type range

Description

• 

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.

Thread Safety

• 

The .. operator is thread-safe as of Maple 15.

• 

For more information on thread safety, see index/threadsafe.

Examples

addi&comma;i&equals;1..3

6

(1)

1..3

1..3

(2)

`$`1..3

1&comma;2&comma;3

(3)

cata&comma;1..3

a1&comma;a2&comma;a3

(4)

A:=1&comma;2&comma;3&comma;4

A:=1&comma;2&comma;3&comma;4

(5)

A..2

1&comma;2

(6)

A3..

3&comma;4

(7)

See Also

concatenation, evalr, plot[range], selection, type[range]


Download Help Document

Was this information helpful?



Please add your Comment (Optional)
E-mail Address (Optional)
What is ? This question helps us to combat spam