Swift 1.2 and Xcode 6.3 beta
developer.apple.com
Swift 1.2 and Xcode 6.3 beta
1–10 of 94 posts
Re: Swift 1.2 and Xcode 6.3 beta
#2Re: Swift 1.2 and Xcode 6.3 beta
#3let x : SomeThing
if condition {
x = foo()
} else { x = bar()
}use(x)
Re: Swift 1.2 and Xcode 6.3 beta
#4This is practical. It's something you wish for within a couple hours of Swift. let x : SomeThing if condition { x = foo() } else { x = bar() } use(x)
let x : Something = condition ? foo() : bar()
but yeah, it would be nice to defer initialization of an immutable.
Re: Swift 1.2 and Xcode 6.3 beta
#5This is practical. It's something you wish for within a couple hours of Swift. let x : SomeThing if condition { x = foo() } else { x = bar() } use(x)
short of having a language mechanism for doing an 'uninitialized' let, conditional operators could work: let x : Something = condition ? foo() : bar() but yeah, it would be nice to defer initialization of an immutable.
Re: Swift 1.2 and Xcode 6.3 beta
#6This is practical. It's something you wish for within a couple hours of Swift. let x : SomeThing if condition { x = foo() } else { x = bar() } use(x)
short of having a language mechanism for doing an 'uninitialized' let, conditional operators could work: let x : Something = condition ? foo() : bar() but yeah, it would be nice to defer initialization of an immutable.
Re: Swift 1.2 and Xcode 6.3 beta
#7This is practical. It's something you wish for within a couple hours of Swift. let x : SomeThing if condition { x = foo() } else { x = bar() } use(x)
short of having a language mechanism for doing an 'uninitialized' let, conditional operators could work: let x : Something = condition ? foo() : bar() but yeah, it would be nice to defer initialization of an immutable.