<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">Am 11.11.2017 um 19:03 schrieb Chris Lattner <<a href="mailto:sabre@nondot.org" class="">sabre@nondot.org</a>>:</div><br class="Apple-interchange-newline"><div class=""><div class="" style="word-wrap: break-word; -webkit-nbsp-mode: space; 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=""><div class="" style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;"><div class="">Swift is quite flexible on what can act as a closure — would it be allowed to use a dynamic callable in that context?</div><div class="">I guess forwarding of</div><div class=""><br class=""></div><div class=""><div class="" style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);"><span class="" style="color: rgb(186, 45, 162);">let</span><span class="Apple-converted-space"> </span>closure: ([(<span class="" style="color: rgb(112, 61, 170);">String</span>,<span class="Apple-converted-space"> </span><span class="" style="color: rgb(112, 61, 170);">Int</span>)]) -><span class="Apple-converted-space"> </span><span class="" style="color: rgb(112, 61, 170);">Int</span> = DynamicCallableType()</div></div><div class=""><br class=""></div><div class="">to the dynamicCall method of DynamicCallableType isn’t that hard, but wouldn’t it be odd if the value of closure changes when you leave out its type?</div></div></div></blockquote><br class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;"></div><div class="">I’m not sure I understand what you’re getting at. Can you show how this would work with the example in the motivation section?</div></div></div></blockquote></div><br class=""><div class="">I’m just asking if this should work ;-) — I didn’t see anything regarding it in the proposal.</div><div class="">But to take something from the document:</div><div class=""><br class=""></div><div class=""><pre style="box-sizing: border-box; font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 13.600000381469727px; margin-top: 0px; margin-bottom: 0px; word-wrap: normal; padding: 16px; overflow: auto; line-height: 1.45; background-color: rgb(246, 248, 250); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; word-break: normal; color: rgb(36, 41, 46);" class=""> <span class="pl-c" style="box-sizing: border-box; color: rgb(106, 115, 125);"><span class="pl-c" style="box-sizing: border-box;">//</span> file = open(filename)</span>
<span class="pl-c" style="box-sizing: border-box; color: rgb(106, 115, 125);"></span> <span class="pl-k" style="box-sizing: border-box; color: rgb(215, 58, 73);">let</span> file <span class="pl-k" style="box-sizing: border-box; color: rgb(215, 58, 73);">=</span> Python.<span class="pl-smi" style="box-sizing: border-box;">open</span>.<span class="pl-c1" style="box-sizing: border-box; color: rgb(0, 92, 197);">call</span>(filename)
</pre></div><div class=""><pre style="box-sizing: border-box; font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 13.600000381469727px; margin-top: 0px; margin-bottom: 0px; word-wrap: normal; padding: 16px; overflow: auto; line-height: 1.45; background-color: rgb(246, 248, 250); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; word-break: normal; color: rgb(36, 41, 46);" class=""><span class="pl-k" style="box-sizing: border-box; color: rgb(215, 58, 73);">let</span> openFile: (String) -> FileHandle? <span class="pl-k" style="box-sizing: border-box; color: rgb(215, 58, 73);">=</span> Python.<span class="pl-smi" style="box-sizing: border-box;">open // is this be possible, or an error?</span></pre><div class=""><br class=""></div></div></body></html>