You are browsing as a guest. Sign up (or log in) to start making projects!

1h 42m 51s logged

Borrowed the “return expr if(cond)” syntax from ruby
Implemented Tail call optimization which optimizes away recursion on tail calls

Example:
Before:

str count(int amount) {
    return "Done!" if amount == 1;
    return count(amount - 1);
}

After:

str count(int amount) {
    int tco@argument@amount = amount;
    while (true) {
        if (tco@argument@amount == 1) return "Done !";
        tco@argument@amount = tco@argument@amount - 1;
    }
}
0
6

Comments 0

No comments yet. Be the first!