[swift-evolution] History and future of Swift's parentheses
gor at gyolchanyan.com
Fri Jun 9 10:12:35 CDT 2017
> So I wonder if any of you have had any thoughts about what Swift's parentheses-related future (or evolutionary baggage) will be?
I really wish swift used the concept of tuples **exclusively** for all purposes that involve parentheses, as well as dividing tuples into two categories:
- Bare tuples, which do not have labels.
- Rich tuples, which do.
As a consequence, here's a list of statements that would become true:
- All functions take exactly one parameter, which is a tuple.
- All closures (a.k.a. function pointers) take exactly one parameter, which is a bare tuple.
- All functions return exactly one parameter, which is a tuple.
- Pattern matching is done on a single bare tuple using a single bare tuple pattern.
The currently ongoing proposal to make a single-element tuple auto-flatten would work extremely well with this idea, by making all these changes completely backward-compatible.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the swift-evolution