Hi
Based on my understanding of the explanation of lazy val memoization in
section 5.2.1, I would have thought that if I define the following function:
def func(i: => Int): Unit = {
lazy val cached = {
println("Calculating")
i * i
}
cached
Ah OK. So I am guessing I misunderstood section 5.2.1. The "cons" function
is only ever called once in this scenario?
On Tuesday, 10 April 2018 17:19:24 UTC+2, des.m...@gmail.com wrote:
>
> Hi
>
> Based on my understanding of the explanation of lazy val memoization in
> section 5.2.1, I would