<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div class="elementToProof"><span style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="ContentPasted0 ContentPasted1">Maybe certain values for float and double should
 be allowable (e.g. NaN (matching all variants), POSITIVE_INFINITY, NEGATIVE_INFINITY and zero (matching any zero value))? These are clearly defined. All other values would render a compile-time error? (many question marks here) /P</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> amber-dev <amber-dev-retn@openjdk.org> on behalf of Remi Forax <forax@univ-mlv.fr><br>
<b>Sent:</b> Thursday, January 26, 2023 2:15 PM<br>
<b>To:</b> Angelos Bimpoudis <angelos.bimpoudis@oracle.com><br>
<b>Cc:</b> amber-dev <amber-dev@openjdk.org><br>
<b>Subject:</b> Re: Draft JEP on Primitive types in patterns, instanceof, and switch</font>
<div> </div>
</div>
<div>
<div style="font-family:arial,helvetica,sans-serif; font-size:12pt; color:#000000">
<div><br>
</div>
<div><br>
</div>
<hr id="x_zwchr" data-marker="__DIVIDER__">
<div data-marker="__HEADERS__">
<blockquote style="border-left:2px solid #1010FF; margin-left:5px; padding-left:5px; color:#000; font-weight:normal; font-style:normal; text-decoration:none; font-family:Helvetica,Arial,sans-serif; font-size:12pt">
<b>From: </b>"Angelos Bimpoudis" <angelos.bimpoudis@oracle.com><br>
<b>To: </b>"amber-dev" <amber-dev@openjdk.org><br>
<b>Sent: </b>Thursday, January 26, 2023 10:48:47 AM<br>
<b>Subject: </b>Draft JEP on Primitive types in patterns, instanceof, and switch<br>
</blockquote>
</div>
<div><style style="display:none">
<!--
p
        {margin-top:0;
        margin-bottom:0}
-->
</style></div>
<div data-marker="__QUOTED_TEXT__">
<blockquote style="border-left:2px solid #1010FF; margin-left:5px; padding-left:5px; color:#000; font-weight:normal; font-style:normal; text-decoration:none; font-family:Helvetica,Arial,sans-serif; font-size:12pt">
<div class="x_elementToProof x_ContentPasted0" style="font-family:"Segoe UI","Segoe UI ","Helvetica Neue",sans-serif; font-size:11pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
<span style="color:rgb(0,0,0); font-family:"Segoe UI","Segoe UI ","Helvetica Neue",sans-serif; font-size:11pt">Hello all,</span></div>
<div class="x_elementToProof x_ContentPasted0" style="font-family:"Segoe UI","Segoe UI ","Helvetica Neue",sans-serif; font-size:11pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
<span style="color:rgb(0,0,0); font-family:"Segoe UI","Segoe UI ","Helvetica Neue",sans-serif; font-size:11pt"><br>
</span></div>
<div class="x_elementToProof x_ContentPasted0" style="font-family:"Segoe UI","Segoe UI ","Helvetica Neue",sans-serif; font-size:11pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
<span style="color:rgb(0,0,0); font-family:"Segoe UI","Segoe UI ","Helvetica Neue",sans-serif; font-size:11pt">I would like to share this draft JEP with you about primitive types in patterns, instanceof, and switch:</span></div>
<div class="x_elementToProof x_ContentPasted0" style="font-family:"Segoe UI","Segoe UI ","Helvetica Neue",sans-serif; font-size:11pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
<div><br class="x_ContentPasted0">
</div>
<div class="x_ContentPasted0">https://openjdk.org/jeps/8288476</div>
<div><br class="x_ContentPasted0">
</div>
<div class="x_ContentPasted0">"Enhance pattern matching by allowing primitive types to appear anywhere in patterns. Extend instanceof to support primitive types, and extend switch to allow primitive constants as case labels."</div>
<div><br class="x_ContentPasted0">
</div>
<div class="x_ContentPasted0">Comments very much welcomed!</div>
<div class="x_ContentPasted0"><br>
</div>
<div class="x_ContentPasted0">Many thanks,</div>
<div class="x_ContentPasted0">Angelos</div>
<br>
</div>
</blockquote>
<div><br>
</div>
<div>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 data-mce-bogus="1">
</div>
<div><br data-mce-bogus="1">
</div>
<div>Allowing switching on double and float constants is just wrong.</div>
<div>Rust is actually trying to remove that feature<br>
</div>
<div>  <a href="https://github.com/rust-lang/rust/issues/41255">https://github.com/rust-lang/rust/issues/41255</a><br data-mce-bogus="1">
</div>
<div><br data-mce-bogus="1">
</div>
<div>I see no point to make the same mistake.<br data-mce-bogus="1">
</div>
<div><br data-mce-bogus="1">
</div>
<div>Otherwise, the rest is fine.<br data-mce-bogus="1">
</div>
<div><br data-mce-bogus="1">
</div>
<div>Rémi<br data-mce-bogus="1">
</div>
<div><br data-mce-bogus="1">
</div>
</div>
</div>
</div>
</body>
</html>