[swift-evolution] Proposal: Re-instate mandatory self for accessing instance properties and functions

Erica Sadun erica at ericasadun.com
Mon Dec 14 17:12:06 CST 2015


Swift.print() is a good example vs NSView's print()

I like things the way they are, and would rather use code highlights, linting tools, and in-house style standards rather than remove implicit self. That said, I could argue both sides.

-- E


> On Dec 14, 2015, at 4:05 PM, Stephen Celis via swift-evolution <swift-evolution at swift.org> wrote:
> 
> On Mon, Dec 14, 2015 at 5:35 PM, Dan Loewenherz via swift-evolution <swift-evolution at swift.org <mailto:swift-evolution at swift.org>> wrote:
> 
> 2. How can one reference a function with the same name as an instance
> method in the class from which you’re referencing from? E.g., in the above
> example, I believe that the “add” function is unreachable from within the class
> (please correct me if I’m wrong).
> 
> FWIW, I like implicit self but have been bit by this several times before. You can use the current module's name to reference the free function, but the error messaging you'll face beforehand doesn't make it easy to get to that solution.
> 
> Stephen
>  _______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20151214/222dec4f/attachment.html>


More information about the swift-evolution mailing list