<div dir="ltr">On Mon, Dec 26, 2016 at 2:27 PM, Adam Nemecek via swift-evolution <span dir="ltr"><<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">The elements already have an Identity, the one that you get when you invoke the default constructor. It's 0 for Int, "" for String. </div></blockquote><div><br></div><div>Please don't do this. Dave has already confirmed that `init()` makes no semantic guarantees as to the value returned. It _happens_ to be the case that Int() == 0. That does _not_ mean that semantically `Int.init()` provides the identity element for Int.</div><div><br></div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><div class="gmail_quote">On Mon, Dec 26, 2016 at 11:24 AM, David Sweeris <span dir="ltr"><<a href="mailto:davesweeris@mac.com" target="_blank">davesweeris@mac.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto"><div><div class="m_8089979145759785394h5"><div><br></div><div>On Dec 26, 2016, at 11:12, Tino Heth via swift-evolution <<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>> wrote:<br><br></div><blockquote type="cite"><div>There is an older discussion that is somewhat linked to this topic:<div>"Removing the empty initialiser requirement from RangeReplaceableCollection"<br><div><a href="https://lists.swift.org/pipermail/swift-evolution/Week-of-Mon-20160704/023642.html" target="_blank">https://lists.swift.org/piperm<wbr>ail/swift-evolution/Week-of-<wbr>Mon-20160704/023642.html</a></div><div><br></div></div><div>Imho "DefaultConstructible" types can be very handy, but so far, it seems no one has presented a single use case that is important enough to justify the inclusion in the stdlib.</div><div>On the other hand, I'm quite sure that there's much functionality in the stdlib that many people consider as superfluous…</div><div><br></div><div>I guess adding the protocol wouldn't have a big impact on size, so for for me, the question is "Does this protocol confuse users of Swift?", which I'd answer with "yes, possibly" (unless someone comes up with a name that is more intuitive).</div></div></blockquote><br></div></div><div>"Identity", but, at least for many numeric types, you'd need a mechanism for specifying which one you mean.</div><div><br></div><div>- Dave Sweeris</div></div></blockquote></div><br></div>
</div></div><br>______________________________<wbr>_________________<br>
swift-evolution mailing list<br>
<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a><br>
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank">https://lists.swift.org/<wbr>mailman/listinfo/swift-<wbr>evolution</a><br>
<br></blockquote></div><br></div></div>