<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
I come to the same conclusion as John, but from a slightly different
angle.<br>
<br>
First, I'm not thrilled with the idea of specifying TWR via
desugaring at all; it means that accidental artifacts of
specification end up being weighted too seriously. But I also think
that TWR suffers from failure of imagination (it is too IO-specific)
and also that it suffers from other accidental issues (such as,
using an interface for AC, which forces us to pick a name that might
be great for IO but lousy for arbitrary resources. A type class
would be better, when we have them.) <br>
<br>
So I would prefer to raise our sights on TWR towards the construct
we would like to work towards (just as we raised up switch from the
gutter of byte-stream parsing). <br>
<br>
<blockquote type="cite" cite="mid:5EB235EC-5CEA-4618-9086-8C85AF9C812C@oracle.com">
<div style="font-family: sans-serif;">
<div class="markdown" style="white-space: normal;">
<p dir="auto">I think the opposite on this one. It seems to me
that using <code style="margin: 0; padding: 0 0.4em;
border-radius: 3px; background-color: #F7F7F7;">_</code>
is an excellent way to mute that warning. I find it
annoyingly opinionated: Why shouldn’t I expect to use TWR to
simulate the RAII-style open/close events from C++, without
lint bumping my elbow?</p>
</div>
<div class="plaintext" style="white-space: normal;">
<blockquote style="margin: 0 0 5px; padding-left: 5px;
border-left: 2px solid #777777; color: #777777;">
<p dir="auto">If we allow '_', it means that we are in a way
able to call _.close().</p>
</blockquote>
</div>
<div class="markdown" style="white-space: normal;">
<p dir="auto">The documentation for desugaring TWR can just
introduce a new name if necessary; the JLS introduces
unnamed temps all the time and this is just another place
for one.</p>
</div>
<div class="plaintext" style="white-space: normal;">
<blockquote style="margin: 0 0 5px; padding-left: 5px;
border-left: 2px solid #777777; color: #777777;">
<p dir="auto">The other case is the case (2), should we
allow '_' in a middle of an init list, i think that like
with 'var' we should not allow '_' in an init list.
<br>
So reject
<br>
int x, _;</p>
</blockquote>
</div>
<div class="markdown" style="white-space: normal;">
<p dir="auto">I agree.</p>
</div>
</div>
</blockquote>
<br>
</body>
</html>