<?xml version=
"1.0" encoding=
"UTF-8"?>
<!
DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<
html xmlns=
"http://www.w3.org/1999/xhtml" xml:lang=
"en">
<
head>
<
title>GAP (Example) - Chapter
1: The Example Package</
title>
<
meta http-equiv=
"content-type" content=
"text/html; charset=UTF-8" />
<
meta name=
"generator" content=
"GAPDoc2HTML" />
<
link rel=
"stylesheet" type=
"text/css" href=
"manual.css" />
<
script src=
"manual.js" type=
"text/javascript"></
script>
<
script type=
"text/javascript">overwriteStyle();</
script>
</
head>
<
body class=
"chap1" onload=
"jscontent()">
<
div class=
"chlinktop"><
span class=
"chlink1">Goto Chapter: </
span><
a href=
"chap0.html">Top</
a> <
a href="chap1.html">1</a> <a href="chap2.html">2</a> <a href="chapInd.html">Ind</a> </div>
<div class="chlinkprevnexttop"> <a href="chap0.html">[Top of Book]</a> <a href="chap0.html#contents">[Contents]</a> <a href="chap0.html">[Previous Chapter]</a> <a href="chap2.html">[Next Chapter]</a> </div>
<p id="mathjaxlink" class="pcenter"><a href="chap1_mj.html">[MathJax on]</a></p>
<p><a id="X8656021F83A3BD80" name="X8656021F83A3BD80"></a></p>
<div class="ChapSects"><a href="chap1.html#X8656021F83A3BD80">1 <span class="Heading">The Example Package</span></a>
<div class="ContSect"><span class="tocline"><span class="nocss"> </span><a href="chap1.html#X7D3DC4ED855DC13C">1.1 <span class="Heading">The Main Functions</span></a>
</span>
<div class="ContSSBlock">
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap1.html#X791F84D17C64D56A">1.1-1 ListDirectory</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap1.html#X841462157B10C113">1.1-2 FindFile</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap1.html#X7856BE147FCE91AC">1.1-3 LoadedPackages</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap1.html#X7838D0477D8C0571">1.1-4 Which</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap1.html#X79090A0F87898612">1.1-5 WhereIsPkgProgram</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap1.html#X80F716527825B803">1.1-6 HelloWorld</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap1.html#X84DA2EEC8534A70D">1.1-7 FruitCake</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap1.html#X85B83BDB83B1C910">1.1-8 Recipe</a></span>
</div></div>
</div>
<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.html#X7A671E2078C9770B"><span class="RefLink">2.1</span></a>, <a href="chap2.html#X79E203C779518B3D"><span class="RefLink">2.2</span></a> and <a href="chap2.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="example"><pre>
<span class="GAPprompt">gap></span> <span class="GAPinput">?Example package</span>
</pre></div>
<p>to see the functions provided by the <strong class="pkg">Example</strong> package.</p>
<p><a id="X7D3DC4ED855DC13C" name="X7D3DC4ED855DC13C"></a></p>
<h4>1.1 <span class="Heading">The Main Functions</span></h4>
<p>The following functions are available:</p>
<p><a id="X791F84D17C64D56A" name="X791F84D17C64D56A"></a></p>
<h5>1.1-1 ListDirectory</h5>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">an style='color: green'>8227; 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>
<p><a id="X841462157B10C113" name="X841462157B10C113"></a></p>
<h5>1.1-2 FindFile</h5>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">an style='color: green'>8227; 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>
<p><a id="X7856BE147FCE91AC" name="X7856BE147FCE91AC"></a></p>
<h5>1.1-3 LoadedPackages</h5>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">an style='color: green'>8227; 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>
<div class="example"><pre>
<span class="GAPprompt">gap></span> <span class="GAPinput">RecNames( GAPInfo.PackagesLoaded );</span>
</pre></div>
<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>
<p><a id="X7838D0477D8C0571" name="X7838D0477D8C0571"></a></p>
<h5>1.1-4 Which</h5>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">an style='color: green'>8227; 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="example"><pre>
<span class="GAPprompt">gap></span> <span class="GAPinput">Which("date"); </span>
"/bin/date"
<span class="GAPprompt">gap></span> <span class="GAPinput">Exec("date");</span>
Fri 28 Jan 2011 16:22:53 GMT
</pre></div>
<p><a id="X79090A0F87898612" name="X79090A0F87898612"></a></p>
<h5>1.1-5 WhereIsPkgProgram</h5>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">an style='color: green'>8227; 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="example"><pre>
<span class="GAPprompt">gap></span> <span class="GAPinput">WhereIsPkgProgram( "hello" );</span>
</pre></div>
<p><a id="X80F716527825B803" name="X80F716527825B803"></a></p>
<h5>1.1-6 HelloWorld</h5>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">an style='color: green'>8227; 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>
<p><a id="X84DA2EEC8534A70D" name="X84DA2EEC8534A70D"></a></p>
<h5>1.1-7 FruitCake</h5>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">an style='color: green'>8227; 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.html#X85B83BDB83B1C910"><span class="RefLink">1.1-8</span></a>).</p>
<p><a id="X85B83BDB83B1C910" name="X85B83BDB83B1C910"></a></p>
<h5>1.1-8 Recipe</h5>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">an style='color: green'>8227; 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.html#X84DA2EEC8534A70D"><span class="RefLink">1.1-7</span></a>) provides an example of such a string.</p>
<div class="chlinkprevnextbot"> <a href="chap0.html">[Top of Book]</a> <a href="chap0.html#contents">[Contents]</a> <a href="chap0.html">[Previous Chapter]</a> <a href="chap2.html">[Next Chapter]</a> </div>
<div class="chlinkbot"><span class="chlink1">Goto Chapter: </span><a href="chap0.html">Top</a> <a href="chap1.html">1</a> <a href="chap2.html">2</a> <a href="chapInd.html">Ind</a> </div>
<hr />
<p class="foot">generated by <a href="https://www.math.rwth-aachen.de/~Frank.Luebeck/GAPDoc">GAPDoc2HTML</a></p>
</body>
</html>
¤ Dauer der Verarbeitung: 0.6 Sekunden
¤
*© Formatika GbR, Deutschland