"Scoped Mutable Variables"
Alaa Mohamed
333alaamo at gmail.com
Thu May 22 03:26:58 UTC 2025
Dear OpenJDK Reviewers and Community,
I hope this message finds you well.
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.
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.
I would appreciate any feedback or suggestions you may have on the design,
naming, integration approach, or any other aspect of the proposal.
Please find the full proposal text attached (or below).
Thank you very much for your time and consideration.
Best regards,
Alaa Mohamed
[ GitHub - alaa-333/scoped-variable-jep
<https://github.com/alaa-333/scoped-variable-jep.git> ]
[ LinkedIn :
https://www.linkedin.com/in/alaa-mohamed-1468a3304?lipi=urn%3Ali%3Apage%3Ad_flagship3_profile_view_base_contact_details%3BOH8SwytOQoO2HCH0VxvdBA%3D%3D
]
Also for more details : Java Enhancement Proposal (JEP) (1).pdf
<
https://drive.google.com/file/d/1P-k9XfpRzLdnuOYUpBUFfPaHBGWHjM9z/view?usp=sharing
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/jdk-dev/attachments/20250522/0e739afe/attachment.htm>
More information about the jdk-dev
mailing list