Note: information on this page refers to Ceylon 1.0, not to the current release.
: (segmented range) operator
The segmented range operator creates a Range from its endpoints.
Usage
Range<Integer> ten = 1:10;
Description
Definition
The lhs:rhs operator is defined in pseudocode as:
rhs <=0 then [] else Range(lhs, {lhs++ rhs times} )
See the language specification for more details.
Polymorphism
The : operator is not polymorphic.
The meaning of : depends on the
Range
class.
Type
The result type of the lhs:rhs operator is Lhs[] where Lhs is the type of lhs.
See also
..(spanned range)- object creation operators in the language specification
- operator precedence in the language specification
- Operator polymorphism in the Tour of Ceylon