<div dir="ltr"><p style="line-height:100%;margin-bottom:0cm">
In thinking about record destructuring it occurs to me it could be
used in more places than currently proposed.</p>
<p style="line-height:100%;margin-bottom:0cm"><br>
</p>
<p style="line-height:100%;margin-bottom:0cm">One example would be
in a function call:</p>
<p style="line-height:100%;margin-bottom:0cm"><br>
</p>
<p style="line-height:100%;margin-bottom:0cm">record
HumanName(firstName: String, middleName: String, lastName: String) {}</p>
<p style="line-height:100%;margin-bottom:0cm">HumanName humanName
= new HumanName(“Alice”, “Bateman”, “Chandler”);</p>
<p style="line-height:100%;margin-bottom:0cm"><br>
</p>
<p style="line-height:100%;margin-bottom:0cm">String
getFormattedName(humanName: HumanName(firstName, _, lastName))</p>
<p style="line-height:100%;margin-bottom:0cm">{</p>
<p style="line-height:100%;margin-bottom:0cm"> return lastName +
“, “ + firstName;</p>
<p style="line-height:100%;margin-bottom:0cm">}</p>
<p style="line-height:100%;margin-bottom:0cm"><br>
</p>
<p style="line-height:100%;margin-bottom:0cm">final String fmtName
= getFormattedName(humanName);</p>
<p style="line-height:100%;margin-bottom:0cm"><br>
</p>
<p style="line-height:100%;margin-bottom:0cm"><br>
</p>
<p style="line-height:100%;margin-bottom:0cm">another could be in
a for loop</p>
<p style="line-height:100%;margin-bottom:0cm"><br>
</p>
<p style="line-height:100%;margin-bottom:0cm">final Set<HumanName>
humans = new HashSet<>();</p>
<p style="line-height:100%;margin-bottom:0cm">humans.add(humanName);</p>
<p style="line-height:100%;margin-bottom:0cm">for (final
humanName: HumanName(firstName, _, lastName): humans)</p>
<p style="line-height:100%;margin-bottom:0cm">{</p>
<p style="line-height:100%;margin-bottom:0cm"> processFirstName(firstName);</p>
<p style="line-height:100%;margin-bottom:0cm"> processLastName(lastName);</p>
<p style="line-height:100%;margin-bottom:0cm"> ...</p>
<p style="line-height:100%;margin-bottom:0cm">}</p>
<p style="line-height:100%;margin-bottom:0cm"><br>
</p>
<p style="line-height:100%;margin-bottom:0cm">or indeed in any
body</p>
<p style="line-height:100%;margin-bottom:0cm"><br>
</p>
<p style="line-height:100%;margin-bottom:0cm">with humanName as
HumanName(firstName, _, lastName)</p>
<p style="line-height:100%;margin-bottom:0cm">{</p>
<p style="line-height:100%;margin-bottom:0cm"> processFirstName(firstName);</p>
<p style="line-height:100%;margin-bottom:0cm"> processLastName(lastName);</p>
<p style="line-height:100%;margin-bottom:0cm"> ...</p>
<p style="line-height:100%;margin-bottom:0cm">}</p>
<p style="line-height:100%;margin-bottom:0cm"><br>
</p>
</div>