Why can\'t i define a variable recursively in a code block?
scala> { | val test: Stream[Int] = 1 #:: test | } :9: error: forward
I'll add that when you write:
object O { val x = y val y = 0 }
You are actually writing this:
object O { val x = this.y val y = 0 }
That little this is what is missing when you declare this stuff inside a definition.
this