on Thu Apr 14 2016, Chris Lattner <swift-evolution@swift.org> wrote:
> On Apr 14, 2016, at 10:21 PM, John McCall <rjmcc...@apple.com> wrote: >> >>> On Apr 14, 2016, at 9:57 PM, Chris Lattner via swift-evolution >>> <swift-evolution@swift.org> wrote: >>> >>> We currently accept function type syntax without parentheses, like: > >> To me, the unparenthesized style suggests that the input and output >> are peers, which feels more natural for the sort of value-to-value >> transform/predicate where this most commonly occurs. Parenthesizing >> the input feels fussier, which contributes to a sense that the >> argument is just one component to producing the result. >> The parentheses are grammatically unnecessary in most cases (by frequency of >> use in higher-use programming, not by feature count). > > I agree with your point that many simple higher order programming > examples (e.g. map, filter, etc) take a single argument. That said, I > don’t agree that this means that we should syntactically privilege > this special case. In many places in the Swift grammar we aim for > consistency, even if it means a bit more punctuation in specific > cases. And, FWIW, the standard library higher-order functions are all declared with parens around the argument list, because it is a more recognizable form. -- Dave _______________________________________________ swift-evolution mailing list swift-evolution@swift.org https://lists.swift.org/mailman/listinfo/swift-evolution