<rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" version="2.0">
  <channel>
    <title>MaplePrimes - answers and comments on Question, Please help me creating a Maple 11 Library Archive (.mla file)!!!</title>
    <link>http://www.mapleprimes.com/questions/119912-Please-Help-Me-Creating-A-Maple-11-Library-Archive-mla-File</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 15:40:13 GMT</lastBuildDate>
    <pubDate>Thu, 11 Jun 2026 15:40:13 GMT</pubDate>
    <itunes:subtitle />
    <itunes:summary />
    <description>The latest answers and comments added to the Question, Please help me creating a Maple 11 Library Archive (.mla file)!!!</description>
    <image>
      <url>http://www.mapleprimes.com/images/mapleprimeswhite.jpg</url>
      <title>MaplePrimes - answers and comments on Question, Please help me creating a Maple 11 Library Archive (.mla file)!!!</title>
      <link>http://www.mapleprimes.com/questions/119912-Please-Help-Me-Creating-A-Maple-11-Library-Archive-mla-File</link>
    </image>
    <item>
      <title>not yet a module</title>
      <link>http://www.mapleprimes.com/questions/119912-Please-Help-Me-Creating-A-Maple-11-Library-Archive-mla-File?ref=Feed:MaplePrimes:Please help me creating a Maple 11 Library Archive (.mla file)!!!:Comments#answer119920</link>
      <itunes:summary>&lt;p&gt;Your procedures are not (yet) members of a module. So, as you've got it so far, that `with(NewArchive)` is not appropriate. There is no one-to-one relationship between modules and library archives. You can store procedures inside an archive, without their necessarily having to be exports of a module. (But, on the other hand, there's nothing to stop you doing that it you want.)&lt;/p&gt;
&lt;p&gt;Here it is, without a module for the two procedures. You can put all manner of file-checking a try..catch and bullet-proofing around it, if you want. It's important to put the valid, writable new archive &lt;em&gt;first&lt;/em&gt; in libname, so that what gets saved does get saved &lt;em&gt;there&lt;/em&gt; and not elsewhere.&lt;/p&gt;
&lt;pre&gt;restart:

# keep only the assignment to loc that you want.
loc:="Z:/Documents/NewArchive.mla":
loc:=cat(kernelopts(homedir),"\\My Documents\\NewArchive.mla"):

try
  FileTools:-Remove(loc);
catch:
end try:

foo:=proc(x) sin(x); end proc:
bar:=proc(x) cos(x); end proc:

try
  LibraryTools:-Create(loc);
  libname:=loc,libname;
  print("saving");
  savelib(foo);
  savelib(bar);
catch "error":
end try:

                            "saving"
&lt;/pre&gt;
&lt;p&gt;Now they should be saved and ready for re-use. Start a new session, to check.&lt;/p&gt;
&lt;pre&gt;restart:

libname:=cat(kernelopts(homedir),"\\My Documents\\NewArchive.mla"),libname:

foo(7);

                             sin(7)

bar(11);

                            cos(11)
&lt;/pre&gt;
&lt;p&gt;And if you want, you can put that libname adjustment line in your (personal) &lt;a href="http://www.maplesoft.com/support/help/Maple/view.aspx?path=worksheet/reference/initialization"&gt;maple initialization file&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;And now with the two procedures inside a module.&lt;/p&gt;
&lt;pre&gt;restart:

# keep only the assignment to loc that you want.
loc:="Z:/Documents/NewArchive.mla":
loc:=cat(kernelopts(homedir),"\\My Documents\\NewArchive.mla"):

try
  FileTools:-Remove(loc);
catch:
end try:

NewModule:=module()
option package;
export foo, bar;
   foo:=proc(x) arcsin(x); end proc:
   bar:=proc(x) arccos(x); end proc:
end module:

try
  LibraryTools:-Create(loc);
  libname:=loc,libname;
  print("saving");
  savelib(NewModule);
catch "error":
end try:

                            "saving"
&lt;/pre&gt;
&lt;p&gt;Now test it, in a new session.&lt;/p&gt;
&lt;pre&gt;restart:

libname:=cat(kernelopts(homedir),"\\My Documents\\NewArchive.mla"),libname:

foo(7);

                             foo(7)

bar(11);

                            bar(11)

with(NewModule);

                           [bar, foo]

foo(7);

                           arcsin(7)

bar(11);

                           arccos(11)
