RFC: DIP draft for "Compiler-defined Attribute Consistency"

Nick Treleaven nick at geany.org
Mon Jul 26 12:07:01 UTC 2021


On Wednesday, 21 July 2021 at 20:13:16 UTC, Rune Morling wrote:
> - abstract says something about the type of a class/function 
> (part of the OOP hierarchy)
> - final says that a function in a class cannot be overridden 
> (part of the OOP hierarchy)
> - override says that a function in a class is being overridden 
> (part of the OOP hierarchy)

None of these 3 attributes change the actual type of the class, 
they only affect methods in the class or methods in a subclass. 
What I'm saying is that it's simpler and easier to remember to 
use @attribute syntax for attributes that only affect a 
function/method, rather than that rule except attributes that are 
related to OOP don't use @.

Really using `abstract class` or `final class` is just another 
way of writing `class Foo {final: ...` or `class Foo {abstract: 
...`. So the attributes actually apply to the methods.


More information about the Digitalmars-d mailing list