<rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" version="2.0">
  <channel>
    <title>MaplePrimes - answers and comments on Question, sequence of export variables in a module matter</title>
    <link>http://www.mapleprimes.com/questions/96566-Sequence-Of-Export-Variables-In-A-Module-Matter</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 20:34:23 GMT</lastBuildDate>
    <pubDate>Thu, 11 Jun 2026 20:34:23 GMT</pubDate>
    <itunes:subtitle />
    <itunes:summary />
    <description>The latest answers and comments added to the Question, sequence of export variables in a module matter</description>
    <image>
      <url>http://www.mapleprimes.com/images/mapleprimeswhite.jpg</url>
      <title>MaplePrimes - answers and comments on Question, sequence of export variables in a module matter</title>
      <link>http://www.mapleprimes.com/questions/96566-Sequence-Of-Export-Variables-In-A-Module-Matter</link>
    </image>
    <item>
      <title>Disturbing, but save in an archive instead</title>
      <link>http://www.mapleprimes.com/questions/96566-Sequence-Of-Export-Variables-In-A-Module-Matter?ref=Feed:MaplePrimes:sequence of export variables in a module matter:Comments#answer96569</link>
      <itunes:summary>&lt;p&gt;It is rather curious, indeed. And disturbing!&lt;/p&gt;
&lt;p&gt;Apparently by saving the module in the second example mp:-mult evaluates to the global variable mult, which has not been defined to be anything.&lt;/p&gt;
&lt;p&gt;If inside the procedure f2, mult is replaced by mp:-mult, then both versions work, also after saving.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;However, if you create a Maple archive and save your packages there, both seem to work fine:&lt;/p&gt;
&lt;p&gt;restart;&lt;br&gt;#mkdir("F:/temp");&lt;br&gt;march(create,"F:/temp/mp.mla",10);&lt;br&gt;restart;&lt;br&gt;mp1:= module() &lt;br&gt;export mult, f2; option package;&lt;br&gt;mult:=proc(v) 3*v end proc;&lt;br&gt;f2 :=proc(v) mult(v); end proc;&lt;br&gt;end module;&lt;br&gt;savelibname:="F:/temp/mp.mla";&lt;br&gt;savelib(mp1);&lt;br&gt;restart;&lt;br&gt;libname := libname, "F:/temp";&lt;br&gt;&lt;br&gt;with(mp1);&lt;br&gt;f2(5);&lt;br&gt;mult(4);&lt;br&gt;&lt;br&gt;restart;&lt;br&gt;mp2:= module() export f2, mult; option package;&lt;br&gt;mult:=proc(v) 3*v end proc;&lt;br&gt;f2 :=proc(v) mult(v) end proc;&lt;br&gt;end module;&lt;br&gt;&lt;br&gt;savelibname:="F:/temp/mp.mla";&lt;br&gt;savelib(mp2);&lt;br&gt;&lt;br&gt;restart;&lt;br&gt;libname := "F:/temp",libname;&lt;br&gt;&lt;br&gt;with(mp2);&lt;br&gt;f2(5);&lt;br&gt;mult(4);&lt;br&gt;&lt;br&gt;&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;It is rather curious, indeed. And disturbing!&lt;/p&gt;
&lt;p&gt;Apparently by saving the module in the second example mp:-mult evaluates to the global variable mult, which has not been defined to be anything.&lt;/p&gt;
&lt;p&gt;If inside the procedure f2, mult is replaced by mp:-mult, then both versions work, also after saving.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;However, if you create a Maple archive and save your packages there, both seem to work fine:&lt;/p&gt;
&lt;p&gt;restart;&lt;br&gt;#mkdir("F:/temp");&lt;br&gt;march(create,"F:/temp/mp.mla",10);&lt;br&gt;restart;&lt;br&gt;mp1:= module() &lt;br&gt;export mult, f2; option package;&lt;br&gt;mult:=proc(v) 3*v end proc;&lt;br&gt;f2 :=proc(v) mult(v); end proc;&lt;br&gt;end module;&lt;br&gt;savelibname:="F:/temp/mp.mla";&lt;br&gt;savelib(mp1);&lt;br&gt;restart;&lt;br&gt;libname := libname, "F:/temp";&lt;br&gt;&lt;br&gt;with(mp1);&lt;br&gt;f2(5);&lt;br&gt;mult(4);&lt;br&gt;&lt;br&gt;restart;&lt;br&gt;mp2:= module() export f2, mult; option package;&lt;br&gt;mult:=proc(v) 3*v end proc;&lt;br&gt;f2 :=proc(v) mult(v) end proc;&lt;br&gt;end module;&lt;br&gt;&lt;br&gt;savelibname:="F:/temp/mp.mla";&lt;br&gt;savelib(mp2);&lt;br&gt;&lt;br&gt;restart;&lt;br&gt;libname := "F:/temp",libname;&lt;br&gt;&lt;br&gt;with(mp2);&lt;br&gt;f2(5);&lt;br&gt;mult(4);&lt;br&gt;&lt;br&gt;&lt;/p&gt;</description>
      <guid>96569</guid>
      <pubDate>Wed, 01 Sep 2010 13:36:30 Z</pubDate>
      <itunes:author>Preben Alsholm</itunes:author>
      <author>Preben Alsholm</author>
    </item>
    <item>
      <title>Library archive (.mla repository)</title>
      <link>http://www.mapleprimes.com/questions/96566-Sequence-Of-Export-Variables-In-A-Module-Matter?ref=Feed:MaplePrimes:sequence of export variables in a module matter:Comments#answer96586</link>
      <itunes:summary>&lt;p&gt;As a general rule, a module has to be savelib'd to a .mla Library archive (repository) and not to a .m file, if it is to be saved fully intact.&lt;/p&gt;
