2.6 How to extend a class and call base class function from the extended class??

Once a base class is extended, all methods in the base class become part of the extending class. So to call a base class method just use same way as if calling any other method in the extending class itself.

Here is an example.

module person() 
    option object; 
    local age::integer:=100; 
 
    export ModuleCopy::static:= proc(_self,proto::person, age::integer,$) 
           _self:-age := age; 
    end proc; 
 
    local base_class_method::static:=proc(_self,$) 
        print("In base class method..."); 
    end proc; 
 
 
end module; 
 
#---- extend the above class 
module young_person() 
   option object(person); 
   export process::static:=proc(_self,$) 
      print("In young_person process"); 
     _self:-base_class_method(); 
   end proc; 
end module;
 

Here is an example of usage

o:=Object(young_person,20); 
o:-process() 
 
                   "In young_person process" 
                   "In base class method..."
 

The above in Maple 2023.1