Re: [swift-users] Problem with COW optimization

2016-09-18 Thread Dave Abrahams via swift-users
on Sun Sep 18 2016, Adrian Zubarev wrote: > Dear Swift community, > > currently I’m building a value type XML library which is baked behind > the scene with a reference type to manage graph traversing between > nodes. I also like to COW optimize the xml graph, but I run into one > single problem

[swift-users] Bls: what's ^ operator for

2016-09-18 Thread Mr Bee via swift-users
Forget it. Just found the answer myself on Swift ebook. It's a bitwise xor operator. And there's no power operator in Swift. Sorry. I've looked for this for hours. Why did I find the answer after I asked here? Life. :) –Mr Bee Pada Minggu, 18 September 2016 19:41, Mr Bee menulis: Hi

Re: [swift-users] Checking whether an object is uniquely referenced, using a weak reference to it

2016-09-18 Thread Dave Abrahams via swift-users
on Tue Jun 28 2016, Jordan Rose wrote: >> On Jun 27, 2016, at 18:52, Tim Vermeulen wrote: >> >> Thanks for your reply. It didn’t clear up everything, though. The >> official documentation says "Weak references do not affect the >> result of this function.”, which suggests that weak (and unowne

[swift-users] Strange compilation error when calling required initializer on generic type parameter

2016-09-18 Thread Christos Chryssochoidis via swift-users
Hi everyone, I'm using the new Xcode 8/Swift 3 and I'm trying to figure out why the first function in the snippet below compiles correctly, while the other one does not. import Foundation import CoreData protocol P { init?(i: Int) } class C { func f(i: Int) -> T? where T: P {

[swift-users] Problem with COW optimization

2016-09-18 Thread Adrian Zubarev via swift-users
Dear Swift community, currently I’m building a value type XML library which is baked behind the scene with a reference type to manage graph traversing between nodes. I also like to COW optimize the xml graph, but I run into one single problem atm. Image this xml tree: It’s just a root e

[swift-users] reading keyboard input from xcode playgroud

2016-09-18 Thread Mr Bee via swift-users
Hi all, Another question. I used to use this snippet to read keyboard input from XCode's Playground. And it used to work very well. Today, I just updated my XCode to v.8 and Swift v.3. After a little bit modification here and there due to Swift 3 incompatibility, I got this code compiled without

Re: [swift-users] what's ^ operator for

2016-09-18 Thread Saagar Jha via swift-users
The ^ operator performs a bitwise XOR . This is not the same as exponentiation. Saagar Jha > On Sep 18, 2016, at 05:41, Mr Bee via swift-users > wrote: > > Hi all, > > I wrote this in XCode Playground… > > let i = 2^2 > print(i) > >

[swift-users] what's ^ operator for

2016-09-18 Thread Mr Bee via swift-users
Hi all, I wrote this in XCode Playground… let i = 2^2print(i) It runs fine without any errors and print 0, while I expect it to print 4 from 2 power by 2 or 2². Swift ebook and even Google gave me nothing on this. What did I miss? Thank you. Regards, –Mr Bee ___

[swift-users] test, test

2016-09-18 Thread Kenny Leung via swift-users
Lists look like they are not working. ___ swift-users mailing list swift-users@swift.org https://lists.swift.org/mailman/listinfo/swift-users