There are a few ways to view the source of a Maple procedure, such as by using the commands  showstat and print. And these work as usual for the exports of a module. But for procedures which are declared as local to a module these methods do not work right away since by default modules' contents are opaque.

One way around this is to change a setting, by issuing kernelopts(opaquemodules=false) prior to attempting to view or print the module-local procedure in question. That brings a little awkwardness. For one thing, it's one more command to have to issue. Another potential problem is that you may forget to reset that option to true, afterwards. You could even be hiding a bug in your own authored modules, where you fail to notice that they only work properly when that non-default setting has been enabled by you! Generally, it's not a great idea to have to change the functioning environment just to bring about a cosmetic change which controls viewing and inspection.

So there is another way to do it (as of version Maple 14). You can use a double-colon :: instead of a colondash :- when you reference the unexported module local. Doing so should not change Maple's runtime behaviour with respect to the opacity of modules.

For example,

showstat((Student::Calculus1)::RootsNumeric);

instead of

kernelopts(opaquemodules=false):
showstat(Student:-Calculus1:-RootsNumeric)
kernelopts(opaquemodules=true):

in order to show safely the local procedure body with line numbers.

This technique should also work for calling stopat or trace on the procedure.

ps. Thanks, Axel, for telling me of my typo.


Please Wait...