<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Jan 19, 2017, at 8:20 PM, Xiaodi Wu via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">Clearly too big to digest in one take. Some initial thoughts:<div class=""><br class=""></div><div class="">* Not sure about the wisdom of the ad-hoc Substring : String compiler magic. It seems that whatever needs overcoming here would be equally relevant for ArraySlice. It would be more design work, but perhaps not terribly more implementation work, to have a magical protocol that allows the compiler to apply a similar magic to conforming types (e.g. a `ImplicitlyConvertibleSlice` protocol with an associated type, to which ArraySlice and String could both conform). Alternatively, perhaps all of this is not truly necessary for sufficient ergonomics.</div></div></div></blockquote></div><br class=""><div class=""><br class=""></div><div class="">Well if I had my way we’d have conversion operators so you could have:</div><div class=""><br class=""></div><div class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #ba2da2" class="">struct</span><span style="font-variant-ligatures: no-common-ligatures" class=""> Substring {</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> implicit conversion() -> String {</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #008400" class="">//...</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> }</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">}</span></div></div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">But I was also a fan of @conversion so don’t mind me :)</div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">Russ</div></body></html>