<div dir="ltr"><div class="markdown-here-wrapper" style=""><p style="margin:0px 0px 1.2em!important">I want to add an argument to push more the j.u.f.exceptionally approach I suggested.</p>
<p style="margin:0px 0px 1.2em!important">Just today someone in Reddit pointed out how String Templates have an inconsistent semantics with the j.u.function package, as they have the interface:</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 class="hljs language-java" 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;display:block;overflow-x:auto;padding:0.5em;color:rgb(51,51,51);background:rgb(248,248,248)">    <span class="hljs-annotation">@FunctionalInterface</span>
    <span class="hljs-keyword" style="color:rgb(51,51,51);font-weight:bold">public</span> <span class="hljs-class"><span class="hljs-keyword" style="color:rgb(51,51,51);font-weight:bold">interface</span> <span class="hljs-title" style="color:rgb(153,0,0);font-weight:bold;color:rgb(68,85,136);font-weight:bold">Processor</span><<span class="hljs-title" style="color:rgb(153,0,0);font-weight:bold;color:rgb(68,85,136);font-weight:bold">R</span>, <span class="hljs-title" style="color:rgb(153,0,0);font-weight:bold;color:rgb(68,85,136);font-weight:bold">E</span> <span class="hljs-keyword" style="color:rgb(51,51,51);font-weight:bold">extends</span> <span class="hljs-title" style="color:rgb(153,0,0);font-weight:bold;color:rgb(68,85,136);font-weight:bold">Throwable</span>> </span>{
        <span class="hljs-function">R <span class="hljs-title" style="color:rgb(153,0,0);font-weight:bold">process</span><span class="hljs-params">(StringTemplate st)</span> <span class="hljs-keyword" style="color:rgb(51,51,51);font-weight:bold">throws</span> E</span>;
    }
</code></pre>
<p style="margin:0px 0px 1.2em!important">If we had a j.u.f.exceptionally package, then not only it will be more consistent across the the standard library, it will unify a lot of functional interfaces:</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 class="hljs language-java" 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;display:block;overflow-x:auto;padding:0.5em;color:rgb(51,51,51);background:rgb(248,248,248)"><span class="hljs-keyword" style="color:rgb(51,51,51);font-weight:bold">import</span> java.util.function.exceptionally.Function;
[...]
    <span class="hljs-annotation">@FunctionalInterface</span>
    <span class="hljs-keyword" style="color:rgb(51,51,51);font-weight:bold">public</span> <span class="hljs-class"><span class="hljs-keyword" style="color:rgb(51,51,51);font-weight:bold">interface</span> <span class="hljs-title" style="color:rgb(153,0,0);font-weight:bold;color:rgb(68,85,136);font-weight:bold">Processor</span><<span class="hljs-title" style="color:rgb(153,0,0);font-weight:bold;color:rgb(68,85,136);font-weight:bold">R</span>, <span class="hljs-title" style="color:rgb(153,0,0);font-weight:bold;color:rgb(68,85,136);font-weight:bold">E</span> <span class="hljs-keyword" style="color:rgb(51,51,51);font-weight:bold">extends</span> <span class="hljs-title" style="color:rgb(153,0,0);font-weight:bold;color:rgb(68,85,136);font-weight:bold">Throwable</span>> <span class="hljs-keyword" style="color:rgb(51,51,51);font-weight:bold">extends</span> <span class="hljs-title" style="color:rgb(153,0,0);font-weight:bold;color:rgb(68,85,136);font-weight:bold">Function</span><<span class="hljs-title" style="color:rgb(153,0,0);font-weight:bold;color:rgb(68,85,136);font-weight:bold">StringTemplate</span>, <span class="hljs-title" style="color:rgb(153,0,0);font-weight:bold;color:rgb(68,85,136);font-weight:bold">R</span>, <span class="hljs-title" style="color:rgb(153,0,0);font-weight:bold;color:rgb(68,85,136);font-weight:bold">E</span>> </span>{
        <span class="hljs-function">R <span class="hljs-title" style="color:rgb(153,0,0);font-weight:bold">apply</span><span class="hljs-params">(StringTemplate st)</span> <span class="hljs-keyword" style="color:rgb(51,51,51);font-weight:bold">throws</span> E</span>; <span class="hljs-comment" style="color:rgb(153,153,136);font-style:italic">// luckily, the semantics of the word "apply" also fits for activating a processor</span>
    }
