Skip to main content

All Questions

2 votes
2 answers
1k views

Is it a good idea to use "lazy val" for correctness?

In Scala, declaring a val as lazy means that its value won't be evaluated until it's used for the first time. This is often explained/demonstrated as being useful for optimization, in case a value ...
Joseph Sible-Reinstate Monica's user avatar