<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hi Ryan,<div class=""><br class=""></div><div class="">NSNumber basically exists to hide the underlying number type.</div><div class=""><br class=""></div><div class="">Why not use `func boolValue` instead, if you need a true/false answer?</div><div class=""><br class=""></div><div class="">- Tony</div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On May 23, 2016, at 2:01 PM, Ryan Lovelett via swift-users &lt;<a href="mailto:swift-users@swift.org" class="">swift-users@swift.org</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class="">


<title class=""></title>

<div class=""><div class="">On Mon, May 23, 2016, at 04:33 PM, Jens Alfke wrote:<br class=""></div>
<blockquote type="cite" class=""><div class="">&nbsp;<br class=""></div>
<div class=""><blockquote type="cite" class=""><div class="">On May 23, 2016, at 12:25 PM, Ryan Lovelett via swift-users &lt;<a href="mailto:swift-users@swift.org" class="">swift-users@swift.org</a>&gt; wrote:<br class=""></div>
<div class="">&nbsp;<br class=""></div>
<div class=""><div class=""><span class="font" style="font-family:Alegreya-Regular"><span class="size" style="font-size:15px">However it seems that Foundation on Linux has neither</span></span><br class=""></div>
<div class=""><span class="font" style="font-family:Alegreya-Regular"><span class="size" style="font-size:15px">`CFBooleanGetTypeID` or `CFGetTypeID`.</span></span><br class=""></div>
</div>
</blockquote></div>
<div class="">&nbsp;<br class=""></div>
<div class="">Those are part of CoreFoundation, the C library on which the Mac/iOS Foundation framework is built. The two have a complicated relationship; Foundation exposes most but not all of the CoreFoundation APIs as Objective-C, but there are still some features you have to drop down to C to use. This is one.<br class=""></div>
<div class="">&nbsp;<br class=""></div>
<div class="">But I think you’re using the in-development Swift Foundation? That’s a different implementation entirely. Presumably it will have some API of its own to determine the type of a number.<br class=""></div>
</blockquote><div class="">&nbsp;<br class=""></div>
<div class="">Yes I'm using the in-development Swift Foundation. From what I can tell this version is the one that will be used on non-Darwin platforms.<br class=""></div>
<div class="">&nbsp;</div>
<div class="">Assuming that such an API does not currently exist on NSNumber, I'm reasonably confident that it does not, does this mean that a Swift Evolution thread has to be started to add it?</div>
<div class="">&nbsp;</div>
<blockquote type="cite" class=""><div class="">&nbsp;<br class=""></div>
<div class="">—Jens<br class=""></div>
</blockquote><div class="">&nbsp;<br class=""></div>
</div>

_______________________________________________<br class="">swift-users mailing list<br class=""><a href="mailto:swift-users@swift.org" class="">swift-users@swift.org</a><br class="">https://lists.swift.org/mailman/listinfo/swift-users<br class=""></div></blockquote></div><br class=""></div></body></html>