<!DOCTYPE html><html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<div class="markdown-here-wrapper" data-md-url="" style="" markdown-here-wrapper-content-modified="true">
<p style="margin: 0px 0px 1.2em !important;">Hi<br>
Is not all that rosy :-) Comments inline</p>
<p style="margin: 0px 0px 1.2em !important;">On 15/03/2024 13:48,
Victor Nazarov wrote:</p>
<p style="margin: 0px 0px 1.2em !important;"></p>
<div class="markdown-here-exclude">
<p></p>
<blockquote type="cite" cite="mid:CAFOkWZbF5m-LB6zCqYrEYugd3GNyouVTXCpLCqn9uwx5vQhLag@mail.gmail.com">
<div>I think the above can be translated almost word for word
to StringTemplates world:</div>
<div><br>
</div>
<div>
<div>* stringy-literal that doesn't have holes-with-values
can be both String and StringTemplate<br>
</div>
<div>* stringy-literal that has holes-with-values can only
be StringTemplate</div>
<div>* m(String),m(StringTemplate) with stringy-literal that
can be both String and StringTemplate selects
String-overload</div>
* t = s works as when t is StringTemplate and s is String<br>
</div>
</blockquote>
<p></p>
</div>
<p style="margin: 0px 0px 1.2em !important;"></p>
<p style="margin: 0px 0px 1.2em !important;">I assume you mean “s
is a <em>constant</em> String” here.</p>
<p style="margin: 0px 0px 1.2em !important;"></p>
<div class="markdown-here-exclude">
<p></p>
<blockquote type="cite" cite="mid:CAFOkWZbF5m-LB6zCqYrEYugd3GNyouVTXCpLCqn9uwx5vQhLag@mail.gmail.com">
<div>
<div>
<div>* s = t is compile-time error<br>
</div>
<div>
<div>
<div>* s = (String) t succeeds, when s is String and t
is StringTemplate (and does string concatenation)<br>
</div>
</div>
</div>
</div>
</div>
</blockquote>
<p></p>
</div>
<p style="margin: 0px 0px 1.2em !important;"></p>
<p style="margin: 0px 0px 1.2em !important;">Ok, here I note that
you are defining cast conversion from StringTemplate to String
as always successful (via interpolation).</p>
<p style="margin: 0px 0px 1.2em !important;"></p>
<div class="markdown-here-exclude">
<p></p>
<blockquote type="cite" cite="mid:CAFOkWZbF5m-LB6zCqYrEYugd3GNyouVTXCpLCqn9uwx5vQhLag@mail.gmail.com">
<div>
<div>
<div>
<div>* t instanceof String succeeds on StringTemplate
variable t as long as t doesn't have any
holes-with-values<br>
</div>
</div>
</div>
</div>
</blockquote>
<p></p>
</div>
<p style="margin: 0px 0px 1.2em !important;"></p>
<p style="margin: 0px 0px 1.2em !important;">This is inconsistent.
You now have cases where “t instanceof String” returns false,
but where (String)t succeds.</p>
<p style="margin: 0px 0px 1.2em !important;"></p>
<div class="markdown-here-exclude">
<p></p>
<blockquote type="cite" cite="mid:CAFOkWZbF5m-LB6zCqYrEYugd3GNyouVTXCpLCqn9uwx5vQhLag@mail.gmail.com">
<div>
<div>
<div>
<div>* s instanceof StringTemplate succeeds when s is
String<br>
</div>
</div>
</div>
</div>
</blockquote>
<p></p>
</div>
<p style="margin: 0px 0px 1.2em !important;"></p>
<p style="margin: 0px 0px 1.2em !important;">Again, probably you
mean “constant String” here.</p>
<p style="margin: 0px 0px 1.2em !important;"></p>
<div class="markdown-here-exclude">
<p></p>
<blockquote type="cite" cite="mid:CAFOkWZbF5m-LB6zCqYrEYugd3GNyouVTXCpLCqn9uwx5vQhLag@mail.gmail.com">
<div>
<div>
<div>
<div>* additionally stringy-literal can use "t" or "T"
*suffix* to denote that it is really a template, this
can be used to tweak overload-selection and to
certify, that some processing of values is expected</div>
</div>
</div>
</div>
</blockquote>
<p></p>
</div>
<p style="margin: 0px 0px 1.2em !important;"></p>
<p style="margin: 0px 0px 1.2em !important;">Overall, while I
agree this is not completely terrible, we are signing up for a
lot of work here. There’s new conversion, relationship with
pattern matching and instanceof to figure out, possible issues
with overload resolution and inference. For instance, yesterday
I mentioned this example:</p>
<pre style="font-size: 0.85em; font-family: Consolas, Inconsolata, Courier, monospace;font-size: 1em; line-height: 1.2em;margin: 1.2em 0px;"><code style="font-size: 0.85em; font-family: Consolas, Inconsolata, Courier, monospace;margin: 0px 0.15em; padding: 0px 0.3em; white-space: pre-wrap; border: 1px solid rgb(234, 234, 234); background-color: rgb(248, 248, 248); border-radius: 3px; display: inline;white-space: pre; overflow: auto; border-radius: 3px; border: 1px solid rgb(204, 204, 204); padding: 0.5em 0.7em; display: block !important;">List<StringTemplate> ls = List.of("Hello");
</code></pre>
<p style="margin: 0px 0px 1.2em !important;">Which won’t work. One
way to look at it, is that it’s as broken as:</p>
<pre style="font-size: 0.85em; font-family: Consolas, Inconsolata, Courier, monospace;font-size: 1em; line-height: 1.2em;margin: 1.2em 0px;"><code style="font-size: 0.85em; font-family: Consolas, Inconsolata, Courier, monospace;margin: 0px 0.15em; padding: 0px 0.3em; white-space: pre-wrap; border: 1px solid rgb(234, 234, 234); background-color: rgb(248, 248, 248); border-radius: 3px; display: inline;white-space: pre; overflow: auto; border-radius: 3px; border: 1px solid rgb(204, 204, 204); padding: 0.5em 0.7em; display: block !important;"> List<Long> ls = List.of(1);
</code></pre>
<p style="margin: 0px 0px 1.2em !important;">But another way to
look at it is that we’re adding more complexity to a part of the
language that already is shaky. To me that feels like a big
risk, especially given that the "payoff" is to leave an extra
“t” out at the beginning of the template. In orther words, we
should be careful about right-sizing complexity.<br>
</p>
<p style="margin: 0px 0px 1.2em !important;">Also, regarding:</p>
<p style="margin: 0px 0px 1.2em !important;"></p>
<div class="markdown-here-exclude">
<p></p>
<blockquote type="cite">
<div>2) avoiding proliferation of String-literal sublanguages
as advocated by Brian Goetz</div>
</blockquote>
<p></p>
</div>
<p style="margin: 0px 0px 1.2em !important;"></p>
<p style="margin: 0px 0px 1.2em !important;">I don’t read that in
the same way as you do. I think what Brian meant is that
anything inside quotes should be uniform. We would not like to
have different kinds of rules for escaping etc. depending on
what kind of literal you use. In that sense, sticking a “t” in
front is no different from using “”” to denote that what’s
coming is a text block.</p>
<p style="margin: 0px 0px 1.2em !important;">Maurizio</p>
<div title="MDH:PHA+SGk8YnI+SXMgbm90IGFsbCB0aGF0IHJvc3kgOi0pIENvbW1lbnRzIGlubGluZTxicj48L3A+
PGRpdiBjbGFzcz0ibW96LWNpdGUtcHJlZml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