you can implement something like ``` class Once&lt...
# getting-started
c
you can implement something like
Copy code
class Once<T> : ReadWriteProperty<Any, T> {

    private var value: T? = null

    override fun getValue(thisRef: Any, property: KProperty<*>): T =
        value ?: throw IllegalStateException("Property has not been initialized")

    override fun setValue(thisRef: Any, property: KProperty<*>, value: T) {
        if (this.value != null) throw IllegalStateException("Property has already been initialized")
        this.value = value
    }

}
usage is
var s: String by Once()
and it will behave as you stated