Given there is destructuring declaration, why not destructing assignment?
Sample use case:
fun localFibonacci(n:Int) = buildSequence{
var (a, b) = Pair(0,1) // can use destructing here
while(a < n) {
yield(a)
// (a, b) = Pair(b, a+b) // so why not here when it very useful
val (tempa, tempb) = Pair(b, a+b) // need to do these three lines in place of the one above
a = tempa // only because needed temporary values
b = tempb // even a third line needed when one should suffice
}
}
// sample call
println("fib is ${localFibonacci(50).toList()}")
Surely this would be simple to add, and fits with the idiom of being pragmatic?