Consider the following simple procedure

>F:=proc(LL::{set(list(integer)), list(list(integer))})
    LL;
 end proc:

 

Now execute this little loop


>for B in [{[1,2]},{[1,1/2]}] do
   try
      print(F(B));
  catch:
     print(lasterror);
  end try:
od:
                                  {[1, 2]}
  

"invalid input: %1 expects its %-2 argument, %3, to be of type %4, but
      received %5"

 

On the other hand  we get a more informative output with the following:


>F({[1,1/2]});


Error, invalid input: F expects its 1st argument, LL, to be of type {set(list(integer)), list(list(integer))}, but received {[1, 1/2]}

What's going on here with the try catch? Any ideas?

 


Please Wait...