[swift-evolution] [swift-evolution-announce] [Review] Require self for accessing instance members

Jens Persson jens at bitcycle.com
Sat Dec 19 00:06:19 CST 2015


Yes, to call the standalone foo, you'd call it on its module name:
TheModuleOfFoo.foo()

On Sat, Dec 19, 2015 at 6:52 AM, Kenny Leung via swift-evolution <
swift-evolution at swift.org> wrote:

> >       * What is your evaluation of the proposal?
>
> +1 for it.
>
> >       * Is the problem being addressed significant enough to warrant a
> change to Swift?
>
> Yes. I feel it makes things more correct.
>
> >       * Does this proposal fit well with the feel and direction of Swift?
>
> Yes. One of Swift’s goals is to be clear in reading, and this makes it it
> readily explicit when an instance property or function is being referred to
> when reading over code.
>
> >       * If you have you used other languages or libraries with a similar
> feature, how do you feel that this proposal compares to those?
>
> I prefer a shorter syntax, like Ruby’s @blah. It will serve the same
> purpose, and save some space and typing. In fact, I would prefer to have
> all scopes of variables decorated so you could tell them all at a glance:
>     - local variables have no decoration
>     - instance properties with @
>     - arguments with $
>     - statics, globals, etc…
>     - types that I have to worry about mutating because someone else might
> have a reference to it vs. ones that I don’t have to worry about. (I used
> to think this was structs vs classes, but after being on this list I’m not
> so sure…)
>
> >       * How much effort did you put into your review? A glance, a quick
> reading, or an in-depth study?
>
> I have read about half of the posts on this.
>
> --------------------
>
> Considering this makes me think - if self were not required:
>
> you have a standalone function foo()
>
> you also have an instance method foo()
>
> If you have another instance method
>
> func bar() {
>     //Could you ever call the standalone function foo?
>     foo()
> }
>
>
> -Kenny
>
>
> _______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution
>



-- 
bitCycle AB | Smedjegatan 12 | 742 32 Östhammar | Sweden
http://www.bitcycle.com/
Phone: +46-73-753 24 62
E-mail: jens at bitcycle.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20151219/856b1364/attachment.html>


More information about the swift-evolution mailing list