Question: basic question on parent and child modules

When a child proc calls a parent local proc using parent_module:-parent_proc(), Maple gives an error. But when the child calls the parent local proc using just parent_proc() it works. Why is that?

parent_module:=module()
 
 local child_module;
 local parent_proc;

 export parent_entry;

 child_module:= module()
    export child_entry; 
    child_entry :=proc()
     #parent_module:-parent_proc(); #this fails
     parent_proc(); #this works
    end proc;
  end module;

 #local
 parent_proc :=proc()
   print("insider parent proc");
 end proc;

 #public
 parent_entry :=proc()
   child_module:-child_entry();
 end proc;
end module;

parent_module:-parent_entry();
              "insider parent proc"

but the other way, (the commented code above) gives

parent_module:-parent_entry();
Error, (in child_entry) module does not export `parent_proc`

 

Please Wait...