ammarbinfaisal / sahl

a programming language with channels and coroutines/threads
MIT License
9 stars 1 forks source link

loop's end register gets overridden by a function called in its body #61

Closed ammarbinfaisal closed 9 months ago

ammarbinfaisal commented 9 months ago
fun alloc(i: int) -> [int] {
    print(i, "\n");
    return make([int], 1000);
}

fun main() {
    for i in 0..1024 {
        print(len(alloc(i)), "\n");
    }
}

the loop only runs till 1000 instead of 1024