> On 2 Feb 2017, at 14:52, Derrick Ho via swift-evolution > <[email protected]> wrote: > > Shouldn't NSUInteger always become UInt in swift?
Jordan answers this question in his email: For people who would suggest that Swift actually take unsigned integers seriously instead of using ‘Int’ everywhere, I sympathize, but I think that ship has sailed—not with us, but with all the existing UIKit code that uses NSInteger for counters. Consistently importing NSUInteger as UInt would be a massive source-break in Swift 4 that just wouldn’t be worth it. Given that, is it better to more closely model what’s in user headers, or to have consistency between user and system headers? > On Thu, Feb 2, 2017 at 12:07 AM Freak Show via swift-evolution > <[email protected] <mailto:[email protected]>> wrote: > I have a framework I wrote that maps Objective C objects to sqlite records - > deriving sqlite schema definitions from property definitions. You simply > derive model classes from my base class Model and the base class will > introspect the properties and handle all the sql for you. A little like > CoreData but the property definitions are used for the meta model instead of > an external model file and it is a lot leaner and natural feeling. > > I picked NSUInteger for the auto incremented primary key because, after all, > it would never go negative. > > However, when I tried to import this framework into Swift and use Model as a > base class for a Swift class, I found it nearly impossible to satisfy the > compiler about mixed mode comparisons and ultimately changed the type to > NSInteger. > > I was not happy about it and if I wasn't the framework author I would have > thought harder about changing it. > > > > >> On Feb 1, 2017, at 17:29, Jordan Rose via swift-evolution >> <[email protected] <mailto:[email protected]>> wrote: >> >> find out how Objective-C projects are using NSUInteger in their headers: >> >> - Do they have no NSUIntegers at all? >> - Are they using NSUInteger because they’re overriding something that used >> NSUInteger, or implementing a protocol method that used NSUInteger? >> - Are they using NSUInteger as an opaque value, where comparisons and >> arithmetic are uninteresting? >> - Are they using NSUInteger as an index or count of something held in memory? > > _______________________________________________ > swift-evolution mailing list > [email protected] <mailto:[email protected]> > https://lists.swift.org/mailman/listinfo/swift-evolution > <https://lists.swift.org/mailman/listinfo/swift-evolution> > _______________________________________________ > swift-evolution mailing list > [email protected] > https://lists.swift.org/mailman/listinfo/swift-evolution
_______________________________________________ swift-evolution mailing list [email protected] https://lists.swift.org/mailman/listinfo/swift-evolution
