[Pitch] Richer function identifiers, simpler function types


(Anton Zhilin) #1

Could you please publish it on Github? It is a bit difficult to read such
long posts in mailing lists.

1) I wouldn't like if ability to get function by name was removed.
Granted, it doesn't always work, but when it does, it's nice and concise.

2) SE-0066 and removal of tuple splat behaviour are caused by the fact that
Swift function argument lists are not tuples.
Inout, @noescape and others make sense only in function types.

Example:
(Int, Int) -> Int will be a function that takes two Ints
((Int, Int)) -> Int will be a function that takes one tuple
(((Int, Int))) -> Int will be the same as ((Int, Int)) -> Int

3) Methods will be uncurried when used as closures.
Example:
[Int].map as ([Int], @noescape (Int) -> Int) -> [Int]

- Anton