Multicellular Swift: evolution in action

Note: If any more acceptances or reviews show up today or tomorrow, I’ll be updating this post rather than creating a new one.

Accepted Proposals

SE-0053 Remove explicit use of let from Function Parameters got rid of a single case that prevented SE-0001 from being implemented without exceptions. It’s a bookkeeping kind of proposal but one that simplifies and cleans up Swift.

SE-0016 Adding initializers to Int and UInt to convert from UnsafePointer and UnsafeMutablePointer means you won’t have to write all your pointer arithmetic in C: “Just as users can create Unsafe[Mutable]Pointers from Ints and UInts, they should be able to create Ints and UInts from Unsafe[Mutable]Pointers. This will allow users to call C functions with intptr_t and uintptr_t parameters, and will allow users to perform more advanced pointer arithmetic than is allowed by UnsafePointers.”

SE-0054 Abolish ImplicitlyUnwrappedOptional (IUO) type was accepted pending user experience, or as I like to call it, “Swift try before Swift buy“. The idea is that IUO moves from the type system to declaration attribute. “The appearance of ! at the end of a property or variable declaration’s type no longer indicates that the declaration has IUO type; rather, it indicates that (1) the declaration has optional type, and (2) the declaration has an attribute indicating that its value may be implicitly forced.”

SE-0055: Make unsafe pointer nullability explicit using Optional. “Today, UnsafePointer and friends suffer from a problem inherited from C: every pointer value could potentially be null, and code that works with pointers may or may not expect this. Failing to take the null pointer case into account can lead to assertion failures or crashes. This proposal makes UnsafePointer<Int> represent a non-nullable pointer, and UnsafePointer<Int>? a nullable pointer. This also allows us to preserve information about pointer nullability available in header files for imported C and Objective-C APIs.”

In Review

One Comment

  • Thanks, I finally understood what SE-0054 (Abolish IUO Type) actually meant! ?