</code></pre>
<div title="MDH:SSB3YW50IHRvIGFkZCBhbiBhcmd1bWVudCB0byBwdXNoIG1vcmUgdGhlIGoudS5mLmV4Y2VwdGlv
bmFsbHkgYXBwcm9hY2ggSSBzdWdnZXN0ZWQuPGRpdj48YnI+PC9kaXY+PGRpdj5KdXN0IHRvZGF5
IHNvbWVvbmUgaW4gUmVkZGl0IHBvaW50ZWQgb3V0IGhvdyBTdHJpbmcgVGVtcGxhdGVzIGhhdmUg
YW4gaW5jb25zaXN0ZW50IHNlbWFudGljcyB3aXRoIHRoZSBqLnUuZnVuY3Rpb24gcGFja2FnZSwg
YXMgdGhleSBoYXZlIHRoZSBpbnRlcmZhY2U6PC9kaXY+PGRpdj48YnI+PC9kaXY+PGRpdj5gYGBq
YXZhPC9kaXY+PGRpdj4mbmJzcDsgJm5ic3A7IEBGdW5jdGlvbmFsSW50ZXJmYWNlPGJyPiZuYnNw
OyAmbmJzcDsgcHVibGljIGludGVyZmFjZSBQcm9jZXNzb3ImbHQ7UiwgRSBleHRlbmRzIFRocm93
YWJsZSZndDsgezxicj4mbmJzcDsgJm5ic3A7ICZuYnNwOyAmbmJzcDsgUiBwcm9jZXNzKFN0cmlu
Z1RlbXBsYXRlIHN0KSB0aHJvd3MgRTs8YnI+Jm5ic3A7ICZuYnNwOyB9PGJyPjwvZGl2PjxkaXY+
YGBgPC9kaXY+PGRpdj48YnI+PC9kaXY+PGRpdj5JZiB3ZSBoYWQgYSBqLnUuZi5leGNlcHRpb25h
bGx5IHBhY2thZ2UsIHRoZW4gbm90IG9ubHkgaXQgd2lsbCBiZSBtb3JlIGNvbnNpc3RlbnQgYWNy
b3NzIHRoZSB0aGUgc3RhbmRhcmQgbGlicmFyeSwgaXQgd2lsbCB1bmlmeSBhIGxvdCBvZiBmdW5j
dGlvbmFsIGludGVyZmFjZXM6PC9kaXY+PGRpdj48YnI+PC9kaXY+PGRpdj5gYGBqYXZhPC9kaXY+
PGRpdj5pbXBvcnQgamF2YS51dGlsLmZ1bmN0aW9uLjx3YnI+ZXhjZXB0aW9uYWxseS5GdW5jdGlv
bjs8L2Rpdj48ZGl2PlsuLi5dPC9kaXY+PGRpdj4mbmJzcDsgJm5ic3A7IEBGdW5jdGlvbmFsSW50
ZXJmYWNlPGJyPiZuYnNwOyAmbmJzcDsgcHVibGljIGludGVyZmFjZSBQcm9jZXNzb3ImbHQ7Uiwg
RSBleHRlbmRzIFRocm93YWJsZSZndDsgZXh0ZW5kcyBGdW5jdGlvbiZsdDtTdHJpbmdUZW1wbGF0
ZSwgUiwgRSZndDsgezxicj4mbmJzcDsgJm5ic3A7ICZuYnNwOyAmbmJzcDsgUiBhcHBseShTdHJp
bmdUZW1wbGF0ZSBzdCkgdGhyb3dzIEU7IC8vIGx1Y2tpbHksIHRoZSBzZW1hbnRpY3Mgb2YgdGhl
IHdvcmQgImFwcGx5IiBhbHNvIGZpdHMgZm9yIGFjdGl2YXRpbmcgYSBwcm9jZXNzb3I8YnI+Jm5i
c3A7ICZuYnNwOyB9PGJyPjwvZGl2PjxkaXY+YGBgPC9kaXY+PGRpdj48YnI+PC9kaXY+" style="height:0;width:0;max-height:0;max-width:0;overflow:hidden;font-size:0em;padding:0;margin:0"></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Apr 13, 2023 at 2:30 PM Holo The Sage Wolf <<a href="mailto:holo3146@gmail.com" target="_blank">holo3146@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">>

Do you have a way to help me find that Amber discussion?<div><br></div><div>Here is the start of the thread: <a href="https://mail.openjdk.org/pipermail/amber-dev/2023-March/007849.html" target="_blank">https://mail.openjdk.org/pipermail/amber-dev/2023-March/007849.html</a></div><div><br></div><div>But the relevant part (the discussion I had with Brian Goetz) starts here: <a href="https://mail.openjdk.org/pipermail/amber-dev/2023-March/007858.html" target="_blank">https://mail.openjdk.org/pipermail/amber-dev/2023-March/007858.html</a></div><div><br></div><div>The end conclusion was what you probably expect it to be, but I think it is important discussion to have and I hope that when few features will finally finalize and there will be a bit of free time to the team the discussion will start to be active again </div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Apr 13, 2023 at 1:45 PM Andrew Haley <<a href="mailto:aph-open@littlepinkcloud.com" target="_blank">aph-open@littlepinkcloud.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 4/13/23 11:23, Holo The Sage Wolf wrote:<br>
> As a side note, generally I'm a bit disappointed<br>
<br>
You and everybody else.<br>
<br>
> from the state of<br>
> exceptions with generics in Java, not too long ago I talked about it in (I<br>
> believe) the Amber mailing list about possible improvements in the future.<br>
<br>
I've spent a fair bit of time discussing this kind of thing with Brian Goetz<br>
et al., and it's just a very hard problem. Any "Hey, let's do this!" probably<br>
will have some unfortunate side effects somewhere.<br>
<br>
Do you have a way to help me find that Amber discussion?<br>
<br>
-- <br>
Andrew Haley  (he/him)<br>
Java Platform Lead Engineer<br>
Red Hat UK Ltd. <<a href="https://www.redhat.com" rel="noreferrer" target="_blank">https://www.redhat.com</a>><br>
<a href="https://keybase.io/andrewhaley" rel="noreferrer" target="_blank">https://keybase.io/andrewhaley</a><br>
EAC8 43EB D3EF DB98 CC77 2FAD A5CD 6035 332F A671<br>
<br>
</blockquote></div><br clear="all"><div><br></div><span>-- </span><br><div dir="ltr"><div dir="ltr">Holo The Wise Wolf Of Yoitsu</div></div>
</blockquote></div><br clear="all"><div><br></div><span>-- </span><br><div dir="ltr"><div dir="ltr">Holo The Wise Wolf Of Yoitsu</div></div>