Hello, where can I find how exactly does `with (x)...
# announcements
w
Hello, where can I find how exactly does
with (x) {a() b() c()}
work? Do the
a()
and
b()
execute on the same instance of
x
, or do the result of
a()
can "update" the
x
, so the following methods run on what
a()
returned?
t
witoldsz: does this article from #feed help? https://medium.com/@rotxed/kotlin-a-deeper-look-8569d4da36f
btw, afai understood, it should be equivalent to have
x.a(); x.b()
, so I guess it
a()
is modifying
x
,
b()
will see the modified
x
k
The former. If you want the latter, just like in Java, it would just be
x.a().b().c()
.
w
Thanks