<html><body><div style="font-family: arial, helvetica, sans-serif; font-size: 12pt; color: #000000"><div>Each time i re-read this JEP, i'm more and more sorry about its state.<br data-mce-bogus="1"></div><div>- we are breaking how Strings worked, now everything in between "..." is not a String anymore.</div><div> As an example, given a String s, only one of the following lines compiles<br data-mce-bogus="1"></div><div> System.out.println("s = \{s}".toUpperCase());<br data-mce-bogus="1"></div><div> System.out.println("s = {\s}".toUpperCase());<br data-mce-bogus="1"></div><div> </div><div>- conceptually we have something like<br data-mce-bogus="1"></div><div> instance -> template -> arguments<br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><div> but instead of grouping it like this<br data-mce-bogus="1"></div><div> Class.apply(template).invoke(instance, arguments)<br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><div> the JEP groups them like this<br data-mce-bogus="1"></div><div> instance.apply(new TemplatedString(template, arguments))<br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><div> which is far less efficient because both the class and the template are constants while the instance and the arguments are not.<br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><div>Rémi<br data-mce-bogus="1"></div><div><br></div><hr id="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>"Jim Laskey" <james.laskey@oracle.com><br><b>To: </b>"core-libs-dev" <core-libs-dev@openjdk.java.net><br><b>Sent: </b>Tuesday, October 25, 2022 6:41:05 PM<br><b>Subject: </b>RFR - Implementation of JEP-430 String Templates (Preview) CSR<br></blockquote></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="">Request for a broader review of the String Template APIs for JEP 430. </div>
<div class=""><br class="">
</div>
<div class="">Summary:</div>
<div class=""><br class="">
Enhance the Java programming language with string templates, which are similar to string literals but contain embedded expressions. A string template is interpreted at run time by replacing each expression with the result of evaluating that expression, possibly
after further validation and transformation. This is a preview language feature and API.</div>
<div class=""><br class="">
</div>
<div class="">CSR: <a href="https://bugs.openjdk.org/browse/JDK-8286021" class="" target="_blank">https://bugs.openjdk.org/browse/JDK-8286021</a><br data-mce-bogus="1"></div>
<div class="">JEP: <a href="https://openjdk.org/jeps/430" class="" target="_blank">https://openjdk.org/jeps/430</a><br data-mce-bogus="1"></div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class="">Thank you.</div>
<div class=""><br class="">
</div>
<div class="">— Jim</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div><br></blockquote></div></div></body></html>