Debian Codegraph @

doc/ref/chap5.html

raw symbols SCIP
1 <?xml version="1.0" encoding="UTF-8"?>
2
3 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
4 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
5
6 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
7 <head>
8 <title>GAP (ref) - Chapter 5: Functions</title>
9 <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
10 <meta name="generator" content="GAPDoc2HTML" />
11 <link rel="stylesheet" type="text/css" href="manual.css" />
12 <script src="manual.js" type="text/javascript"></script>
13 <script type="text/javascript">overwriteStyle();</script>
14 </head>
15 <body class="chap5" onload="jscontent()">
16
17
18 <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="chap3.html">3</a> <a href="chap4.html">4</a> <a href="chap5.html">5</a> <a href="chap6.html">6</a> <a href="chap7.html">7</a> <a href="chap8.html">8</a> <a href="chap9.html">9</a> <a href="chap10.html">10</a> <a href="chap11.html">11</a> <a href="chap12.html">12</a> <a href="chap13.html">13</a> <a href="chap14.html">14</a> <a href="chap15.html">15</a> <a href="chap16.html">16</a> <a href="chap17.html">17</a> <a href="chap18.html">18</a> <a href="chap19.html">19</a> <a href="chap20.html">20</a> <a href="chap21.html">21</a> <a href="chap22.html">22</a> <a href="chap23.html">23</a> <a href="chap24.html">24</a> <a href="chap25.html">25</a> <a href="chap26.html">26</a> <a href="chap27.html">27</a> <a href="chap28.html">28</a> <a href="chap29.html">29</a> <a href="chap30.html">30</a> <a href="chap31.html">31</a> <a href="chap32.html">32</a> <a href="chap33.html">33</a> <a href="chap34.html">34</a> <a href="chap35.html">35</a> <a href="chap36.html">36</a> <a href="chap37.html">37</a> <a href="chap38.html">38</a> <a href="chap39.html">39</a> <a href="chap40.html">40</a> <a href="chap41.html">41</a> <a href="chap42.html">42</a> <a href="chap43.html">43</a> <a href="chap44.html">44</a> <a href="chap45.html">45</a> <a href="chap46.html">46</a> <a href="chap47.html">47</a> <a href="chap48.html">48</a> <a href="chap49.html">49</a> <a href="chap50.html">50</a> <a href="chap51.html">51</a> <a href="chap52.html">52</a> <a href="chap53.html">53</a> <a href="chap54.html">54</a> <a href="chap55.html">55</a> <a href="chap56.html">56</a> <a href="chap57.html">57</a> <a href="chap58.html">58</a> <a href="chap59.html">59</a> <a href="chap60.html">60</a> <a href="chap61.html">61</a> <a href="chap62.html">62</a> <a href="chap63.html">63</a> <a href="chap64.html">64</a> <a href="chap65.html">65</a> <a href="chap66.html">66</a> <a href="chap67.html">67</a> <a href="chap68.html">68</a> <a href="chap69.html">69</a> <a href="chap70.html">70</a> <a href="chap71.html">71</a> <a href="chap72.html">72</a> <a href="chap73.html">73</a> <a href="chap74.html">74</a> <a href="chap75.html">75</a> <a href="chap76.html">76</a> <a href="chap77.html">77</a> <a href="chap78.html">78</a> <a href="chap79.html">79</a> <a href="chap80.html">80</a> <a href="chap81.html">81</a> <a href="chap82.html">82</a> <a href="chap83.html">83</a> <a href="chap84.html">84</a> <a href="chap85.html">85</a> <a href="chap86.html">86</a> <a href="chap87.html">87</a> <a href="chapBib.html">Bib</a> <a href="chapInd.html">Ind</a> </div>
19
20 <div class="chlinkprevnexttop">&nbsp;<a href="chap0.html">[Top of Book]</a>&nbsp; <a href="chap0.html#contents">[Contents]</a>&nbsp; &nbsp;<a href="chap4.html">[Previous Chapter]</a>&nbsp; &nbsp;<a href="chap6.html">[Next Chapter]</a>&nbsp; </div>
21
22 <p id="mathjaxlink" class="pcenter"><a href="chap5_mj.html">[MathJax on]</a></p>
23 <p><a id="X86FA580F8055B274" name="X86FA580F8055B274"></a></p>
24 <div class="ChapSects"><a href="chap5.html#X86FA580F8055B274">5 <span class="Heading">Functions</span></a>
25 <div class="ContSect"><span class="tocline"><span class="nocss">&nbsp;</span><a href="chap5.html#X870553EF8605792F">5.1 <span class="Heading">Information about a function</span></a>
26 </span>
27 <div class="ContSSBlock">
28 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap5.html#X79C3BDC4781FA0FD">5.1-1 NameFunction</a></span>
29 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap5.html#X877F03F77FD74C98">5.1-2 NumberArgumentsFunction</a></span>
30 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap5.html#X818BAB817A4FB346">5.1-3 NamesLocalVariablesFunction</a></span>
31 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap5.html#X80E108C57F90FAA3">5.1-4 FilenameFunc</a></span>
32 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap5.html#X7FF7643781D2C194">5.1-5 StartlineFunc</a></span>
33 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap5.html#X844F95767C74834F">5.1-6 LocationFunc</a></span>
34 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap5.html#X845A929B83D46E01">5.1-7 PageSource</a></span>
35 </div></div>
36 <div class="ContSect"><span class="tocline"><span class="nocss">&nbsp;</span><a href="chap5.html#X851B58408520700D">5.2 <span class="Heading">Calling a function with a list argument that is interpreted as
37 several arguments</span></a>
38 </span>
39 <div class="ContSSBlock">
40 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap5.html#X7CF4DDB97D65AE52">5.2-1 CallFuncList</a></span>
41 </div></div>
42 <div class="ContSect"><span class="tocline"><span class="nocss">&nbsp;</span><a href="chap5.html#X83066E5A80B5FB71">5.3 <span class="Heading">Wrapping a function, so the values produced are cached</span></a>
43 </span>
44 <div class="ContSSBlock">
45 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap5.html#X817ED3B280A64601">5.3-1 MemoizePosIntFunction</a></span>
46 </div></div>
47 <div class="ContSect"><span class="tocline"><span class="nocss">&nbsp;</span><a href="chap5.html#X7EB0A85F7D128BE0">5.4 <span class="Heading">Functions that do nothing</span></a>
48 </span>
49 <div class="ContSSBlock">
50 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap5.html#X7DB422A2876CCC4D">5.4-1 ReturnTrue</a></span>
51 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap5.html#X7C131FB17D7518FC">5.4-2 ReturnFalse</a></span>
52 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap5.html#X7A0994DE7C258E55">5.4-3 ReturnFail</a></span>
53 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap5.html#X818EA8C47B46A634">5.4-4 ReturnNothing</a></span>
54 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap5.html#X8788D7D780FCE169">5.4-5 ReturnFirst</a></span>
55 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap5.html#X810325697BDEF899">5.4-6 IdFunc</a></span>
56 </div></div>
57 <div class="ContSect"><span class="tocline"><span class="nocss">&nbsp;</span><a href="chap5.html#X80FE39D27CE3DE1B">5.5 <span class="Heading">Function Types</span></a>
58 </span>
59 <div class="ContSSBlock">
60 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap5.html#X85E40340806C2B8C">5.5-1 IsFunction</a></span>
61 <span class="ContSS"><br /><span class="nocss">&nbsp;&nbsp;</span><a href="chap5.html#X87838FE885A9AAF9">5.5-2 FunctionsFamily</a></span>
62 </div></div>
63 <div class="ContSect"><span class="tocline"><span class="nocss">&nbsp;</span><a href="chap5.html#X81F732457F7BC851">5.6 <span class="Heading">Naming Conventions</span></a>
64 </span>
65 </div>
66 <div class="ContSect"><span class="tocline"><span class="nocss">&nbsp;</span><a href="chap5.html#X7A1721CD79F08E71">5.7 <span class="Heading">Code annotations (pragmas)</span></a>
67 </span>
68 </div>
69 </div>
70
71 <h3>5 <span class="Heading">Functions</span></h3>
72
73 <p>The section <a href="chap4.html#X815F71EA7BC0EB6F"><span class="RefLink">4.11</span></a> describes how to define a function. In this chapter we describe functions that give information about functions, and various utility functions used either when defining functions or calling functions.</p>
74
75 <p><a id="X870553EF8605792F" name="X870553EF8605792F"></a></p>
76
77 <h4>5.1 <span class="Heading">Information about a function</span></h4>
78
79 <p><a id="X79C3BDC4781FA0FD" name="X79C3BDC4781FA0FD"></a></p>
80
81 <h5>5.1-1 NameFunction</h5>
82
83 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; NameFunction</code>( <var class="Arg">func</var> )</td><td class="tdright">(&nbsp;attribute&nbsp;)</td></tr></table></div>
84 <p>returns the name of a function. For operations, this is the name used in their declaration. For functions, this is the variable name they were first assigned to. (For some internal functions, this might be a name <em>different</em> from the name that is documented.) If no such name exists, the string <code class="code">"unknown"</code> is returned.</p>
85
86
87 <div class="example"><pre>
88 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">NameFunction(SylowSubgroup);</span>
89 "SylowSubgroup"
90 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Blubberflutsch:=x-&gt;x;;</span>
91 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">HasNameFunction(Blubberflutsch);</span>
92 true
93 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">NameFunction(Blubberflutsch);</span>
94 "Blubberflutsch"
95 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">a:=Blubberflutsch;;</span>
96 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">NameFunction(a);</span>
97 "Blubberflutsch"
98 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">SetNameFunction(a, "f");</span>
99 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">NameFunction(a);</span>
100 "f"
101 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">HasNameFunction(x-&gt;x);</span>
102 false
103 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">NameFunction(x-&gt;x);</span>
104 "unknown"
105 </pre></div>
106
107 <p><a id="X877F03F77FD74C98" name="X877F03F77FD74C98"></a></p>
108
109 <h5>5.1-2 NumberArgumentsFunction</h5>
110
111 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; NumberArgumentsFunction</code>( <var class="Arg">func</var> )</td><td class="tdright">(&nbsp;operation&nbsp;)</td></tr></table></div>
112 <p>returns the number of arguments the function <var class="Arg">func</var> accepts. -1 is returned for all operations. For functions that use <code class="code">...</code> or <code class="code">arg</code> to take a variable number of arguments, the number returned is -1 times the total number of parameters. For attributes, 1 is returned.</p>
113
114
115 <div class="example"><pre>
116 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">NumberArgumentsFunction(function(a,b,c,d,e,f,g,h,i,j,k)return 1;end);</span>
117 11
118 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">NumberArgumentsFunction(Size);</span>
119 1
120 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">NumberArgumentsFunction(IsCollsCollsElms);</span>
121 3
122 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">NumberArgumentsFunction(Sum);</span>
123 -1
124 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">NumberArgumentsFunction(function(a, x...) return 1; end);</span>
125 -2
126 </pre></div>
127
128 <p><a id="X818BAB817A4FB346" name="X818BAB817A4FB346"></a></p>
129
130 <h5>5.1-3 NamesLocalVariablesFunction</h5>
131
132 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; NamesLocalVariablesFunction</code>( <var class="Arg">func</var> )</td><td class="tdright">(&nbsp;operation&nbsp;)</td></tr></table></div>
133 <p>returns a mutable list of strings; the first entries are the names of the arguments of the function <var class="Arg">func</var>, in the same order as they were entered in the definition of <var class="Arg">func</var>, and the remaining ones are the local variables as given in the <code class="keyw">local</code> statement in <var class="Arg">func</var>. (The number of arguments can be computed with <code class="func">NumberArgumentsFunction</code> (<a href="chap5.html#X877F03F77FD74C98"><span class="RefLink">5.1-2</span></a>).)</p>
134
135
136 <div class="example"><pre>
137 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">NamesLocalVariablesFunction(function( a, b ) local c; return 1; end);</span>
138 [ "a", "b", "c" ]
139 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">NamesLocalVariablesFunction(function( arg ) local a; return 1; end);</span>
140 [ "arg", "a" ]
141 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">NamesLocalVariablesFunction( Size );</span>
142 fail
143 </pre></div>
144
145 <p><a id="X80E108C57F90FAA3" name="X80E108C57F90FAA3"></a></p>
146
147 <h5>5.1-4 FilenameFunc</h5>
148
149 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; FilenameFunc</code>( <var class="Arg">func</var> )</td><td class="tdright">(&nbsp;function&nbsp;)</td></tr></table></div>
150 <p>For a function <var class="Arg">func</var>, <code class="func">FilenameFunc</code> returns either <code class="keyw">fail</code> or the absolute path of the file from which <var class="Arg">func</var> has been read. The return value <code class="keyw">fail</code> occurs if <var class="Arg">func</var> is a compiled function or an operation. For functions that have been entered interactively, the string <code class="code">"*stdin*"</code> is returned, see Section <a href="chap9.html#X85EC7D9087C481B0"><span class="RefLink">9.6</span></a>.</p>
151
152
153 <div class="example"><pre>
154 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">FilenameFunc( LEN_LIST ); # a kernel function</span>
155 fail
156 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">FilenameFunc( Size ); # an operation</span>
157 fail
158 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">FilenameFunc( x -&gt; x^2 ); # an interactively entered function</span>
159 "*stdin*"
160 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">meth:= ApplicableMethod( Size, [ Group( () ) ] );;</span>
161 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">FilenameFunc( meth );</span>
162 "... some path .../grpperm.gi"
163 </pre></div>
164
165 <p><a id="X7FF7643781D2C194" name="X7FF7643781D2C194"></a></p>
166
167 <h5>5.1-5 StartlineFunc</h5>
168
169 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; StartlineFunc</code>( <var class="Arg">func</var> )</td><td class="tdright">(&nbsp;function&nbsp;)</td></tr></table></div>
170 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; EndlineFunc</code>( <var class="Arg">func</var> )</td><td class="tdright">(&nbsp;function&nbsp;)</td></tr></table></div>
171 <p>Let <var class="Arg">func</var> be a function. If <code class="func">FilenameFunc</code> (<a href="chap5.html#X80E108C57F90FAA3"><span class="RefLink">5.1-4</span></a>) returns <code class="keyw">fail</code> for <var class="Arg">func</var> then also <code class="func">StartlineFunc</code> returns <code class="keyw">fail</code>. If <code class="func">FilenameFunc</code> (<a href="chap5.html#X80E108C57F90FAA3"><span class="RefLink">5.1-4</span></a>) returns a filename for <var class="Arg">func</var> then <code class="func">StartlineFunc</code> returns the line number in this file where the definition of <var class="Arg">func</var> starts.</p>
172
173 <p><code class="func">EndlineFunc</code> behaves similarly and returns the line number in this file where the definition of <var class="Arg">func</var> ends.</p>
174
175
176 <div class="example"><pre>
177 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">meth:= ApplicableMethod( Size, [ Group( () ) ] );;</span>
178 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">FilenameFunc( meth );</span>
179 "... some path ... /lib/grpperm.gi"
180 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">StartlineFunc( meth );</span>
181 487
182 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">EndlineFunc( meth );</span>
183 487
184 </pre></div>
185
186 <p><a id="X844F95767C74834F" name="X844F95767C74834F"></a></p>
187
188 <h5>5.1-6 LocationFunc</h5>
189
190 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; LocationFunc</code>( <var class="Arg">func</var> )</td><td class="tdright">(&nbsp;function&nbsp;)</td></tr></table></div>
191 <p>Let <var class="Arg">func</var> be a function. Returns a string describing the location of <var class="Arg">func</var>, or <code class="keyw">fail</code> if the information cannot be found. This uses the information provided by <code class="func">FilenameFunc</code> (<a href="chap5.html#X80E108C57F90FAA3"><span class="RefLink">5.1-4</span></a>) and <code class="func">StartlineFunc</code> (<a href="chap5.html#X7FF7643781D2C194"><span class="RefLink">5.1-5</span></a>)</p>
192
193
194 <div class="example"><pre>
195 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">LocationFunc( Intersection );</span>
196 "... some path ... gap/lib/coll.gi:2467"
197 # String is an attribute, so no information is stored
198 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">LocationFunc( String );</span>
199 fail
200 </pre></div>
201
202 <p><a id="X845A929B83D46E01" name="X845A929B83D46E01"></a></p>
203
204 <h5>5.1-7 PageSource</h5>
205
206 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; PageSource</code>( <var class="Arg">func</var>[, <var class="Arg">nr</var>] )</td><td class="tdright">(&nbsp;function&nbsp;)</td></tr></table></div>
207 <p>This shows the file containing the source code of the function or method <var class="Arg">func</var> in a pager (see <code class="func">Pager</code> (<a href="chap2.html#X7ED03E41792C3840"><span class="RefLink">2.4-1</span></a>)). The display starts at a line shortly before the code of <var class="Arg">func</var>.</p>
208
209 <p>For operations <var class="Arg">func</var> the function shows the source code of the declaration of <var class="Arg">func</var>. Operations can have several declarations, use the optional second argument to specify which one should be shown (in the order the declarations were read); the default is to show the first.</p>
210
211 <p>For kernel functions the function tries to show the C source code.</p>
212
213 <p>If GAP cannot find a file containing the source code this will be indicated.</p>
214
215 <p>Usage examples:<br /> <code class="code">met := ApplicableMethod(\^, [(1,2),2743527]); PageSource(met);</code><br /> <code class="code">PageSource(Combinations);</code><br /> <code class="code">PageSource(SORT_LIST); </code><br /> <code class="code">PageSource(Size, 2);</code><br /> <code class="code">ct := CharacterTable(Group((1,2,3))); </code><br /> <code class="code">met := ApplicableMethod(Size,[ct]); PageSource(met); </code></p>
216
217 <p><a id="X851B58408520700D" name="X851B58408520700D"></a></p>
218
219 <h4>5.2 <span class="Heading">Calling a function with a list argument that is interpreted as
220 several arguments</span></h4>
221
222 <p><a id="X7CF4DDB97D65AE52" name="X7CF4DDB97D65AE52"></a></p>
223
224 <h5>5.2-1 CallFuncList</h5>
225
226 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; CallFuncList</code>( <var class="Arg">func</var>, <var class="Arg">args</var> )</td><td class="tdright">(&nbsp;operation&nbsp;)</td></tr></table></div>
227 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; CallFuncListWrap</code>( <var class="Arg">func</var>, <var class="Arg">args</var> )</td><td class="tdright">(&nbsp;operation&nbsp;)</td></tr></table></div>
228 <p>returns the result, when calling function <var class="Arg">func</var> with the arguments given in the list <var class="Arg">args</var>, i.e. <var class="Arg">args</var> is <q>unwrapped</q> so that <var class="Arg">args</var> appears as several arguments to <var class="Arg">func</var>.</p>
229
230
231 <div class="example"><pre>
232 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">CallFuncList(\+, [6, 7]);</span>
233 13
234 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">#is equivalent to:</span>
235 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">\+(6, 7);</span>
236 13
237 </pre></div>
238
239 <p>A more useful application of <code class="func">CallFuncList</code> is for a function <code class="code">g</code> that is called in the body of a function <code class="code">f</code> with (a sublist of) the arguments of <code class="code">f</code>, where <code class="code">f</code> has been defined with a single formal argument <code class="code">arg</code> (see <a href="chap4.html#X815F71EA7BC0EB6F"><span class="RefLink">4.11</span></a>), as in the following code fragment.</p>
240
241
242 <div class="example"><pre>
243 f := function ( arg )
244 CallFuncList(g, arg);
245 ...
246 end;
247 </pre></div>
248
249 <p>In the body of <code class="code">f</code> the several arguments passed to <code class="code">f</code> become a list <code class="code">arg</code>. If <code class="code">g</code> were called instead via <code class="code">g( arg )</code> then <code class="code">g</code> would see a single list argument, so that <code class="code">g</code> would, in general, have to <q>unwrap</q> the passed list. The following (not particularly useful) example demonstrates both described possibilities for the call to <code class="code">g</code>.</p>
250
251
252 <div class="example"><pre>
253 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">PrintNumberFromDigits := function ( arg )</span>
254 <span class="GAPprompt">&gt;</span> <span class="GAPinput"> CallFuncList( Print, arg );</span>
255 <span class="GAPprompt">&gt;</span> <span class="GAPinput"> Print( "\n" );</span>
256 <span class="GAPprompt">&gt;</span> <span class="GAPinput"> end;</span>
257 function( arg... ) ... end
258 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">PrintNumberFromDigits( 1, 9, 7, 3, 2 );</span>
259 19732
260 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">PrintDigits := function ( arg )</span>
261 <span class="GAPprompt">&gt;</span> <span class="GAPinput"> Print( arg );</span>
262 <span class="GAPprompt">&gt;</span> <span class="GAPinput"> Print( "\n" );</span>
263 <span class="GAPprompt">&gt;</span> <span class="GAPinput"> end;</span>
264 function( arg... ) ... end
265 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">PrintDigits( 1, 9, 7, 3, 2 );</span>
266 [ 1, 9, 7, 3, 2 ]
267 </pre></div>
268
269 <p><code class="func">CallFuncListWrap</code> differs only in that the result is a list. This returned list is empty if the called function returned no value, else it contains the returned value as its single member. This allows wrapping functions which may, or may not return a value.</p>
270
271
272 <div class="example"><pre>
273 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">CallFuncListWrap( x -&gt; x, [1] );</span>
274 [ 1 ]
275 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">CallFuncListWrap( function(x) end, [1] );</span>
276 [ ]
277 </pre></div>
278
279 <p><a id="X83066E5A80B5FB71" name="X83066E5A80B5FB71"></a></p>
280
281 <h4>5.3 <span class="Heading">Wrapping a function, so the values produced are cached</span></h4>
282
283 <p><a id="X817ED3B280A64601" name="X817ED3B280A64601"></a></p>
284
285 <h5>5.3-1 MemoizePosIntFunction</h5>
286
287 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; MemoizePosIntFunction</code>( <var class="Arg">function</var>[, <var class="Arg">options</var>] )</td><td class="tdright">(&nbsp;function&nbsp;)</td></tr></table></div>
288 <p><code class="func">MemoizePosIntFunction</code> returns a function which behaves the same as <var class="Arg">function</var>, except it caches the results for any inputs that are positive integers. Thus if the new function is called multiple times with the same input, then any call after the first will return the cached value, instead of recomputing it. By default, the cache can be flushed by calling <code class="func">FlushCaches</code> (<a href="chap79.html#X87A4316C818B3DE3"><span class="RefLink">79.10-4</span></a>).</p>
289
290 <p>The returned function will by default only accept positive integers.</p>
291
292 <p>This function does not promise to never call <var class="Arg">function</var> more than once for any input -- values may be removed if the cache gets too large, or if <code class="func">FlushCaches</code> (<a href="chap79.html#X87A4316C818B3DE3"><span class="RefLink">79.10-4</span></a>) is called, or if multiple threads try to calculate the same value simultaneously.</p>
293
294 <p>The optional second argument is a record which provides a number of configuration options. The following options are supported.</p>
295
296
297 <dl>
298 <dt><strong class="Mark"><code class="code">defaults</code> (default an empty list)</strong></dt>
299 <dd><p>Used to initialise the cache, both initially and after each flush. If <code class="code">defaults[i]</code> is bound, then this is used as default value for the input <code class="code">i</code>.</p>
300
301 </dd>
302 <dt><strong class="Mark"><code class="code">flush</code> (default <code class="keyw">true</code>)</strong></dt>
303 <dd><p>If this is <code class="keyw">true</code>, the cache is emptied whenever <code class="func">FlushCaches</code> (<a href="chap79.html#X87A4316C818B3DE3"><span class="RefLink">79.10-4</span></a>) is called; if false, then the cache cannot be flushed.</p>
304
305 </dd>
306 <dt><strong class="Mark"><code class="code">errorHandler</code> (defaults to <code class="func">Error</code> (<a href="chap6.html#X7E7AD8D87EBA1A08"><span class="RefLink">6.6-1</span></a>))</strong></dt>
307 <dd><p>A function to be called when an input which is not a positive integer is passed to the cache. The function can either raise an error, or else return a value which is then returned by the cache. Note that such a value does not get cached itself.</p>
308
309 </dd>
310 </dl>
311
312 <div class="example"><pre>
313 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">f := MemoizePosIntFunction(</span>
314 <span class="GAPprompt">&gt;</span> <span class="GAPinput"> function(i) Print("Check: ",i,"\n"); return i*i; end,</span>
315 <span class="GAPprompt">&gt;</span> <span class="GAPinput"> rec(defaults := [,,50], errorHandler := x -&gt; "Bad") );;</span>
316 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">f(2);</span>
317 Check: 2
318 4
319 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">f(2);</span>
320 4
321 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">f(3);</span>
322 50
323 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">f(-3);</span>
324 "Bad"
325 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">FlushCaches();</span>
326 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">f(2);</span>
327 Check: 2
328 4
329 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">f(3);</span>
330 50
331 </pre></div>
332
333 <p><a id="X7EB0A85F7D128BE0" name="X7EB0A85F7D128BE0"></a></p>
334
335 <h4>5.4 <span class="Heading">Functions that do nothing</span></h4>
336
337 <p>The following functions return fixed results (or just their own argument). They can be useful in places when the syntax requires a function, but actually no functionality is required. So <code class="func">ReturnTrue</code> (<a href="chap5.html#X7DB422A2876CCC4D"><span class="RefLink">5.4-1</span></a>) is often used as family predicate in <code class="func">InstallMethod</code> (<a href="chap78.html#X837EFDAB7BEF290B"><span class="RefLink">78.3-1</span></a>).</p>
338
339 <p><a id="X7DB422A2876CCC4D" name="X7DB422A2876CCC4D"></a></p>
340
341 <h5>5.4-1 ReturnTrue</h5>
342
343 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; ReturnTrue</code>( <var class="Arg">...</var> )</td><td class="tdright">(&nbsp;function&nbsp;)</td></tr></table></div>
344 <p>This function takes any number of arguments, and always returns <code class="keyw">true</code>.</p>
345
346
347 <div class="example"><pre>
348 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">f:=ReturnTrue;</span>
349 function( arg... ) ... end
350 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">f();</span>
351 true
352 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">f(42);</span>
353 true
354 </pre></div>
355
356 <p><a id="X7C131FB17D7518FC" name="X7C131FB17D7518FC"></a></p>
357
358 <h5>5.4-2 ReturnFalse</h5>
359
360 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; ReturnFalse</code>( <var class="Arg">...</var> )</td><td class="tdright">(&nbsp;function&nbsp;)</td></tr></table></div>
361 <p>This function takes any number of arguments, and always returns <code class="keyw">false</code>.</p>
362
363
364 <div class="example"><pre>
365 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">f:=ReturnFalse;</span>
366 function( arg... ) ... end
367 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">f();</span>
368 false
369 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">f("any_string");</span>
370 false
371 </pre></div>
372
373 <p><a id="X7A0994DE7C258E55" name="X7A0994DE7C258E55"></a></p>
374
375 <h5>5.4-3 ReturnFail</h5>
376
377 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; ReturnFail</code>( <var class="Arg">...</var> )</td><td class="tdright">(&nbsp;function&nbsp;)</td></tr></table></div>
378 <p>This function takes any number of arguments, and always returns <code class="keyw">fail</code>.</p>
379
380
381 <div class="example"><pre>
382 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">oops:=ReturnFail;</span>
383 function( arg... ) ... end
384 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">oops();</span>
385 fail
386 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">oops(-42);</span>
387 fail
388 </pre></div>
389
390 <p><a id="X818EA8C47B46A634" name="X818EA8C47B46A634"></a></p>
391
392 <h5>5.4-4 ReturnNothing</h5>
393
394 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; ReturnNothing</code>( <var class="Arg">...</var> )</td><td class="tdright">(&nbsp;function&nbsp;)</td></tr></table></div>
395 <p>This function takes any number of arguments, and always returns nothing.</p>
396
397
398 <div class="example"><pre>
399 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">n:=ReturnNothing;</span>
400 function( object... ) ... end
401 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">n();</span>
402 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">n(-42);</span>
403 </pre></div>
404
405 <p><a id="X8788D7D780FCE169" name="X8788D7D780FCE169"></a></p>
406
407 <h5>5.4-5 ReturnFirst</h5>
408
409 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; ReturnFirst</code>( <var class="Arg">...</var> )</td><td class="tdright">(&nbsp;function&nbsp;)</td></tr></table></div>
410 <p>This function takes one or more arguments, and always returns the first argument. <code class="func">IdFunc</code> (<a href="chap5.html#X810325697BDEF899"><span class="RefLink">5.4-6</span></a>) behaves similarly, but only accepts a single argument.</p>
411
412
413 <div class="example"><pre>
414 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">f:=ReturnFirst;</span>
415 function( first, rest... ) ... end
416 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">f(1);</span>
417 1
418 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">f(2,3,4);</span>
419 2
420 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">f();</span>
421 Error, Function: number of arguments must be at least 1 (not 0)
422 </pre></div>
423
424 <p><a id="X810325697BDEF899" name="X810325697BDEF899"></a></p>
425
426 <h5>5.4-6 IdFunc</h5>
427
428 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; IdFunc</code>( <var class="Arg">obj</var> )</td><td class="tdright">(&nbsp;function&nbsp;)</td></tr></table></div>
429 <p>returns <var class="Arg">obj</var>. <code class="func">ReturnFirst</code> (<a href="chap5.html#X8788D7D780FCE169"><span class="RefLink">5.4-5</span></a>) is similar, but accepts one or more arguments, returning only the first.</p>
430
431
432 <div class="example"><pre>
433 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">id:=IdFunc;</span>
434 function( object ) ... end
435 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">id(42);</span>
436 42
437 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">f:=id(SymmetricGroup(3));</span>
438 Sym( [ 1 .. 3 ] )
439 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">s:=One(AutomorphismGroup(SymmetricGroup(3)));</span>
440 IdentityMapping( Sym( [ 1 .. 3 ] ) )
441 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">f=s;</span>
442 false
443 </pre></div>
444
445 <p><a id="X80FE39D27CE3DE1B" name="X80FE39D27CE3DE1B"></a></p>
446
447 <h4>5.5 <span class="Heading">Function Types</span></h4>
448
449 <p>Functions are <strong class="pkg">GAP</strong> objects and thus have categories and a family.</p>
450
451 <p><a id="X85E40340806C2B8C" name="X85E40340806C2B8C"></a></p>
452
453 <h5>5.5-1 IsFunction</h5>
454
455 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; IsFunction</code>( <var class="Arg">obj</var> )</td><td class="tdright">(&nbsp;category&nbsp;)</td></tr></table></div>
456 <p>is the category of functions.</p>
457
458
459 <div class="example"><pre>
460 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">IsFunction(x-&gt;x^2);</span>
461 true
462 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">IsFunction(Factorial);</span>
463 true
464 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">f:=One(AutomorphismGroup(SymmetricGroup(3)));</span>
465 IdentityMapping( Sym( [ 1 .. 3 ] ) )
466 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">IsFunction(f);</span>
467 false
468 </pre></div>
469
470 <p><a id="X87838FE885A9AAF9" name="X87838FE885A9AAF9"></a></p>
471
472 <h5>5.5-2 FunctionsFamily</h5>
473
474 <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&#8227; FunctionsFamily</code></td><td class="tdright">(&nbsp;family&nbsp;)</td></tr></table></div>
475 <p>is the family of all functions.</p>
476
477 <p><a id="X81F732457F7BC851" name="X81F732457F7BC851"></a></p>
478
479 <h4>5.6 <span class="Heading">Naming Conventions</span></h4>
480
481 <p>The way functions are named in <strong class="pkg">GAP</strong> might help to memorize or even guess names of library functions.</p>
482
483 <p>If a variable name consists of several words then the first letter of each word is capitalized.</p>
484
485 <p>If the first part of the name of a function is a verb then the function may modify its argument(s) but does not return anything, for example <code class="func">Append</code> (<a href="chap21.html#X79E31DB27C82D6E1"><span class="RefLink">21.4-5</span></a>) appends the list given as second argument to the list given as first argument. Otherwise the function returns an object without changing the arguments, for example <code class="func">Concatenation</code> (<a href="chap21.html#X840C55A77D1BB2E1"><span class="RefLink">21.20-1</span></a>) returns the concatenation of the lists given as arguments.</p>
486
487 <p>If the name of a function contains the word <q><code class="code">Of</code></q> then the return value is thought of as information deduced from the arguments. Usually such functions are attributes (see <a href="chap13.html#X7C701DBF7BAE649A"><span class="RefLink">13.5</span></a>). Examples are <code class="func">GeneratorsOfGroup</code> (<a href="chap39.html#X79C44528864044C5"><span class="RefLink">39.2-4</span></a>), which returns a list of generators for the group entered as argument, or <code class="func">DiagonalOfMat</code> (<a href="chap24.html#X7A9139D686ACB7D8"><span class="RefLink">24.12-1</span></a>).</p>
488
489 <p>For the setter and tester functions of an attribute <code class="code">Attr</code> the names <code class="code">SetAttr</code> resp. <code class="code">HasAttr</code> are available (see <a href="chap13.html#X7C701DBF7BAE649A"><span class="RefLink">13.5</span></a>).</p>
490
491 <p>If the name of a function contains the word <q><code class="code">By</code></q> then the return value is thought of as built in a certain way from the parts given as arguments. For example, creating a group as a factor group of a given group by a normal subgroup can be done by taking the image of <code class="func">NaturalHomomorphismByNormalSubgroup</code> (<a href="chap39.html#X80FC390C7F38A13F"><span class="RefLink">39.18-1</span></a>). Other examples of <q><code class="code">By</code></q> functions are <code class="func">GroupHomomorphismByImages</code> (<a href="chap40.html#X7F348F497C813BE0"><span class="RefLink">40.1-1</span></a>) and <code class="func">LaurentPolynomialByCoefficients</code> (<a href="chap66.html#X8467263B7EFA013E"><span class="RefLink">66.13-1</span></a>).</p>
492
493 <p>Often such functions construct an algebraic structure given by its generators (for example, <code class="func">RingByGenerators</code> (<a href="chap56.html#X7D736E027DFD8961"><span class="RefLink">56.1-4</span></a>)). In some cases, <q><code class="code">By</code></q> may be replaced by <q><code class="code">With</code></q> (like e.g. <code class="func">GroupWithGenerators</code> (<a href="chap39.html#X8589EF9C7B658B94"><span class="RefLink">39.2-3</span></a>)) or even both versions of the name may be used. The difference between <code class="code">StructByGenerators</code> and <code class="code">StructWithGenerators</code> is that the latter guarantees that the <code class="code">GeneratorsOfStruct</code> value of the result is equal to the given set of generators (see <a href="chap31.html#X82039A218274826F"><span class="RefLink">31.3</span></a>).</p>
494
495 <p>If the name of a function has the form <q><code class="code">AsSomething</code></q> then the return value is an object (usually a collection which has the same family of elements), which may, for example:</p>
496
497
498 <ul>
499 <li><p>know more about its own structure (and so support more operations) than its input (e.g. if the elements of the collection form a group, then this group can be constructed using <code class="func">AsGroup</code> (<a href="chap39.html#X7A0747F17B50D967"><span class="RefLink">39.2-5</span></a>));</p>
500
501 </li>
502 <li><p>discard its additional structure (e.g. <code class="func">AsList</code> (<a href="chap30.html#X8289FCCC8274C89D"><span class="RefLink">30.3-8</span></a>) applied to a group will return a list of its elements);</p>
503
504 </li>
505 <li><p>contain all elements of the original object without duplicates (like e.g. <code class="func">AsSet</code> (<a href="chap30.html#X856D927378C33548"><span class="RefLink">30.3-10</span></a>) does if its argument is a list of elements from the same family);</p>
506
507 </li>
508 <li><p>remain unchanged (like e.g. <code class="func">AsSemigroup</code> (<a href="chap51.html#X80ED104F85AE5134"><span class="RefLink">51.1-6</span></a>) does if its argument is a group).</p>
509
510 </li>
511 </ul>
512 <p>If <code class="code">Something</code> and the argument of <code class="code">AsSomething</code> are domains, some further rules apply as explained in <a href="../../doc/tut/chap7.html#X7EA77DE17DD8A231"><span class="RefLink">Tutorial: Changing the Structure</span></a>.</p>
513
514 <p>If the name of a function <code class="code">fun1</code> ends with <q><code class="code">NC</code></q> then there is another function <code class="code">fun2</code> with the same name except that the <code class="code">NC</code> is missing. <code class="code">NC</code> stands for <q>no check</q>. When <code class="code">fun2</code> is called then it checks whether its arguments are valid, and if so then it calls <code class="code">fun1</code>. The functions <code class="func">SubgroupNC</code> (<a href="chap39.html#X7C82AA387A42DCA0"><span class="RefLink">39.3-1</span></a>) and <code class="func">Subgroup</code> (<a href="chap39.html#X7C82AA387A42DCA0"><span class="RefLink">39.3-1</span></a>) are a typical example.</p>
515
516 <p>The idea is that the possibly time consuming check of the arguments can be omitted if one is sure that they are unnecessary. For example, if an algorithm produces generators of the derived subgroup of a group then it is guaranteed that they lie in the original group; <code class="func">Subgroup</code> (<a href="chap39.html#X7C82AA387A42DCA0"><span class="RefLink">39.3-1</span></a>) would check this, and <code class="func">SubgroupNC</code> (<a href="chap39.html#X7C82AA387A42DCA0"><span class="RefLink">39.3-1</span></a>) omits the check.</p>
517
518 <p>Needless to say, all these rules are not followed slavishly, for example there is one operation <code class="func">Zero</code> (<a href="chap31.html#X8040AC7A79FFC442"><span class="RefLink">31.10-3</span></a>) instead of two operations <code class="code">ZeroOfElement</code> and <code class="code">ZeroOfAdditiveGroup</code>.</p>
519
520 <p><a id="X7A1721CD79F08E71" name="X7A1721CD79F08E71"></a></p>
521
522 <h4>5.7 <span class="Heading">Code annotations (pragmas)</span></h4>
523
524 <p>GAP supports the use of code annotations (pragmas) in functions, i.e., adding comments to functions that are stored in the function object itself, unlike regular comments. Pragmas are single-line comments, starting with <code class="code">#%</code>:</p>
525
526
527 <div class="example"><pre>
528 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">function()</span>
529 <span class="GAPprompt">&gt;</span> <span class="GAPinput"> #% This is a pragma</span>
530 <span class="GAPprompt">&gt;</span> <span class="GAPinput"> # This is not a pragma</span>
531 <span class="GAPprompt">&gt;</span> <span class="GAPinput"> return;</span>
532 <span class="GAPprompt">&gt;</span> <span class="GAPinput">end;;</span>
533 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">Display( last );</span>
534 function ( )
535 #% This is a pragma
536 return;
537 end
538 </pre></div>
539
540 <p>Pragmas can be used to mark parts of functions that should later be manipulated using <a href="chap4.html#X8732D9257FFCEA1B"><span class="RefLink">4.16</span></a>.</p>
541
542 <p>Please note that heavy use of pragmas in functions slows down the execution of your function in the same way as adding empty <code class="code">;</code> statements to your code.</p>
543
544
545 <div class="example"><pre>
546 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">a := function( )</span>
547 <span class="GAPprompt">&gt;</span> <span class="GAPinput"> local i;</span>
548 <span class="GAPprompt">&gt;</span> <span class="GAPinput"> for i in [ 1 .. 1000000 ] do</span>
549 <span class="GAPprompt">&gt;</span> <span class="GAPinput"> i := i + 1;</span>
550 <span class="GAPprompt">&gt;</span> <span class="GAPinput"> od;</span>
551 <span class="GAPprompt">&gt;</span> <span class="GAPinput">end;</span>
552 function( ) ... end
553 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">a();</span>
554 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">time;</span>
555 14
556 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">b := function( )</span>
557 <span class="GAPprompt">&gt;</span> <span class="GAPinput"> local i;</span>
558 <span class="GAPprompt">&gt;</span> <span class="GAPinput"> for i in [ 1 .. 1000000 ] do</span>
559 <span class="GAPprompt">&gt;</span> <span class="GAPinput"> i := i + 1;</span>
560 <span class="GAPprompt">&gt;</span> <span class="GAPinput"> #% pragma</span>
561 <span class="GAPprompt">&gt;</span> <span class="GAPinput"> #% pragma</span>
562 <span class="GAPprompt">&gt;</span> <span class="GAPinput"> #% pragma</span>
563 <span class="GAPprompt">&gt;</span> <span class="GAPinput"> #% pragma</span>
564 <span class="GAPprompt">&gt;</span> <span class="GAPinput"> #% pragma</span>
565 <span class="GAPprompt">&gt;</span> <span class="GAPinput"> od;</span>
566 <span class="GAPprompt">&gt;</span> <span class="GAPinput">end;</span>
567 function( ) ... end
568 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">b();</span>
569 <span class="GAPprompt">gap&gt;</span> <span class="GAPinput">time;</span>
570 25
571 </pre></div>
572
573
574 <div class="chlinkprevnextbot">&nbsp;<a href="chap0.html">[Top of Book]</a>&nbsp; <a href="chap0.html#contents">[Contents]</a>&nbsp; &nbsp;<a href="chap4.html">[Previous Chapter]</a>&nbsp; &nbsp;<a href="chap6.html">[Next Chapter]</a>&nbsp; </div>
575
576
577 <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="chap3.html">3</a> <a href="chap4.html">4</a> <a href="chap5.html">5</a> <a href="chap6.html">6</a> <a href="chap7.html">7</a> <a href="chap8.html">8</a> <a href="chap9.html">9</a> <a href="chap10.html">10</a> <a href="chap11.html">11</a> <a href="chap12.html">12</a> <a href="chap13.html">13</a> <a href="chap14.html">14</a> <a href="chap15.html">15</a> <a href="chap16.html">16</a> <a href="chap17.html">17</a> <a href="chap18.html">18</a> <a href="chap19.html">19</a> <a href="chap20.html">20</a> <a href="chap21.html">21</a> <a href="chap22.html">22</a> <a href="chap23.html">23</a> <a href="chap24.html">24</a> <a href="chap25.html">25</a> <a href="chap26.html">26</a> <a href="chap27.html">27</a> <a href="chap28.html">28</a> <a href="chap29.html">29</a> <a href="chap30.html">30</a> <a href="chap31.html">31</a> <a href="chap32.html">32</a> <a href="chap33.html">33</a> <a href="chap34.html">34</a> <a href="chap35.html">35</a> <a href="chap36.html">36</a> <a href="chap37.html">37</a> <a href="chap38.html">38</a> <a href="chap39.html">39</a> <a href="chap40.html">40</a> <a href="chap41.html">41</a> <a href="chap42.html">42</a> <a href="chap43.html">43</a> <a href="chap44.html">44</a> <a href="chap45.html">45</a> <a href="chap46.html">46</a> <a href="chap47.html">47</a> <a href="chap48.html">48</a> <a href="chap49.html">49</a> <a href="chap50.html">50</a> <a href="chap51.html">51</a> <a href="chap52.html">52</a> <a href="chap53.html">53</a> <a href="chap54.html">54</a> <a href="chap55.html">55</a> <a href="chap56.html">56</a> <a href="chap57.html">57</a> <a href="chap58.html">58</a> <a href="chap59.html">59</a> <a href="chap60.html">60</a> <a href="chap61.html">61</a> <a href="chap62.html">62</a> <a href="chap63.html">63</a> <a href="chap64.html">64</a> <a href="chap65.html">65</a> <a href="chap66.html">66</a> <a href="chap67.html">67</a> <a href="chap68.html">68</a> <a href="chap69.html">69</a> <a href="chap70.html">70</a> <a href="chap71.html">71</a> <a href="chap72.html">72</a> <a href="chap73.html">73</a> <a href="chap74.html">74</a> <a href="chap75.html">75</a> <a href="chap76.html">76</a> <a href="chap77.html">77</a> <a href="chap78.html">78</a> <a href="chap79.html">79</a> <a href="chap80.html">80</a> <a href="chap81.html">81</a> <a href="chap82.html">82</a> <a href="chap83.html">83</a> <a href="chap84.html">84</a> <a href="chap85.html">85</a> <a href="chap86.html">86</a> <a href="chap87.html">87</a> <a href="chapBib.html">Bib</a> <a href="chapInd.html">Ind</a> </div>
578
579 <hr />
580 <p class="foot">generated by <a href="https://www.math.rwth-aachen.de/~Frank.Luebeck/GAPDoc">GAPDoc2HTML</a></p>
581 </body>
582 </html>