Your conclusion is the same as mine and you disagree with what I said? :/ mine:
> Swift forces you to use class name to alert you on the fact that static > variables and methods (may) affect the other instances of the class as > static variables are shared between instances. That does make sense. y ours: > I think the reasoning behind this syntax is simply to make it easy to > distinguish usages of static members (methods or variables) from instance > ones. Zhaoxin On Sat, Jul 2, 2016 at 12:58 AM, Jens Alfke <j...@mooseyard.com> wrote: > > > On Jul 1, 2016, at 9:38 AM, zh ao <owe...@gmail.com> wrote: > > > > Swift forces you to use class name to alert you on the fact that static > variables and methods (may) affect the other instances of the class as > static variables are shared between instances. That does make sense. > > I disagree. Both static and instance methods can affect other instances of > the class. In other words, just looking at these two calls: > something() > MyClass.something() > there’s no way to tell whether either or both of them change class-wide > state. (To spell it out clearly: the implementation of the instance method > something() might change the variable MyClass.staticState.) > > I think the reasoning behind this syntax is simply to make it easy to > distinguish usages of static members (methods or variables) from instance > ones. > > —Jens
_______________________________________________ swift-users mailing list swift-users@swift.org https://lists.swift.org/mailman/listinfo/swift-users