Re:Java's records, Lombok's data, and Kotlin's data classes
by pron on Friday May 07, 2021 @03:59PM
(#27080239)
I don't think they offer more. Deconstructing patterns and "reconstructors" (generalised "withers") are on the way. And Java features are often designed as a complete whole: some of the feature is in the language, some in the core libraries, and some, even, in the VM. In the case of records, they're treated in a special way by the runtime (e.g. in serialisation).
[ Parent
| on HN ]
Re:Java's records, Lombok's data, and Kotlin's data classes
by valenterry on Friday May 07, 2021 @09:09PM
(#27082669)
Well I said "they offer more" and not "they will always offer more". So I stand by what I said.
> In the case of records, they're treated in a special way by the runtime (e.g. in serialisation).
Scala will use them as underlying implementation (just like it will do with value-types, functions and so on).