All examples
Language

Lazy integer progressions

Iterate half open Int64 ranges without materializing elements and inspect constant time arithmetic membership.

Download .aner source
range_basic.aner
let samples: Range = Range(start: 0, stop: 10, step: 2)
print(samples.len())
print(samples.get(3))
print(samples.contains(6))
print(samples.find(7))
for index in samples {
    print(index)
}
for index in Range(start: 5, stop: 0, step: -2) {
    print(index)
}
print(Range(3, 3).is_empty())
print(dtype(samples))

Make it your experiment.

With Aner installed, save this program as examples/range_basic.aner inside a folder for your experiment. Open a terminal in that folder, then check and run the program.

Terminal
aner check examples/range_basic.aner
aner run examples/range_basic.aner

The aner command must be on your PATH. Follow the installation guide if your terminal cannot find it.

Use the compatible native Aner development engine with import free temporal, binary, Range, Optional and Result values, and VS Code extension 0.1.37 or newer. No import is required. Calendar values use Gregorian and explicit fixed offset contracts; Bytes uses strict explicit text encoding; Range is lazy; outcome payload access is checked. See each separate native value reference for exact ownership, resource limits and time/space complexity.

Iris and Wine are teaching datasets with their own attribution. Example outcomes are not comparative benchmarks or evidence of clinical validity.

Dataset sources & attribution
Install Aner