Re: [swift-users] Subclass doesn't inherit convenience initialiser

2016-05-30 Thread Krzysztof Siejkowski via swift-users
Which swift version are you using? Your code works correctly for me on Swift 2.2 in the Playgrounds, apart from the wrong letter casing of the argument label (should be `URL`, not `url`). On the separate note, your usecase seems like a great place for writing an extension of NSMutableURLRequest

[swift-users] Can't get Error pattern matching to work cross framework and command line tool

2016-05-30 Thread Joakim Hassila via swift-users
Ok, I am stumped and wanted to see if anyone had any ideas on how to troubleshoot this. Short background: First off, I do have throwing/do/catch working perfectly fine in Playgrounds as well as in standalone apps as well as in an app that links with one of my own test frameworks, so I would hop

Re: [swift-users] swift-users Digest, Vol 6, Issue 28

2016-05-30 Thread Brent Royal-Gordon via swift-users
> Thanks for the tip on print(String(validatingUTF8: buf)), that does > reproduce my input text, line for line, EXCEPT for wrapping every line in > "Optional(line-of-text-with-terminator)", for example "Optional("import > Glibc\n")". > > So, how does wrapping a line of UTF8 text in another cha

Re: [swift-users] swift-users Digest, Vol 6, Issue 28

2016-05-30 Thread John Myers via swift-users
Is there a way to format the text in the following link that appeared in today's digest? The code toward the bottom is all run together. I would edit to correct it if that were possible. Thanks! On Mon, May 30, 2016 at 12:00 PM, wrote:

[swift-users] Protocol doesn't conform to itself: Any workaround?

2016-05-30 Thread Charles Srstka via swift-users
So, the pitfall below seems to be fairly well-known, as I was able to find previous references to it on the list: -- protocol P { func foo() } struct S: P { func foo() { print("foo") } } func doSomething(c: C) { for each in c { each.foo() } } let arr: [P] = [S()

[swift-users] Subclass doesn't inherit convenience initialiser

2016-05-30 Thread Michal Kalinowski via swift-users
Hello, I'm subclassing NSMutableURLRequest to patch lack of httpBody property. My subclass doesn't implement any initialisers so it inherits all the designated initialisers. From what I understand, since all designated initialisers are implemented(inherited) then I should also inherit convenie

Re: [swift-users] Simple text file I/O with Swift 3 (Quinn "The Eskimo!")

2016-05-30 Thread Ken Burgett via swift-users
On 2016-05-30 10:00, swift-users-requ...@swift.org wrote: Send swift-users mailing list submissions to swift-users@swift.org To subscribe or unsubscribe via the World Wide Web, visit https://lists.swift.org/mailman/listinfo/swift-users or, via email, send a message with subject o

Re: [swift-users] swift-users Digest, Vol 6, Issue 28

2016-05-30 Thread Ken Burgett via swift-users
On 2016-05-30 10:00, swift-users-requ...@swift.org wrote: Send swift-users mailing list submissions to swift-users@swift.org To subscribe or unsubscribe via the World Wide Web, visit https://lists.swift.org/mailman/listinfo/swift-users or, via email, send a message with subject o

Re: [swift-users] Simple text file I/O with Swift 3

2016-05-30 Thread Ken Burgett via swift-users
Sorry, that does not compile with Swift 3. First of all, the expression "(count:BUFSIZE, repeatedValue:CChar(0))" must be written as "(repeating:CChar(0), count:BUFSIZE)", Note that the order within the expression is significant (don't ask me why, it just is. Ask the language designers). Sec

Re: [swift-users] Simple text file I/O with Swift 3

2016-05-30 Thread Quinn "The Eskimo!" via swift-users
On 28 May 2016, at 19:05, Ken Burgett via swift-users wrote: > print(buf) The trick here is to replace the above line with: print(String(validatingUTF8: buf)) `fgets` sets up `buf` to hold a C string, so you have to convert it to a Swift string. How do you do this depends on the encod