[swift-evolution] [Review] SE-0024 "Optional Value Setter `??=`"

Sune Foldager cyano at me.com
Tue Feb 16 12:38:18 CST 2016

> On 13 Feb 2016, at 06:15, Douglas Gregor via swift-evolution <swift-evolution at swift.org> wrote:
> What is your evaluation of the proposal?
I’m -1. My main objection is the same as others have brought up, namely that, contrary to ??, it keeps us in “optional land”. That is, a ??= b ~> a = a ?? b, so a must be optional.

> Is the problem being addressed significant enough to warrant a change to Swift?
I don’t think so. In Python, where ||= works, I do use that from time to time because it’s “idiomatic”, but I don’t really think it’s very obvious what it does. In Swift, my programming style is a bit different, and I don’t find myself needing it. Especially due to the way it keeps optional (which is obviously not an issue in Python).

> Does this proposal fit well with the feel and direction of Swift?
I don’t know, but I don’t think it’s a very important addition and can lead to confusion instead.

> How much effort did you put into your review? A glance, a quick reading, or an in-depth study?
Read the responses. Thought about my own use, and looked at some Python and Swift code.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160216/5b5694bf/attachment.html>

More information about the swift-evolution mailing list