Replies: 7 comments 17 replies
-
If I may ask, what was the reasoning behind the use of underscore for private member variables and not the use of Was it a matter of aesthetics or inspired by Python pseudo-privacy mechanism? |
Beta Was this translation helpful? Give feedback.
-
For some reason the use of underscore from an aesthetic point of view does not feel "right", but if it works... 😒 Something like the following examples make it more obvious to my tired eyes that they mean
Maybe it's not clear with the aforementioned examples, but with the use of private methods inside classes, it makes it clearer:
|
Beta Was this translation helpful? Give feedback.
-
@yegappan Can you suggest something or related somethings that you'd expect to take less than a day to fix? |
Beta Was this translation helpful? Give feedback.
-
I was asked to look at the crash; I'll finish what I'm doing, trying to track down the specifics of the crash, but maybe not a solution. He had something to look at after the crash; so I'll probably do that. As far as I'm concerned there should be a central figure coordinating, to prevent interference. I do wonder why you felt it necessary to post that in the middle of the thread about the crash, rather than starting a separate thread. It's rude. |
Beta Was this translation helpful? Give feedback.
-
But until the issue of |
Beta Was this translation helpful? Give feedback.
-
The member access control issues discussed above are all addressed in the latest version of Vim. |
Beta Was this translation helpful? Give feedback.
-
#13007 prevents direct access to interface statics. It also allows a |
Beta Was this translation helpful? Give feedback.
-
Functions outside of a Vim9 class/object can have read-only access or a read-write access or no access
to a class/object member variable. This is described in https://vimhelp.org/vim9class.txt.html.
The following sample code shows how to declare member variables with these different access controls:
This page is created to track the different ways these member variables can be accessed and whether they
are tested and verified to work properly. The following cases are tested with the changes in the PR #12978.
Access from script level:
Access from a def function:
Access from a method in the class:
Access from a method in a different class:
Access from child class extending a class:
Access from a class implementing an interface:
Note: The last test crashes Vim.
Beta Was this translation helpful? Give feedback.
All reactions