Is there a way to achieve the same thing, though? ...
# announcements
c
Is there a way to achieve the same thing, though? Overwrite the object we're attached to?
k
Not really, that's not how functions work in Kotlin. You could add something like
UByte.withUpperNibble(upper): UByte
that returns a new value instead.
👍 1
c
Ah well, good to know. Thanks for the help.
k
You don't want what Fortran allowed people to do in the old days. Call function(4), and have function (number) do number=number+1. Once that returns, everywhere you have 4 was treated as 5.