[swift-evolution] [swift-evolution-announce] [Review] Replace `typealias` keyword with `associatedtype` for associated type declarations

David James davidbjames1 at gmail.com
Thu Jan 7 12:22:18 CST 2016


I think it’s more confusing (albeit not as educational) to have two different words here. For example, if I create a protocol with associated types that are used in protocol functions, then I want to implement that protocol in a class/struct tying those types to concrete types. Having two different words feels unnatural even if it is more technically accurate.

For example:

protocol ProductMaker {
    typealias Product
    func makeFoo() -> Product 
}

struct FooMaker : ProductMaker {
    typealias Product = Foo
    func makeFoo() -> Product {
        return Foo()
    }
}

> On Jan 7, 2016, at 6:55 PM, Pierre Monod-Broca via swift-evolution <swift-evolution at swift.org> wrote:
> 
>> What is your evaluation of the proposal?
> I'm ok
> 
>> 	* Is the problem being addressed significant enough to warrant a change to Swift?
> Yes, the current keyword is odd
> 
>> 	* Does this proposal fit well with the feel and direction of Swift?
> Not bad, this would be my second choice if I was the only one using swift (the cz
> 
> 
>> 	* If you have you used other languages or libraries with a similar feature, how do you feel that this proposal compares to those?
> N/A
> 
>> 	* How much effort did you put into your review? A glance, a quick reading, or an in-depth study?
> A bit more than a quick reading of the discussion
> 
> Pierre
> 
> Le 3 janv. 2016 à 07:38, Douglas Gregor <dgregor at apple.com <mailto:dgregor at apple.com>> a écrit :
> 
>> Hello Swift community,
>> 
>> The review of "Replace `typealias` keyword with `associatedtype` for associated type declarations” begins now and runs through Wednesday, January 6th. The proposal is available here:
>> 
>> 	https://github.com/apple/swift-evolution/blob/master/proposals/0011-replace-typealias-associated.md <https://github.com/apple/swift-evolution/blob/master/proposals/0011-replace-typealias-associated.md>
>> 
>> Reviews are an important part of the Swift evolution process. All reviews should be sent to the swift-evolution mailing list at
>> 
>> 	https://lists.swift.org/mailman/listinfo/swift-evolution <https://lists.swift.org/mailman/listinfo/swift-evolution>
>> 
>> or, if you would like to keep your feedback private, directly to the review manager.
>> 
>> What goes into a review?
>> 
>> The goal of the review process is to improve the proposal under review through constructive criticism and, eventually, determine the direction of Swift. When writing your review, here are some questions you might want to answer in your review:
>> 
>> 	* What is your evaluation of the proposal?
>> 	* Is the problem being addressed significant enough to warrant a change to Swift?
>> 	* Does this proposal fit well with the feel and direction of Swift?
>> 	* If you have you used other languages or libraries with a similar feature, how do you feel that this proposal compares to those?
>> 	* How much effort did you put into your review? A glance, a quick reading, or an in-depth study?
>> 
>> More information about the Swift evolution process is available at
>> 
>> 	https://github.com/apple/swift-evolution/blob/master/process.md <https://github.com/apple/swift-evolution/blob/master/process.md>
>> 
>> 	Cheers,
>> 	Doug Gregor
>> 	Review Manager
>> 
>> 
>> _______________________________________________
>> swift-evolution-announce mailing list
>> swift-evolution-announce at swift.org <mailto:swift-evolution-announce at swift.org>
>> https://lists.swift.org/mailman/listinfo/swift-evolution-announce <https://lists.swift.org/mailman/listinfo/swift-evolution-announce>
> 
> _______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution

David James

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160107/9a9d6624/attachment.html>


More information about the swift-evolution mailing list