[swift-evolution] Brainstorming: Optional sugar inferred map

Paul Ossenbruggen possen at gmail.com
Tue Feb 16 09:16:18 CST 2016


Oh wait, yeah now I see the problem. 

> On Feb 15, 2016, at 10:32 PM, Thorsten Seitz <tseitz42 at icloud.com> wrote:
> 
> 
> Am 16.02.2016 um 05:52 schrieb Paul Ossenbruggen via swift-evolution <swift-evolution at swift.org <mailto:swift-evolution at swift.org>>:
> 
>> Currently it is possible to do this: 
>> 
>> a ?? doSomething(59)
>> 
>> it is not a huge stretch to allow the result of the left hand optional expression on the right hand side:
>> 
>> 	    a ?? doSomething($$)
> 
> Actually it *is* a huge stretch because it is just the opposite!
> The second version is just `map` written with an operator where the rhs is only called for the case that a value is present, i.e. non-nil.
> The first version covers the opposite case where the value is absent, i.e. is nil. 
> 
> -Thorsten 

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


More information about the swift-evolution mailing list