<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
This came up when we did switch expressions. Brief answer: no.
Blocks already have a pretty strong association in Java -- something
that holds statements. Java developers would likely find it a
jarring gear-change to start seeing these as expressions.
Additionally, it creates new points of confusion, such as
interaction of yield with break/continue, or nested block
expressions (next request would be: can I yield to an uplevel
expression?) This is as far as we're comfortable going right now.<br>
<br>
<div class="moz-cite-prefix">On 8/24/2022 3:26 PM, Tesla Zhang
wrote:<br>
</div>
<blockquote type="cite" cite="mid:tencent_3446E7F2AAF64BBD1568498853CE6F64F109@qq.com">
<div>Hi all,</div>
<div><br>
</div>
<div><br>
</div>
<div>Since switch expressions have block bodies with `yield`
specifying its value, is it a good idea to generalize this to
all blocks, and allow blocks as expressions?</div>
<div><br>
</div>
<div>
<hr style="margin: 0 0 10px 0;border: 0;border-bottom:1px solid
#E6E8EB;height:0;line-height:0;font-size:0;padding: 20px 0 0
0;width: 50px;">
<div class="xm_write_text_sign">Regards,<br>
Tesla</div>
</div>
</blockquote>
<br>
</body>
</html>