Replies: 7 comments 2 replies
-
Here's a simple example that demonstrates what is implemented so far.
outputs
|
Beta Was this translation helpful? Give feedback.
-
Should I guess the idea of "optional part" might mean that a builtin interface could have methods with a default implementation. Or maybe having |
Beta Was this translation helpful? Give feedback.
-
Allowing an interface to extend multiple interfaces may become more useful
|
Beta Was this translation helpful? Give feedback.
-
@errael : Thanks for opening this discussion. |
Beta Was this translation helpful? Give feedback.
-
To support backward compatibility we cannot add new methods to builtin interfaces (e.g. vimContainer) in the future. So we need to create one builtin interface per method. This will result in too many builtin interfaces. This raises the question, do we really need the builtin interfaces? I think supporting just the builtin methods (e.g. len(), empty(), string(), etc.) is sufficient. This will allow us to add additional methods in the future without breaking backward compatibility. A class also can implement only the builtin methods that it supports. |
Beta Was this translation helpful? Give feedback.
-
What's the problem with having a lot of builtin interfaces? Additionally, from a programmer's perspective,
That argues for having a complete design and burnin period until released, Without having an idea of future plans/direction, it's hard to discuss. It Here are some of the points that have been brought up, mostly about vim9script
There's little comment from the vim team on what the community had to say. It |
Beta Was this translation helpful? Give feedback.
-
If we use one builtin interface for every builtin method, then I don't see
The default implementation of empty() and "==" are not sufficient for a container object.
The "vimObject" interface cannot be extended in the future (as it will break backward compatibility).
If we support default implementation for the builtin methods, then there won't be
As discussed previously, if we use one interface per method, then this will
If there are default implementations for these methods, then how will you
I did create multiple draft PRs with both the implementations to get the comments. |
Beta Was this translation helpful? Give feedback.
-
PR #13238 has a mechanism that allows objects to be used with builtin functions.
It is based on an object implementing a vim builtin interface. Use this discussion
to comment on, and provide feedback about, this approach.
See the PR and its help for details.
Beta Was this translation helpful? Give feedback.
All reactions