<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=""><div class="">This is very much on purpose. In more weakly typed languages, nil is treated as a “falsy” value, and so you can use || to deal with it. Swift is very strongly typed and only booleans can be used in boolean expressions, not boolean-like values. (Remember how you used to be able to do `if someOptional`, but it was changed so that you have to say `if someOptional != nil`). When we talk about optionals, we use ? symbol to convey that something is optional-related. And so there’s ??.</div><br class=""><div class="">
<div class="">— Radek</div>
</div>
<br class=""><div><blockquote type="cite" class=""><div class="">On 16 Feb 2016, at 15:18, James Campbell 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=""><div class=""><div class="">Granted it may be confusing since other languages use the Or operator which reads better.</div><div class=""><br class=""></div><div class="">X ||= y</div><div class=""><br class=""></div><div class="">However I would argue that this operator has no choice but to use ??= Since it is a mirror for the ?? Operation.</div><div class=""><br class=""></div><div class="">Perhaps it would be better for the language if ?? Was actually || but this would be a small but big change and would belong in another proposal.</div><div class=""><br class=""><div class="acompli_signature">Sent from <a dir="ltr" href="http://supmenow.com/" x-apple-data-detectors="true" x-apple-data-detectors-type="link" x-apple-data-detectors-result="0" class="">Supmenow.com</a></div><br class=""></div><br class=""><br class=""><br class="">
<div class="gmail_quote">On Tue, Feb 16, 2016 at 6:14 AM -0800, "Ross O'Brien via swift-evolution" <span dir="ltr" class=""><<a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a>></span> wrote:<br class="">
<br class="">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="3D"ltr"" class="">
<div dir="ltr" class=""><div class="">"y is assigned to x if x is nil" <i class="">is</i> exactly what "x ??= y" means. If x is nil, x is assigned the value of y; if x is not nil, it doesn't matter what y is.</div><div class=""><br class=""></div><div class="">This is exactly consistent with the boolean operator ||= ; "x ||= y" means "y is assigned to x if x is false" - if x is false, x is assigned the value of y; if x is true, it doesn't matter what y is.)</div><div class=""><br class=""></div><div class="">Why do you think it means the opposite?<br class=""></div></div><div class="gmail_extra"><br class=""><div class="gmail_quote">On Tue, Feb 16, 2016 at 1:24 PM, David Sweeris via swift-evolution <span dir="ltr" class=""><<a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto" class=""><div class="">-1, because in my mind, "x ??= y" kinda looks like "y is assigned to x iff y isn't nil", or, if you associate the ?? part with the lhs, "y is assigned to x if x is nil", neither of which is what the proposed operator means. In fact, the 2nd case is the *opposite* of what ??= means in this proposal.</div><div class=""><br class=""></div><div class="">To be clear, it's the syntax that I'm opposed to, not the concept.</div><div class=""><br class=""></div><div class="">- Dave Sweeris</div><div class=""><div class="h5"><div class=""><br class="">On Feb 12, 2016, at 23:15, Douglas Gregor <<a href="mailto:dgregor@apple.com" target="_blank" class="">dgregor@apple.com</a>> wrote:<br class=""><br class=""></div><blockquote type="cite" class=""><div class=""><p style="margin-top:0px;margin-bottom:16px;color:rgb(51,51,51);font-family:'Helvetica Neue',Helvetica,'Segoe UI',Arial,freesans,sans-serif,'Apple Color Emoji','Segoe UI Emoji','Segoe UI Symbol';font-size:16px;background-color:rgb(255,255,255)" class="">Hello Swift community,</p><p style="margin-top:0px;margin-bottom:16px;color:rgb(51,51,51);font-family:'Helvetica Neue',Helvetica,'Segoe UI',Arial,freesans,sans-serif,'Apple Color Emoji','Segoe UI Emoji','Segoe UI Symbol';font-size:16px;background-color:rgb(255,255,255)" class="">The review of SE-0024 "Optional Value Setter `??=`" begins now and runs through February 18, 2016. The proposal is available here:</p><blockquote style="margin:0px 0px 16px;padding:0px 15px;border-left-width:4px;border-left-style:solid;border-left-color:rgb(221,221,221);background-color:rgb(255,255,255)" class=""><div style="margin-top:0px;margin-bottom:0px" class=""><font color="#777777" face="Helvetica Neue, Helvetica, Segoe UI, Arial, freesans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol" size="3" class=""><a href="https://github.com/apple/swift-evolution/blob/master/proposals/0024-optional-value-setter.md" target="_blank" class="">https://github.com/apple/swift-evolution/blob/master/proposals/0024-optional-value-setter.md</a></font></div></blockquote><p style="margin-top:0px;margin-bottom:16px;color:rgb(51,51,51);font-family:'Helvetica Neue',Helvetica,'Segoe UI',Arial,freesans,sans-serif,'Apple Color Emoji','Segoe UI Emoji','Segoe UI Symbol';font-size:16px;background-color:rgb(255,255,255)" class="">Reviews are an important part of the Swift evolution process. All reviews should be sent to the swift-evolution mailing list at</p><blockquote style="margin:0px 0px 16px;padding:0px 15px;color:rgb(119,119,119);border-left-width:4px;border-left-style:solid;border-left-color:rgb(221,221,221);font-family:'Helvetica Neue',Helvetica,'Segoe UI',Arial,freesans,sans-serif,'Apple Color Emoji','Segoe UI Emoji','Segoe UI Symbol';font-size:16px;background-color:rgb(255,255,255)" class=""><div style="margin-top:0px;margin-bottom:0px" class=""><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" style="background-color:transparent;color:rgb(64,120,192);text-decoration:none" target="_blank" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a></div></blockquote><p style="margin-top:0px;margin-bottom:16px;color:rgb(51,51,51);font-family:'Helvetica Neue',Helvetica,'Segoe UI',Arial,freesans,sans-serif,'Apple Color Emoji','Segoe UI Emoji','Segoe UI Symbol';font-size:16px;background-color:rgb(255,255,255)" class="">or, if you would like to keep your feedback private, directly to the review manager. When replying, please try to keep the proposal link at the top of the message:</p><blockquote style="margin:0px 0px 16px;padding:0px 15px;border-left-width:4px;border-left-style:solid;border-left-color:rgb(221,221,221);background-color:rgb(255,255,255)" class=""><p style="color:rgb(119,119,119);font-family:'Helvetica Neue',Helvetica,'Segoe UI',Arial,freesans,sans-serif,'Apple Color Emoji','Segoe UI Emoji','Segoe UI Symbol';font-size:16px;margin-top:0px;margin-bottom:16px" class="">Proposal link:</p><blockquote style="margin:0px 0px 16px;padding:0px 15px;border-left-width:4px;border-left-style:solid;border-left-color:rgb(221,221,221)" class=""><div style="margin-top:0px;margin-bottom:0px" class=""><font color="#777777" face="Helvetica Neue, Helvetica, Segoe UI, Arial, freesans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol" size="3" class=""><a href="https://github.com/apple/swift-evolution/blob/master/proposals/0024-optional-value-setter.md" target="_blank" class="">https://github.com/apple/swift-evolution/blob/master/proposals/0024-optional-value-setter.md</a></font></div></blockquote><p style="color:rgb(119,119,119);font-family:'Helvetica Neue',Helvetica,'Segoe UI',Arial,freesans,sans-serif,'Apple Color Emoji','Segoe UI Emoji','Segoe UI Symbol';font-size:16px;margin-top:0px;margin-bottom:16px" class="">Reply text</p><blockquote style="color:rgb(119,119,119);font-family:'Helvetica Neue',Helvetica,'Segoe UI',Arial,freesans,sans-serif,'Apple Color Emoji','Segoe UI Emoji','Segoe UI Symbol';font-size:16px;margin:0px;padding:0px 15px;border-left-width:4px;border-left-style:solid;border-left-color:rgb(221,221,221)" class=""><div style="margin-top:0px;margin-bottom:0px" class="">Other replies</div></blockquote></blockquote><h5 style="margin-top:1em;margin-bottom:16px;line-height:1.4;font-size:1em;color:rgb(51,51,51);font-family:'Helvetica Neue',Helvetica,'Segoe UI',Arial,freesans,sans-serif,'Apple Color Emoji','Segoe UI Emoji','Segoe UI Symbol';background-color:rgb(255,255,255)" class=""><a href="https://github.com/apple/swift-evolution#what-goes-into-a-review-1" style="background-color:transparent;color:rgb(64,120,192);text-decoration:none;display:inline-block;padding-right:2px;line-height:1.1" target="_blank" class=""><u class=""></u><u class=""></u><u class=""></u><u class=""></u></a>What goes into a review?</h5><p style="margin-top:0px;margin-bottom:16px;color:rgb(51,51,51);font-family:'Helvetica Neue',Helvetica,'Segoe UI',Arial,freesans,sans-serif,'Apple Color Emoji','Segoe UI Emoji','Segoe UI Symbol';font-size:16px;background-color:rgb(255,255,255)" class="">The goal of the review process is to improve the proposal under review through constructive criticism and, eventually, determine the direction of Swift. When writing your review, here are some questions you might want to answer in your review:</p><ul style="padding:0px 0px 0px 2em;margin-top:0px;margin-bottom:16px;color:rgb(51,51,51);font-family:'Helvetica Neue',Helvetica,'Segoe UI',Arial,freesans,sans-serif,'Apple Color Emoji','Segoe UI Emoji','Segoe UI Symbol';font-size:16px;background-color:rgb(255,255,255)" class=""><li class="">What is your evaluation of the proposal?</li><li class="">Is the problem being addressed significant enough to warrant a change to Swift?</li><li class="">Does this proposal fit well with the feel and direction of Swift?</li><li class="">If you have used other languages or libraries with a similar feature, how do you feel that this proposal compares to those?</li><li class="">How much effort did you put into your review? A glance, a quick reading, or an in-depth study?</li></ul><p style="margin-top:0px;margin-bottom:16px;color:rgb(51,51,51);font-family:'Helvetica Neue',Helvetica,'Segoe UI',Arial,freesans,sans-serif,'Apple Color Emoji','Segoe UI Emoji','Segoe UI Symbol';font-size:16px;background-color:rgb(255,255,255)" class="">More information about the Swift evolution process is available at</p><blockquote style="margin:0px 0px 16px;padding:0px 15px;color:rgb(119,119,119);border-left-width:4px;border-left-style:solid;border-left-color:rgb(221,221,221);font-family:'Helvetica Neue',Helvetica,'Segoe UI',Arial,freesans,sans-serif,'Apple Color Emoji','Segoe UI Emoji','Segoe UI Symbol';font-size:16px;background-color:rgb(255,255,255)" class=""><div style="margin-top:0px;margin-bottom:0px" class=""><a href="https://github.com/apple/swift-evolution/blob/master/process.md" style="background-color:transparent;color:rgb(64,120,192);text-decoration:none" target="_blank" class="">https://github.com/apple/swift-evolution/blob/master/process.md</a></div></blockquote><p style="margin-top:0px;margin-bottom:16px;color:rgb(51,51,51);font-family:'Helvetica Neue',Helvetica,'Segoe UI',Arial,freesans,sans-serif,'Apple Color Emoji','Segoe UI Emoji','Segoe UI Symbol';font-size:16px;background-color:rgb(255,255,255)" class="">Thank you,</p><p style="margin-top:0px;margin-bottom:16px;color:rgb(51,51,51);font-family:'Helvetica Neue',Helvetica,'Segoe UI',Arial,freesans,sans-serif,'Apple Color Emoji','Segoe UI Emoji','Segoe UI Symbol';font-size:16px;background-color:rgb(255,255,255)" class="">Doug Gregor</p><p style="margin-top:0px;margin-bottom:16px;color:rgb(51,51,51);font-family:'Helvetica Neue',Helvetica,'Segoe UI',Arial,freesans,sans-serif,'Apple Color Emoji','Segoe UI Emoji','Segoe UI Symbol';font-size:16px;background-color:rgb(255,255,255)" class="">Review Manager</p></div></blockquote></div></div><blockquote type="cite" class=""><div class=""><span class="">_______________________________________________</span><br class=""><span class="">swift-evolution-announce mailing list</span><br class=""><span class=""><a href="mailto:swift-evolution-announce@swift.org" target="_blank" class="">swift-evolution-announce@swift.org</a></span><br class=""><span class=""><a href="https://lists.swift.org/mailman/listinfo/swift-evolution-announce" target="_blank" class="">https://lists.swift.org/mailman/listinfo/swift-evolution-announce</a></span><br class=""></div></blockquote></div><br class="">_______________________________________________<br class="">
swift-evolution mailing list<br class="">
<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a><br class="">
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br class="">
<br class=""></blockquote></div><br class=""></div>
</div>
</blockquote>
</div>
</div>_______________________________________________<br class="">swift-evolution mailing list<br class=""><a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a><br class="">https://lists.swift.org/mailman/listinfo/swift-evolution<br class=""></div></blockquote></div><br class=""></body></html>