Re: [swift-users] [swift-corelibs-dev] String manipulation (replacingOccurrences) in Linux swift

2016-05-28 Thread Tony Parker via swift-users
Hi Brent, > On May 26, 2016, at 2:29 PM, Brent Royal-Gordon via swift-corelibs-dev > wrote: > >>#if os(Linux) >>print("Let's change those carriage returns...") >>processedString = string.replacingOccurrences(of: "\r\n", with: >>

Re: [swift-users] Foundation on Linux `CFBooleanGetTypeID`/`CFGetTypeID`

2016-05-24 Thread Tony Parker via swift-users
Let’s get a bug into JIRA, then we’ll figure out what we should do here. - Tony > On May 24, 2016, at 1:03 PM, Jens Alfke wrote: > > >> On May 24, 2016, at 12:52 PM, Tony Parker > > wrote: >> >> One other

Re: [swift-users] Foundation on Linux `CFBooleanGetTypeID`/`CFGetTypeID`

2016-05-24 Thread Tony Parker via swift-users
> On May 24, 2016, at 12:49 PM, Jens Alfke wrote: > > >> On May 24, 2016, at 11:03 AM, Tony Parker > > wrote: >> >> Why not use `func boolValue` instead, if you need a true/false answer? > > I don’t remember the

Re: [swift-users] Foundation on Linux `CFBooleanGetTypeID`/`CFGetTypeID`

2016-05-24 Thread Tony Parker via swift-users
> On May 24, 2016, at 1:11 PM, Ryan Lovelett wrote: > > On Tue, May 24, 2016, at 04:07 PM, Tony Parker wrote: >> Let’s get a bug into JIRA, then we’ll figure out what we should do here. > > That's the problem for me. What is the bug? Based on the code example I >

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

2016-07-12 Thread Tony Parker via swift-users
Feel free to file issues for us at bugs.swift.org when you find these kinds of things. Since we have two different source code bases for these APIs, we need to find and fix these kinds of mismatches. This year has had a lot of renaming, so hopefully once we get them all

Re: [swift-users] Possible swift 3 method rewrite issue with NSRequestConcreteImplementation ?

2016-07-21 Thread Tony Parker via swift-users
FYI: https://github.com/apple/swift/pull/3663 <https://github.com/apple/swift/pull/3663> - Tony > On Jul 20, 2016, at 12:10 PM, Tony Parker via swift-users > <swift-users@swift.org> wrote: > >> >> On Jul 20, 2016, at 5:17 AM, John Spurlock <john.spurl

Re: [swift-users] Possible swift 3 method rewrite issue with NSRequestConcreteImplementation ?

2016-07-21 Thread Tony Parker via swift-users
t; On Jul 21, 2016, at 13:06, Tony Parker via swift-users >> <swift-users@swift.org <mailto:swift-users@swift.org>> wrote: >> >> FYI: >> >> https://github.com/apple/swift/pull/3663 >> <https://github.com/apple/swift/pull/3663> >>

Re: [swift-users] Possible swift 3 method rewrite issue with NSRequestConcreteImplementation ?

2016-07-20 Thread Tony Parker via swift-users
> On Jul 20, 2016, at 5:17 AM, John Spurlock wrote: > > 1. Since encoding/decoding various types is the principal domain of this > type, it seems ok to be overly clear in the method names here. > Agreed; I’m trying out a few approaches to see what works best. > 2.

Re: [swift-users] Possible swift 3 method rewrite issue with NSRequestConcreteImplementation ?

2016-07-18 Thread Tony Parker via swift-users
Probably, but there could be a compiler bug or importer bug lurking here. - Tony > On Jul 18, 2016, at 5:29 PM, Jacob Bandes-Storch <jtban...@gmail.com> wrote: > > Shouldn't that be implicit, since the function is `override`? > > On Mon, Jul 18, 2016 at 5:25 PM, Tony P

Re: [swift-users] Possible swift 3 method rewrite issue with NSRequestConcreteImplementation ?

2016-07-18 Thread Tony Parker via swift-users
We renamed some of these methods for Swift 3 in an attempt to remove some of the confusion surrounding which of these did what - they were really named for C types and not Swift ones. encodeInt:forKey: and decodeInt:forKey: are the two missing ones, since they were easily confused with the

Re: [swift-users] Possible swift 3 method rewrite issue with NSRequestConcreteImplementation ?

