[swift-evolution] Referencing zero-parameter functions

Kurt Werle kurt at circlew.org
Thu May 5 12:14:26 CDT 2016


On Thu, May 5, 2016 at 10:03 AM, Chris Lattner via swift-evolution <
swift-evolution at swift.org> wrote:

> On May 5, 2016, at 8:59 AM, Alex Hoppen via swift-evolution <
> swift-evolution at swift.org> wrote:
> > Say you have the function `foo() -> Int`. Then `foo()` calls `foo` and
> returns its return value of type `Int` – not a reference to the function of
> type `Void -> Int`.
>
> Right.
>
> That said, what is wrong with just “foo”?
>

Yeah, that'd work.  The problems:
* Name collisions with variables (not a big deal, I think)
* "foo" looks substantially different than "bar(baz:)", but they mean the
same thing

I prefer something like #foo(), #bar(baz:).  Clearly that particular choice
can't work.

Kurt
-- 
kurt at CircleW.org
http://www.CircleW.org/kurt/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160505/2acec499/attachment.html>


More information about the swift-evolution mailing list