[swift-evolution] (no subject)

Zach Wolfe zachrwolfe at me.com
Sun Nov 20 13:25:37 CST 2016

+14689 on this one. I'm working on a project right now where I have a significant amount of subtypes inside one of my types (gameboy emulator, creating abstractions on the io registers to make them more pleasant to deal with) and I have the subtypes split up into a bunch of files. With current syntax, all of these files are forced to adhere to the following pattern:
extension IORegisters {
    struct X { body }

With this proposal, all of these files could be unindented to the left like so (and would arguably be more clear):
struct IORegister.X { body }

I'm in favour of allowing methods and computed properties to be declared in this way as well:
func A.doSomething() {}
var A.computedProperty: B {}

I also agree with the notion that this proposal should be viewed as syntactic sugar - a short-form way of writing extensions, nothing more - and as such should not have any weird semantic differences from them.

Also, this is my first reply on this list, hi everyone!

More information about the swift-evolution mailing list