Although there's no spelling for this...
https://bugs.swift.org/browse/SR-3550
On Mon, Jan 30, 2017 at 7:29 PM Joe Groff via swift-evolution <
[email protected]> wrote:

>
> > On Jan 30, 2017, at 11:42 AM, Austin Zheng via swift-evolution <
> [email protected]> wrote:
> >
> > The reason Swift works like this is because you can assign a function
> value (independently of calling it) to a variable. So there aren't two
> separate namespaces separating function names and variable names.
>
> To be honest, I would say that there's no "reason" for this, except as
> lingering effects of our early "functions have simple names, and arguments
> have labeled tuple type" model. If we had originally implemented the
> language with its current (at least aspirational) Smalltalk-ish
> compound-names model, we probably would have ended up allowing this, since
> the var and func do formally have different names. The ability to reference
> a function by only the first segment of its name is likewise legacy of the
> original model, though it happens to be useful since good naming hygiene
> encourages different base names for different things to begin with.
>
> -Joe
> _______________________________________________
> swift-evolution mailing list
> [email protected]
> https://lists.swift.org/mailman/listinfo/swift-evolution
>
_______________________________________________
swift-evolution mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to