[swift-evolution] [Pitch] Richer function identifiers, simpler function types

Антон Жилин antonyzhilin at gmail.com
Thu Apr 28 13:54:53 CDT 2016


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160428/fa865cb1/attachment.html>


More information about the swift-evolution mailing list