This function calls a Mapleprogram given as a string mapleprogram.
Note that any command line there has to end with a semicolon.
The arguments inputdata1 and inputdata2 are here just for convenience and you can put the empty strings if you want or leave them away.
Inside mapleprogram the string placeholder1 is then replaced by the string inputdata1 and placeholder2 is replaced the string inputdata2.
In the string inputdata1 we take care automatically of the main compatibility problem between Macaulay 2 and Maple which is replacing in lists the curly brackets are by square brackets.
The Maple program has to write its output in the Maple variable returnvalue. This is converted in Maple into a string, square brackets are replaced by curly brackets and then this string is evaluated in Macaulay 2 via the function value.
A very simple example:
|
|
|
Here is an example how to send a Matrix to Maple, compute its integer normal form and send it back to Macaulay 2:
|
|
|
|
Using inputdata2 to pass the command ismith to Maple:
|
|
|
|
|
(Note that it may be more convenient for you to use for mapleprogram the three-slashes string delimiter but this cannot be done here in the doc environment).
Same program but obtaining also the base change matrices:
|
|
|
|
|
|
|
|
|
The object callMaple is a method function with options.