sure, but this is somewhat unexpected behavior to ...
# stdlib
k
sure, but this is somewhat unexpected behavior to me regardless. I think it would be assuming something that they don't want to assume. You could just do
val v2 = if (v1.v == 1) v1 else v1.copy(v = 1)
I do see your point but I think the stdlib and language in general was designed to be lean and orthogonal and let you do exactly what you want with their building blocks, not provide an exact feature for everything everyone might want