<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body><div>On Wed, Dec 30, 2015, at 03:12 PM, Kevin Wooten via swift-evolution wrote:<br></div>
<blockquote type="cite"><div><blockquote type="cite"><div><blockquote style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;orphans:auto;text-align:start;text-indent:0px;text-transform:none;white-space:normal;widows:auto;word-spacing:0px;-webkit-text-stroke-width:0px;" type="cite"><div><div> </div>
<div>Another possibility I've thought of is defining `defer { val }` to guarantee that val remains alive until the defer fires on scope exit. That might let us leave `defer` as the one "guarantee something happens exactly at scope exit" language construct.<br></div>
</div>
</blockquote></div>
</blockquote><div> </div>
<div>What about this…<br></div>
<div> </div>
<div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font-size:13px;line-height:normal;font-family:Menlo;"><span class="colour" style="color:rgb(187, 44, 162)">defer</span> <span class="colour" style="color:rgb(187, 44, 162)">let</span> val = grabOrCreateSomething() {<br></div>
<div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font-size:13px;line-height:normal;font-family:Menlo;"> return;<br></div>
<div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font-size:13px;line-height:normal;font-family:Menlo;min-height:15px;">}<br></div>
<div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font-size:13px;line-height:normal;font-family:Menlo;"> </div>
<div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;line-height:normal;">Seems natural once you learn guard.<br></div>
</div>
</div>
</blockquote><div> </div>
<div>Natural? I have no idea what you're expecting that expression to actually do. What is a "defer let"?<br></div>
<div> </div>
<div>-Kevin</div>
<div> </div>
</body>
</html>