How can I return a function side-effecting lexical closure1 in Scala?
For instance, I was looking at this code sample in Go:
Slightly shorter, you don't need the return.
def fib() = { var a = 0 var b = 1 () => { val t = a; a = b b = t + b b } }