package Kotlin101.Functions.TailRecursive

//make recursive functions safer (won't blow the stack)
tailRecursive fun loop(current : Int = 0, until : Int){
    if (current < until) {
        print("$current ")
        loop(current + 1, until)
    }
    else
        print("Finished")
}

fun main (Args : Array<String>){
    loop(until = 10)
}
Add tail call optimization example
Add tail call optimization example

dodyg/Kotlin101,mewebstudio/Kotlin101