[swift-evolution] [swift-evolution-announce] [Review] SE-0041: Updating Protocol Naming Conventions for Conversions
Xiaodi Wu
xiaodi.wu at gmail.com
Wed May 11 00:14:01 CDT 2016
On Tue, May 10, 2016 at 9:33 PM, Erica Sadun via swift-evolution <
swift-evolution at swift.org> wrote:
>
> > On May 10, 2016, at 6:51 PM, Chris Lattner via swift-evolution <
> swift-evolution at swift.org> wrote:
> >
> >
> >> On May 10, 2016, at 11:48 AM, Chris Lattner <clattner at apple.com> wrote:
> >>
> >> Hello Swift community,
> >>
> >> The review of "SE-0041: Updating Protocol Naming Conventions for
> Conversions" begins now and runs through May 16. The proposal is available
> here:
> >>
> >>
> https://github.com/apple/swift-evolution/blob/master/proposals/0041-conversion-protocol-conventions.md
> >
> > Here are comments from someone who preferred to stay anonymous. These
> are not my own:
> >
> >
> >
> >
> > * What is your evaluation of the proposal?
> >
> > I rather agree with the comments mentioned in the proposal from the
> Standard Library design team, in that I agree with the basic intention of
> the proposal, but I’m not convinced about the proposed answer. Specifically:
>
>
> We'd be happy to bikeshed again.
>
> I think fundamentally our take on this is:
>
> * We want there to be a standard that expresses the three
> conversion/initialization styles.
> * We feel the system is currently broken. And we want to have a coherent
> and settled vision in place for 3, even imperfect.
> * We're flexible about the naming but it should be (1) Swifty and (2) well
> grounded in meaning.
>
> Let me turn the floor over to Matthew here.
>
Like David Hart and the anonymous reviewer, I agree that the problem is
worth solving but the proposed names leave something to be desired. I'd
like to offer a minimalist suggestion:
Initializable -- for what's currently "LiteralConvertible" (and also
StringInterpolationConvertible)
Convertible -- for "StringConvertible" protocols
Representable -- keep as it is currently
I agree with others that "Creatable" is a strange term because it's not
used anywhere else. Looking at the auto-generated docs for the
"LiteralConvertible" protocols, it says that conforming types "can be
initialized with" whatever thing is said to be convertible. I think that
offers a pretty clear alternative word--namely, "initializable."
I can live with "convertible" being one-way. Not all "convertible" things
are like convertible cars. When you convert from one faith to another, for
example, some level of finality is intended.
I can also live with the current usage of the term "representable." In the
context of things like "representable values" in floating point types,
representability suggests exactness and thus round-trippability.
(And to use the example in the proposal, a lawyer who represents you well
[*] is one that communicates your position to the court. You "input" your
position, your lawyer goes to court, and then they "output" your position
in legalese to the court. If there's degradation in the quality of the
"output," then you've been inadequately represented.)
[*And, it bears clarifying that your lawyer is considered to represent
*you* and not merely *your interests*. If you're the plaintiff in a case
and your lawyers says, "My client's entitled to a million dollars!", the
court can restate that as "Plaintiff argues that she's entitled to a
million dollars."]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160511/558cc7dc/attachment.html>
More information about the swift-evolution
mailing list