Range Arrays
Alternatively a range expression can be used to generate an array with consecutive values.
[!IMPORTANT] µcad ranges include start and end point! This is different in many other programming languages. So in µcad
[1..3]results in[1,2,3].
std::debug::assert_eq([[1..5], [1, 2, 3, 4, 5]]);
std::debug::assert_eq([[-2..2], [-2, -1, 0, 1, 2]]);
The order of the endpoints of a range is important.
[6..1]; // error
[2..-2]; // error
Only Integer can be used as endpoint.
[1.0..2.0]; // parse_error