Require self for accessing instance members


(Pelaia II, Tom) #1

I agree with this proposal, but I would prefer the option of just using a single dot prefix instead of requiring “self.” to access members. Already, Swift interprets the dot prefix in other contexts such as enum case assignment and static member assignments to instances. I think the dot prefix can be used more extensively to refer to context targets. Within the context of an instance method or initializer, the dot prefix alone would be sufficient to refer to the instance.

···

_____________________________________________________________________________________
Thomas Pelaia II, Ph.D. | Applications Leader, Accelerator Physics, Research Accelerator Division
Spallation Neutron Source | Oak Ridge National Lab, Building 8600, MS-6462, Oak Ridge, TN 37831
phone: (865) 414-7960 | FaceTime: t6p@ornl.gov<mailto:t6p@ornl.gov> | fax: (865) 574-6617 | homepage: http://www.ornl.gov/~t6p