<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=""><br class=""><div><blockquote type="cite" class=""><div class="">On 25 Feb 2016, at 05:19, Paul Ossenbruggen via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">These lack conciseness. What about the already supported: <div class=""><br class=""></div><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;" class=""><div style="font-size: 13px;" class=""><b class="">let _ = </b>ingoreResult()</div></blockquote></div></div></blockquote><br class=""></div><div>This could work until we gain some other, general purpose, method to suppress warnings, though it isn’t pretty IMO. For example, if a class’ methods are designed to be chain able then the result isn’t necessary (it’s just self), so in things like loops you could end up having to use let _ an awful lot, like so:</div><div><br class=""></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>class Chainable {</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>var value = 0</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>func add(add:Int) {</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>value += add</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>return self</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>}</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>}</div><div><br class=""></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>let chainable = Chainable()</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>for _ in 0 ..< 10 {</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>if getSomeCondition() {</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>let _ = chainable.add(5)</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>} else {</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>let _ = chainable.add(2)</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>}</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>}</div><div><br class=""></div><div>Stupid example, but imagine if there were a few other operations, perhaps handled by other conditionals, then suddenly you end up with a lot of these let _ statements, which is why being able to suppress the warnings in all cases is still desirable.</div><div><br class=""></div><div>On the topic of verbosity in the attribute, I don’t think there’s any need to go to four words; the current attribute is @warn_unused_result, and I think that @ignore_unused_result works a direct opposite (i.e- the result being unused is still strange to the compiler, but it chooses not to issue a warning about it). I’m only using snake case because that’s what the current value has, obviously we’ll adjust for whatever the final attribute naming convention turns out to be.</div></body></html>