Re: [swift-corelibs-dev] NSCoding methods

2016-01-01 Thread Luke Howard via swift-corelibs-dev
> On 29 Dec 2015, at 10:54 AM, Philippe Hausler wrote: > > It is ok on the special types; those are harder than they may seem… NSValue > in Darwin has some limitations like that especially when it comes to secure > coding or non standard aligned values. I have a solution

Re: [swift-corelibs-dev] NSCoding methods

2015-12-30 Thread Luke Howard via swift-corelibs-dev
I’ve written a few unit tests for NSKeyedArchiver/NSKeyedUnarchiver but it could do with lots more (if anyone is interested!). We are gated by some methods not having isEqual() implementations yet (which is used to verify the test results). The tests pass on both Linux and OS X, although

Re: [swift-corelibs-dev] NSCoding methods

2015-12-26 Thread Luke Howard via swift-corelibs-dev
> On 27 Dec 2015, at 3:45 AM, Philippe Hausler wrote: > > Totally reasonable since that is a limitation that will cause subclassers to > not be able to implement that even outside of Foundation. > > What would help most for unit testing what you have so far? > > I have a

Re: [swift-corelibs-dev] NSCoding methods

2015-12-23 Thread Luke Howard via swift-corelibs-dev
> On 24 Dec 2015, at 9:37 AM, Jordan Rose wrote: > > No, we cannot encode things "non-mangled but with the namespace". For any > type other than top-level non-generic class types, using a non-mangled name > is not unique. The only correct answer for arbitrary classes is

Re: [swift-corelibs-dev] NSCoding methods

2015-12-23 Thread Philippe Hausler via swift-corelibs-dev
NSCoding will have to use something to transform from strings to classes, and that satisfy the two cases (or more) that we have already shown, currently there is no thing that does that in either form; either mangled or non mangled. Basically we need something to implement NSClassFromString

Re: [swift-corelibs-dev] NSCoding methods

2015-12-22 Thread Luke Howard via swift-corelibs-dev
> On 22 Dec 2015, at 5:50 AM, Jordan Rose wrote: > > IMHO on Linux NSKeyedArchiver should always use mangled names. If we want > cross-platform archives, we should set up standard substitutions, but given > that Swift classes exposed to Objective-C are archived with

Re: [swift-corelibs-dev] NSCoding methods

2015-12-22 Thread Philippe Hausler via swift-corelibs-dev
To clarify the goals: I think it is reasonable for us to have a goal to be able to encode/decode archives from foreign targets; e.g. linux encodes an archive and mac os x decodes or iOS encodes and linux decodes. This will allow for server architecture to transmit binary archives across the

Re: [swift-corelibs-dev] NSCoding methods

2015-12-22 Thread Luke Howard via swift-corelibs-dev
Some work on NSKeyedArchiver below: https://github.com/lhoward/swift-corelibs-foundation/tree/lhoward/nscoding Very incomplete (most classes don’t have coders, there is no unarchiver, inexperienced Swift programmer). — Luke ___ swift-corelibs-dev

Re: [swift-corelibs-dev] NSCoding methods

2015-12-19 Thread Philippe Hausler via swift-corelibs-dev
Somewhat; the mangled symbols are technically searchable by dlsym but that seems like a hack. Perhaps one of the stdlib/compiler team might be able to speak more on this than myself and they may have suggestions for a better way. Foundation is at a special spot in which we can sometimes get

[swift-corelibs-dev] NSCoding methods

2015-12-12 Thread Daniel Strokis via swift-corelibs-dev
Hi All, I’ve noticed that for many classes in Foundation, encodeWithCoder and init?(coder aDecoder: NSCoder) call NSUnimplemented. Are these methods that just haven’t been implemented yet, or are we not interested in implementing these moving forward? Apologies if this has already been