https://kotlinlang.org logo
#announcements
Title
# announcements
g

groostav

05/02/2017, 5:37 AM
blegh, is there an equatable lazy in kotlin?
m

marcinmoskala

05/02/2017, 7:29 AM
groostav: Not sure what you mean. I found nothing when I searched for "equatable lazy". I guess that you mean something like:
Copy code
lazy val a = getValOfA()
If so then there is no such thing. There is only lazy basing on property delegation:
Copy code
val a by lazy { getValOfA() }
But the result is nearly the same
g

groostav

05/02/2017, 5:33 PM
what I want is a lazy that performs equals on its value, ie
lazy { 42 } == lazy { 42 }
currently returns
false
4 Views