Question: lastexception cleared by the creation of an rtable, why?

In a do loop with a try... catch statement I had placed an assignment to a vector element after catch: but before the line printing the lastexception. That the loop didn't perform as expected, but resulted in an error about ListTools:-FormatMessage wanting its first argument to be a string surprised me. Putting the assigment to the vector after the exception printing worked fine.
It seems that rtables are the exception (no pun intended) to the order being irrelevant.
 

restart;
V:=Vector():
for j from 1 to 5 do
  try
   V(j):=j/(j-1)
  catch:
   V(j):=17; # clears lastexception apparently
   printf(cat(StringTools:-FormatMessage(lastexception[ 2 .. -1 ] ),"\n"));
  end try
end do:
#####
restart;
V:=Vector():
for j from 1 to 5 do
  try
   V(j):=j/(j-1)
  catch:
   printf(cat(StringTools:-FormatMessage(lastexception[ 2 .. -1 ] ),"\n"));
   V(j):=17;
  end try
end do:

These simple lines confirm my observation:

restart;
lastexception;
5/0;
lastexception;
5/5;
lastexception;
x:=47;
lastexception;
table();
lastexception;
[1,2,3];
lastexception;
rtable();
lastexception; # Now cleared!


 

Please Wait...