&lt;p&gt;If there is no writable .mla archive in the savelibname (or libname) path then Maple will write out to a .m ("dotm") format file instead.&lt;/p&gt;
&lt;p&gt;And, in general, a module is not fully encapsulated when saved to a .m file. That should be better documented. But there it is.&lt;/p&gt;
&lt;p&gt;Workarounds are to either assign savelibname to a particular .mla filename, or to a directory which contains a writable .mla archive. That's good practice in general, or else lots of savelib() calls will litter some directory instead of nicely saving any individual .m's to a .mla container.&lt;/p&gt;
&lt;p&gt;FWIW, that is related to why customized context-menu actions do not work properly on modules as the display output. The GUI-kernel interaction for it is somehow dotm based, and only a shell of the module object gets received by the context-menu package's code. This is a shame, given how long modules have been in Maple.&lt;/p&gt;
&lt;!--break--&gt;
&lt;p&gt;The Example in &lt;a href='http://www.maplesoft.com/support/help/search.aspx?term=LibraryTools,Create' target='_new'&gt;?LibraryTools,Create&lt;/a&gt; should use the currently supported .mla and not the old deprecated .lib/.ind filename extensions.&lt;/p&gt;
&lt;p&gt;It might be better if the tools were more user-friendly. The `savelib` command could issue an error if no writable archive were present, and suggest using `save` instead. The `save` command could issue an error if told to save a module whichit could not fully handle. And so on. I bet something better is workable, while only losing "misfunctionality".&lt;/p&gt;
&lt;p&gt;acer&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;As a general rule, a module has to be savelib'd to a .mla Library archive (repository) and not to a .m file, if it is to be saved fully intact.&lt;/p&gt;
&lt;p&gt;If there is no writable .mla archive in the savelibname (or libname) path then Maple will write out to a .m ("dotm") format file instead.&lt;/p&gt;
&lt;p&gt;And, in general, a module is not fully encapsulated when saved to a .m file. That should be better documented. But there it is.&lt;/p&gt;
&lt;p&gt;Workarounds are to either assign savelibname to a particular .mla filename, or to a directory which contains a writable .mla archive. That's good practice in general, or else lots of savelib() calls will litter some directory instead of nicely saving any individual .m's to a .mla container.&lt;/p&gt;
&lt;p&gt;FWIW, that is related to why customized context-menu actions do not work properly on modules as the display output. The GUI-kernel interaction for it is somehow dotm based, and only a shell of the module object gets received by the context-menu package's code. This is a shame, given how long modules have been in Maple.&lt;/p&gt;
&lt;!--break--&gt;
&lt;p&gt;The Example in &lt;a href='http://www.maplesoft.com/support/help/search.aspx?term=LibraryTools,Create' target='_new'&gt;?LibraryTools,Create&lt;/a&gt; should use the currently supported .mla and not the old deprecated .lib/.ind filename extensions.&lt;/p&gt;
&lt;p&gt;It might be better if the tools were more user-friendly. The `savelib` command could issue an error if no writable archive were present, and suggest using `save` instead. The `save` command could issue an error if told to save a module whichit could not fully handle. And so on. I bet something better is workable, while only losing "misfunctionality".&lt;/p&gt;
&lt;p&gt;acer&lt;/p&gt;</description>
      <guid>96586</guid>
      <pubDate>Wed, 01 Sep 2010 19:24:22 Z</pubDate>
      <itunes:author>acer</itunes:author>
      <author>acer</author>
    </item>
  </channel>
</rss>