<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div class="elementToProof" style="font-family: Calibri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);">
Hey folks,</div>
<div class="elementToProof" style="text-align: left; text-indent: 0px; margin-top: 1em; margin-bottom: 1em; font-family: Calibri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);">
I'm really excited about the new Java features that keep getting added, and I had an idea I wanted to share. Have you thought about introducing a pattern matching feature similar to Scala’s, which allows for more concise and readable code?</div>
<div style="text-align: left; text-indent: 0px; margin-top: 1em; margin-bottom: 1em; font-family: Calibri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);">
In Scala, you can match a list that starts with a specific element without having to spell everything out. For example:</div>
<div class="elementToProof" style="font-family: Calibri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);">
case List(_, 2, _*) => "I only care that this list has 2 as the second element"<br>
case Person("Alice", age) => "It's Alice"<br>
<br>
This approach makes the code less verbose and lets you focus directly on the elements you care about. It’s a lot cleaner than extracting elements and comparing them separately, which is what we do now in Java.</div>
<div style="text-align: left; text-indent: 0px; margin-top: 1em; margin-bottom: 1em; font-family: Calibri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);">
I think adding something like this to Java would be a big win, making pattern matching more powerful and the code more readable.</div>
<div style="text-align: left; text-indent: 0px; margin-top: 1em; margin-bottom: 1em; font-family: Calibri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);">
Just wanted to throw this idea out there and see what you all think.</div>
<div class="elementToProof" style="text-align: left; text-indent: 0px; margin-top: 1em; margin-bottom: 1em; font-family: Calibri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);">
<br>
Kind Regards, <br>
Georgi Stoyanov</div>
<div id="Signature">
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);">
<br>
</div>
</div>
</body>
</html>