[swift-evolution] [Pitch] Add Null struct to Foundation
colemancda at me.com
Thu Jun 23 00:57:42 CDT 2016
Specifically, line 77 in JSON.swift
> On Jun 23, 2016, at 12:54 AM, David Waite <david at alkaline-solutions.com> wrote:
>> On Jun 22, 2016, at 10:14 PM, Alsey Miller via swift-evolution <swift-evolution at swift.org <mailto:swift-evolution at swift.org>> wrote:
>> 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.
> I assume you are thinking of [String:SomeRootJSONProtocol] as the Object type? However, once you reference the data as a protocol however, it will be promoted and stored as a reference type.
> I’ve preferred a similar approach to the following for JSON (although this isn’t my code): https://gist.github.com/dorentus/1e2132edfb174028bf11#file-json-swift-L30-L38 <https://gist.github.com/dorentus/1e2132edfb174028bf11#file-json-swift-L30-L38>
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the swift-evolution