The Swift Programming Language book says:
Global constants and variables are always computed lazily, in a similar manner to Lazy Stored Properties. Unlike lazy stored properties, global constants and variables do not need to be marked with the lazy modifier.
Local constants and variables are never computed lazily.
I don't quite understand what does it mean. I made a test:
var a = print("A") print("B") var b = a
If they were lazy, I would expect it to print
B and then
A, but it prints
A and then
B. How is it lazy?