<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body><div style="font-family:Arial;">Big +1.<br></div>
<div><div style="font-family:Arial;"><br></div>
</div>
<div>Using `!` is widely seen as a smell. However, the need for it still arises; they are preconditions, of a sort. It has become prevalent in my teams’ codebases to do “guard else preconditionFailure”.<br></div>
<div style="font-family:Arial;"><div style="font-family:Arial;"><br></div>
</div>
<div style="font-family:Arial;">I like `!!` over something like `?!`; it follows the pattern that almost every `?` in the language has an equivalent `!`.<br></div>
<div><div style="font-family:Arial;"><br></div>
</div>
<div><div style="font-family:Arial;">The implementation details are ultimately not relevant to me. I’m a fan of `Never` being a bottom type for more reasons than just this. I also see no reason why operator funcs couldn’t accept file and line as extra arguments on the rhs.<br></div>
</div>
<div style="font-family:Arial;"><br></div>
<div id="sig20055365"><div class="signature"><span class="font" style="font-family:arial, sans-serif, sans-serif">Best,</span><span class="font" style="font-family:arial, sans-serif, sans-serif"></span><br></div>
<div class="signature"><span class="font" style="font-family:arial, sans-serif, sans-serif">&nbsp; Zachary Waldowski</span><span class="font" style="font-family:arial, sans-serif, sans-serif"></span><br></div>
<div class="signature"><span class="font" style="font-family:arial, sans-serif, sans-serif">&nbsp;&nbsp;</span><a href="mailto:zach@waldowski.me"><span class="font" style="font-family:arial, sans-serif, sans-serif">zach@waldowski.me</span></a><span class="font" style="font-family:arial, sans-serif, sans-serif"></span><br></div>
<div style="font-family:Arial;"><br></div>
<div style="font-family:Arial;">On Tue, Jun 27, 2017, at 01:16 PM, Erica Sadun via swift-evolution wrote:<br></div>
</div>
<blockquote type="cite"><div>Using an operator to provide feedback on the context of a failed unwrap has become a commonly implemented approach in the Swift developer Community. What are your thoughts about adopting this widely-used operator into the standard library?<br></div>
<div><br></div>
<div><span class="font" style="font-family:Menlo">guard !lastItem.isEmpty else { return }</span><br></div>
<div><span class="font" style="font-family:Menlo">let lastItem = array.last !! "Array must be non-empty"</span><br></div>
<div><br></div>
<div>Details here: &nbsp;<a href="https://gist.github.com/erica/423e4b1c63b95c4c90338cdff4939a9b">https://gist.github.com/erica/423e4b1c63b95c4c90338cdff4939a9b</a><br></div>
<div><br></div>
<div>Thank you for your thoughtful feedback, -- E<br></div>
<div><br></div>
<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>