Maple V undocumented by Joe Riel

Joe Riel, joer@k-online.com, discovered undocumented commands of Maple V and also took a deeper look on built-in procedures. The following text is a summary of E-mails Joe Riel sent me and which I was permitted to publish. I included some remarks on the goto command myself in square brackets and added the numbers of R5 built-in functions to the table at the bottom of this page.

Joe Riel wrote:

Undocumented Maple commands

Here are some of the undocumented commands that I'm aware of in Release 3.

The Maple archive manager, march, allows one to list the contents of the Maple library. I've uncovered a few useful but undocumented procedures which are part of the standard release (V5.3). Some of these procedures may have been mentioned in the update releases, however, there is no on-line documentation for them.

If you have UNIX you can use the following command to create an alphabetized list of the contents of the main library, excluding the help files,

march -l lib | awk '$1 !~ /help/ {print $1}' | sort > archive
The march utility is also available for the DOS/Windows version, but you'll have to use another method to process the file.

Following is a list of some of the procedures I've found.

Undocumented Functions in Release 3
Name   Brief Description or Best Guess
     
convert/    
  and And's all the elements of an expression.
  Bessel Converts Airy functions, Ai & Bi, to Bessel functions.
  Eexp Converts E's in an expression to exp(1)'s.
  lnarctan Converts ln's and arctans with complex arguments to ...
  or Or's all the elements of an expression.
  power Converts a surd to a power.
  surd Converts a power to a surd.
     
savelib   Saves a sequence of variables to the first library in the expression sequence libname.
     
tools/    
  arity Returns the number of arguments of a procedure.
  canapply Indicates whether a procedure is applicable (?).
  genglob Generates a global variable of the form w.i where w is the parameter of genglob and i is an integer.
gensym  Returns a synonym for a variable, i.e. a variable which looks the same as another but has a different machine address and so is considered by Maple to be different.

The goto command

You can use it in the following manner,
> n := 10;
> goto(n);
> ...
> 10: ...
which allows branching. [n is of type integer.] Also, if you can use macros to create "labels" in your source code, for example,
> macro(finis=999);

> temp := proc()
> ...
> goto finis;
> ...
> finis:
> ...
> end:
[The goto statement can only be used in the procedure containing this command. You cannot jump into or exit loops using goto. Also trying to enter or prematurely quit nested procedures with this command is impossible.]

Built-in procedures

A small number of Maple's procedures are "built-in", that is, part of the kernel. A built-in procedure has the form

proc() options builtin; "number" end:

where "number" is a positive integer that points to the code in the kernel. [...] While it is not possible to trace the action of a built-in procedure, it is occasionally useful to determine its arguments when it is called. This can be done by reassigning the procedure so that it calls the built-in function, for example,

> unprotect(abs):

> abs := proc()
>    options trace;
>    proc() options builtin; 55 end(args)
> end:
That, alas, requires looking up the number of the built-in function, which makes it dependent on the version of Maple. A better method is to assign the built-in procedure to another procedure and then call that procedure in the new procedure; the following shows how this is done.
> olddiff := eval(diff):

> unprotect(diff):

> diff := proc()
>    options trace;
>    olddiff(args)
> end:
 
> diff(x^2, x);

{--> enter diff, args = x^2, x

                                  2 x

<-- exit diff (now at top level) = 2*x}

                                  2 x
The following table lists all the built-in functions defined in Release 3 through Release 5, and gives their associated number.

Built-in procedures in Maple V R3 through R5
Name of procedure R3 R4 R4 comments R5 R5 comments
           
inner --- 53 undocumented 53 undocumented
ASSERT --- 54   54  
`*` [Asterisk] --- 55   55  
DEBUG --- 56   58  
ERROR 50 57   60  
Im 51 58   63  
MorrBrilCull --- 59 undocumented 66 undocumented
`+` [Plus] --- 60   68  
RETURN 52 61   69  
Re 53 62   70  
SearchText 54 63   71  
abs 55 64   72  
add --- 65   73  
addressof 56 66   74  
alias 57 67   75  
anames 58 68   76  
appendto 59 69   77  
array 60 70   78  
assemble 61 71   79  
assigned 62 72   80  
attributes --- 73   81  
callback 63 74 OEM versions only 83 undocumented
cat 64 75   84  
coeff 65 76   85  
coeffs 66 77   86  
convert 67 78   87  
debugopts 68 79   89  
degree 69 80   91  
denom --- 81   92  
diff 70 82   93  
disassemble 71 83   94  
divide 72 84   95  
`$` [dollar] 73 85   96  
entries 74 86   97  
eval 75 87   98  
evalb 76 88   99  
evalf 77 89   100  
evalhf 78 90   101  
evaln 79 91   102  
expand 80 92   103  
frontend 81 93   104  
gc 82 94   105  
genpoly 83 95   106  
getuserinterface --- 96 undocumented 107 undocumented
goto 84 97 undocumented 108 undocumented
has 85 98   109  
hastype 86 99   110  
`evalf/hypergeom` 87 100   ---  
icontent 88 101   113  
if 89 102   114  
igcd 90 103   115  
ilog10 91 104   116  
indets 92 105   117  
indices 93 106   118  
intersect 94 107   119  
`int/series` 95 108    ---  
iolib --- 109   121  
iquo 96 110   122  
irem 97 111   123  
isqrt 98 112   124  
kernelopts --- 113   125  
lcoeff 99 114   126  
ldegree 100 115   127  
length 101 116   128  
lexorder 102 117   129  
lprint 103 118   130  
macro 104 119   131  
map 105 120   132  
map2
---
121   133  
max 106 122   134  
maxnorm 107 123   135  
member 108 124   136  
min 109 125   137  
minus 110 126   138  
modp 111 127   139  
modp1 112 128   140  
mods 113 129   141  
mul
---
130   142  
nops 114 131   143  
normal 115 132   144  
numboccur 116 133   145  
numer 117 134   146  
op 118 135   147  
order 119 136   148  
parse 120 137   149  
pointto 121 138   150  
print 122 139   151  
printf 123
---
   ---  
protect 124
---
   ---  
readlib 125 140   152  
readline 126
---
   ---  
searchtext 127 141   153  
select 128 142   154  
seq 129 143   155  
series 130 144   156  
setattributes
---
145    ---  
setuserinterface
---
146 undocumented 158 undocumented
sign 131 147   159  
sort 132 148   160  
sscanf 133
---
   ---  
ssystem 134 149   161  
subs 135 150   162  
subsop 136 151   163  
substring 137 152   164  
system 138 153   165  
table 139 154   166  
taylor 140 155   167  
tcoeff 141 156   168  
time 142 157   169  
`kernel/transpose`
---
158 undocumented 171 undocumented
traperror 143 159   172  
trunc 144 160   173  
type 145 161   174  
typematch
---
162   175  
unames 146 163   176  
union 147 164   177  
unprotect 148
---
   ---  
userinfo 149 165   178  
words 150
---
   ---  
writeto 151 166   179  

The `kernel/transpose` procedure transposes an array.

A help data base on undocumented Maple commands (Release 4) can be found in the MapleArchives: undoc.zip.


back

MAPLE UNDOCUMENTED 1.1 current as of August 11, 1999
Author: Joe Riel, joer@k-online.com
Original file location: http://www.math.utsa.edu/mirrors/maple/mplundoc.htm