[swift-evolution] [SE-0011] Re-considering the replacement keyword for "typealias"

Stephen Christopher schristopher at bignerdranch.com
Sat Dec 19 15:20:18 CST 2015


I like “requiredtype”.

Step Christopher
Big Nerd Ranch, LLC
schristopher at bignerdranch.com


On Sat, Dec 19, 2015 at 3:54 PM, Dave Abrahams via swift-evolution <
swift-evolution at swift.org> wrote:

>
> On Dec 19, 2015, at 12:17 PM, Michael Henson via swift-evolution <
> swift-evolution at swift.org> wrote:
>
> 1) Do you agree about using “associatedtype”?
>> 2) If not, which keyword would you prefer to use? why? (you can introduce
>> a new one)
>
>
> There is another alternative. Rather than trying to come up with another
> brand-new keyword, we can re-use one that has an existing and appropriate
> meaning: required.
>
> Example:
>
> protocol ExampleProtocol {
>   required typealias Element
>   typealias MethodSignature = (arg: Element) -> Bool
>
>   ... etc
> }
>
> It's a little more verbose at the point of use but the declarations are
> relatively uncommon and this usage is clearly separate from regular
> typealias declarations.
>
>
> I think this is a big improvement over associatedtype, except that the
> type that satisfies the requirement needn't be a typealias.  I would
> therefore prefer "requiredtype."
>
> -Dave
>
>
>
>
> _______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20151219/9b259ebc/attachment.html>


More information about the swift-evolution mailing list