[swift-evolution] Remove Failable Initializers

James Campbell james at supmenow.com
Mon Mar 7 09:40:42 CST 2016


This is my draft proposal.

https://github.com/jcampbell05/swift-evolution/blob/master/proposals/0045-remove-falliable-initilizer.md

Let me know your thoughts.

*___________________________________*

*James⎥Head of Trolls*

*james at supmenow.com <james at supmenow.com>⎥supmenow.com <http://supmenow.com>*

*Sup*

*Runway East *

*10 Finsbury Square*

*London*

* EC2A 1AF *

On Mon, Mar 7, 2016 at 2:27 PM, Tino Heth <2th at gmx.de> wrote:

> +1
> Without "try?", it would be really inconvenient to not have "init?" — but
> failable initializers as they are now are somewhat odd, because they are
> half-function and half-procedure:
> Regular init-methods have no return, so you can basically think of them as
> a configuration that is called on an allocated object.
> This isn't true anymore for "init?", as it not only it turns a
> "void-function" into something that returns an optional, but also doesn't
> explicitly model the non-nil case (there is no "return self").
> Replacing this mechanism with an error would actually make initializers
> more method-like, and less special.
>
> Tino
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160307/86c4953a/attachment.html>


More information about the swift-evolution mailing list