[swift-evolution] Reconsidering SE-0003 Removing var from Function Parameters and Pattern Matching

Charles Srstka cocoadev at charlessoft.com
Sun Jan 24 19:44:18 CST 2016


> On Jan 24, 2016, at 12:31 PM, Dave Abrahams via swift-evolution <swift-evolution at swift.org> wrote:
> 
> on Sun Jan 24 2016, David Owens II <swift-evolution at swift.org <mailto:swift-evolution at swift.org>> wrote:
> 
>> Removing var from function params, I get that. But the if-binding is
>> unfortunate. It's literally a line of code for the sole purpose of
>> making the compiler happy.
> 
> That's not the purpose; even though I am not a fan of prohibiting "var"
> there, I understand that the purpose of doing so is avoiding confusion,
> because some people believe they are getting a reference through which
> to mutate the contents of the original optional.


But that’s not what assigning something to a var means in any other context. Why should it be any different here?

Charles

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160124/55afd013/attachment.html>


More information about the swift-evolution mailing list