<rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" version="2.0">
  <channel>
    <title>MaplePrimes - answers and comments on Question, How to use MmaTranslator?</title>
    <link>http://www.mapleprimes.com/questions/40732-How-To-Use-MmaTranslator</link>
    <language>en-us</language>
    <copyright>2026 Maplesoft, A Division of Waterloo Maple Inc.</copyright>
    <generator>Maplesoft Document System</generator>
    <lastBuildDate>Thu, 11 Jun 2026 22:01:36 GMT</lastBuildDate>
    <pubDate>Thu, 11 Jun 2026 22:01:36 GMT</pubDate>
    <itunes:subtitle />
    <itunes:summary />
    <description>The latest answers and comments added to the Question, How to use MmaTranslator?</description>
    <image>
      <url>http://www.mapleprimes.com/images/mapleprimeswhite.jpg</url>
      <title>MaplePrimes - answers and comments on Question, How to use MmaTranslator?</title>
      <link>http://www.mapleprimes.com/questions/40732-How-To-Use-MmaTranslator</link>
    </image>
    <item>
      <title>MmaTranslator does not convert user defined functions</title>
      <link>http://www.mapleprimes.com/questions/40732-How-To-Use-MmaTranslator?ref=Feed:MaplePrimes:How to use MmaTranslator?:Comments#answer75371</link>
      <itunes:summary>From the online help for the MmaTranslator package, "Note: The MmaTranslator package &lt;strong&gt;does not convert Mathematica programs&lt;/strong&gt;."

In Mathematica parlance, using the SetDelayed assignment (shortcut :=, colon equal) is deemed as defining a user function or program. So remove the set delayed and the list of assignment will be correctly translated.

&lt;pre&gt;
with(MmaTranslator):
FromMma(`( T={1,2,3}; v[{}]=0; v[{1}]=1; v[{2}]=2;v[{3}]=3;v[{1,2}]=4;v[{1,3}]=5; v[{2,3}]=6; v[T]=19;)`);

 MmaTranslator/Assign(T, [1, 2, 3]), MmaTranslator/Assign(v([]), 0), 

   MmaTranslator/Assign(v([1]), 1), MmaTranslator/Assign(v([2]), 2), 

   MmaTranslator/Assign(v([3]), 3), MmaTranslator/Assign(v([1, 2]), 4), 

   MmaTranslator/Assign(v([1, 3]), 5), MmaTranslator/Assign(v([2, 3]), 6), 

   MmaTranslator/Assign(v(T), 19)

&lt;/pre&gt;

To answer your second question, it would be great if you could explain in plain English what Test1 is supposed to achieve. No offense here, but from Mathematica point of view, this "function" creates a bunch of unrelated global symbols (and not an array called v) and the SetDelayed assignment is totally useless.

For instance, what do you expect from the Mathematica expression v[{}] = 0? I f v is supposed to be an array (a list in Mathematica jargon), this expression if meaningless. On the other hand, if v is supposed to be a function, then the above expression can be interpreted as the definition of the special case where the function v is provided with an empty list as argument and in this case is instructed to return zero.

Regards,
-- 
Jean-Marc</itunes:summary>
      <description>From the online help for the MmaTranslator package, "Note: The MmaTranslator package &lt;strong&gt;does not convert Mathematica programs&lt;/strong&gt;."

In Mathematica parlance, using the SetDelayed assignment (shortcut :=, colon equal) is deemed as defining a user function or program. So remove the set delayed and the list of assignment will be correctly translated.

&lt;pre&gt;
with(MmaTranslator):
FromMma(`( T={1,2,3}; v[{}]=0; v[{1}]=1; v[{2}]=2;v[{3}]=3;v[{1,2}]=4;v[{1,3}]=5; v[{2,3}]=6; v[T]=19;)`);

 MmaTranslator/Assign(T, [1, 2, 3]), MmaTranslator/Assign(v([]), 0), 

   MmaTranslator/Assign(v([1]), 1), MmaTranslator/Assign(v([2]), 2), 

   MmaTranslator/Assign(v([3]), 3), MmaTranslator/Assign(v([1, 2]), 4), 

   MmaTranslator/Assign(v([1, 3]), 5), MmaTranslator/Assign(v([2, 3]), 6), 

   MmaTranslator/Assign(v(T), 19)

&lt;/pre&gt;

To answer your second question, it would be great if you could explain in plain English what Test1 is supposed to achieve. No offense here, but from Mathematica point of view, this "function" creates a bunch of unrelated global symbols (and not an array called v) and the SetDelayed assignment is totally useless.

For instance, what do you expect from the Mathematica expression v[{}] = 0? I f v is supposed to be an array (a list in Mathematica jargon), this expression if meaningless. On the other hand, if v is supposed to be a function, then the above expression can be interpreted as the definition of the special case where the function v is provided with an empty list as argument and in this case is instructed to return zero.

Regards,
-- 
Jean-Marc</description>
      <guid>75371</guid>
      <pubDate>Tue, 09 Oct 2007 14:47:58 Z</pubDate>
      <itunes:author>gulliet</itunes:author>
      <author>gulliet</author>
    </item>
    <item>
      <title>Thanks Jean-Marc..</title>
      <link>http://www.mapleprimes.com/questions/40732-How-To-Use-MmaTranslator?ref=Feed:MaplePrimes:How to use MmaTranslator?:Comments#answer75296</link>
      <itunes:summary>Thanks a lot for the explanation.
