Re: [swift-corelibs-dev] Foundation and NSDecimal

2016-09-28 Thread Kenny Leung via swift-corelibs-dev
I would also say that this should not be marked as @discardableResult, since 
its only purpose is to report back yes or no, it would be kind of suspicious if 
the it wasn’t used.

-Kenny


> On Sep 27, 2016, at 5:34 AM, Alex Blewitt via swift-corelibs-dev 
>  wrote:
> 
> The Framework function 
> 
> NS_INLINE BOOL NSDecimalIsNotANumber(const NSDecimal *dcm)
> 
> has been imported into Swift on both Darwin and Linux as
> 
> :type lookup NSDecimalIsNotANumber
> @discardableResult func NSDecimalIsNotANumber(_ dcm: 
> Swift.UnsafePointer) -> Swift.Bool
> :type lookup NSDecimalIsNotANumber
> func NSDecimalIsNotANumber(_ dcm: Swift.UnsafePointer) -> 
> Swift.Bool
> 
> However I think this should instead be imported as a member function on the 
> Decimal type, instead of passing through a pointer.
> 
> extension Decimal {
>  public func isNotANumber() -> Bool
> }
> 
> This may not have been picked up by the automatic renaming progress because 
> it's a const pointer, and because it's an NS_INLINE defined in the header, 
> instead of in an implementation file.
> 
> There are some other global constants NSDecimalMaxSize and NSDecimalNoScale, 
> which should probably be implemented as constants in the Decimal type as well 
> e.g.
> 
> extension Decimal {
>  public let maxSize = 8
>  public let noScale =  Int16.max
> }
> 
> Since this would need to be fixed in both the Swift Linux foundation 
> implementation and the Darwin overlay (and it would be a breaking change) 
> what is the right process to be able to fix this?
> 
> Alex
> ___
> swift-corelibs-dev mailing list
> swift-corelibs-dev@swift.org
> https://lists.swift.org/mailman/listinfo/swift-corelibs-dev

___
swift-corelibs-dev mailing list
swift-corelibs-dev@swift.org
https://lists.swift.org/mailman/listinfo/swift-corelibs-dev


Re: [swift-corelibs-dev] Implementing HTTPCookieStorage

2016-11-07 Thread Kenny Leung via swift-corelibs-dev
I’m for locating it in the same place on all platforms. In general, I’m tired 
of digging around in different places for stuff depending on which flavor I’m 
using.

-Kenny


> On Nov 7, 2016, at 2:45 PM, Tony Parker via swift-corelibs-dev 
>  wrote:
> 
> Hi Pushkar,
> 
> Good question. If this were Darwin I guess I would say ~/Library/Application 
> Support — but I don’t know what the best practices are on other platforms. 
> Does anyone out there have some suggestions?
> 
> - Tony
> 
>> On Nov 7, 2016, at 11:09 AM, Pushkar N Kulkarni via swift-corelibs-dev 
>>  wrote:
>> 
>> Hi there, 
>> 
>> I have spent some time working on a basic implementation of 
>> HTTPCookieStorage. In the process, I came across two crucial questions 
>> related to cookie persistence:
>> 1. How do you persist the cookies?
>> 2. Where do you persist them?
>> 
>> In my current implementation 
>> (https://github.com/apple/swift-corelibs-foundation/pull/672), I write them 
>> to a hidden plist file located in the user's home directory. Would that be 
>> an acceptable approach?
>> 
>> Is there anything more to consider while thinking of persistence? I'd 
>> greatly appreciate suggestions/comments. 
>> 
>> Thanks!
>> Pushkar N Kulkarni,
>> IBM Runtimes
>> 
>> Simplicity is prerequisite for reliability - Edsger W. Dijkstra
>> 
>> 
>> ___
>> swift-corelibs-dev mailing list
>> swift-corelibs-dev@swift.org
>> https://lists.swift.org/mailman/listinfo/swift-corelibs-dev
> 
> ___
> swift-corelibs-dev mailing list
> swift-corelibs-dev@swift.org
> https://lists.swift.org/mailman/listinfo/swift-corelibs-dev

___
swift-corelibs-dev mailing list
swift-corelibs-dev@swift.org
https://lists.swift.org/mailman/listinfo/swift-corelibs-dev


Re: [swift-corelibs-dev] NSSortDescriptor implementation

2017-01-16 Thread Kenny Leung via swift-corelibs-dev
I don’t think it’s possible to implement NSSortDescriptor without 
KeyValueCoding, which is not possible with the current Swift.

-Kenny


> On Jan 13, 2017, at 9:31 AM, Sergej Jaskiewicz via swift-corelibs-dev 
>  wrote:
> 
> Hello, Swift community.
> 
> I would like to participate in implementing NSSortDescriptor. Has anybody 
> already been doing anything with this part of Foundation? If not, I’d be glad 
> to take this task and see what I can come up with.
> 
> Is there anything I should know before I start? I mean some unobvious 
> subtleties with NSSortDescriptor.
> ___
> swift-corelibs-dev mailing list
> swift-corelibs-dev@swift.org
> https://lists.swift.org/mailman/listinfo/swift-corelibs-dev

___
swift-corelibs-dev mailing list
swift-corelibs-dev@swift.org
https://lists.swift.org/mailman/listinfo/swift-corelibs-dev