Replies: 4 comments 4 replies
-
Is it a change, from the original spec, to allow So there would only be implicit interfaces? The programmer still needs to know about interfaces, there's still the
instead of
(assuming in the original example, The former doesn't look simpler. It doesn't save any conceptual understanding. Somewhat off topic,
Not especially relevant, but I don't see how that necessarily requires quite a bit of, or even any, refactoring. In any event, by the time a programmer needs it in their big project, let's hope specifies is available ;-) |
Beta Was this translation helpful? Give feedback.
-
I don't think so, it would be a bit strange to exclude abstract classes. I just read that as a generalisation - more exactly "not just abstract".
I think "specifies" makes the interface declaration explicit. Implicit would probably be used to describe the case where every class provided an interface regardless.
One way to do it.
Fixed.
The syntax would hopefully be simplified. It saves having to understand that they're both describing, almost, the same thing. Dart has already done the work here so if it's agreed that Bram had something similar in mind it would provide some guidance. Here's the initial proposal to remove interfaces from Dart: https://news.dartlang.org/2012/06/proposal-to-eliminate-interface.html
Like anything, people have different views on how onerous a given refactoring might be. |
Beta Was this translation helpful? Give feedback.
-
As I understand it, class Foo specifies IFoo
def DoSomething(): void
echomsg "Doing something"
enddef
endclass would be exactly the same as class Foo
def DoSomething(): void
echomsg "Doing something"
enddef
endclass
interface IFoo
def DoSomething(): void
endinterface and both used as expected class A extends Foo
def StopSomething(): void
echomsg "Stop it"
enddef
endclass
class B implements IFoo
def DoSomething(): void
echomsg "Doing something different"
enddef
endclass |
Beta Was this translation helpful? Give feedback.
-
In #13069 (comment) the statement
Is not accurate. (unless I'm still not understanding something). How do you think this affects the exploration for
|
Beta Was this translation helpful? Give feedback.
-
It's currently slated to provide classes with the capability to define interfaces. See
:help specifies
.It seems to me that it is worth exploring the possibility of removing explicit interface structures and folding them into this class based mechanism.
With this
specifies
feature I believe the following would declare an identical interface.I mentioned this to Bram some time ago:
I still think it would be worth exploring ways to remove the redundancy without losing "the intent". This would possibly result in removing standalone interfaces so it should be considered before any release.
Beta Was this translation helpful? Give feedback.
All reactions