[swift-evolution] Why doesn't Swift allow a variable and a function with the same name?

Jacob Bandes-Storch jtbandes at gmail.com
Mon Jan 30 21:56:45 CST 2017

You said "The ability to reference a function by only the first segment of
its name is likewise legacy of the original model..." — how else could you
refer to a nullary function? Even if labels were required for naming
(>0)-ary functions, there's still ambiguity between a nullary function and
a variable.
On Mon, Jan 30, 2017 at 7:54 PM Joe Groff <jgroff at apple.com> wrote:

> > On Jan 30, 2017, at 7:34 PM, Jacob Bandes-Storch <jtbandes at gmail.com>
> wrote:
> >
> > Although there's no spelling for this...
> https://bugs.swift.org/browse/SR-3550
> IMO, the way to spell `foo` with no arguments is just `foo`. If we
> strictly required the labels for referring to n-ary functions, that would
> make it unambiguous…
> -Joe
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20170131/1714d6f6/attachment.html>

More information about the swift-evolution mailing list