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

2016-05-24 Thread Jens Alfke via swift-users
> On May 24, 2016, at 1:39 PM, Ryan Lovelett wrote: > > I have filed a bug https://bugs.swift.org/browse/SR-1610 > > > Obviously please reformat/update accordingly. This was the best I could come > up with. Your issue

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

2016-05-24 Thread Ryan Lovelett via swift-users
On Tue, May 24, 2016, at 04:18 PM, Jens Alfke via swift-users wrote: > For completeness I should add that there are other cases where you need > to know the exact type: > > * When formatting a floating-point number, you should use 6 decimal > places if it's a float, 16 if it's a double. (If you

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

2016-05-24 Thread Ryan Lovelett via swift-users
On Tue, May 24, 2016, at 04:19 PM, Tony Parker wrote: > >> On May 24, 2016, at 1:11 PM, Ryan Lovelett > d...@ryan.lovelett.me> 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

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] Foundation on Linux `CFBooleanGetTypeID`/`CFGetTypeID`

2016-05-24 Thread Jens Alfke via swift-users
For completeness I should add that there are other cases where you need to know the exact type: * When formatting a floating-point number, you should use 6 decimal places if it's a float, 16 if it's a double. (If you use all 15 for a float, you end up with results like “0.999”

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

2016-05-24 Thread Ryan Lovelett via swift-users
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 provided in this thread. I'm somewhat convinced that the bug is that Foundation on

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 Ryan Lovelett via swift-users
On Tue, May 24, 2016, at 02:03 PM, Tony Parker wrote: > Hi Ryan, > > NSNumber basically exists to hide the underlying number type. > > Why not use `func boolValue` instead, if you need a true/false answer? It's not so much that I need a bool _answer_. Its more that I need to know what _type_

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 Jens Alfke via swift-users
> 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 original code snippet, but there are cases where you need to know what type of number is stored in an NSNumber. An

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

2016-05-23 Thread Ryan Lovelett via swift-users
On Mon, May 23, 2016, at 04:33 PM, Jens Alfke wrote: > >> On May 23, 2016, at 12:25 PM, Ryan Lovelett via swift-users > us...@swift.org> wrote: >> >> However it seems that Foundation on Linux has neither >> `CFBooleanGetTypeID` or `CFGetTypeID`. > > Those are part of CoreFoundation, the C library

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

2016-05-23 Thread Ryan Lovelett via swift-users
I am trying to run some Swift code that relies on Foundation on Linux (it is thoughtbot's Argo library if anyone wants to know the exact code). There is a fairly simple extension to NSNumber that looks like: import Foundation extension NSNumber { var isBool: Bool { return