<div dir="ltr">Good point on that. I still think the best solution is to take the existing syntax of<div><br></div><div><div><br></div><div>struct Key {</div><div>    init(forRSA:Void) { /* */ }</div><div>    init(forCurve25519:Void) { /* */ }</div><div>    init(forAES:Void) { /* */ }</div><div>}</div><div><br></div><div>let a = Key(forRSA: ())</div><div><div><br></div><div>or </div><div><br></div><div>let empty: Void = ()</div><div>let c = Key(forAES: empty)</div></div></div><div><br></div><div>and make it somewhat easier to read.  Perhaps<br></div><div><br></div><div><div>let b = Key(forCurve25519: _ )</div><div><br></div><div>I think many people will read Key(forAES) as Key.init(_: forAES), so that may be not the best expression here.</div><div><br></div><div><br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Dec 13, 2015 at 4:21 PM, Drew Crawford <span dir="ltr">&lt;<a href="mailto:drew@sealedabstract.com" target="_blank">drew@sealedabstract.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><span class=""><br><div><blockquote type="cite"><div>On Dec 13, 2015, at 7:13 AM, ilya &lt;<a href="mailto:ilya.nikokoshev@gmail.com" target="_blank">ilya.nikokoshev@gmail.com</a>&gt; wrote:</div><br><div><span style="font-family:HelveticaNeue;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:pre-wrap;word-spacing:0px;float:none;display:inline!important">You can easily call a private parametrized init from a class function though. </span></div></blockquote></div><div><br></div></span><div>Sure, but we&#39;re just shuffling the deck.  We&#39;ve gone from a bad public API to a bad private API.</div><div><br></div><div>Actually, it&#39;s worse, because we now have BOTH a bad private API AND a bad public API.  There is a reason that NSData.dataWithData(...) is a Swift compile error.</div><div><br></div><div>The (ab)use of class functions as constructors is a holdover from ObjC times.  If you want to make an instance in Swift, you should type ClassName( and see what autocomplete suggests; you should not have to read through the documentation of class functions to see if they are secretly constructors that have been filed at the wrong shelf in the library.</div></div></blockquote></div><br></div>