> On Jan 19, 2017, at 8:20 PM, Xiaodi Wu via swift-evolution
> <[email protected]> wrote:
>
> Clearly too big to digest in one take. Some initial thoughts:
>
> * 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.
Well if I had my way we’d have conversion operators so you could have:
struct Substring {
implicit conversion() -> String {
//...
}
}
But I was also a fan of @conversion so don’t mind me :)
Russ_______________________________________________
swift-evolution mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution