[swift-evolution] [Pitch] Improving capturing semantics of local functions
C. Keith Ray
keithray at mac.com
Sun Nov 12 22:37:31 CST 2017
I'd vote for # 1
Starting with "func" helps signal that the context is a function. (Though I know some things can precede "func".)
Having the function name second is important to me: you don't have to scan further for its name.
Template arguments seem more important than capture lists, so I'd put it before the other.
--
C. Keith Ray
* https://leanpub.com/wepntk <- buy my book?
* http://www.thirdfoundationsw.com/keith_ray_resume_2014_long.pdf
* http://agilesolutionspace.blogspot.com/
> On Nov 12, 2017, at 8:11 PM, Brent Royal-Gordon via swift-evolution <swift-evolution at swift.org> wrote:
>
>
> 1. func fn<T>[foo, bar](param: T) throws -> T where T: Equatable { … }
> 2. func fn[foo, bar]<T>(param: T) throws -> T where T: Equatable { … }
> 3. func [foo, bar] fn<T>(param: T) throws -> T where T: Equatable { … }
> 4. [foo, bar] func fn<T>(param: T) throws -> T where T: Equatable { … }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20171112/e73266a2/attachment.html>
More information about the swift-evolution
mailing list