Re:Java 21: What’s New?
by valenterry on Thursday August 10, 2023 @02:53AM
(#37072831)
No, I think this only works on Java Records where it's clear what the identifiers are.
You are destructuring the object here, and since it is a record type that is nothing more than its typed, ordered fields listed in the constructor, you just use it as its reverse function here, basically.
Destructuring for other kind of objects are planned with user-defined destructors. But it does have plenty prior art, e.g. in haskell you can deconstruct lists arbitrarily like _:secondElem:rest would bind secondElem logically.
Which probably explains the person saying "I hate it".