On Sun, Oct 1, 2023 at 11:06 AM Ernie Rael <[email protected]> wrote:
> On 23/10/01 6:44 AM, Yegappan Lakshmanan wrote: > > Hi, > > On Sun, Oct 1, 2023 at 5:17 AM shane qian <[email protected]> wrote: > >> and I meant vim9script so far I felt it's good for type-checking and >> performance, but vim9 class to me I felt a bit burdened, not sure if >> still a chance to make it be simple to use (use for scripting), still wish >> that's the goal. @errael @yegappan >> >> > I haven't introduced any fancy OOP features so far. These are the features > that Bram has partially implemented or planned for and were already in > the todo list. > > The spec clearly says (said) > > Object methods of the base class can be overruled. *The signature > (arguments,* > *argument types and return type) must be exactly the same*. The method > of the > base class can be called by prefixing "super.". > > I can't find where Bram partially implemented or planned to allow > contravariant parameters. In fact it looks the other way around. See > comments > https://github.com/vim/vim/pull/13221#issuecomment-1741637630 . > > After we've all worked hard to resolve incomplete spec issues (thinking > statics) and to get the implementation to meet the spec. This last minute > spec change, which doesn't seem to offer any useful functionality and > hasn't been discussed or tested, feels ill-conceived. > We have two options for the method parameter types. We can either follow the Typescript/Java specification, which supports covariance for the method parameters or follow the Dart specification which supports contra-variance for the method parameters. As we are already following the Dart specification for interfaces, I choose the Dart specification. > While this may be something for the future, *I see no reason to change > the spec now*. > > These features are basic to any OOP language. > > Can you point to a language that doesn't have overloaded methods that > allows contravariant parameters? I'm not saying there aren't any (I'm just > a country language-lawyer). > Are you referring to covariant parameters here? If you are, then Dart allows only contravariant parameters for overloaded methods. Regards, Yegappan > [...] > I think using a formal type checking term like "covariance" and > "contra-variance" > confuses people to think that we are introducing fancy features. But > these are > just terms for describing the type check and not new features. > > I don't believe that is accurate regarding contra-variant parameters; that > is new. And for returning a covariant type that could already be done *without > removing the requirement* that "the signature ... must be exactly the > same". > > > I could have > used "implement appropriate type check for method arguments and return > types in extended classes". > > > -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/vim_dev/CAAW7x7mPtLqJsD0w8a%3DODLj5V%3Dj4-OZ__TPbkC90AXz%3D5byNrw%40mail.gmail.com.
