[swift-evolution] [Pitch] Support for pure functions. Part n + 1.

Adrian Zubarev adrian.zubarev at devandartist.com
Fri Feb 17 12:27:11 CST 2017


Who said that pure functions should be newcomer friendly? Swift attributes are way at the end of the swift’s book. Using the -> arrow at first won’t break anything. If one would optimize some functions by annotating them to be pure, the change to something like ~> would be really easy.

IMHO clustering the whole code with hundred’s of different attributes isn’t the right way either. Purity could be easily be expressed throw the arrow, plus it enforces you to have a return type (other than Void).



-- 
Adrian Zubarev
Sent with Airmail

Am 17. Februar 2017 um 18:59:17, Nicolas Fezans (nicolas.fezans at gmail.com) schrieb:

The arrow proposals -> vs. ~> vs. => are not really much shorter than 
the 4 letters of the pure keyword but just confusing and frightening 
for newcomers (BTW __pure exists in GCC if I remember well) whereas 
"pure func" is something that people can easily google in case they 
need to learn the concept. The different arrows are very compact but 
feel a bit like J, which is a language I would not like swift to look 
like. 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20170217/59428a11/attachment.html>


More information about the swift-evolution mailing list