&lt;/pre&gt;
&lt;p&gt;There is an alternative to placing the .mla in a location with which you must prepend libname (in each new session, or in an initialization file). The alternative is to place the .mla archive as if it belonged to some made-up Maple toolbox. For example, using Maple 15 you could place it here (using Windows backslash, but use forwardslash if you prefer)&lt;/p&gt;
&lt;pre&gt;  cat(kernelopts('homedir'),"\\maple\\toolbox\\15\\misc\\lib\\NewArchive.mla");
&lt;/pre&gt;
&lt;p&gt;Such locations are "special" in the sense that Maple automatically includes them in libname, hence removing the need for you to adjust libname in an initialization file. In order for that to take effect, you'll have to quit all open M15 GUI instances and relaunch the whole GUI. You can query the name `libname`, to see if the presence of that folder, even if empty, causes it to get added to libname. It should also work for Maple 11, if you replace the 15 in that folder path with an 11.&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;Your procedures are not (yet) members of a module. So, as you've got it so far, that `with(NewArchive)` is not appropriate. There is no one-to-one relationship between modules and library archives. You can store procedures inside an archive, without their necessarily having to be exports of a module. (But, on the other hand, there's nothing to stop you doing that it you want.)&lt;/p&gt;
&lt;p&gt;Here it is, without a module for the two procedures. You can put all manner of file-checking a try..catch and bullet-proofing around it, if you want. It's important to put the valid, writable new archive &lt;em&gt;first&lt;/em&gt; in libname, so that what gets saved does get saved &lt;em&gt;there&lt;/em&gt; and not elsewhere.&lt;/p&gt;
&lt;pre&gt;restart:

# keep only the assignment to loc that you want.
loc:="Z:/Documents/NewArchive.mla":
loc:=cat(kernelopts(homedir),"\\My Documents\\NewArchive.mla"):

try
  FileTools:-Remove(loc);
catch:
end try:

foo:=proc(x) sin(x); end proc:
bar:=proc(x) cos(x); end proc:

try
  LibraryTools:-Create(loc);
  libname:=loc,libname;
  print("saving");
  savelib(foo);
  savelib(bar);
catch "error":
end try:

                            "saving"
&lt;/pre&gt;
&lt;p&gt;Now they should be saved and ready for re-use. Start a new session, to check.&lt;/p&gt;
&lt;pre&gt;restart:

libname:=cat(kernelopts(homedir),"\\My Documents\\NewArchive.mla"),libname:

foo(7);

                             sin(7)

bar(11);

                            cos(11)
&lt;/pre&gt;
&lt;p&gt;And if you want, you can put that libname adjustment line in your (personal) &lt;a href="http://www.maplesoft.com/support/help/Maple/view.aspx?path=worksheet/reference/initialization"&gt;maple initialization file&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;And now with the two procedures inside a module.&lt;/p&gt;
&lt;pre&gt;restart:

# keep only the assignment to loc that you want.
loc:="Z:/Documents/NewArchive.mla":
loc:=cat(kernelopts(homedir),"\\My Documents\\NewArchive.mla"):

try
  FileTools:-Remove(loc);
catch:
end try:

NewModule:=module()
option package;
export foo, bar;
   foo:=proc(x) arcsin(x); end proc:
   bar:=proc(x) arccos(x); end proc:
end module:

try
  LibraryTools:-Create(loc);
  libname:=loc,libname;
  print("saving");
  savelib(NewModule);
catch "error":
end try:

                            "saving"
&lt;/pre&gt;
&lt;p&gt;Now test it, in a new session.&lt;/p&gt;
&lt;pre&gt;restart:

libname:=cat(kernelopts(homedir),"\\My Documents\\NewArchive.mla"),libname:

foo(7);

                             foo(7)

bar(11);

                            bar(11)

with(NewModule);

                           [bar, foo]

foo(7);

                           arcsin(7)

bar(11);

                           arccos(11)
&lt;/pre&gt;
&lt;p&gt;There is an alternative to placing the .mla in a location with which you must prepend libname (in each new session, or in an initialization file). The alternative is to place the .mla archive as if it belonged to some made-up Maple toolbox. For example, using Maple 15 you could place it here (using Windows backslash, but use forwardslash if you prefer)&lt;/p&gt;
&lt;pre&gt;  cat(kernelopts('homedir'),"\\maple\\toolbox\\15\\misc\\lib\\NewArchive.mla");
&lt;/pre&gt;
&lt;p&gt;Such locations are "special" in the sense that Maple automatically includes them in libname, hence removing the need for you to adjust libname in an initialization file. In order for that to take effect, you'll have to quit all open M15 GUI instances and relaunch the whole GUI. You can query the name `libname`, to see if the presence of that folder, even if empty, causes it to get added to libname. It should also work for Maple 11, if you replace the 15 in that folder path with an 11.&lt;/p&gt;</description>
      <guid>119920</guid>
      <pubDate>Tue, 17 May 2011 06:33:51 Z</pubDate>
      <itunes:author>pagan</itunes:author>
      <author>pagan</author>
    </item>
    <item>
      <title>Problem solved!</title>
      <link>http://www.mapleprimes.com/questions/119912-Please-Help-Me-Creating-A-Maple-11-Library-Archive-mla-File?ref=Feed:MaplePrimes:Please help me creating a Maple 11 Library Archive (.mla file)!!!:Comments#comment119946</link>
      <itunes:summary>&lt;p&gt;@pagan: Thanks a lot!!! That's exactly what I was looking for!!&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;@pagan: Thanks a lot!!! That's exactly what I was looking for!!&lt;/p&gt;</description>
      <guid>119946</guid>
      <pubDate>Tue, 17 May 2011 18:32:03 Z</pubDate>
      <itunes:author>19Massa87</itunes:author>
      <author>19Massa87</author>
    </item>
  </channel>
</rss>