2016-07-18 Thread Tony Parker via swift-users
Hi John, Can you try this? @objc(encodeInt:forKey:) override func encode(_ intv: Int, forKey key: String) { print("\(key) \(intv)") // never called } - Tony > On Jul 18, 2016, at 12:11 AM, John Spurlock via swift-users > wrote: > > Minimal repro case

Re: [swift-users] Possible swift 3 method rewrite issue with NSRequestConcreteImplementation ?

2016-07-19 Thread Tony Parker via swift-users
I thought of the exact same name, but I'm not enthusiastic about the inconsistency this creates with all of the other decode methods on NSCoder. I'm discussing with a few people to decide what to do next. - Tony > On Jul 19, 2016, at 6:32 PM, Brent Royal-Gordon >

Re: [swift-users] Possible swift 3 method rewrite issue with NSRequestConcreteImplementation ?

2016-07-19 Thread Tony Parker via swift-users
Hi John, Thanks for filing the bug. The root cause of the issue is that the importer would turn the following methods into the same name: - (void)encodeInt:(int)x forKey:(NSString *)k; - (void)encodeInt32:(uint32_t)x forKey:(NSString *)k; Plus, there is the added confusion that this method:

Re: [swift-users] NSJSONSerialization barfs writing a Dictionary parsed from JSON: "Invalid type in JSON write (_SwiftValue)"

2016-11-18 Thread Tony Parker via swift-users
FYI, here is the GitHub commit that addressed this issue: https://github.com/apple/swift/commit/1f11ef2fd29f214bd9d9a5fa85246d36c04448f0 It was also reported as SE-0140. Basically, optional values were getting

Re: [swift-users] Decimal imported as NSDecimal not NSDecimalNumber in Swift 3 to Objective C

2016-11-11 Thread Tony Parker via swift-users
Hi Chris, Can you file a radar or JIRA for us on this? It looks like something should be fixed in the documentation at least, or perhaps in the bridging. - Tony > On Nov 11, 2016, at 1:46 PM, Chris Anderson via swift-users > wrote: > > I'm having problems with the

Re: [swift-users] Is there any way to decode from Any type JSON Object using JSONDecoder?

2017-06-22 Thread Tony Parker via swift-users
Hi Masaki, Do you mean that you are going through the JSON as a string value and changing the keys, then you want to pass this re-written JSON to the decoder? - Tony > On Jun 21, 2017, at 6:58 PM, Masaki Haga via swift-users > wrote: > > Hi Swift-Users, > > I was

Re: [swift-users] Decode a JSON object of unknown format into a Dictionary with Decodable in Swift 4

2017-06-22 Thread Tony Parker via swift-users
Hi Jon, > On Jun 22, 2017, at 6:00 PM, Jon Shier wrote: > > Tony: > My main concern here is that, as Swift’s official JSON parsing method, > Codable should be able to handle any JSON representation and use and it > doesn’t. In fact, it can’t. If that’s considered okay

Re: [swift-users] Decode a JSON object of unknown format into a Dictionary with Decodable in Swift 4

2017-06-22 Thread Tony Parker via swift-users
Hi Jon, Usually this boils down to a question of: what are you going to do with the Any? If you intended to cast it to a dictionary and get at its values using string keys, then writing a struct with the properties you care about is the way we recommend doing this. You don’t have to include

Re: [swift-users] KVC - KeyPath in Operation

2017-06-14 Thread Tony Parker via swift-users
Hi Somu, You can certainly file a bug for us. It may be something we are already tracking or already fixed, but the bug report will let us double check that. Thanks, - Tony > On Jun 13, 2017, at 12:33 PM, somu subscribe via swift-users > wrote: > > Thanks a lot Jordan

Re: [swift-users] KVC - KeyPath in Operation

2017-06-16 Thread Tony Parker via swift-users
> Hope this helps. > > - Rod > > > >> On 15 Jun 2017, at 10:27 am, Tony Parker via swift-users >> <swift-users@swift.org <mailto:swift-users@swift.org>> wrote: >> >> Hi Somu, >> >> You can certainly file a bug for us. It may be som

Re: [swift-users] KVC - KeyPath in Operation

2017-10-28 Thread Tony Parker via swift-users
. >>> >>> - Tony >>> >>>> On Jun 15, 2017, at 9:14 PM, Rod Brown <rodney.bro...@icloud.com> wrote: >>>> >>>> Hi Tony and Somu, >>>> >>>> I have an open radar for this one which has been outstanding for a