[Grace-core] Visibility of variables and constants in Objects

James Noble kjx at ecs.vuw.ac.nz
Fri Jul 5 06:33:43 PDT 2013


> A bit off to the side, but do we require overridden methods to have an override annotation?

we're supposed to require *overriding* methods to have an "is overrides" annotation.

>  I would argue that is very important, especially if there are no private methods as it is easy to accidentally override something from several superclasses up. 

we don't require the overridden methods to be annotation - that would be somehow the opposite of "final", right?

(BTW I thought of a use case for fields overriding methods - implementing an abstract field :-)


type Point = {
  x -> Number
  y -> Number
}

class AbstractPoint.new -> Point {
  method x is abstract -> Number { }
  method y is abstract -> Number { } 
}

class CartesianPoint -> Point {
 var x is public : Number
 var x is public : Number
}




More information about the Grace-core mailing list