<?xml version="1.0" encoding="utf-8" ?> <!-- for emacs: -*- coding: utf-8 -*- --> <!-- Apache may like this line in the file .htaccess: AddCharset utf-8 .html --> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN" "http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg-flat.dtd" > <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head><title>loadPackage -- load a package</title> <link rel="stylesheet" type="text/css" href="../../../../Macaulay2/Style/doc.css"/> </head> <body> <table class="buttons"> <tr> <td><div><a href="_install__Package.html">next</a> | <a href="_needs__Package.html">previous</a> | <a href="_install__Package.html">forward</a> | <a href="_needs__Package.html">backward</a> | <a href="_packages.html">up</a> | <a href="index.html">top</a> | <a href="master.html">index</a> | <a href="toc.html">toc</a> | <a href="http://www.math.uiuc.edu/Macaulay2/">Macaulay2 web site</a></div> </td> </tr> </table> <div><a href="index.html" title="">Macaulay2Doc</a> > <a href="___The_sp__Macaulay2_splanguage.html" title="">The Macaulay2 language</a> > <a href="_packages.html" title="">packages</a> > <a href="_load__Package.html" title="load a package">loadPackage</a></div> <hr/> <div><h1>loadPackage -- load a package</h1> <div class="single"><h2>Synopsis</h2> <ul><li><div class="list"><dl class="element"><dt class="heading">Usage: </dt><dd class="value"><div><tt>loadPackage "PACKAGENAME"</tt></div> </dd></dl> </div> </li> <li><div class="single">Inputs:<ul><li><span><tt>PACKAGENAME</tt>, <span>a <a href="___String.html">string</a></span>, the name of the package</span></li> </ul> </div> </li> <li><div class="single">Consequences:<ul><li>Loads the package PACKAGENAME that is in the file PACKAGENAME.m2</li> </ul> </div> </li> <li><div class="single">Outputs:<ul><li><span><span>a <a href="___Package.html">package</a></span>, the package just loaded.</span></li> </ul> </div> </li> <li><div class="single"><a href="_using_spfunctions_spwith_spoptional_spinputs.html">Optional inputs</a>:<ul><li><span><tt>FileName => </tt><span><span>a <a href="___String.html">string</a></span>, <span>default value null</span>, the name of the file containing the source code of the package, from which it should be loaded</span></span></li> <li><span><tt>LoadDocumentation => </tt><span><span>a <a href="___Boolean.html">Boolean value</a></span>, <span>default value false</span>, whether to load the documentation of the package, too; see <a href="_begin__Documentation.html" title="package item: start documentation section">beginDocumentation</a></span></span></li> <li><span><tt>DebuggingMode => </tt><span><span>a <a href="___Boolean.html">Boolean value</a></span>, <span>default value null</span>, the value of <a href="_debugging__Mode.html" title="whether to enter the debugger when an error occurs">debuggingMode</a> during loading the package; specifying it here overrides the value specified as an option to <a href="_new__Package_lp__String_rp.html" title="package item: start a new package">newPackage</a> by the package itself</span></span></li> <li><span><tt>Configuration => </tt><span><span>a <a href="___List.html">list</a></span>, <span>default value {}</span>, a list of options <tt>KEY => VALUE</tt>, overriding the defaults specified in the source code of the package and the (possibly updated) values in the file in the user's application directory.</span></span></li> </ul> </div> </li> </ul> </div> <div class="single"><h2>Description</h2> <div><p>The file <tt>PACKAGENAME.m2</tt> should be on the load <a href="_path.html" title="list of directories to look in">path</a> and should contain a package named <tt>PACKAGENAME</tt>.</p> <p>If the variable <a href="_notify.html" title="whether to notify the user when a file is loaded">notify</a> is set to true, then an informational message is displayed after the file is loaded.</p> <table class="examples"><tr><td><pre>i1 : notify = true o1 = true</pre> </td></tr> <tr><td><pre>i2 : loadPackage "FirstPackage" --database not present: /builddir/build/BUILD/Macaulay2-1.3.1-r10737/StagingArea/common/lib/Macaulay2/i686-Linux-Fedora-15/FirstPackage/cache/rawdocumentation-dcba-4.db --beginDocumentation: reading the rest of /builddir/build/BUILD/Macaulay2-1.3.1-r10737/Macaulay2/packages/FirstPackage.m2 --package "FirstPackage" loaded --loaded /builddir/build/BUILD/Macaulay2-1.3.1-r10737/Macaulay2/packages/FirstPackage.m2 o2 = FirstPackage o2 : Package</pre> </td></tr> </table> </div> </div> <div class="single"><h2>See also</h2> <ul><li><span><a href="_packages.html" title="">packages</a></span></li> <li><span><a href="_an_spexample_spof_spa_sppackage.html" title="">an example of a package</a></span></li> <li><span><a href="_needs__Package.html" title="load a package if not already loaded">needsPackage</a> -- load a package if not already loaded</span></li> <li><span><a href="_load.html" title="read Macaulay2 commands">load</a> -- read Macaulay2 commands</span></li> </ul> </div> <div class="waystouse"><h2>Ways to use <tt>loadPackage</tt> :</h2> <ul><li>loadPackage(String)</li> </ul> </div> </div> </body> </html>