Fwd: [JEP 440] Question regarding removing support for record patterns appearing in the header of an enhanced for statement

Brian Goetz brian.goetz at oracle.com
Mon Nov 27 17:26:41 UTC 2023


The following was received on amber-spec-comments.

The answer is quite simple: we didn’t think that this sub-feature was ready.  As we look ahead at pattern-related features to come, it is clear that there are interactions with several of them (especially imperative matching), and it made sense to co-design those feature so as not to create a new constraint that those would have to be compatible with.

Begin forwarded message:

From: "Spaendonck, Flip van" <p.h.m.v.spaendonck at tue.nl<mailto:p.h.m.v.spaendonck at tue.nl>>
Subject: [JEP 440] Question regarding removing support for record patterns appearing in the header of an enhanced for statement
Date: November 22, 2023 at 5:40:49 AM EST
To: "amber-spec-comments at openjdk.org<mailto:amber-spec-comments at openjdk.org>" <amber-spec-comments at openjdk.org<mailto:amber-spec-comments at openjdk.org>>

Dear Amber Expert Group member,

I am a PhD candidate at Eindhoven University of Technology doing research into formally proving the correctness of automated restructurings of large legacy codebases.
The features that have come with JDK21 have been very useful when it comes to quickly delivering robust code, especially JEP 440 and its sibling JEP 441.
However, in JEP 440, it is noted that “the main change since the second preview is to remove support for record patterns appearing in the header of an enhanced for statement.”. I have tried my best to find the rationale behind this decision, but I can not find any comments on this on the internet, nor am I able to come up with a convincing argument, besides time/labor constraints, myself.
I certainly do not intend to start an argument on this decision, I am just hoping that perhaps one of the expert group members could give some explanation as to why it was decided to drop this feature.

With kind regards,

Flip van Spaendonck

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/amber-dev/attachments/20231127/a7eb172b/attachment-0001.htm>


More information about the amber-dev mailing list