Feedback on JEP 468: Derived Record Creation

Brian Goetz brian.goetz at oracle.com
Fri Mar 29 16:17:16 UTC 2024


This concept has been discussed in several different forms on 
amber-spec-experts and amber-dev (for example, see the thread on "Scope 
for JEP 468: Derived record creation".)

On 3/27/2024 10:23 PM, Jos Angel George wrote:
> Hi Amber team,
>
> Super excited about JEP 468!
>
> Can we use the with syntax for Constructor as well? This syntax feels 
> very natural compared to the currently proposed record derivation 
> syntax (Builder vs toBuilder). For me, this will be the final missing 
> piece to ditch a library like Lombok.
>
> record Color(int r, int g, int b) { }
>
> Color c = Color with {
>   r = 100;
>   g = 50;
>   b = 200;
> }
>
> Color derived = c with { r = 75; }
>
> - Jos Angel George
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/amber-spec-comments/attachments/20240329/3d562908/attachment.htm>


More information about the amber-spec-comments mailing list