<h3>1 <span class="Heading">The Example Package</span></h3>
<p>This chapter describes the <strong class="pkg">GAP</strong> package <strong class="pkg">Example</strong>. As its name suggests it is an example of how to create a <strong class="pkg">GAP</strong> package. It has little functionality except for being a package.</p>
<p>See Sections <a href="chap2_mj.html#X7A671E2078C9770B"><span class="RefLink">2.1</span></a>, <a href="chap2_mj.html#X79E203C779518B3D"><span class="RefLink">2.2</span></a> and <a href="chap2_mj.html#X7A242BA97D904EDF"><span class="RefLink">2.3</span></a> for how to install, compile and load the <strong class="pkg">Example</strong> package.</p>
<p>If you are interested in developing a <strong class="pkg">GAP</strong> package, see <a href="../../../doc/ref/chap76_mj.html#X79F76C1E834BFDCC"><span class="RefLink">Reference: Using and Developing GAP Packages</span></a>.</p>
<p>If you are viewing this with on-line help, type:</p>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ ListDirectory</code>( [<var class="Arg">dir</var>] )</td><td class="tdright">( function )</td></tr></table></div>
<p>lists the files in directory <var class="Arg">dir</var> (a string) or the current directory if called with no arguments.</p>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ FindFile</code>( <var class="Arg">directory_name</var>, <var class="Arg">file_name</var> )</td><td class="tdright">( function )</td></tr></table></div>
<p>searches for the file <var class="Arg">file_name</var> in the directory tree rooted at <var class="Arg">directory_name</var> and returns the absolute path names of all occurrences of this file as a list of strings.</p>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ LoadedPackages</code>( )</td><td class="tdright">( function )</td></tr></table></div>
<p>returns a list with the names of the packages that have been loaded so far. All this does is execute</p>
<p>You might like to check out some of the other information in the <code class="code">GAPInfo</code> record (see <a href="../../../doc/ref/chap3_mj.html#X8354754E7935F935"><span class="RefLink">Reference: GAPInfo</span></a>).</p>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ Which</code>( <var class="Arg">prg</var> )</td><td class="tdright">( function )</td></tr></table></div>
<p>returns the path of the program executed if <code class="code">Exec(<var class="Arg">prg</var>);</code> is called, e.g.</p>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ WhereIsPkgProgram</code>( <var class="Arg">prg</var> )</td><td class="tdright">( function )</td></tr></table></div>
<p>returns a list of paths of programs with name <var class="Arg">prg</var> in the current packages loaded. Try:</p>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ HelloWorld</code>( )</td><td class="tdright">( function )</td></tr></table></div>
<p>executes the C program <code class="code">hello</code> provided by the <strong class="pkg">Example</strong> package.</p>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ FruitCake</code></td><td class="tdright">( global variable )</td></tr></table></div>
<p>is a record with the bits and pieces needed to make a boiled fruit cake. Its fields satisfy the criteria for <code class="func">Recipe</code> (<a href="chap1_mj.html#X85B83BDB83B1C910"><span class="RefLink">1.1-8</span></a>).</p>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ Recipe</code>( <var class="Arg">cake</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<p>displays the recipe for cooking <var class="Arg">cake</var>, where <var class="Arg">cake</var> is a record satisfying certain criteria explained here: its recognised fields are <code class="code">name</code> (a string giving the type of cake or cooked item), <code class="code">ovenTemp</code> (a string), <code class="code">cookingTime</code> (a string), <code class="code">ingredients</code> (a list of strings each containing an <code class="code">_</code> which is used to line up the entries and is replaced by a blank), <code class="code">method</code> (a list of steps, each of which is a string or list of strings), and <code class="code">notes</code> (a list of strings). The global variable <code class="func">FruitCake</code> (<a href="chap1_mj.html#X84DA2EEC8534A70D"><spanclass="RefLink">1.1-7</span></a>) provides an example of such a string.</p>
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.15Bemerkung:
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.