Re: [swift-users] Why there's no Character literals?

2016-07-10 Thread Saagar Jha via swift-users
Yes, but then a similar complaint could be made that I wanted a String this time. The only real way to tell the difference is to use something like single quotes. > On Jul 10, 2016, at 14:03, Rick Mann via swift-users > wrote: > > >> On Jul 10, 2016, at 11:44 , Saagar

Re: [swift-users] Difference between Apple and Linux versions of Swift - CompareOptions

2016-07-10 Thread Zhao Xin via swift-users
You are right, the shorter one will exist in the final release. Always the shorter ones. Zhaoxin On Mon, Jul 11, 2016 at 9:50 AM, Jon Hoffman wrote: > Thank you for the reply. I am pretty sure that you are correct about them > being the same when Swift 3 is released. I

Re: [swift-users] Syntax for extending a struct conforming to a protocol with constraint

2016-07-10 Thread Austin Zheng via swift-users
You can't do this yet, but it's on the roadmap: https://github.com/apple/swift/blob/master/docs/GenericsManifesto.md#conditional-conformances- Austin > On Jul 9, 2016, at 10:54 PM, 褚晓敏 via

Re: [swift-users] Syntax for extending a struct conforming to a protocol with constraint

2016-07-10 Thread Zhao Xin via swift-users
How about this? struct Polynomial { > //definition goes here > } > extension Polynomial: CustomStringConvertible { > //implementation goes here > } Zhaoxin On Sun, Jul 10, 2016 at 1:54 PM, 褚晓敏 via swift-users wrote: > Hello, every one. I want to extend

Re: [swift-users] Difference between Apple and Linux versions of Swift - CompareOptions

2016-07-10 Thread Jon Hoffman via swift-users
Thank you for the reply. I am pretty sure that you are correct about them being the same when Swift 3 is released. I am more concerned about which API will be the correct one when Swift 3 is officially released. My assumption is the Xcode version will be the final one but just wanted to

Re: [swift-users] Difference between Apple and Linux versions of Swift - CompareOptions

2016-07-10 Thread Zhao Xin via swift-users
I think they should be the same when Swift 3 release. You example is just how API will change from Swift 2 to 3. You can file a bug if you want to speed up the changing. Zhaoxin On Mon, Jul 11, 2016 at 6:13 AM, Jon Hoffman via swift-users < swift-users@swift.org> wrote: > With Swift 3.0 Preview

Re: [swift-users] Why there's no Character literals?

2016-07-10 Thread Zhao Xin via swift-users
Of course not. Struct Set is commonly known. let foo:Set = [1,2,3,4] let bar:Set = [1,2,3,4] If you do not specify them as Sets, foo and bar will be Arrays. Zhaoxin On Thu, Jul 7, 2016 at 5:35 PM, 王 黎明 wrote: > > In Swift, we must specify the type for Character

Re: [swift-users] Why there's no Character literals?

2016-07-10 Thread Rick Mann via swift-users
> On Jul 10, 2016, at 11:44 , Saagar Jha via swift-users > wrote: > > Well, what if you wanted to create a String with one character? There’s no > way to differentiate. That hardly seems like the justification. In that case, you'd specify the type: let s: String =

Re: [swift-users] Why there's no Character literals?

2016-07-10 Thread Saagar Jha via swift-users
Well, what if you wanted to create a String with one character? There’s no way to differentiate. > On Jul 7, 2016, at 02:35, 王 黎明 via swift-users [swift-users@swift.org](mailto:swift-users@swift.org) wrote: > In Swift, we must specify the type for Character variables(because there’s no Character

Re: [swift-users] lazy initialisation

2016-07-10 Thread Karl via swift-users
> On 9 Jul 2016, at 06:34, Zhao Xin wrote: > > The compiler is not smart enough to treat this as you think, nor it will be > designed to. According to the documents, it is the developer‘s burden ​to add > @noescape or weak or unowned. So I disagree it is a bug. > > Zhaoxin