Re: Class implementation

2023-01-15 Fir de Conversatie Christopher Plewright
So, instead of using the "this." prefix, vim9 could specify that member variable names must either use the @ prefix for public, or use the _ prefix for private. ie., all member variable names must have one of these two prefixes. I think this is worth considering, because it's simple,

Re: Class implementation

2023-01-15 Fir de Conversatie Christopher Plewright
On Sunday, 15 January 2023 at 03:02:57 UTC+11 yegapp...@gmail.com wrote: On Sat, Jan 14, 2023 at 7:34 AM Bram Moolenaar wrote: > > Currently I decided to keep it relatively simple and only provide three > ways: > > - public: read and write access, using the "public" keyword > - default:

Re: Creating a child class instance doesn't invoke the parent class new() function

2023-01-15 Fir de Conversatie Christopher Plewright
On Monday, 16 January 2023 at 07:19:29 UTC+11 Bram Moolenaar wrote: The simplest would be that the parent constructor is always called first. However, it usually has arguments and those need to be passed somehow. Is there a language where this works nicely and we do it like that in Vim?

Re: Choices for Vim9 class implementation

2022-12-26 Fir de Conversatie Christopher Plewright
On Tuesday, 27 December 2022 at 11:14:33 UTC+11 Christopher Plewright wrote: > > > Another possibility occurred to me, that you could keep; *function* and > *endfunction* > That could still be used to always mean *static *functions - as that > essentially does now already

Re: Choices for Vim9 class implementation

2022-12-26 Fir de Conversatie Christopher Plewright
On Monday, 26 December 2022 at 22:59:19 UTC+11 Bram Moolenaar wrote: > I think that makes it a static class "function", and not a class > "method". > > That depends on how you define this. A method usually implicitily gets > an extra argument or is aware of its context. It does not

Re: Choices for Vim9 class implementation

2022-12-25 Fir de Conversatie Christopher Plewright
On Monday, 26 December 2022 at 10:26:50 UTC+11 err...@raelity.com wrote: > On 22/12/25 2:54 PM, Christopher Plewright wrote: > > I didn't know it was documented that there could be a static class > function. The whole point of the question was to determine if there could > be

Re: Choices for Vim9 class implementation

2022-12-25 Fir de Conversatie Christopher Plewright
> > > > I thought that the declaration would be like this; > > > > this.name : *string *= "Somebody" > > > > Or is auto-type detection at play here too? > > It's called type inference. The type of the expression is used as the > type of the variable. In most cases this works very well,

Re: Choices for Vim9 class implementation

2022-12-25 Fir de Conversatie Christopher Plewright
On Monday, 26 December 2022 at 09:08:22 UTC+11 err...@raelity.com wrote: > On 22/12/25 1:07 PM, Bram Moolenaar wrote: > > With 9.0.1094, in the script that follows, attempting to read a > classMember through an instance fails; > > echomsg c.classMember > > should it? > > No, an object does

Re: Choices for Vim9 class implementation

2022-12-24 Fir de Conversatie Christopher Plewright
On Sunday, 25 December 2022 at 02:34:35 UTC+11 Doug Kearns wrote: > On Mon, 19 Dec 2022 at 00:33, Bram Moolenaar wrote: > >> >> One thing I'm not yet sure about is the declaration. Currently it works >> like this: >> >> this.name: string >> this.gender: Gender >> >> Notice

Re: Choices for Vim9 class implementation

2022-12-24 Fir de Conversatie Christopher Plewright
On Saturday, 24 December 2022 at 04:40:15 UTC+11 bfrg wrote: > > No, I prefer 'this' over 'self'. I was considering if its possible to > go without any keyword for it. For example, these days we also have > syntax highlighting which can give a different color for member variables > and

RE: Patch 9.0.1086

