The time for Easter eggs will soon be here.

And using LibraryTools to browse and poke about in Maple's .mla files can show a few undocumented items.

Here's one below, that's an interesting part of a package.

> exports(TestTools);
Try, Trynocrash, i, _pexports, TestOptions, Info, ResetInfo, SetRecord,
 
    PlotStructure, StatisticsTests, HadFailure, PrintOnFail, calcver

> TestTools:-Try();
Error, invalid input: TestTools:-Try uses a 2nd argument, ans (of type uneval),
which is missing
> TestTools:-Try(foo,bar);
Error, invalid input: TestTools:-Try expects its 1st argument, n, to be of type
{posint, string, And(float,positive)}, but received foo

> TestTools:-Try(1,foo,foo);
foo;

> TestTools:-Try(1,foo,bar);
foo;
 
["#  Try 1 failed running the following code:
 
 
    ", "foo;
 
    ", "
 
    ", "#  Used testing procedure: verify
 
    ", "#  Extra arguments: []
 
    ", "#  Expected result : bar
 
    ", "#  Evaluated result: foo
 
    "]

You can see that there's a lot to this routine, by examination. The other package exports don't look so interesting, with the exception perhaps of PlotStructure. The purpose of Try is pretty obvious -- to test a computed result against an expected result. The exact workings are harder to understand, in the absence of documentation. But use of verify is a good thing, because verify is flexible.

interface(verboseproc=3):
eval(TestTools:-Try);

acer


Please Wait...