As I am not familiar with Mma your explanation is really useful.
Regards,
Jean</itunes:summary>
      <description>Thanks a lot for the explanation.
As I am not familiar with Mma your explanation is really useful.
Regards,
Jean</description>
      <guid>75296</guid>
      <pubDate>Sun, 14 Oct 2007 00:22:11 Z</pubDate>
      <itunes:author>Jean</itunes:author>
      <author>Jean</author>
    </item>
    <item>
      <title>about MmaTranslator</title>
      <link>http://www.mapleprimes.com/questions/40732-How-To-Use-MmaTranslator?ref=Feed:MaplePrimes:How to use MmaTranslator?:Comments#comment84914</link>
      <itunes:summary>Thanks again for the long comments and explanation 
Jean-Marc.

I was trying in Mma Test1:= etc. Effectively,
Test1:= is a bunch of things. Nevertheless 
they are used by a function (MyFormula1) like this:

MyFormula1[MyTest_, i_] := (( v[DeleteCases[#, 
  i]] ) &amp; /@ Rest[Subsets[T]])

But what is not clear to me is how to obtain 
your expressions like

MmaTranslator/Assign(T, [1, 2, 3]), MmaTranslator/Assign(v([]), 0),

I am not sure if that is input or output. 
A last thing: I didnt know that was not possible
to translate programs..in fact.. I thought it was
easy.. given that apparently there is one option
to translate notebooks (which probably may contian
programs).

Anyway.. thanks for the comments

Jean

</itunes:summary>
      <description>Thanks again for the long comments and explanation 
Jean-Marc.

I was trying in Mma Test1:= etc. Effectively,
Test1:= is a bunch of things. Nevertheless 
they are used by a function (MyFormula1) like this:

MyFormula1[MyTest_, i_] := (( v[DeleteCases[#, 
  i]] ) &amp; /@ Rest[Subsets[T]])

But what is not clear to me is how to obtain 
your expressions like

MmaTranslator/Assign(T, [1, 2, 3]), MmaTranslator/Assign(v([]), 0),

I am not sure if that is input or output. 
A last thing: I didnt know that was not possible
to translate programs..in fact.. I thought it was
easy.. given that apparently there is one option
to translate notebooks (which probably may contian
programs).

Anyway.. thanks for the comments

Jean

</description>
      <guid>84914</guid>
      <pubDate>Thu, 11 Oct 2007 13:00:41 Z</pubDate>
      <itunes:author>Jean</itunes:author>
      <author>Jean</author>
    </item>
    <item>
      <title>A Mathematica Notebook is not Necessarily a Program</title>
      <link>http://www.mapleprimes.com/questions/40732-How-To-Use-MmaTranslator?ref=Feed:MaplePrimes:How to use MmaTranslator?:Comments#comment91986</link>
      <itunes:summary>Hi,

Reading your post, I have just released that inputs and outputs were not clearly delineated in my previous. Sorry about that. Indeed, the inputs are the first two lines only. The rest of the lines is the output, though it is a stylized version for whatever reason that come from the copy and past process. If you evalute the first two lines in a worksheet, you will see the "real" output in the form of meaningful Maple expessions.

About the second point you mentioned, keep in mind that a Mathematica notebook is not necessarily a program. 

Say, we write some stuff about integration. The notebook is likely to mixed textual information, or explanations, in the form of text cells, and input and output cells that contains different types of integrals and their corresponding results after evaluation.

In this case, converting a notebook is just a matter of looking for each input cell in turn and translating them in the corresponding Maple integration command.

On the other hand, one or more user defined functions may occur in a given notebook or the notebook may be just a collection of such definitions (in this case we speak of package).

I hope this clears up the confusion.

Regards,
-- 
Jean-Marc </itunes:summary>
      <description>Hi,

Reading your post, I have just released that inputs and outputs were not clearly delineated in my previous. Sorry about that. Indeed, the inputs are the first two lines only. The rest of the lines is the output, though it is a stylized version for whatever reason that come from the copy and past process. If you evalute the first two lines in a worksheet, you will see the "real" output in the form of meaningful Maple expessions.

About the second point you mentioned, keep in mind that a Mathematica notebook is not necessarily a program. 

Say, we write some stuff about integration. The notebook is likely to mixed textual information, or explanations, in the form of text cells, and input and output cells that contains different types of integrals and their corresponding results after evaluation.

In this case, converting a notebook is just a matter of looking for each input cell in turn and translating them in the corresponding Maple integration command.

On the other hand, one or more user defined functions may occur in a given notebook or the notebook may be just a collection of such definitions (in this case we speak of package).

I hope this clears up the confusion.

Regards,
-- 
Jean-Marc </description>
      <guid>91986</guid>
      <pubDate>Fri, 12 Oct 2007 19:35:52 Z</pubDate>
      <itunes:author>gulliet</itunes:author>
      <author>gulliet</author>
    </item>
  </channel>
</rss>