Question: how to use showsource() command?

I can't figure how to use the showsource() command. There are no examples given.

kernelopts(version);
Maple 2017.0, X86 64 WINDOWS, May 17 2017, Build ID 1231047

If I use it on a local proc() it gives an error. Since it needs a file name

f := proc(x) if x <= 2 then print(x); print(x^2) end if; print(-x); x^3 end proc:
showsource(f);

Error, (in fopen) file or directory does not exist

From help:

The showsource command is similar to showstat, but displays the original 
source code corresponding to the requested statements, if that source 
code is available and, in the case of procedures retrieved from 
libraries, kernelopts(keepdebuginfo) is true. If source code is 
not available, showsource raises a warning and then produces 
the same output as showstat.

But there is not one single example of how to use this command. I tried it on a local file (.mpl) in the same folder, but it complained.

restart;
currentdirName :="C:\\bla\\bla";
currentdir(currentdirName);
showsource("maple_proc.mpl");

Error, invalid input: showsource expects its 1st argument, p, 
to be of type {`::`, name}, but received maple_proc.mpl


If I try

showsource(int);
Warning, no source information available; using showstat instead

Just looking for an example on how to use this command. (why help does not show an example?)

 

 

 

Please Wait...