> 5. func fn<T>[foo, bar](param: T) throws -> T where T: Equatable captures 
> [foo, bar] { … }

I guess it can be considered good practice to start a line with the most 
important information, and move the details to the far right, so that they 
don’t distract the hasty reader.
I’m not sure if the capture list an example for this, but for good or worse, it 
didn’t draw much attention in another position either (the first „[foo, bar]“ 
that slipped through).

That variant (func fn<T>[foo, bar](param: T)) is definitely my favorite, 
because it keeps a characteristic of closures (first the capture list, then the 
parameters), but doesn’t carry over the mingling of body and parameters that 
has to be done in closures.
_______________________________________________
swift-evolution mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to