Yep, I made a pull request already, but I still need to fix the thread link once games becomes available again. I’ll add an example about the current proposal allowing you to move the inheritance constraints out :) It’s good to have the choice.
> On 02 May 2016, at 10:11, Pyry Jahkola <[email protected]> wrote: > > Thank you for the effort David, this is great! > > Considering this example: > >> On 02 May 2016, David Hart <[email protected] <mailto:[email protected]>> >> wrote: >> >> For example, here is the same function declaration (…) after the change: >> func anyCommonElements<T : SequenceType, U : SequenceType>(lhs: T, _ rhs: U) >> -> Bool where >> T.Generator.Element: Equatable, >> T.Generator.Element == U.Generator.Element >> { >> ... >> } > I originally had the opinion that this should be further changed for > consistency into the following form: > > func anyCommonElements<T, U>(lhs: T, _ rhs: U) -> Bool where > T : SequenceType, > U : SequenceType, > T.Generator.Element : Equatable, > T.Generator.Element == U.Generator.Element > { > ... > } > However, I do agree now that in the simple case highlighted below it makes no > sense to use the where clause at all: > >> It was also proposed to remove the simple inheritance constraints from the >> generic parameter list, but several arguments were brought up that it would >> complicate declarations of simple generics which only needed inheritance >> constraints. >> > Of course, the proposal doesn't prevent anyone from moving all inheritance > constraints into the where clause, so maybe we should point out that it's > also possible to further simplify the first line of function declarations > that way. It just remains a stylistic choice left for the developer to choose. > > Anyway, +1! Did you make a pull request already? > > — Pyry >
_______________________________________________ swift-evolution mailing list [email protected] https://lists.swift.org/mailman/listinfo/swift-evolution
