<@U0BHS1Y07> &gt; What's the point of having a se...
# stdlib
i
@voddan
What's the point of having a separate wrapper for desctructuring?
The wrapper changes the group numbering, so that
component1
corresponds to the group with index 1, rather than 0. We had experimented with the design when
MatchResult
can be destructured immediately, but found that very confusing https://discuss.kotlinlang.org/t/public-review-of-the-standard-library-apis-closed/1362/76
👍 1
v
I understand the concerns, but frankly
text.replace(){ (_, first, second) -> }
is much better than no lambda destructuring at all
@ilya.gorbunov From what I have read in the discussion, lambda destructuring or destructuring with a placeholder
_
were not even talked about, despite them being on the table at the times of 1.0.