Collective attribute

A record in the class definition that begins with no access type is a collective attribute. It is not created for any particular class member, but belongs to the class itself. Currently only three collective attributes can be defined, which are All the collective attributes are optional. The following is a class which has all the three collective attributes.
    global.circle = class
          super = global.ellipse;
          title = "circle";
          new = radius -> ();
    
          public radius = 1 in _RP;
          auto longaxis = () -> parent.radius;
          auto shortaxis = () -> parent.radius;
          auto area = () -> pi * (parent.radius)^2;
          auto perimeter = () -> 2 * pi * parent.radius;
    end



oz 2009-12-22