Nate > On Jun 28, 2016, at 3:57 PM, Dave Abrahams via swift-evolution > <[email protected]> wrote: > > >> on Thu Jun 23 2016, Nate Cook <[email protected]> wrote: >> >> I like the namespace-based approach to group these protocols together >> and I'm very happy to see some clarification happening in this group >> of protocols. However, I don't think the proposed new names >> communicate what they need to. The names listed in the "Alternatives >> Considered" section do a better job of describing the use and behavior >> of these protocols. >> >> Primarily, the new names read like we're saying that a conforming type >> is a literal, compounding a common existing confusion between literals >> and types that can be initialized with a literal. > > No, it's exactly the opposite, as I keep saying. Conformance to this > protocol does *not* mean you can initialize the type with a literal. Fair enough! The point I'm most concerned about is that there is confusion (among the populace at large, less so on this list) between literals and types that can be written as literals. The number 43 is an integer literal, not an `Int` - its type is either inferred from context or given explicitly. Some kind of adjective in the protocol name would make that more clear than removing the adjective. > Proof: > > func f<T: IntegerLiteralConvertible>() -> T { > return T(integerLiteral: 43) // Error > return T(43) // Also an Error > } > > It means an instance of the type can be *written* as a literal: > > func f<T: IntegerLiteralConvertible>() -> T { > return 43 // OK > } > > Everybody's confused about the meaning of the protocol, and doesn't like > the proposed names because they imply exactly the actual meaning of the > protocol, which they misunderstand. I resemble this remark. Nate > -- > Dave > > _______________________________________________ > swift-evolution mailing list > [email protected] > https://lists.swift.org/mailman/listinfo/swift-evolution _______________________________________________ swift-evolution mailing list [email protected] https://lists.swift.org/mailman/listinfo/swift-evolution
Re: [swift-evolution] [Proposal Draft] Literal Syntax Protocols
Nate Cook via swift-evolution Wed, 29 Jun 2016 14:59:41 -0700
- Re: [swift-e... Dave Abrahams via swift-evolution
- Re: [swift-e... Adrian Zubarev via swift-evolution
- Re: [swift-e... Vladimir.S via swift-evolution
- Re: [swift-e... Dave Abrahams via swift-evolution
- Re: [swift-e... Adrian Zubarev via swift-evolution
- Re: [swift-e... Steve Canon via swift-evolution
- Re: [swift-e... David Sweeris via swift-evolution
- Re: [swift-e... Stephen Canon via swift-evolution
- Re: [swift-e... David Sweeris via swift-evolution
- Re: [swift-evolu... David Sweeris via swift-evolution
- Re: [swift-evolution] [Propos... Nate Cook via swift-evolution
- Re: [swift-evolution] [Proposal Draft]... L. Mihalkovic via swift-evolution
- Re: [swift-evolution] [Proposal Draft]... David Sweeris via swift-evolution
- Re: [swift-evolution] [Proposal D... Matthew Johnson via swift-evolution
- Re: [swift-evolution] [Proposal Draft]... Vladimir.S via swift-evolution
- Re: [swift-evolution] [Proposal D... Adrian Zubarev via swift-evolution
- Re: [swift-evolution] [Propos... Matthew Johnson via swift-evolution
- Re: [swift-evolution] [Proposal Draft]... Hooman Mehr via swift-evolution
- Re: [swift-evolution] [Proposal D... T.J. Usiyan via swift-evolution
- Re: [swift-evolution] [Propos... Hooman Mehr via swift-evolution
- Re: [swift-evolution] [Proposal D... Matthew Johnson via swift-evolution
