[swift-evolution] [Pitch] Add Null struct to Foundation
michael.peternell at gmx.at
Thu Jun 23 17:59:08 CDT 2016
I think NSNull() should be used, not a struct. I don't think that a struct would be more performant. Or maybe the performance doesn't matter at all in any real-world usage scenario. But you may write a benchmark of a realistic (!) use-case (!) if you think otherwise... would be interesting to see the results.
Keeping with NSNull() also simplifies objc-interoperability.
> Am 23.06.2016 um 06:14 schrieb Alsey Miller via swift-evolution <swift-evolution at swift.org>:
> Add a struct Null to the Swift 3.0 Foundation value types. As a struct, Null is more performant (no ARC or memory allocation) than NSNull, and will be needed for Swift JSON decoders and libraries that want to use struct value types, and be free from classes for their model layer.
> swift-evolution mailing list
> swift-evolution at swift.org
More information about the swift-evolution