By "5" you mean, like, 2, right? And "1" means 0?
Is this one of those Google interview questions?
This shows the closure evaluated twice by the function:
scala> callByName {
| println("calling")
| i += 1
| }
calling
calling
and then
scala> println(i)
4
That's after it was 2.
HTH.