<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: "Segoe UI", "Segoe UI Web (West European)", "Helvetica Neue", sans-serif; font-size: 11pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="elementToProof">
Thanks for the quick reply. </div>
<div style="font-family: "Segoe UI", "Segoe UI Web (West European)", "Helvetica Neue", sans-serif; font-size: 11pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="elementToProof">
<br>
</div>
<div style="font-family: "Segoe UI", "Segoe UI Web (West European)", "Helvetica Neue", sans-serif; font-size: 11pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="elementToProof">
I think there is one important factor here. By quickly inspecting the issues in the links, <span style="background-color:rgb(255, 255, 255);display:inline !important" class="ContentPasted0">IIUC,<span class="ContentPasted0 ContentPasted1 ContentPasted5"> the
semantics of floating-point constants there follow the semantics of <code>==</code>​. So -0 and 0 compare equal there (e.g., <a href="https://github.com/rust-lang/rust/issues/41620#issuecomment-300587182" id="LPNoLPOWALinkPreview">https://github.com/rust-lang/rust/issues/41620#issuecomment-300587182</a>). </span></span></div>
<div class="_Entity _EType_OWALinkPreview _EId_OWALinkPreview _EReadonly_1"></div>
<div style="font-family: "Segoe UI", "Segoe UI Web (West European)", "Helvetica Neue", sans-serif; font-size: 11pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="elementToProof">
<span style="background-color:rgb(255, 255, 255);display:inline !important" class="ContentPasted0"><span class="ContentPasted0 ContentPasted1"><br>
</span></span></div>
<div style="font-family: "Segoe UI", "Segoe UI Web (West European)", "Helvetica Neue", sans-serif; font-size: 11pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="elementToProof">
<span style="background-color:rgb(255, 255, 255);display:inline !important" class="ContentPasted0"><span class="ContentPasted0 ContentPasted1">The JEP follows the road
</span><span class="ContentPasted0 ContentPasted1 ContentPasted3" style="font-size: 11pt;">of "representation equivalence" as described in <a href="https://download.java.net/java/early_access/jdk20/docs/api/java.base/java/lang/Double.html#fpNumericalEq" style="margin:0px;background-color:rgb(255, 255, 255)" class="ContentPasted4">https://download.java.net/java/early_access/jdk20/docs/api/java.base/java/lang/Double.html#fpNumericalEq</a> </span></span></div>
<div style="font-family: "Segoe UI", "Segoe UI Web (West European)", "Helvetica Neue", sans-serif; font-size: 11pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="elementToProof">
<span style="background-color:rgb(255, 255, 255);display:inline !important" class="ContentPasted0"><span class="ContentPasted0 ContentPasted1 ContentPasted3" style="font-size: 11pt;"><br>
</span></span></div>
<div style="font-family: "Segoe UI", "Segoe UI Web (West European)", "Helvetica Neue", sans-serif; font-size: 11pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="elementToProof">
<span style="background-color:rgb(255, 255, 255);display:inline !important" class="ContentPasted0"><span class="ContentPasted0 ContentPasted1 ContentPasted3" style="font-size: 11pt;"><br>
</span></span></div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Remi Forax <forax@univ-mlv.fr><br>
<b>Sent:</b> 26 January 2023 14:16<br>
<b>To:</b> Angelos Bimpoudis <angelos.bimpoudis@oracle.com><br>
<b>Cc:</b> amber-spec-experts <amber-spec-experts@openjdk.org><br>
<b>Subject:</b> [External] : Re: Draft JEP on Primitive types in patterns, instanceof, and switch</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">> From: "Angelos Bimpoudis" <angelos.bimpoudis@oracle.com><br>
> To: "amber-dev" <amber-dev@openjdk.org><br>
> Sent: Thursday, January 26, 2023 10:48:47 AM<br>
> Subject: Draft JEP on Primitive types in patterns, instanceof, and switch<br>
<br>
> Hello all,<br>
<br>
> I would like to share this draft JEP with you about primitive types in patterns,<br>
> instanceof, and switch:<br>
<br>
> <a href="https://openjdk.org/jeps/8288476">https://openjdk.org/jeps/8288476</a><br>
<br>
> "Enhance pattern matching by allowing primitive types to appear anywhere in<br>
> patterns. Extend instanceof to support primitive types, and extend switch to<br>
> allow primitive constants as case labels."<br>
<br>
> Comments very much welcomed!<br>
<br>
> Many thanks,<br>
> Angelos<br>
<br>
I still think that the semantics proposed for pattern matching on primitive types is useless complexity with the perverse side effect of normalizing the usage of "default" in pattern matching (too many examples of this JEP are using "default") but we already
discussed that. <br>
<br>
Allowing switching on double and float constants is just wrong. <br>
Rust is actually trying to remove that feature <br>
[ <a href="https://urldefense.com/v3/__https://github.com/rust-lang/rust/issues/41255__;!!ACWV5N9M2RV99hQ!NfJ7KspB447oMGi0NoEyXC6s_w3vD1N-SBu5hiD4kMVAkmwDWPNbymH83iOnrkakPoayD6vwGwuB5NvedJfjH9LU$">
https://urldefense.com/v3/__https://github.com/rust-lang/rust/issues/41255__;!!ACWV5N9M2RV99hQ!NfJ7KspB447oMGi0NoEyXC6s_w3vD1N-SBu5hiD4kMVAkmwDWPNbymH83iOnrkakPoayD6vwGwuB5NvedJfjH9LU$</a> |
<a href="https://urldefense.com/v3/__https://github.com/rust-lang/rust/issues/41255__;!!ACWV5N9M2RV99hQ!NfJ7KspB447oMGi0NoEyXC6s_w3vD1N-SBu5hiD4kMVAkmwDWPNbymH83iOnrkakPoayD6vwGwuB5NvedJfjH9LU$">
https://urldefense.com/v3/__https://github.com/rust-lang/rust/issues/41255__;!!ACWV5N9M2RV99hQ!NfJ7KspB447oMGi0NoEyXC6s_w3vD1N-SBu5hiD4kMVAkmwDWPNbymH83iOnrkakPoayD6vwGwuB5NvedJfjH9LU$</a> ]
<br>
<br>
I see no point to make the same mistake. <br>
<br>
Otherwise, the rest is fine. <br>
<br>
Rémi<br>
</div>
</span></font></div>
</body>
</html>