<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Oct 8, 2016, at 12:39 AM, John McCall <<a href="mailto:rjmccall@apple.com" class="">rjmccall@apple.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="" style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div class=""><blockquote type="cite" class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: 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-size-adjust: auto; -webkit-text-stroke-width: 0px;"><div class="" style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div class="" style="margin: 0px; line-height: normal; font-family: Menlo;">%a = alloc_stack</div><div class="" style="margin: 0px; line-height: normal; font-family: Menlo; min-height: 14px;"><br class=""></div><div class="" style="margin: 0px; line-height: normal; font-family: Menlo;">begin_exclusive %a</div><div class="" style="margin: 0px; line-height: normal; font-family: Menlo;">apply foo(%a) // must be marked an initializer?</div><div class="" style="margin: 0px; line-height: normal; font-family: Menlo;">end_exclusive %a</div><div class="" style="margin: 0px; line-height: normal; font-family: Menlo; min-height: 14px;"><br class=""></div><div class="" style="margin: 0px; line-height: normal; font-family: Menlo;">begin_shared %a</div><div class="" style="margin: 0px; line-height: normal; font-family: Menlo;">apply bar(%a) // immutable access</div><div class="" style="margin: 0px; line-height: normal; font-family: Menlo;">end_shared %a</div><div class="" style="margin: 0px; line-height: normal; font-family: Menlo; min-height: 14px;"><br class=""></div><div class="" style="margin: 0px; line-height: normal; font-family: Menlo;">dealloc_stack %a</div></div></blockquote><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: 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;" class=""><br class=""></div><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: 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; float: none; display: inline !important;" class="">I think alloc_stack returns an owned (but uninitialized) address and there's</span></div><div class="">general scoped operation to turn an owned address into a borrow. Or it could</div><div class="">be implicit in the operation that needs a borrowed value, as you suggest below.</div></div></div></blockquote></div><br class=""><div class=""><div class="">I should have decorated the code with transitions to get the point across:</div><div class=""><br class=""></div><div class=""><font face="Menlo" class="">%a = alloc_stack // -> owned/uninitialized</font></div><div class=""><font face="Menlo" class=""><br class=""></font></div><div class=""><font face="Menlo" class="">begin_exclusive %a // -> exclusive/uninitialized</font></div><div class=""><font face="Menlo" class="">apply foo(%a) // -> exclusive/initialized</font></div><div class=""><font face="Menlo" class="">end_exclusive %a // -> owned/initialized</font></div><div class=""><font face="Menlo" class=""><br class=""></font></div><div class=""><font face="Menlo" class="">begin_shared %a // -> shared (implies initialized)</font></div><div class=""><font face="Menlo" class="">apply bar(%a) // immutable access</font></div><div class=""><font face="Menlo" class="">end_shared %a // -> owned/initialized</font></div><div class=""><font face="Menlo" class=""><br class=""></font></div><div class=""><font face="Menlo" class="">dealloc_stack %a // -> invalid</font></div></div><div class=""><br class=""></div><div class="">-Andy</div></body></html>