<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 Light", "Helvetica Light", sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Hello, I don't think this proposal "reduce unintended side effects caused by variable mutations in nested blocks". This massively decreases the readability of code. Your purposed problem can be solved by declaring new non-final local variables in the nested
 scopes and making the main local variable final, and there is no proof that your proposed problem actually happens in development. You can search for Static Single-Assignment form for more efficient usages of variables that is both more human and machine friendly.
 Also on a side note, Java Language feature discussions usually happen on compiler-dev list.</div>
<div class="elementToProof" style="font-family: "Calibri Light", "Helvetica Light", sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class="elementToProof" style="font-family: "Calibri Light", "Helvetica Light", sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Regards, Chen Liang</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> jdk-dev <jdk-dev-retn@openjdk.org> on behalf of Alaa Mohamed <333alaamo@gmail.com><br>
<b>Sent:</b> Wednesday, May 21, 2025 8:54 PM<br>
<b>To:</b> jdk-dev@openjdk.java.net <jdk-dev@openjdk.java.net><br>
<b>Subject:</b> "Scoped Mutable Variables"</font>
<div> </div>
</div>
<div>
<div dir="rtl">
<div>
<div style="line-height:1.4; direction:ltr; margin-left:0px">
<p><span style="font-size:13.3341px; font-weight:700; color:rgb(0,0,0); letter-spacing:0em">Dear OpenJDK Reviewers and Community,</span></p>
</div>
<div style="line-height:1.4; direction:ltr; margin-left:0px">
<p><span style="font-size:13.3341px; font-weight:700; color:rgb(0,0,0); letter-spacing:0em">I hope this message finds you well.</span></p>
</div>
<div style="line-height:1.4; direction:ltr; margin-left:0px">
<p><span style="font-size:13.3341px; font-weight:700; color:rgb(0,0,0); letter-spacing:0em">Please find attached my draft Java Enhancement Proposal (JEP) titled "Scoped Mutable Variables" (JEP XXXX), which introduces a new variable declaration modifier scoped.
 This modifier allows variables to be mutable exclusively within a limited lexical scope (such as inside if, for, or while blocks) without affecting the variable’s value in the enclosing or global scope.</span></p>
</div>
<div style="line-height:1.4; direction:ltr; margin-left:0px">
<p><span style="font-size:13.3341px; font-weight:700; color:rgb(0,0,0); letter-spacing:0em">This proposal aims to reduce unintended side effects caused by variable mutations in nested blocks, thereby improving code safety and readability in large-scale Java
 projects.</span></p>
</div>
<div style="line-height:1.4; direction:ltr; margin-left:0px">
<p><span style="font-size:13.3341px; font-weight:700; color:rgb(0,0,0); letter-spacing:0em">I would appreciate any feedback or suggestions you may have on the design, naming, integration approach, or any other aspect of the proposal.</span></p>
</div>
<div style="line-height:1.4; direction:ltr; margin-left:0px">
<p><span style="font-size:13.3341px; font-weight:700; color:rgb(0,0,0); letter-spacing:0em">Please find the full proposal text attached (or below).</span></p>
</div>
<div style="line-height:1.4; direction:ltr; margin-left:0px">
<p><span style="font-size:13.3341px; font-weight:700; color:rgb(0,0,0); letter-spacing:0em">Thank you very much for your time and consideration.</span></p>
</div>
<div style="line-height:1.4; direction:ltr; margin-left:0px">
<p><span style="font-size:13.3341px; font-weight:700; color:rgb(0,0,0); letter-spacing:0em">Best regards,</span><br>
<span style="font-size:13.3341px; font-weight:700; color:rgb(0,0,0); letter-spacing:0em">Alaa Mohamed</span><br>
<span style="font-size:13.3341px; font-weight:700; color:rgb(0,0,0); letter-spacing:0em">[Your email]</span><br>
<span style="font-size:13.3341px; font-weight:700; color:rgb(0,0,0); letter-spacing:0em">[
</span><a href="https://github.com/alaa-333/scoped-variable-jep.git" style="font-size:13.3341px; font-weight:700; color:rgb(0,0,0); letter-spacing:0em">GitHub - alaa-333/scoped-variable-jep</a><span style="font-size:13.3341px; font-weight:700; color:rgb(0,0,0); letter-spacing:0em">
 ] </span></p>
</div>
<div style="line-height:1.4; direction:ltr; margin-left:0px">
<p><span style="font-size:13.3341px; font-weight:700; color:rgb(0,0,0); letter-spacing:0em">[ LinkedIn :
</span><a href="https://www.linkedin.com/in/alaa-mohamed-1468a3304?lipi=urn%3Ali%3Apage%3Ad_flagship3_profile_view_base_contact_details%3BOH8SwytOQoO2HCH0VxvdBA%3D%3D"><span style="font-size:13.3341px; font-weight:700; color:rgb(26,98,255); letter-spacing:0em">https://www.linkedin.com/in/alaa-mohamed-1468a3304?lipi=urn%3Ali%3Apage%3Ad_flagship3_profile_view_base_contact_details%3BOH8SwytOQoO2HCH0VxvdBA%3D%3D</span></a><span style="font-size:13.3341px; font-weight:700; color:rgb(0,0,0); letter-spacing:0em">
 ]</span><br>
<span style="font-size:13.3341px; font-weight:700; color:rgb(0,0,0); letter-spacing:0em">Also for more details :
</span><a href="https://drive.google.com/file/d/1P-k9XfpRzLdnuOYUpBUFfPaHBGWHjM9z/view?usp=sharing" style="font-size:13.3341px; font-weight:700; color:rgb(0,0,0); letter-spacing:0em">Java Enhancement Proposal (JEP) (1).pdf</a></p>
</div>
</div>
</div>
</div>
</body>
</html>