2022-12-22 Fir de Conversatie Christopher Plewright
> On 23-Dec-2022 00:44, Bram Moolenaar wrote: > > Patch 9.0.1086 > > Problem:Display wrong in Windows terminal after exiting Vim. > > Solution: Apply screen restore fix for Windows 11 also to Windows 10 > builds. > > (Christopher Plewright

Re: Patch 9.0.1084

2022-12-20 Fir de Conversatie Christopher Plewright
> The attached patch tries to fix both warnings. Thanks. > It seems that the function peek_input_record_buffer() is not used anywhere. > So the patch removes it. Yeah, it’s not used now. The existing static s_irCache is inner function scoped, so I couldn’t directly inject records to it for

Re: Choices for Vim9 class implementation

2022-12-19 Fir de Conversatie Christopher Plewright
> > > The difference between a regular method and a constructor is that for a > constructor it is very common to assign the argument to an object > member. > > The idea comes from Dart, and I don't think Dart supports this for > anything but constructors. > That's a good point, it is usually

Re: Choices for Vim9 class implementation

2022-12-19 Fir de Conversatie Christopher Plewright
> class Blahh > toX: TYPE_A > toY: TYPE_B > fn SetXandY(toX, toY) > enfunc > endclass So... like you said, that was confusing. But, I just realised that prefixing member variables with "this" everywhere consistently could perhaps allow us to do something in between, along these lines? class

Re: Choices for Vim9 class implementation

2022-12-19 Fir de Conversatie Christopher Plewright
On Tuesday, 20 December 2022 at 01:26:15 UTC+11 Bram Moolenaar wrote: > > > I'm not a big fan of the "this" keyword. I agree if going to use it, > > ensure to use it everywhere. Consistency is good. I like simplicity, and > > dislike redundancy. > > What do you mean, do you prefer "self"? >

Re: Choices for Vim9 class implementation

2022-12-19 Fir de Conversatie Christopher Plewright
On Monday, 19 December 2022 at 19:52:34 UTC+11 Christopher Plewright wrote: > I'm not a big fan of the "this" keyword. I agree if going to use it, > ensure to use it everywhere. Consistency is good. I like simplicity, and > dislike redundancy. > > So, about &quo

Re: Choices for Vim9 class implementation

2022-12-19 Fir de Conversatie Christopher Plewright
I'm not a big fan of the "this" keyword. I agree if going to use it, ensure to use it everywhere. Consistency is good. I like simplicity, and dislike redundancy. So, about "this", alternatively, don't use it anywhere, but maybe you could throw an error if a function argument name is also

Re: Patch 9.0.1012

2022-12-06 Fir de Conversatie Christopher Plewright
On Tuesday, 6 December 2022 at 07:58:38 UTC+11 Bram Moolenaar wrote: > > Patch 9.0.1012 > Problem: Tests may get stuck in buffer with swap file. > Solution: Bail out when bwipe! doesn't get another buffer. > Files: src/testdir/runtest.vim > Hi Bram, After merge with latest, I was getting

RE: Patch 9.0.0980 causes tiny font to be used after ":set bg&"

2022-12-02 Fir de Conversatie Christopher Plewright
> ESC[4m is "set underline mode" >Thanks, but the sequence I'm seeing is ESC[?4m. > >Regards, >Gary Ah, OK, thought I recognised it, but was mistaken. I recall years ago that mintty had an issue moving text up to make space for underline. Thought it might be related, but it seems not. --

Re: Patch 9.0.0980 causes tiny font to be used after ":set bg&"

2022-12-02 Fir de Conversatie Christopher Plewright
ESC[4m is "set underline mode" On Saturday, 3 December 2022 at 09:45:20 UTC+11 Gary Johnson wrote: > On 2022-12-02, Bram Moolenaar wrote: > > Gary Johnson wrote: > > > > > After updating to the latest Vim, 9.0.0984, and starting Vim in > > > a terminal without a file specified, the command

MS-Windows console mouse scroll events

2022-10-20 Fir de Conversatie Christopher Plewright
Hi all, Seeking some feedback on how to move forward? This week, I've been implementing mouse scrolling for vim in MS-Windows consoles.Not the gui version, gVim, just the console version. The MS-Windows gui version gVim already works for all mouse scroll features. Thought it would be

Re: Patch 9.0.0787

2022-10-18 Fir de Conversatie Christopher Plewright
wrote: > > > On 18-Oct-2022 23:34, Bram Moolenaar wrote: > > > Patch 9.0.0787 (after 9.0.0775) > > > Problem: MS-Windows: mouse scrolling in terminal misbehaves without > dll. > > > Solution: Add #ifdef as a temporary solution. (Christopher Plewright, >