also is there a `.field` equivalent in Kotlin for ...
# announcements
a
also is there a
.field
equivalent in Kotlin for constructors? I can't seem to find one, and it is really annoying to manually create the property definition...
s
a
.field
equivalent? What exactly are you looking for?
a
using my previous example I could do
Files.newBufferedWriter(logFile).field
in the
init{}
block
and get
writer
as a val which can be accessed outside the init block
s
oh, I see, you’re talking about a live template
I mean, I don’t know that that’s much more difficult than just writing
val writer = {the code you were going to write out}
after the init block
a
well in this case no
but I'm talking about if there is some calculated value in
init{}
which I want to use that calculated value to make another calculation to assign to a
val
or something