mirror of
https://github.com/wren-lang/wren.git
synced 2026-01-12 06:38:45 +01:00
Still need to implement better semantics, but this is an important first step. It's much faster now too, which is good.
12 lines
352 B
Plaintext
12 lines
352 B
Plaintext
var range = 1..3
|
|
IO.print(range.iteratorValue(1)) // expect: 1
|
|
IO.print(range.iteratorValue(2)) // expect: 2
|
|
IO.print(range.iteratorValue(3)) // expect: 3
|
|
|
|
// Doesn't bother to bounds check.
|
|
IO.print(range.iteratorValue(-2)) // expect: -2
|
|
IO.print(range.iteratorValue(5)) // expect: 5
|
|
|
|
// Or type check.
|
|
IO.print(range.iteratorValue("s")) // expect: s
|