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

Craig Cruden ccruden at novafore.com
Fri Jan 29 06:52:30 CST 2016


I think my last response was vague and not in response to this email but I really like this formatting better (though it is probably too late).   

If you really want to hack in mutable state in the inner part — then it would be a matter of 

if exists foo {
	var bar = foo // non-optional
	...
}

But I don’t think I would write new code like that anyways.



> On 2016-01-29, at 12:54:12, Thorsten Seitz via swift-evolution <swift-evolution at swift.org> wrote:
> 
> This is called flow typing in Ceylon and they are using "exists" for that case but testing for conformance with "is" works just the same way there. The latter is of importance because the common use of union types in Ceylon.
> 
> if exists foo {
>         // foo is non-optional here
> }
> 
> if foo is String {
>         // foo is of type String here
> }
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160129/68d61402/attachment.html>


More information about the swift-evolution mailing list