<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="">Le 13 févr. 2016 à 00:15, Douglas Gregor via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> a écrit :</div><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><blockquote style="box-sizing: border-box; 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="box-sizing: border-box; margin-top: 0px; margin-bottom: 0px;" class=""><font face="Helvetica Neue, Helvetica, Segoe UI, Arial, freesans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol" class="" size="3" color="#777777"><a href="https://github.com/apple/swift-evolution/blob/master/proposals/0024-optional-value-setter.md" class="">https://github.com/apple/swift-evolution/blob/master/proposals/0024-optional-value-setter.md</a></font></div></blockquote><ul style="box-sizing: border-box; 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 style="box-sizing: border-box;" class="">What is your evaluation of the proposal?</li></ul></div></div></blockquote><div>Fits among the other assignment operators. Contrary to some beliefs, the nil/optional coalescing operator can still return an optional:</div><div><br class=""></div><div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(79, 129, 135);" class="">strongOptional<span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> = </span>strongOptional<span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> ?? </span>weakOptional</div><div class=""><br class=""></div><div class="">So the ??= assignment is well suited (for the form resulting in optional):</div><div class=""><br class=""></div><div class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(79, 129, 135);" class="">strongOptional<span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> ??= </span>weakOptional</div></div><div class=""><br class=""></div><div class="">It may not be the best option for dictionary as some pointed out, but it can be use outside dictionary as well, allowing one to break long chain of nil/optional coalescing.</div><div class=""><br class=""></div><div class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(79, 129, 135);" class="">strongOptional<span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> = </span>strongOptional<span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> ?? </span>weakOptional<span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> ?? </span>weakerOptional<span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> ?? </span>weakestOptional</div></div><div class=""><br class=""></div><div class="">In some possible used case:</div><div class=""><br class=""></div><div class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(79, 129, 135);" class="">currentSetting<span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> = </span>currentSetting<span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> ?? </span>userDefault<span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> ?? </span>systemDefault<span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> ?? </span>builtinDefault</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(79, 129, 135);" class="">currentSetting<span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> ??= </span>userDefault</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(79, 129, 135);" class="">currentSetting<span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> ??= </span>systemDefault</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(79, 129, 135);" class="">currentSetting<span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> ??= </span>builtinDefault</div></div><div class=""><br class=""></div></div><blockquote type="cite" class=""><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><ul style="box-sizing: border-box; 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 style="box-sizing: border-box;" class="">Is the problem being addressed significant enough to warrant a change to Swift?</li></ul></div></div></blockquote><div>Not really a problem, just a "why is this missing" state. The change also seem of minimal churn and be of low risk.</div><br class=""><blockquote type="cite" class=""><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><ul style="box-sizing: border-box; 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 style="box-sizing: border-box;" class="">Does this proposal fit well with the feel and direction of Swift?</li></ul></div></div></blockquote>It’s just an assignment operator among others which are similar in shape, its not evolution and as such have no direction.</div><div><br class=""><blockquote type="cite" class=""><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><ul style="box-sizing: border-box; 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 style="box-sizing: border-box;" class="">If you have used other languages or libraries with a similar feature, how do you feel that this proposal compares to those?</li></ul></div></div></blockquote>Nope</div><div><br class=""><blockquote type="cite" class=""><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><ul style="box-sizing: border-box; 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 style="box-sizing: border-box;" class="">How much effort did you put into your review? A glance, a quick reading, or an in-depth study?</li></ul></div></div></blockquote></div>Been following the thread<div class=""><br class=""></div><div class="">Dany</div></body></html>