Re: [vim/vim] Make object/class member variables public by default (PR #12932)

2023-08-31 Fir de Conversatie Yegappan Lakshmanan
On Thu, Aug 31, 2023 at 6:50 AM errael wrote: > I have started a discussion (#12979 > ) to capture the > access matrix. > > Thank you. I'll take a look. I would have done something if you'd said "go > ahead" . > > > I have marked the failing cases

Re: [vim/vim] Make object/class member variables public by default (PR #12932)

2023-08-30 Fir de Conversatie JohnBeckett
On Thursday, August 31, 2023 at 2:40:37 AM UTC+10 Yegappan Lakshmanan wrote: To summarize, we have the following ways to declare and control access to object and class member variables currently (without the changes from this PR): vim9script class A # object member: read-only access this.val1 =

Re: [vim/vim] Make object/class member variables public by default (PR #12932)

2023-08-29 Fir de Conversatie Yegappan Lakshmanan
Hi, On Tue, Aug 29, 2023 at 1:38 PM errael wrote: > >- > >Able to access private static >- > >Compile error when trying to write public static > > There's another one (a real shocker). > > It's OK to write to a private member. > > vim9script > > class C > this._m: number >

Re: [vim/vim] Make object/class member variables public by default (PR #12932)

2023-08-29 Fir de Conversatie Yegappan Lakshmanan
Hi, On Tue, Aug 29, 2023 at 1:42 PM Christian Brabandt < vim-dev-git...@256bit.org> wrote: > Should the example here > https://github.com/vim/vim/blob/d01a0df61d2a322645fb393ed704fcec38e0d0fe/runtime/doc/vim9class.txt#L186-L200 > > also be changed to use underscores? Otherwise we wouldn't need

Re: [vim/vim] Make object/class member variables public by default (PR #12932)

2023-08-29 Fir de Conversatie Yegappan Lakshmanan
Hi, On Tue, Aug 29, 2023 at 11:03 AM Gianmaria Bajo wrote: > Also readable doesn't exist anywhere else. If simplicity is the ultimate > goal, I'd say this PR is ok in just removing public. We can live without > readonly but even more so without stuff invented for vimscript that > doesn't exist

Re: [vim/vim] Make object/class member variables public by default (PR #12932)

2023-08-29 Fir de Conversatie Yegappan Lakshmanan
On Tue, Aug 29, 2023 at 9:20 AM dkearns wrote: > > Is there some strong objection to requiring a keyword modifier? Why is a > default needed at all? > If we always require a keyword modifier (like private, public, etc.) in a member/method declaration, then it will be too cumbersome to add this

Re: [vim/vim] Make object/class member variables public by default (PR #12932)

2023-08-29 Fir de Conversatie Yegappan Lakshmanan
Hi, On Tue, Aug 29, 2023 at 9:08 AM errael wrote: > readonly is working AFAICT. I still need to put together some tests. I > can't try writing to a readonly static because of the compilation failure > bug that prevents writing to class statics. One nice thing about readonly > is that it doesn't

Re: [vim/vim] Make object/class member variables public by default (PR #12932)

2023-08-29 Fir de Conversatie Yegappan Lakshmanan
Hi Christian, On Tue, Aug 29, 2023 at 12:06 PM Christian Brabandt < vim-dev-git...@256bit.org> wrote: > so let me summarize: the current proposal is to remove the public keyword > completely (?) and make all attributes public by default (unless they start > with _)? So by removing this keyword,

Re: [vim/vim] Make object/class member variables public by default (PR #12932)

2023-08-28 Fir de Conversatie Yegappan Lakshmanan
Hi, On Mon, Aug 28, 2023 at 6:47 PM errael wrote: > I looked around to get a feel... The following fixes the "access to > private static" var in the example, if you want to include it. Not tested > much. > > diff --git a/src/vim9expr.c b/src/vim9expr.c > --- a/src/vim9expr.c > +++

Re: [vim/vim] Make object/class member variables public by default (PR #12932)

2023-08-28 Fir de Conversatie Yegappan Lakshmanan
Hi, On Mon, Aug 28, 2023 at 12:14 PM errael wrote: > When I build objmember, with no modifications, and run this I see two > problems > >1. Able to access private static >2. Compile error when trying to write public static > > I am able to reproduce the second issue even using a two