Replies: 8 comments 10 replies
-
I am going to make the following changes to the interface specification:
Let me know if you see any issues with this interface specification. |
Beta Was this translation helpful? Give feedback.
-
This one got a double take from me; they're all abstract aren't they? Checked it out and saw the errors; a good laugh. I don't see any potential problems with the spec. Can't wait to try and break it. |
Beta Was this translation helpful? Give feedback.
-
See #13100 which closes this discussion when integrated |
Beta Was this translation helpful? Give feedback.
-
Closed as of patch 9.0.1906 92d9ee5 |
Beta Was this translation helpful? Give feedback.
-
Sorry, this is moving a bit fast for me to keep up.
Interfaces generally specify behaviour, not data, and languages with this sort of type system usually allow properties but not fields to appear in interfaces. Irrespective of whether this is a good idea or not it's surprising that it passes through without comment. Is anyone paying attention? |
Beta Was this translation helpful? Give feedback.
-
On Sun, Sep 17, 2023 at 11:34 AM dkearns ***@***.***> wrote:
Sorry, this is moving a bit fast for me to keep up.
1. An interface can have only read-only and read-write instance
variables.
Interfaces generally specify behaviour, not data, and languages with this
sort of type system usually allow properties but not fields to appear in
interfaces.
As Bram described in
https://groups.google.com/g/vim_dev/c/yYpFNUHdRho/m/UTFWOY5VAgAJ (which you
quoted in another discussion),
it is useful to directly specify an interface from a class definition. If
we support this, then interfaces will have both data and behavior.
Irrespective of whether this is a good idea or not it's surprising that it
passes through without comment. Is anyone paying attention?
The changes to interfaces and class members/methods were discussed in the
past two weeks. Now that all the
changes are merged, can you try out the latest Vim version and let me know
if you have any comments?
|
Beta Was this translation helpful? Give feedback.
-
Reopening in case it's of use for @dkearns explorations. |
Beta Was this translation helpful? Give feedback.
-
Closing (again). Thinks it's worked out. |
Beta Was this translation helpful? Give feedback.
-
(Closed as of patch 9.0.1906 92d9ee5)
Trying some tests with
interface
inheritance showed some strange and unusual things. But maybevim9script
doesn't support interface inheritance, and aninterface
attempting to inherit another interface should be flagged as an error.Flagging it as an error might also be a way to defer handling the issues until spec/implementation is ready, possibly post 9.1.
There are some obvious issues
interface inheritance syntax
Currently the following is supported, Java use extends;
extends seems to better express the intent.
body of an interface inheriting an interface
An
interface
that inherits an interface is required to repeat the elementsof the parent interface. That may be an accident of using
implements
.class implementing multiple interfaces
Following gets
E1349: Function "F1" of interface "I2" not implemented
when processing
class B
.Using an object member instead of an object method gets the same error,
but the workaround fails with
E1369: Duplicate member
. Catch-22Beta Was this translation helpful? Give feedback.
All reactions