<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">On Feb 1, 2016, at 1:02 PM, Matthew Johnson <<a href="mailto:matthew@anandabits.com" class="">matthew@anandabits.com</a>> wrote:<br class=""><div><blockquote type="cite" class=""><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><blockquote type="cite" class=""><div class=""><div 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;" class=""><blockquote type="cite" class=""><div class=""><div class="" style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div class=""><br class=""></div><div class="">I’m glad to see an @autoclosure func in this thread. We will want to be able to use this feature with @autoclosure in addition to @noescape.</div><div class=""><br class=""></div></div></div></blockquote><blockquote type="cite" class=""><div class=""><div class="" style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div class="">As far as exiting without calling the closure, I suggest `@noescape(once?)`. The `?` indicates the closure may or may not be called, but<span class="Apple-converted-space"> </span><b class="">will not</b> be called more than once.</div></div></div></blockquote><div class=""><br class=""></div><div class="">I don’t see how this is useful. You wouldn’t be able to initialize a value with this semantic, so it isn’t any more powerful than @noescape on the caller side.</div></div></div></blockquote><div class=""><br class=""></div><div class="">Right, you would not be able to use it for initialization.</div><div class=""><br class=""></div>It gives a guarantee that the closure will not be executed twice. This semantic guarantee could be useful, especially if the closure has side-effects. It adds the clarity of a guarantee to APIs where the zero-or-one-times semantic is implicit with @noescape alone.</div></div></div></blockquote><br class=""></div><div>Right, but unless the compiler is going to enforce it somehow, it doesn’t add any value above a comment. Particularly given that we want to keep the language simple where possible, I think that a comment would be perfectly fine for this. We don’t want to be in the business of providing a "documentation hook” in the language for every theoretical invariant someone might want to express.</div><div><br class=""></div><div>-Chris</div><br class=""></body></html>