<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body><div style="font-family:Arial;">If you're engaging in a non-standard design pattern, that you are willfully writing yourself, I really don't see what the problem is with applying @discardableResult to declarations that need it, just like any of Swift's other decorators that describe convention and use patterns.<br></div>
<div style="font-family:Arial;"><br></div>
<div style="font-family:Arial;">Cheers,<br></div>
<div style="font-family:Arial;"> Zach<br></div>
<div><br></div>
<div><br></div>
<div>On Sun, Oct 30, 2016, at 01:52 PM, Jody Schofield via swift-evolution wrote:<br></div>
<blockquote type="cite"><div><div style="font-family:Arial;">I think assumptions are being made that shouldn't be. For example I use a lot for design patterns such as the builder. Most of the methods return a reference to self so they can be chained together. The compiler shouldn't tell me I'm wrong for ignoring those return values. It use to be my decision.<br></div>
</div>
<div>Swift was already a very opinionated language and I can see it's being taken even further. A mistake in my opinion and one that is certainly making the language more frustrating than pleasurable to use.<br></div>
<div><br></div>
<div><br></div>
<div><div style="font-family:Arial;"><br></div>
<div style="font-family:Arial;">On Oct 30, 2016, at 1:32 PM, Robert Widmann <<a href="mailto:devteam.codafi@gmail.com">devteam.codafi@gmail.com</a>> wrote:<br></div>
</div>
<blockquote type="cite"><div><div>Functions that return values return them for a reason. Ignoring them is, more likely than not, an oversight that should be corrected, hence @discardableResult. We're talking error codes, object lifetime tokens, failure indicators, etc. All things that result in ignoring critical code paths for the sake of convenience. If you find yourself executing a lot of side effects and ignoring return values, I would take a look at why. A lot of times you have control over the API and can eliminate some of these unused return values. Otherwise, please try to see if the return values of these functions are relevant to the well-being of your program.<br></div>
<div><div style="font-family:Arial;"><br></div>
<div style="font-family:Arial;">~Robert Widmann<br></div>
</div>
<div><div style="font-family:Arial;"><br></div>
<div style="font-family:Arial;">2016/10/30 8:49、Jody Schofield via swift-dev <<a href="mailto:swift-dev@swift.org">swift-dev@swift.org</a>> のメッセージ:<br></div>
</div>
<blockquote type="cite"><div><div dir="ltr"><div style="font-size:13px;">Sorry, I'm sure this has been discussed before, but what the heck???<br></div>
<div style="font-size:13px;"><br></div>
<div style="font-size:13px;">This feature is killing me. Now I have go add @discardableResult to every function that returns a non-Void or use the ugly syntax `_ =`? <br></div>
<div style="font-size:13px;"><br></div>
<div style="font-size:13px;">Until swift 3 I've really enjoyed the new language. Now I find it to be getting too rigid for the sake of "protecting" me from myself. The safety levels needs to be dialled back some.<br></div>
<div style="font-size:13px;"><br></div>
<div style="font-size:13px;"><br></div>
</div>
</div>
</blockquote><blockquote type="cite"><div><div style="font-family:Arial;"><span>_______________________________________________</span><br></div>
<div style="font-family:Arial;"><span>swift-dev mailing list</span><br></div>
<div style="font-family:Arial;"><span><a href="mailto:swift-dev@swift.org">swift-dev@swift.org</a></span><br></div>
<div style="font-family:Arial;"><span><a href="https://lists.swift.org/mailman/listinfo/swift-dev">https://lists.swift.org/mailman/listinfo/swift-dev</a></span><br></div>
</div>
</blockquote></div>
</blockquote><div><u>_______________________________________________</u><br></div>
<div>swift-evolution mailing list<br></div>
<div><a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a><br></div>
<div><a href="https://lists.swift.org/mailman/listinfo/swift-evolution">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br></div>
</blockquote><div style="font-family:Arial;"><br></div>
</body>
</html>