[Vala] Interface distinction in class definition?



Hello. In Vala, derived class and implemented interfaces are defined
the same say, like in C#. As this way there is no syntactical
difference, C# convention states that interface names always start
with "I". For example, interface Foo would have name IFoo in C#.
However, there is no such convention in GLib or Vala, so the
distinction is not quite obvious, which can cause problems.

I was thinking it wouldn't be such a bad idea to inherit a Java
solution for this problem, that being keywords that clearly specify,
what the parent class is and what the implemented interfaces are.

  Example:

public class Child extends Parent implements Interface1, Interface2 {
}

  Or a hybrid syntax (I'd like that more):

public class Child: Parent, implements Interface1, Interface2 {
}

public class Child: implements Interface1 {
}

  Alternatively, it could be also good to explicitly add the
"interface" keyword in front of every interface in the list:

public class Child: Parent, interface List, interface Clonable {
}

public class Child: interface List {
}


What do you think?



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]