[swift-evolution] Proposal: Replace ?? by an (optional) argument to ?

Rob Mayoff mayoff at dqd.com
Mon Jan 25 20:52:27 CST 2016


`x?(false)` already has a meaning. If `x` is of type `Optional<(Bool) ->
()>`, then `x?(false)` means “if x is None, do nothing; if x is Some(f),
call f(false)”.

I don't think the end is "the most important position", and I don't think
the default value is necessarily "the least important part of the
expression".

I like the existing ?? operator more than this idea.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160125/3c195bad/attachment.html>


More information about the swift-evolution mailing list