[swift-evolution] Lambda function syntax

Craig Cruden ccruden at novafore.com
Thu Dec 24 05:02:06 CST 2015

I have to say that nuance is basically lost on me.  If I assign a variable I know when I use it I get a type back based on “:”.  If I call a function it has parameters that are defined as : type, if I use a function that ends with a definition “)” [end of parameter list; beginning of type of function] “:” it specifies the “type” of function (what I expect when I call the function).  

I have always associated “arrows” with things like mathematical functions, as such when I switch back and forth between languages I immediately switch back to reading arrows in regards to functions.  

It probably is only compounded by the other languages that I use where they tend to use -> or => to represent an arrow.

But then each person’s sensibilities are different :p

> On 2015-12-24, at 17:44:52, Tino Heth via swift-evolution <swift-evolution at swift.org> wrote:
>> I'm completely against replacing '->' by ':' it would make unreadable the declaration of a function taking a closure as parameter, or returning one (among other things).
> That's definitely right: Two different separators only shift the problem by one level, but hopefully it won't become common to deal with "functions having functions as parameters that have function parameters that… ;-)
> Also there is the different meaning of ":" ("is a...") and "->" ("returns a…")
> _______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20151224/90485aab/attachment.html>

More information about the swift-evolution mailing list