Add set index in list, and update lib+examples+tests
This commit is contained in:
parent
09ac16a42d
commit
3bccc227ba
12 changed files with 117 additions and 60 deletions
|
|
@ -3,14 +3,9 @@
|
|||
|
||||
fn range(from: int, to: int) -> (fn() -> (int, bool)) {
|
||||
i := from - 1
|
||||
end := to - 1
|
||||
|
||||
fn() -> (int, bool) {
|
||||
if i < end {
|
||||
(i = i+1, true)
|
||||
} else {
|
||||
(-1, false)
|
||||
}
|
||||
(i = i+1, i+1 < to)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue