Standardize arguments in closures


In the light of this proposal swift-evolution/ at master · apple/swift-evolution · GitHub

I suggest to do similar for closure arguments.

Right now we can define our closure arguments in 3 ways:

let closure: (String) -> Int = {
  value -> Int in
  return 0

let closure2: (String) -> Int = {
  (value) -> Int in
  return 0

let closure3: (String) -> Int = {
  (value:String) -> Int in
  return 0

The first version, could be abolished in light of the above proposal. It would avoid confusion and improve the learning curve. The 1st example doesn't allow either to add the type as we did in example 3.

What are your thoughts?



Sent from my iPhone