> On Dec 23, 2015, at 10:34 AM, Chris Lattner via swift-evolution > <[email protected]> wrote: > > Here are how I see the pros and cons I see of these options: > > type: > - Overly short, particularly given the infrequency of these decls, the common > case of “type Element” will be weird floating around given its lack of weight. > - Overly unclear. This is a very specific kind of type, not a generic type > you can use in other contexts. > - Unfortunate keyword. Among other things it would make writing compilers in > swift a pain :-), but again, people would want to use this in other places. > > associated: > - Vacuous: doesn’t mean anything on its own: “associated Element”. > - Somewhat unfortunate as a keyword, but much less so than type. > > associatedtype: > - Clean in context: “associatedtype Element” > - Obvious you wouldn’t want to use it in another context. > - Googlable, unambiguous
Add to the “associatedtype” advantages that, unlike the other two, it passes the “unfortunate keyword” test with flying colors. I don’t often want to name a variable “associatedtype”. Cheers, P _______________________________________________ swift-evolution mailing list [email protected] https://lists.swift.org/mailman/listinfo/swift-evolution
