Question: what rules Maple uses to find correct operator to use if more than one is visible?

I've never noticed this before, becuase I do not like to with()  packages, but like to add the name of the package at each command and alwsys try to use explicit commands.

Compare this first example, which does not work, since the "." in the codeis the global "dot" command ?dot

restart;
VC:=VectorCalculus:
f:=y*sin(x)+y^2;
VC:-Nabla . VC:-Nabla(f,[x,y])

So the dot above is the one used for normal dot product, which is visible without loading any package as in: <1,2>.<3,4> gives 11

Now when I next loaded the VectorCalculus explicitly, but kept the same code the same, i.e. using the same ".", now it worked

restart;
with(VectorCalculus);
VC:=VectorCalculus:  #do not need this now, but to keep the code the same
f:=y*sin(x)+y^2;
VC:-Nabla . VC:-Nabla(f,[x,y])

It worked because Maple now used VectorCalculus:-`.`  ,Even though I did not tell it to do this, it searched the package since it is loaded) and now decided to use VectorCalculus:-`.` instead of the global `.` dot defined before loading this package.

But how did Maple know which dot to use? 

Did it say to itself, the dot in the middile must be VectorCalculus:-`.` and not the global `.` due to the type of the operands around the dot, it automatically found the correct match? 

So imagine if one has loaded more packages, and some might have its own `.` operator that takes the same operands, does Maple search them all to find the correct dot to use based on type of operands to bind it to? and how in this case it knows which to use, if there is more than one match among all loaded packages? I can see this causing confusion, becuase one is never sure in this case which operator was used. I do not know if Maple issues a warning in this case or not.

Please Wait...