[swift-evolution] Pitch: Compound name `foo(:)` for nullary functions

David Sweeris davesweeris at mac.com
Wed Feb 22 16:25:58 CST 2017

> On Feb 22, 2017, at 2:12 PM, Richard Wei <rxrwei at gmail.com> wrote:
> In addition, I think # and @ are very confusing since they are not one of the existing symbols in function name syntax.

Agreed, but it seems like every suggestion other than “foo(:)” which doesn’t use such a character ends up potentially conflicting with some other aspect of functions. That example Rintaro Ishizaki posted about the potential confusion regarding “_” in switch statements doesn’t compile now, but I’m not sure if there isn’t some useful advanced pattern-matching stuff that might need that syntax. And we don’t like “foo(:)” because it breaks the “colon -> argument” rule that exists in the rest of the language.

- Dave Sweeris

More information about the swift-evolution mailing list