CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

| Download

GAP 4.8.9 installation with standard packages -- copy to your CoCalc project to get it

Views: 418346
1
2
<!-- %W hints.xml GAP documentation Greg Gamble -->
3
<!-- %H -->
4
<!-- %Y Copyright (C) 2001, School of Math & Comp. Sci., St Andrews, Scotland -->
5
6
<!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
7
<Appendix Label="Guidelines for Writing a GAP Package">
8
<Heading>Guidelines for Writing a GAP Package</Heading>
9
10
This appendix explains the basics of how to write a &GAP; package so that
11
it interfaces properly to &GAP;. For the role of &GAP; packages and the
12
ways to load them, see Chapter&nbsp;<Ref Chap="Using GAP Packages" BookName="ref"/>.
13
<P/>
14
15
There are two basic aspects of creating a &GAP; package.
16
<P/>
17
18
First, it is a convenient possibility to load additional functionality into
19
&GAP; including a smooth integration of the package documentation. Second,
20
a package is a way to make your code available to other &GAP; users.
21
<P/>
22
23
Moreover, the &GAP; Group may provide some help with redistributing your
24
package via the web and ftp site of GAP itself after checking if the
25
package provides some new or improved functionality which looks interesting
26
for other users, if it contains reasonable documentation, and if it seems
27
to work smoothly with the GAP library and other distributed packages. In
28
this case the package can take part in the &GAP; distribution update
29
mechanism and becomes a <E>deposited</E> package.
30
<P/>
31
32
Furthermore, package authors are encouraged to check if the package would
33
be appropriate for the refereeing process and <E>submit</E> it. If the
34
refereeing has been successful, the package becomes an <E>accepted</E>
35
package. Check out the &GAP; Web site <URL>http://www.gap-system.org</URL>
36
for more details.
37
<P/>
38
39
We start this chapter with a description how the directory structure of a
40
&GAP; package should be constructed and then add remarks on certain aspects
41
of creating a package, some of these only apply to some packages. Finally,
42
we provide guidelines for the release preparation, wrapping and
43
distribution.
44
<P/>
45
<!--
46
The &Example; package is intended to be a prototype for a package. Here
47
we describe just what features one should emulate when writing one's own
48
&GAP; package for popular consumption, and a few pointers as to where to
49
go for more information.
50
-->
51
52
<!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
53
<Section Label="Structure of a GAP Package">
54
<Heading>Structure of a GAP Package</Heading>
55
56
<Index Subkey="for a GAP package">home directory</Index>
57
A &GAP; package should have an alphanumeric name (<A>package-name</A>, say);
58
mixed case is fine, but there should be no whitespaces.
59
All files of a &GAP; package <A>package-name</A> must be collected in a
60
single directory <A>package-dir</A>, where <A>package-dir</A> should be
61
just <A>package-name</A> preferably converted to lowercase and optionally
62
followed by the package version (with or without hyphen to separate the
63
version from <A>package-name</A>).
64
Let us call this directory the <E>home directory</E> of the package.
65
<P/>
66
To use the package with &GAP;, the directory <A>package-dir</A> must
67
be a subdirectory of a <F>pkg</F> directory in (one of) the &GAP; root
68
directories (see <Ref Sect="GAP Root Directories" BookName="ref"/>).
69
For example, if &GAP; is installed in <F>/usr/local/gap4</F> then the
70
files of the package <C>MyPack</C> may be placed in the directory
71
<F>/usr/local/gap4/pkg/mypack</F>.
72
73
The directory <A>package-dir</A> preferably should have the following
74
structure (below, a trailing <C>/</C> distinguishes directories from
75
ordinary files):
76
<P/>
77
<Alt Only="LaTeX">\newpage</Alt>
78
<Log><![CDATA[
79
package-dir/
80
doc/
81
lib/
82
src/
83
tst/
84
README
85
CHANGES
86
configure
87
Makefile.in
88
PackageInfo.g
89
init.g
90
read.g
91
]]></Log>
92
<P/>
93
94
There are three file names with a special meaning in the home
95
directory of a package: <F>PackageInfo.g</F> and <F>init.g</F>
96
which must be present, and <F>read.g</F> which is optional.
97
We now describe the above files and directories:
98
<P/>
99
100
<List>
101
102
<Mark>
103
<F>README</F></Mark>
104
<Item>
105
<Index Key="README" Subkey="for a GAP package"><C>README</C></Index>
106
This should contain <Q>how to get it</Q> (from the &GAP; <C>ftp</C>- and
107
web-sites) instructions, as well as installation instructions and names
108
of the package authors and their email addresses. The installation
109
instructions should be repeated in the package's documentation, which
110
should be in the <F>doc</F> directory
111
(see <Ref Sect="Writing Documentation and Tools Needed"/>).
112
Authors' names and addresses should be repeated both in the package's
113
documentation and in the <File>PackageInfo.g</File> (see below).
114
</Item>
115
116
<Mark>
117
<F>CHANGES</F></Mark>
118
<Item>
119
For further versions of the package, it will be also useful to have a
120
<F>CHANGES</F> file that records the main changes between versions
121
of the package.
122
</Item>
123
124
<Mark><F>configure</F>, <F>Makefile.in</F></Mark>
125
<Item>
126
These files are only necessary if the package has a non-&GAP; component,
127
e.g.&nbsp;some C code (the files of which should be in the <F>src</F>
128
directory). The <F>configure</F> and <F>Makefile.in</F> files of the &Example;
129
package provide prototypes. The <F>configure</F> file typically takes a path
130
<A>path</A> to the &GAP; root directory as argument and uses the value
131
assigned to <C>GAParch</C> in the file <F>sysinfo.gap</F>, created when &GAP;
132
was compiled to determine the
133
compilation architecture, inserts this in place of the string <C>@GAPARCH@</C>
134
in <F>Makefile.in</F> and creates a file <F>Makefile</F>. When <C>make</C> is
135
run (which, of course, reads the constructed <F>Makefile</F>), a directory
136
<F>bin</F> (if necessary) and subdirectories of <F>bin</F> with the path equal
137
to the string assigned to <C>GAParch</C> in the file <F>sysinfo.gap</F> should
138
be created; any binaries constructed by compiling the code in <F>src</F> should
139
end up in this subdirectory of <F>bin</F>.
140
</Item>
141
142
<Mark><F>PackageInfo.g</F></Mark>
143
<Item>
144
<Index Key="PackageInfo.g" Subkey="for a GAP package"><C>PackageInfo.g</C></Index>
145
Since &GAP;&nbsp;4.4, a &GAP; package <E>must</E> have a <F>PackageInfo.g</F>
146
file which contains meta-information about the package (package name, version,
147
author(s), relations to other packages, homepage, download archives, banner,
148
...). This information is used by the package loading mechanism and also for
149
the distribution of a package to other users. The &Example; package's
150
<F>PackageInfo.g</F> file is well-commented and should be used as a
151
prototype (see also <Ref Sect="The PackageInfo.g File"/> for further details).
152
</Item>
153
154
<Mark><F>init.g</F>, <F>read.g</F></Mark>
155
<Item>
156
<Index Key="init.g" Subkey="for a GAP package"><C>init.g</C></Index>
157
<Index Key="read.g" Subkey="for a GAP package"><C>read.g</C></Index>
158
A &GAP; package <E>must</E> have a file <F>init.g</F>. As of &GAP;&nbsp;4.4,
159
the typical <F>init.g</F> and <F>read.g</F> files should normally consist
160
entirely of <Ref Func="ReadPackage" BookName="ref"/> commands (and possibly
161
also <Ref Func="Read" BookName="ref"/> commands) for reading further files
162
of the package. If the <Q>declaration</Q> and <Q>implementation</Q> parts of
163
the package are separated (and this is recommended), there should be a
164
<F>read.g</F> file.
165
The <Q>declaration</Q> part
166
of a package consists of function and variable <E>name</E> declarations and
167
these go in files with <C>.gd</C> extensions; these files are read in via
168
<C>ReadPackage</C> commands in the <F>init.g</F> file. The <Q>implementation</Q> part
169
of a package consists of the actual definitions of the functions and
170
variables whose names were declared in the <Q>declaration</Q> part, and
171
these go in files with <C>.gi</C> extensions; these files are read in via
172
<C>ReadPackage</C> commands in the <F>read.g</F> file. The reason for following the
173
above dichotomy is that the <F>read.g</F> file is read <E>after</E> the <F>init.g</F>
174
file, thus enabling the possibility of a function's implementation to
175
refer to another function whose name is known but is not actually defined
176
yet (see <Ref Sect="Declaration and Implementation Part of a Package"/>
177
below for more details).
178
<P/>
179
The &GAP; code (whether or not it is split into <Q>declaration</Q> and
180
<Q>implementation</Q> parts) should go in the package's <F>lib</F> directory
181
(see below).
182
</Item>
183
184
<Mark><F>doc</F></Mark>
185
<Item>
186
<Index Key="GAPDoc" Subkey="for writing package documentation">GAPDoc format</Index>
187
<Index Key="gapmacro.tex" Subkey="for writing package documentation"><C>gapmacro.tex</C> format</Index>
188
This directory should contain the package's documentation.
189
It is strongly recommended to use an XML-based documentation format
190
supported by the &GAP; package &GAPDoc;
191
(see <Ref Sect="Introduction and Example" BookName="gapdoc"/>)
192
which is used for the &GAP; documentation. An alternative is to use the
193
&TeX;-based system, formerly used for the &GAP; documentation in
194
&GAP;&nbsp;4.4 and earlier releases. This system is described in
195
the document <Q>The gapmacro.tex Manual Format</Q>
196
(the file <F>gap4r5/doc/gapmacrodoc.pdf</F> included in the
197
tools archive as described in Section
198
<Ref Sect="Writing Documentation and Tools Needed"/>)
199
and is still used by some of the &GAP; packages whose authors are
200
encouraged to switch at some point to the &GAPDoc;-based documenation.
201
Please spend some time reading the documentation for whichever
202
system you decide to use for writing your package's documentation.
203
The &Example; package's documentation is written in the XML format
204
supported by the <Package>GAPDoc</Package> package.
205
If you intend to use this format, please use the &Example;
206
package's <F>doc</F> directory as a prototype, which as you will observe
207
contains the master file <F>main.xml</F>, further <F>.xml</F> files for
208
manual chapters (included in the manual via <C>Include</C> directives in
209
the master file) and the &GAP; input file <F>../makedocrel.g</F> which
210
generates the manuals.
211
Generally, one should also provide a <F>manual.bib</F> Bib&TeX; database
212
file or an <F>xml</F> file in the BibXMLext format (see
213
<Ref Sect="The BibXMLext Format" BookName="gapdoc"/>).
214
With <F>gapmacro.tex</F>, it is also possible to use a <F>manual.bbl</F> file.
215
<!-- Generating the
216
various formats of the manuals requires various software tools which are
217
called directly or indirectly by <C>make&uscore;doc</C> and these are listed in
218
Section&nbsp;<Ref Sect="Writing Documentation and Tools Needed"/>. The file <C>manual.mst</C> is
219
needed for generating a manual index; it should be a copy of the one
220
provided in the &Example; package. The only adjustments that a package
221
writer should need to make to <C>make&uscore;doc</C> is to replace occurrences of the
222
word <C>Example</C> with <A>package-name</A>. -->
223
</Item>
224
225
<Mark><F>lib</F></Mark>
226
<Item>
227
This is the preferred place for the &GAP; code, i.e.&nbsp;the <C>.g</C>, <C>.gd</C> and
228
<C>.gi</C> files (other than <F>PackageInfo.g</F>, <F>init.g</F> and <F>read.g</F>). For some
229
packages, the directory <F>gap</F> has been used instead of <F>lib</F>; <F>lib</F> has the
230
slight advantage that it is the default subdirectory of a package directory
231
searched for by the <Ref Func="DirectoriesPackageLibrary" BookName="ref"/> command.
232
</Item>
233
234
<Mark><F>src</F></Mark>
235
<Item>
236
If the package has non-&GAP; code, e.g.&nbsp;C code, then this <Q>source</Q>
237
code should go in the <F>src</F> directory. If there are <C>.h</C>
238
<Q>include</Q> files you may prefer to put these all together in a separate
239
<C>include</C> directory. There is one further rule for the location of kernel
240
library modules or external programs which is explained in
241
<Ref Sect="Installation of GAP Package Binaries"/> below.
242
</Item>
243
244
<Mark><F>tst</F></Mark>
245
<Item>
246
If the package has test files, then they should go in the <F>tst</F>
247
directory. For a deposited package, a test file with a basic test
248
of the package (for example, to check that it works as expected and/or
249
that the manual examples are correct) may be specified in the
250
<File>PackageInfo.g</File> to be included in the &GAP; standard test suite.
251
More specific and time consuming tests are not supposed to be a part of the
252
&GAP; standard test suite but may be placed in the <F>tst</F> directory
253
with further instructions on how to run them.
254
See Section <Ref Sect="Testing a GAP package"/> about the requirements
255
to the test files formats and further recommendations.
256
</Item>
257
258
</List>
259
260
All other files can be organized as you like. But we suggest that you
261
have a look at existing packages and use a similar scheme, for
262
example, put examples in the <File>examples</File> subdirectory, data
263
libraries in extra subdirectories, and so on.
264
<P/>
265
Sometimes there may be a need to include an empty directory in the
266
package distribution (for example, as a place to store some data that
267
may appear at runtime). In this case package authors are
268
advised to put in this directory a short <F>README</F> file describing
269
its purpose to ensure that such directory will be included in the
270
redistribution.
271
<P/>
272
Concerning the &GAP; code in packages, it is recommended to use only
273
documented &GAP; functions, see <Ref Sect="Undocumented Variables" BookName="ref"/>.
274
In particular if you want to make your package available to other &GAP; users
275
it is advisable to avoid using <Q>obsolescent</Q> variables
276
(see <Ref Chap="Replaced and Removed Command Names" BookName="ref"/>).
277
For that, you can set the <C>ReadObsolete</C> component in your
278
<F>gap.ini</F> file to <K>false</K>,
279
see <Ref Sect="The gap.ini and gaprc files" BookName="ref"/>.
280
281
</Section>
282
283
<!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
284
<Section Label="Writing Documentation and Tools Needed">
285
<Heading>Writing Documentation and Tools Needed</Heading>
286
287
If you intend to make your package available to other users it is
288
essential to include documentation explaining how to install and use your
289
programs.
290
<P/>
291
Concerning the installation you should produce a file <F>README</F> which
292
gives a short description of the purpose of the package and contains
293
proper instructions how to install your package. Again, check out some
294
existing packages to get an idea how this could look like.
295
<P/>
296
Concerning the documentation of the use of the package there
297
are currently two recognised ways of producing &GAP; package
298
documentation.
299
<P/>
300
First, there is a recommended XML-based documentation format
301
that is defined in and can be used with the &GAPDoc; package
302
(see&nbsp;<Ref Chap="Introduction and Example" BookName="gapdoc"/>).
303
<P/>
304
Second, there is a method which requires the documentation to be
305
written in &TeX; according to the format described in
306
the document <Q>The gapmacro.tex Manual Format</Q>.
307
<P/>
308
In principle it is also possible to use some completely different
309
documentation format. In that case you need to study the
310
Chapter&nbsp;<Ref Chap="Interface to the GAP Help System" BookName="ref"/>
311
to learn how to make your documentation available to the &GAP; help system.
312
There should be at least a text version of your documenation provided for use
313
in the terminal running &GAP; and some nicely printable version in
314
<C>.pdf</C> format.
315
Many &GAP; users like to browse the documentation in HTML format
316
via their Web browser. As a package author, you are not obliged
317
to provide an HTML version of your package manual, but if you
318
will either use the &GAPDoc; package or follow the guidelines in
319
the document <Q>The gapmacro.tex Manual Format</Q>,
320
(the file <F>gap4r5/doc/gapmacrodoc.pdf</F> included in the
321
tools archive as described in this Section below),
322
you should have no trouble in producing one. Moreover, using the
323
&GAPDoc; package, it is also possible to produce HTML version of the
324
documentation supporting MathJax (<URL>http://www.mathjax.org/</URL>)
325
for the high quality rendering of mathematical symbols while viewing
326
it online. For example, if you are viewing the HTML version of the manual,
327
compare how this formula will look with MathJax turned on/off:
328
<Display Mode="M">
329
[ \chi, \psi ] = \left( \sum_{{g \in G}} \chi(g) \psi(g^{{-1}}) \right) / |G|.
330
</Display>
331
<P/>
332
The manual of the &Example; package is written in the &GAPDoc; format,
333
and commands needed to build it are contained in the file <C>makedocrel.g</C>
334
(you don't need to re-build the manual since it is already included in the package).
335
<P/>
336
Whenever you use the <Package>GAPDoc</Package> or <F>gapmacro.tex</F> &TeX;-based
337
system, you need to have certain &TeX; tools installed: to produce manuals
338
in the <C>.pdf</C> format, you need <C>pdflatex</C> if the <Package>GAPDoc</Package>
339
is used, and either <C>pdftex</C> or <C>gs</C> together with <C>ps2pdf</C> if your
340
package uses <F>gapmacro.tex</F>.
341
Note that using <C>gs</C> and <C>ps2pdf</C> in lieu of <C>pdftex</C> or
342
<C>pdflatex</C> is a poor substitute unless your <C>gs</C> is at least
343
version 6.<A>xx</A> for some <A>xx</A>.
344
In addition, the <C>gapmacro.tex</C> documentation system requires some more tools
345
described below. If you intend to use the &GAPDoc; package for the documenation
346
of your package, you may skip the rest of this section and proceed to the next one
347
to see a minimalistic example of a &GAP; package.
348
<P/>
349
<Index>tools archive for package authors</Index>
350
Otherwise, to produce the <C>.pdf</C> manual formats, the following &GAP;
351
tools (supplied as a part of the &GAP; distribution in the archive
352
<C>tools.tar.gz</C> in the in &GAP;'s <F>etc</F> directory and installed
353
using the script <F>install-tools.sh</F> in the same directory) are needed:
354
<F>gapmacro.tex</F>
355
(the macros file that dictates the style and mark-up for the traditional
356
&TeX;-based system of &GAP; documentation),
357
<C>manualindex</C>
358
(an <C>awk</C> script that adjusts the &TeX;-produced index entries
359
and calls <C>makeindex</C> to process them),
360
and
361
<F>mrabbrev.bib</F>
362
(usually supplied with your &TeX; tools but nevertheless a copy of
363
<F>mrabbrev.bib</F> should be located in &GAP;'s main <F>doc</F> directory.
364
To find it on your system, try: <C>kpsewhich mrabbrev.bib</C> or, if that
365
doesn't work and you can't otherwise find it check out a CTAN site,
366
e.g.&nbsp;search for it at: <URL>http://www.dante.de/cgi-bin/ctan-index</URL>.
367
<P/>
368
If your manual cross-refers to <Package>GAPDoc</Package>- or
369
<F>gapmacro.tex</F>-produced manuals, then <C>manual.lab</C>
370
for each such other manual is needed. For packages using
371
<Package>GAPDoc</Package>-manuals since &GAP;&nbsp;4.3,
372
this is done by starting &GAP; and running
373
<P/>
374
&nbsp;&nbsp;<C>gap> GapDocManualLab( "<A>package</A>" );</C>
375
<P/>
376
<Alt Only="LaTeX">\noindent</Alt>
377
for each such <A>package</A> whose manual is cross-referred to
378
(this includes the <Q>main</Q> manuals, e.g.&nbsp;those in the
379
<F>doc/ref</F> and <F>doc/tut</F> directories).
380
For packages using <F>gapmacro.tex</F>-produced manuals,
381
<C>manual.lab</C> is generated by running <C>tex manual</C>
382
for each package whose manual is cross-referred to.
383
In most cases, packages from the &GAP; distribution will already
384
have these files since they will be created as a part of building their
385
manuals (see e.g. the last command of the <F>example/makedocrel.g</F> script)
386
and included in their distribution, so you will probably not need to
387
create <C>manual.lab</C> files yourself.
388
<P/>
389
To produce an HTML version of the manual one needs the Perl 5 program
390
<F>convert.pl</F> which is included in the tools archive <C>tools.tar.gz</C>.
391
This archive is supplied as a part of the &GAP; distribution in the &GAP;'s
392
<F>etc</F> directory and should be installed using the script
393
<F>install-tools.sh</F> in the same directory.
394
<P/>
395
Finally, to ensure the mathematical formulae are rendered as well as they
396
can be in the HTML version, one should also have the program <C>tth</C>
397
(&TeX; to HTML converter); <F>convert.pl</F> calls <F>tth</F> to translate
398
mathmode formulae to HTML (if it's available). The <F>tth</F> program is easy
399
to compile and can be obtained from
400
<URL>http://hutchinson.belmont.ma.us/tth/tth-noncom/download.html</URL>.
401
<!--
402
A prototype of the command to execute is in the file <F>make_doc</F>;
403
note that the HTML manual is produced in files with <C>.htm</C> extensions
404
in a directory <F>htm</F> outside the <F>doc</F> directory. The beginning
405
of the file <F>convert.pl</F> contains instructions on its usage should
406
you need them.
407
-->
408
<P/>
409
410
</Section>
411
412
413
<!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
414
<Section Label="An Example of a GAP Package">
415
<Heading>An Example of a GAP Package</Heading>
416
417
We illustrate the creation of a &GAP; package by an example of a basic package.
418
<P/>
419
Create the following directories in your home area:
420
<F>.gap</F>, <F>.gap/pkg</F> and <F>.gap/pkg/test</F>.
421
Then inside the directory <F>.gap/pkg/test</F> create an empty file
422
<F>init.g</F>, and a file <F>PackageInfo.g</F> with the following contents:
423
<P/>
424
<Log><![CDATA[
425
SetPackageInfo( rec(
426
PackageName := "test",
427
Version := "1.0",
428
PackageDoc := rec(
429
BookName := "test",
430
SixFile := "doc/manual.six",
431
Autoload := true ),
432
Dependencies := rec(
433
GAP := "4.5",
434
NeededOtherPackages := [ ["GAPDoc", "1.3"] ],
435
SuggestedOtherPackages := [ ] ),
436
AvailabilityTest := ReturnTrue ) );
437
]]></Log>
438
<P/>
439
This file declares the &GAP; package with name <Q>test</Q> in version 1.0.
440
The package documentation consists of one autoloaded book; the <C>SixFile</C>
441
component is needed by the &GAP; help system. Package dependencies require at
442
least &GAP;&nbsp;4.5 and &GAPDoc; package at version at least 1.3, and these
443
conditions will be checked when the package will be loaded
444
(see <Ref Sect="Version Numbers"/>).
445
Since there are no requirements that have to be tested,
446
<C>AvailabilityTest</C> just uses <Ref Func="ReturnTrue" BookName="ref"/>.
447
<P/>
448
Now start &GAP; (without using the <C>-r</C> option) and the <F>.gap</F>
449
directory will be added to the &GAP; root directory to
450
allow &GAP; to find the packages installed there
451
(see <Ref Sect="GAP Root Directories" BookName="ref"/>).
452
<P/>
453
<Log><![CDATA[
454
gap> LoadPackage("test");
455
true
456
]]></Log>
457
<P/>
458
This &GAP; package is too simple to be useful, but we have succeeded
459
in loading it via <Ref Func="LoadPackage" BookName="ref"/>, satisfying
460
all specified dependencies.
461
462
</Section>
463
464
465
<!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
466
<Section Label="File Structure">
467
<Heading>File Structure</Heading>
468
469
Package files may follow the style used for the &GAP; library.
470
Every file in the &GAP; library starts with a header that lists the
471
filename, copyright, a short description of the file contents and the
472
original authors of this file, and ends with a comment line <C>#E</C>.
473
Indentation in functions and the use of decorative spaces in the code
474
are left to the decision of the authors of each file. Global (i.e.
475
re-used elsewhere) comments usually are indented by two hash marks and
476
two blanks, in particular, every declaration or method or function
477
installation which is not only of local scope is separated by a header.
478
<P/>
479
Historically, when the &GAP; main manuals were based on the &TeX; macros
480
described in the document <Q>The gapmacro.tex Manual Format</Q>
481
(the file <F>gap4r5/doc/gapmacrodoc.pdf</F> included in the
482
tools archive as described in Section
483
<Ref Sect="Writing Documentation and Tools Needed"/>)
484
such headers were used for the manuals and have the type
485
<P/>
486
<Log><![CDATA[
487
#############################################################################
488
##
489
#X ExampleFunction(<A>,<B>)
490
##
491
## This function does great things.
492
]]></Log>
493
<P/>
494
where <Q>X</Q> was one of the letters: <C>F</C>, <C>A</C>, <C>P</C>, <C>O</C>,
495
<C>C</C>, <C>R</C> or <C>V</C> indicating whether the object declared will
496
be a function, attribute, property, operation, category, representation or
497
variable, respectively. Additionally <C>M</C> was used in <C>.gi</C> files
498
for method installations. Then a sample usage of the function was given,
499
followed by a comment which described the identifier.
500
This description was automatically be extracted to build the
501
manual source, if there is a <C>\Declaration</C> line in some
502
<C>.msk</C> file together with an appropriate configuration file.
503
<P/>
504
Nowadays, facilities to distribute a document over several files
505
to allow the documentation for parts of some code to be stored in
506
the same file as the code itself are provided by the &GAPDoc; package (see
507
<Ref Sect="Distributing a Document into Several Files" BookName="gapdoc"/>).
508
The same approach is demonstrated by the <Package>Example</Package> package.
509
E.g. <F>example/doc/example.xml</F> has the statement
510
<C>&lt;#Include Label="ListDirectory"></C>
511
and <F>example/lib/files.gd</F> contains
512
<Log><![CDATA[
513
#############################################################################
514
##
515
#F ListDirectory([<dir>]) . . . . . . . . . . list the files in a directory
516
##
517
## <#GAPDoc Label="ListDirectory">
518
## <ManSection>
519
## <Func Name="ListDirectory" Arg="[dir]"/>
520
##
521
## <Description>
522
## lists the files in directory <A>dir</A> (a string)
523
## or the current directory if called with no arguments.
524
## </Description>
525
## </ManSection>
526
## <#/GAPDoc>
527
DeclareGlobalFunction( "ListDirectory" );
528
]]></Log>
529
This is all put together in the file <F>example/makedocrel.g</F> which
530
builds the package documentation, calling
531
<Ref Func="MakeGAPDocDoc" BookName="gapdoc"/> with
532
locations of library files containing parts of the
533
documentation.
534
535
</Section>
536
537
538
539
<!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
540
<Section Label="The PackageInfo.g File">
541
<Heading>The PackageInfo.g File</Heading>
542
<Index Key="ValidatePackageInfo"><C>ValidatePackageInfo</C></Index>
543
As a first step the example in <Ref Sect="An Example of a GAP Package"/>
544
shows the information needed for the package loading mechanism to load
545
a simple package. However, if your package depends on the functionality
546
of other packages, the component <C>Dependencies</C> given in the
547
<F>PackageInfo.g</F> file becomes important
548
(see <Ref Label="Package dependencies"/> below),
549
and more entries become relevant if you want to
550
distribute your package: they contain lists of authors and/or
551
maintainers including contact information, URLs of the package archives
552
and README files, status information, text for a package overview Web
553
page, and so on.
554
<P/>
555
We suggest to create a <F>PackageInfo.g</F> file for your package by
556
copying the one in the <Package>Example</Package> package,
557
distributed with &GAP;, and then adjusting it for your package.
558
Within &GAP; you can look at this template file for a list and explanation
559
of all recognized entries by
560
<Log><![CDATA[
561
Pager(StringFile(Filename(DirectoriesLibrary(),
562
"../pkg/example/PackageInfo.g")));
563
]]></Log>
564
<P/>
565
Once you have created the <F>PackageInfo.g</F> file for your package,
566
you can test its validity with the function
567
<Ref Func="ValidatePackageInfo" BookName="ref"/>.
568
569
</Section>
570
571
572
573
<!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
574
<Section Label="Functions and Variables and Choices of Their Names">
575
<Heading>Functions and Variables and Choices of Their Names</Heading>
576
577
In writing the &GAP; code for your package you need to be a little
578
careful on just how you define your functions and variables.
579
<P/>
580
<E>Firstly</E>, in general one should avoid defining functions and variables
581
via assignment statements in the way you would interactively, e.g.
582
<P/>
583
<Example><![CDATA[
584
gap> Squared := x -> x^2;;
585
gap> Cubed := function(x) return x^3; end;;
586
]]></Example>
587
<P/>
588
The reason for this is that such functions and variables are <E>easily
589
overwritten</E> and what's more you are not warned about it when it happens.
590
<P/>
591
To protect a function or variable against overwriting there is the
592
command <Ref Func="BindGlobal" BookName="ref"/>,
593
or alternatively (and equivalently) you may define a global
594
function via a <Ref Func="DeclareGlobalFunction" BookName="ref"/>
595
and <Ref Func="InstallGlobalFunction" BookName="ref"/> pair
596
or a global variable via a <Ref Func="DeclareGlobalVariable" BookName="ref"/>
597
and <Ref Func="InstallValue" BookName="ref"/> pair. There are also operations
598
and their methods, and related objects like attributes and filters which
599
also have <C>Declare...</C> and <C>Install...</C> pairs.
600
<P/>
601
<E>Secondly</E>, it's a good idea to reduce the chance of accidental
602
overwriting by choosing names for your functions and variables that begin
603
with a string that identifies it with the package, e.g.&nbsp;some of the
604
undocumented functions in the &Example; package begin with <C>Eg</C>. This is
605
especially important in cases where you actually want the user to be able
606
to change the value of a function or variable defined by your package,
607
for which you have used direct assignments (for which the user will
608
receive no warning if she accidentally overwrites them). It's also
609
important for functions and variables defined via <C>BindGlobal</C>,
610
<C>DeclareGlobalFunction</C>/<C>InstallGlobalFunction</C> and
611
<C>DeclareGlobalVariable</C>/<C>InstallValue</C>, in order to avoid name clashes
612
that may occur with (extensions of) the &GAP; library and other
613
packages.
614
<P/>
615
<Index Subkey="for a GAP package">local namespace</Index>
616
Additionally, since &GAP;&nbsp;4.5 a package may place global variables into
617
a local namespace as explained in
618
<Ref Sect="Namespaces for GAP Packages" BookName="ref"/> in order to avoid
619
name clashes and preserve compatibility. This new feature
620
allows you to define in your package global variables with the identifier
621
ending with the <C>@</C> symbol, e.g. <C>xYz@</C>. Such variables may be used
622
in your package code safely, as they may be accessed from outside the package
623
only by their full name, i.e. <C>xYz@YourPackageName</C>. This helps to prevent
624
clashes between different packages or between a package and the &GAP; library
625
because of the same variable names.
626
<!-- TODO: demonstrate in the example package how this is actually used -->
627
<P/>
628
On the other hand, operations and their methods (defined via
629
<Ref Func="DeclareOperation" BookName="ref"/>,
630
<Ref Func="InstallMethod" BookName="ref"/> etc.&nbsp;pairs)
631
and their relatives do not need this consideration, as they
632
avoid name clashes by allowing for more than one <Q>method</Q>
633
for the same-named object.
634
<P/>
635
To demonstrate the definition of a function via a
636
<C>DeclareOperation</C>/<C>InstallMethod</C> pair,
637
the method <Ref Oper="Recipe"/> was included in the &Example; package;
638
<C>Recipe( FruitCake );</C> gives a <Q>method</Q> for making a
639
fruit cake (forgive the pun).
640
<P/>
641
<E>Thirdly</E>, functions or variables with <C>Set<A>XXX</A></C> or <C>Has<A>XXX</A></C> names
642
(even if they are defined as operations) should be avoided as these may
643
clash with objects associated with attributes or properties (attributes
644
and properties <A>XXX</A> declared via the <C>DeclareAttribute</C> and
645
<C>DeclareProperty</C> commands have associated with them testers of form
646
<C>Has<A>XXX</A></C> and setters of form <C>Set<A>XXX</A></C>).
647
<P/>
648
<E>Fourthly</E>, it is a good idea to have some convention for internal
649
functions and variables (i.e.&nbsp;the functions and variables you don't
650
intend for the user to use). For example, they might be entirely
651
CAPITALISED.
652
<P/>
653
Additionally, there is a recommended naming convention that the &GAP; core
654
system and &GAP; packages should not use global variables starting in the
655
lowercase. This allows to reserve variables with names starting in lowecase
656
to the &GAP; user so they will never clash with the system. It is extremely
657
important to avoid using for package global variables very short names
658
started in lowercase. For example, such names like <C>cs</C>, <C>exp</C>,
659
<C>ngens</C>, <C>pc</C>, <C>pow</C> which are perfectly fine for local
660
variables, should never be used for globals. Additionally, the package must
661
not have writable global variables with very short names even if they are
662
starting in uppercase, for example, <C>C1</C> or <C>ORB</C>, since they
663
also could be easily overwritten by the user.
664
<P/>
665
It is a good practice to follow naming conventions used in &GAP; as
666
explained in <Ref Sect="Naming Conventions" BookName="ref"/> and
667
<Ref Sect="Changing the Structure" BookName="tut"/>, which
668
might help users to memorize or even guess names of functions
669
provided by the package.
670
<P/>
671
<E>Finally</E>, note the advantage of using
672
<C>DeclareGlobalFunction</C>/<C>InstallGlobalFunction</C>,
673
<C>DeclareGlobalVariable</C>/<C>InstallValue</C>, etc.&nbsp;pairs (rather than
674
<C>BindGlobal</C>) to define functions and variables, which allow the package
675
author to organise her function- and variable- definitions in any order
676
without worrying about any interdependence. The <C>Declare...</C> statements
677
should go in files with <C>.gd</C> extensions and be loaded by <C>ReadPackage</C>
678
statements in the package <F>init.g</F> file, and the <C>Install...</C> definitions
679
should go in files with <C>.gi</C> extensions and be loaded by <C>ReadPackage</C>
680
statements in the package <F>read.g</F> file; this ensures that the <C>.gi</C>
681
files are read <E>after</E> the <C>.gd</C> files. All other package code should go
682
in <C>.g</C> files (other than the <F>init.g</F> and <F>read.g</F> files themselves) and
683
be loaded via <C>ReadPackage</C> statements in the <F>init.g</F> file.
684
<P/>
685
686
<Index Key="ShowPackageVariables"><C>ShowPackageVariables</C></Index>
687
In conclusion, here is some practical advice on how to check which variables
688
are used by the package.
689
<P/>
690
Firstly, there is a function
691
<Ref Func="ShowPackageVariables" BookName="ref"/>.
692
If the package <A>pkgname</A> is available
693
but not yet loaded then <C>ShowPackageVariables( pkgname )</C>
694
prints a list of global variables that become bound and of methods
695
that become installed when the package is loaded (for that, the package
696
will be actually loaded, so <C>ShowPackageVariables</C> can be called
697
only once for the same package in the same &GAP; session.)
698
The second optional argument <A>version</A> may specify a particular
699
package version to be loaded.
700
An error message will be printed if (the given version of) the package
701
is not available or already loaded.
702
<P/>
703
Info lines for undocumented variables will be marked with an asterisk
704
<C>*</C>. Note that the &GAP; help system is case insensitive,
705
so it is difficult to document identifiers that differ only by case.
706
<P/>
707
The following entries are omitted from the list:
708
default setter methods for attributes and properties that are declared
709
in the package,
710
and <C>Set<A>attr</A></C> and <C>Has<A>attr</A></C> type variables
711
where <A>attr</A> is an attribute or property.
712
<P/>
713
For example, for this package it currently produces the following output:
714
<Log><![CDATA[
715
gap> ShowPackageVariables("example");
716
----------------------------------------------------------------
717
Loading Example 3.3 (Example/Template of a GAP Package)
718
by Werner Nickel (http://www.mathematik.tu-darmstadt.de/~nickel),
719
Greg Gamble (http://www.math.rwth-aachen.de/~Greg.Gamble), and
720
Alexander Konovalov (http://www.cs.st-andrews.ac.uk/~alexk/).
721
----------------------------------------------------------------
722
new global functions:
723
EgSeparatedString( str, c )*
724
FindFile( dir, file )
725
HelloWorld( )
726
ListDirectory( arg )
727
LoadedPackages( )
728
WhereIsPkgProgram( prg )
729
Which( prg )
730
731
new global variables:
732
FruitCake
733
734
new operations:
735
Recipe( arg )
736
737
new methods:
738
Recipe( cake )
739
]]></Log>
740
741
Another trick is to start &GAP; with <C>-r -A</C> options, immediately
742
load your package and then call <Ref Func="NamesUserGVars" BookName="ref"/>
743
which returns a list of the global variable names created since the
744
library was read, to which a value is currently bound. For example, for the
745
<Package>Example</Package> it produces
746
<Log><![CDATA[
747
gap> NamesUserGVars();
748
[ "EgSeparatedString", "FindFile", "FruitCake", "HelloWorld", "ListDirectory",
749
"LoadedPackages", "Recipe", "WhereIsPkgProgram", "Which" ]
750
]]></Log>
751
but for packages with dependencies it will also contain variables created by
752
other packages. Nevertheless, it may be a useful check to search for unwanted
753
variables appearing after package loading. A potentially dangerous situation
754
which should be avoided is when the package uses some simply named temporary
755
variables at the loading stage. Such <Q>phantom</Q> variables may then remain
756
unnoticed and, as a result, there will be no warnings if the user occasionally
757
uses the same name as a local variable name in a function. Even more
758
dangerous is the case when the user variable with the same name already exists
759
before the package is loaded so it will be silently overwritten.
760
761
</Section>
762
763
764
<!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
765
<Section Label="Package dependencies">
766
<Heading>Package Dependencies (Requesting one &GAP; Package from within Another)</Heading>
767
768
<Index>needed package</Index>
769
<Index>suggested package</Index>
770
<Index Subkey="for a GAP package">dependencies</Index>
771
It is possible for one &GAP; package <C>A</C>, say,
772
to require another package <C>B</C>.
773
For that, one simply adds the name and the (least) version number of the
774
package <C>B</C> to the <C>NeededOtherPackages</C> component of the
775
<C>Dependencies</C> component of the <F>PackageInfo.g</F> file of the package
776
<C>A</C>.
777
In this situation, loading the package <C>A</C> forces that also the package
778
<C>B</C> is loaded, and that <C>A</C> cannot be loaded if <C>B</C> is not
779
available.
780
<P/>
781
782
If <C>B</C> is not essential for <C>A</C> but should be loaded if it is
783
available
784
(for example because <C>B</C> provides some improvements of the main system
785
that are useful for <C>A</C>)
786
then the name and the (least) version number of <C>B</C> should be added to
787
the <C>SuggestedOtherPackages</C> component of the
788
<C>Dependencies</C> component of the <F>PackageInfo.g</F> file of <C>A</C>.
789
In this situation, loading <C>A</C> forces an attempt to load also <C>B</C>,
790
but <C>A</C> is loaded even if <C>B</C> is not available.
791
<P/>
792
793
Also the component <C>Dependencies.OtherPackagesLoadedInAdvance</C> in
794
<F>PackageInfo.g</F> is supported, which describes needed packages that
795
shall be loaded before the current package is loaded.
796
See <Ref Sect="Declaration and Implementation Part of a Package"/>
797
for details about this and more generally about the order in which the files
798
of the packages in question are read.
799
<P/>
800
801
All package dependencies must be documented explicitly in the
802
<File>PackageInfo.g</File> file. It is important to properly
803
identify package dependencies and make the right decision
804
whether the other package should be <Q>needed</Q> or <Q>suggested</Q>.
805
For example, declaring package as <Q>needed</Q> when <Q>suggested</Q>
806
might be sufficient may prevent loading of packages under Windows for
807
no good reason.
808
<P/>
809
810
It is not appropriate to explicitly call
811
<Ref BookName="ref" Func="LoadPackage"/> <E>when the package is loaded</E>,
812
since this may distort the order of package loading and result in warning
813
messages. It is recommended to turn such dependencies into needed or
814
suggested packages. For example, a package can be designed in such a way
815
that it can be loaded with restricted functionality if another package
816
(or standalone program) is missing, and in this case the missing package
817
(or binary) is <E>suggested</E>. Alternatively, if the package author
818
decides that loading the package in this situation makes no sense,
819
then the missing component is <E>needed</E>.
820
<P/>
821
822
On the other hand, if <Ref BookName="ref" Func="LoadPackage"/> is called
823
inside functions of the package then there is no such problem, provided
824
that these functions are called only after the package has been loaded,
825
so it is not necessary to specify the other package as suggested. The same
826
applies to test files and manual examples, which may be simply extended
827
by calls to <Ref BookName="ref" Func="LoadPackage"/>.
828
<P/>
829
830
<Index Key="OnlyNeeded" Subkey="option"><C>OnlyNeeded</C></Index>
831
It may happen that a package B that is listed as a suggested
832
package of package A is actually needed by A.
833
If no explicit <Ref BookName="ref" Func="LoadPackage"/> calls for B
834
occur in A at loading time, this can now be detected using
835
the new possibility to load a package without loading its suggested
836
packages using the global option <C>OnlyNeeded</C> which
837
can be used to (recursively) suppress loading the suggested packages
838
of the package in question. Using this option, one can check whether
839
errors or warnings appear when B is not available (note that this option
840
should be used only for such checks to simulate the situation when
841
package B is not available; it is not supposed to be used in an actual
842
&GAP; session when package B will be loaded later, since this may cause
843
problems). In case of any errors or warnings, their consequence can
844
then be either turning B into a needed package or (since apparently B
845
was not intended to become a needed package) changing the code accordingly.
846
Only if package A calls <Ref BookName="ref" Func="LoadPackage"/> for B at
847
loading time (see above) then package B needs to be <E>deinstalled</E>
848
(i.e. removed) to test loading of A without B.
849
<!-- TODO: write a new subsection in Reference manual Chapter 77 GAP
850
Packages how to uninstall GAP package and refer to it from "Example".-->
851
<P/>
852
853
Finally, if the package manual is in the &GAPDoc; format,
854
then &GAPDoc; should still be listed as <E>needed</E> for
855
this package (not as <E>suggested</E>), even though &GAPDoc;
856
is now a needed package for &GAP; itself.
857
<P/>
858
859
</Section>
860
861
862
863
<!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
864
<Section Label="Declaration and Implementation Part of a Package">
865
<Heading>Declaration and Implementation Part of a Package</Heading>
866
867
When &GAP; packages require each other in a circular way,
868
a <Q>bootstrapping</Q> problem arises of defining functions before they are
869
called.
870
The same problem occurs in the &GAP; library, and it is resolved there
871
by separating declarations (which define global variables such as
872
filters and operations)
873
and implementations (which install global functions and methods)
874
in different files.
875
Any implementation file may use global variables defined in any declaration
876
file.
877
&GAP; initially reads all declaration files (in the library they have a
878
<C>.gd</C> suffix) and afterwards reads all implementation files
879
(which have a <C>.gi</C> suffix).
880
<P/>
881
Something similar is possible for &GAP; packages:
882
if a file <F>read.g</F> exists in the home directory of the package,
883
this file is read only <E>after</E> all the <F>init.g</F> files of all
884
(implicitly) required &GAP; packages are read.
885
Thus one can separate declaration and implementation for a &GAP; package
886
in the same way as is done for the &GAP; library,
887
by creating a file <F>read.g</F>,
888
restricting the <Ref Func="ReadPackage" BookName="ref"/> statements in
889
<F>init.g</F> to only read those files of the package that provide
890
declarations,
891
and to read the implementation files from <F>read.g</F>.
892
<P/>
893
<E>Examples:</E>
894
<P/>
895
Suppose that there are two packages <C>A</C> and <C>B</C>,
896
each with files <F>init.g</F> and <F>read.g</F>.
897
<P/>
898
<List>
899
<Item>
900
If package <C>A</C> suggests or needs package <C>B</C>
901
and package <C>B</C> does not need or suggest any other package
902
then first <F>init.g</F> of <C>B</C> is read,
903
then <F>read.g</F> of <C>B</C>,
904
then <F>init.g</F> of <C>A</C>,
905
then <F>read.g</F> of <C>A</C>.
906
</Item>
907
<Item>
908
If package <C>A</C> suggests or needs package <C>B</C>
909
and package <C>B</C> (or a package that is suggested or needed by <C>B</C>)
910
suggests or needs package <C>A</C>
911
then first the files <F>init.g</F> of <C>A</C> and <C>B</C> are read
912
(in an unspecified order)
913
and then the files <F>read.g</F> of <C>A</C> and <C>B</C>
914
(in the same order).
915
</Item>
916
</List>
917
<P/>
918
919
In general, when &GAP; is asked to load a package then first the dependencies
920
between this packages and its needed and suggested packages are inspected
921
(recursively), and a list of package sets is computed such that no cyclic
922
dependencies occur between different package sets and such that no package
923
in any of the package sets needs any package in later package sets.
924
Then &GAP; runs through the package sets and reads for each set first all
925
<F>init.g</F> files and then all <F>read.g</F> files of the packages in the
926
set.
927
(There is one exception from this rule:
928
Whenever packages are autoloaded before the implementation part of the &GAP;
929
library is read, only the <F>init.g</F> files of the packages are read;
930
as soon as the &GAP; library has been read, the <F>read.g</F> files of these
931
packages are also read, and afterwards the above rule holds.)
932
<P/>
933
934
<Index Key="IsPackageMarkedForLoading"><C>IsPackageMarkedForLoading</C></Index>
935
It can happen that some code of a package depends on the availability of
936
suggested packages, i.e., different initializations are performed
937
depending on whether a suggested package will eventually be loaded or not.
938
One can test this condition with the function
939
<Ref Func="IsPackageMarkedForLoading" BookName="ref"/>.
940
In particular, one should <E>not</E> call
941
(and use the value returned by this call) the function
942
<Ref Func="LoadPackage" BookName="ref"/> inside
943
package code that is read during package loading.
944
Note that for debugging purposes loading suggested packages may
945
have been deliberately disabled via the global option <C>OnlyNeeded</C>.
946
<P/>
947
948
Note that the separation of the &GAP; code of packages into declaration
949
part and implementation part does in general <E>not</E> allow one to actually
950
<E>call</E> functions from a package when the implementation part is read.
951
For example,
952
in the case of a <Q>cyclic dependency</Q> as in the second example above,
953
suppose that <C>B</C> provides a new function <C>f</C> or a new global record
954
<C>r</C>, say, which are declared in the declaration part of <C>B</C>.
955
Then the code in the implementation part of <C>A</C> may contain
956
calls to the functions defined in the declaration part of <C>B</C>.
957
However, the implementation part of <C>A</C> may be read
958
<E>before</E> the implementation part of <C>B</C>.
959
So one can in general not assume that during the loading of <C>A</C>,
960
the function <C>f</C> can be called, or that one can access components of
961
the record <C>r</C>.
962
<P/>
963
964
If one wants to call the function <C>f</C> or to access components of the
965
record <C>r</C> in the code of the package <C>A</C> then the problem is
966
that it may be not possible to determine a cyclic dependency between <C>A</C>
967
and <C>B</C> from the packages <C>A</C> and <C>B</C> alone.
968
A safe solution is then to add the name of <C>B</C> to the component
969
<C>Dependencies.OtherPackagesLoadedInAdvance</C> of the <F>PackageInfo.g</F>
970
file of <C>A</C>.
971
The effect is that package <C>B</C> is completely loaded before the file
972
<F>read.g</F> of <C>A</C> is read, provided that there is no cyclic
973
dependency between <C>A</C> and <C>B</C>,
974
and that package <C>A</C> is regarded as not available in the case that
975
such a cyclic dependency between <C>A</C> and <C>B</C> exists.
976
<P/>
977
978
A special case where <C>Dependencies.OtherPackagesLoadedInAdvance</C>
979
can be useful is that a package wants to force the complete &GAP; library
980
to be read before the file <F>read.g</F> of the package <C>A</C> is read.
981
In this situation, the <Q>package name</Q> <C>"gap"</C> should be added
982
to this component in the <F>PackageInfo.g</F> file of <C>A</C>.
983
<P/>
984
985
<Index>autoreadable variables</Index>
986
In the case of cyclic dependencies, one solution for the above problem
987
might be to delay those computations (typically initializations)
988
in package <C>A</C> that require package <C>B</C> to be loaded
989
until all required packages are completely loaded.
990
This can be done by moving the declaration and implementation of the
991
variables that are created in the initialization into a separate file
992
and to declare these variables in the <F>init.g</F> file of the package,
993
via a call to <Ref Func="DeclareAutoreadableVariables" BookName="ref"/>
994
(see also <Ref Sect="Autoreadable Variables"/>).
995
<P/>
996
997
</Section>
998
999
1000
<!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
1001
<Section Label="Autoreadable Variables">
1002
<Heading>Autoreadable Variables</Heading>
1003
1004
Package files containing method installations must be read
1005
when the package is loaded.
1006
For package files <E>not</E> containing method installations
1007
(this applies, for example, to many data files)
1008
another mechanism allows one to delay reading such files
1009
until the data are actually accessed. See
1010
<Ref Label="DeclareAutoreadableVariables" BookName="ref"/> for further
1011
details.
1012
1013
</Section>
1014
1015
1016
1017
<!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
1018
<Section Label="Standalone Programs in a GAP Package">
1019
<Heading>Standalone Programs in a &GAP; Package</Heading>
1020
1021
&GAP; packages that involve stand-alone programs are fundamentally
1022
different from &GAP; packages that consist entirely of &GAP; code.
1023
<P/>
1024
This difference is threefold: A user who installs the &GAP; package
1025
must also compile (or install) the package's binaries, the
1026
package must check whether the binaries are indeed available,
1027
and finally the &GAP; code of the package has to start the external
1028
binary and to communicate with it.
1029
We will cover these three points in the following sections.
1030
<P/>
1031
If the package does not solely consist of an interface to an external
1032
binary and if the external program called is not just special-purpose
1033
code, but a generally available program, chances are high that sooner
1034
or later other &GAP; packages might also require this program.
1035
We therefore strongly recommend the provision of a documented &GAP;
1036
function that will call the external binary. We also suggest to create
1037
actually two &GAP; packages; the first providing only the binary and the
1038
interface and the second (requiring the first,
1039
see&nbsp;<Ref Label="Package dependencies"/>) being the actual &GAP; package.
1040
<P/>
1041
1042
1043
<!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
1044
<Subsection Label="Installation of GAP Package Binaries">
1045
<Heading>Installation of &GAP; Package Binaries</Heading>
1046
1047
<Index Key="sysinfo.gap"><C>sysinfo.gap</C></Index>
1048
<Index Subkey="for a GAP package">external binaries</Index>
1049
The scheme for the installation of package binaries which is described
1050
further on is intended to permit the installation on different
1051
architectures which share a common file system (and share the
1052
architecture independent file).
1053
<P/>
1054
A &GAP; package which includes external binaries contains a <F>bin</F>
1055
subdirectory. This subdirectory in turn contains subdirectories for
1056
the different architectures on which the &GAP; package binaries are
1057
installed. The names of these directories must be the same as the
1058
names of the architecture dependent subdirectories of the main <F>bin</F>
1059
directory. Unless you use a tool like <C>autoconf</C> yourself, you must
1060
obtain the correct name of the binary directory from the main &GAP;
1061
branch. To help with this, the main &GAP; directory contains a file
1062
<F>sysinfo.gap</F> which assigns the shell variable <C>GAParch</C> to the
1063
proper name as determined by &GAP;'s <C>configure</C> process.
1064
For example on a Linux system, the file <F>sysinfo.gap</F> may look like
1065
this:
1066
<P/>
1067
<Log><![CDATA[
1068
GAParch=i586-unknown-linux2.0.31-gcc
1069
]]></Log>
1070
<P/>
1071
We suggest that your &GAP; package contains a file <F>configure</F> which
1072
is called with the path of the &GAP; root directory as
1073
parameter. This file then will read <F>sysinfo.gap</F> and set up
1074
everything for compiling under the given architecture (for example
1075
creating a <F>Makefile</F> from <F>Makefile.in</F>). As initial templates,
1076
you may use installation scripts of the <Package>Example</Package> package.
1077
1078
</Subsection>
1079
1080
1081
<!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
1082
<Subsection Label="Test for the Existence of GAP Package Binaries">
1083
<Heading>Test for the Existence of GAP Package Binaries</Heading>
1084
1085
If an external binary is essential for the workings of a &GAP; package,
1086
the function stored in the component <C>AvailabilityTest</C> of the
1087
<F>PackageInfo.g</F> file of the package should test whether the program
1088
has been compiled on the architecture (and inhibit package loading
1089
if this is not the case).
1090
This is especially important if the package is loaded automatically.
1091
<P/>
1092
The easiest way to accomplish this is to use
1093
<Ref Func="Filename" Label="for a directory and a string" BookName="ref"/>
1094
for checking for the actual binaries in the path given by
1095
<Ref Func="DirectoriesPackagePrograms" BookName="ref"/>
1096
for the respective package.
1097
For example the <Package>example</Package> &GAP; package could use the
1098
following function to test whether the binary <F>hello</F> has been compiled;
1099
it will issue a warning if not, and will only load the package if the binary
1100
is indeed available:
1101
<P/>
1102
<Log><![CDATA[
1103
...
1104
AvailabilityTest := function()
1105
local path,file;
1106
# test for existence of the compiled binary
1107
path:= DirectoriesPackagePrograms( "example" );
1108
file:= Filename( path, "hello" );
1109
if file = fail then
1110
LogPackageLoadingMessage( PACKAGE_WARNING,
1111
[ "The program `hello' is not compiled,",
1112
"`HelloWorld()' is thus unavailable.",
1113
"See the installation instructions;",
1114
"type: ?Installing the Example package" ] );
1115
fi;
1116
return file <> fail;
1117
end,
1118
...
1119
]]></Log>
1120
<P/>
1121
However, if you look at the actual <F>PackageInfo.g</F> file of the
1122
<Package>example</Package> package, you will see that its
1123
<C>AvailabilityTest</C> function always returns <K>true</K>,
1124
and just logs the warning if the binary is not available
1125
(which may be later viewed with
1126
<Ref Func="DisplayPackageLoadingLog" BookName="ref"/>).
1127
This means that the binary is not regarded as essential for this
1128
package.
1129
<P/>
1130
You might also have to cope with the situation that external binaries will
1131
only run under UNIX (and not, say, under Windows), or may not compile with
1132
some compilers or default compiler options.
1133
See&nbsp;<Ref Sect="Testing for the System Architecture" BookName="ref"/>
1134
for information on how to test for the architecture.
1135
<P/>
1136
<Index Key="LogPackageLoadingMessage"><C>LogPackageLoadingMessage</C></Index>
1137
Last but not least: do not print anything in the <C>AvailabilityTest</C>
1138
function of the package via <C>Print</C> or <C>Info</C>. Instead one should
1139
call <Ref Func="LogPackageLoadingMessage" BookName="ref"/> to store
1140
a message which may be viewed later with
1141
<Ref Func="DisplayPackageLoadingLog" BookName="ref"/>
1142
(the latter two functions are introduced in &GAP;&nbsp;4.5)
1143
</Subsection>
1144
1145
1146
1147
<!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
1148
<Subsection Label="Calling of and Communication with External Binaries">
1149
<Heading>Calling of and Communication with External Binaries</Heading>
1150
1151
There are two reasons for this: the input data has to be passed on to
1152
the stand-alone program and the stand-alone program has to be started
1153
from within &GAP;.
1154
<P/>
1155
There are two principal ways of doing this.
1156
<P/>
1157
The first possibility is to write all the data for the stand-alone to
1158
one or several files, then start the stand-alone with
1159
<Ref Oper="Process" BookName="ref"/> or
1160
<Ref Func="Exec" BookName="ref"/>
1161
which then writes the output data to file, and finally read in
1162
the standalone's output file.
1163
<P/>
1164
The second way is interfacing via input-output streams,
1165
see Section&nbsp;<Ref Sect="Input-Output Streams" BookName="ref"/>.
1166
<P/>
1167
Some &GAP; packages use kernel modules
1168
(see <Ref Sect="Kernel modules in GAP packages" BookName="ref"/>)
1169
instead of external binaries.
1170
A kernel module is implemented in C and follows certain conventions to
1171
comply with the &GAP; kernel interface, which we plan to document later.
1172
In the meantime, we advise you to look at existing examples of such packages
1173
and get in touch with &GAP; developers if you plan to develop such a package.
1174
1175
</Subsection>
1176
1177
</Section>
1178
1179
1180
1181
<!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
1182
<Section Label="Having an InfoClass">
1183
<Heading>Having an InfoClass</Heading>
1184
1185
<!-- TODO: (CW) the Example package does not declare an InfoExample,
1186
and it ought to do so! It might be a good idea to suggest
1187
_where_ to put this declaration.-->
1188
1189
<Index Key="InfoClass" Subkey="for a GAP package"><C>InfoClass</C></Index>
1190
It is a good idea to declare an <C>InfoClass</C> for your package. This gives
1191
the package user the opportunity to control the verbosity of output
1192
and/or the possibility of receiving debugging information
1193
(see&nbsp;<Ref Sect="Info functions" BookName="ref"/>). Below, we give a quick
1194
overview of its utility.
1195
<P/>
1196
An <C>InfoClass</C> is defined with a <C>DeclareInfoClass( <A>InfoPkgname</A> );</C>
1197
statement and may be set to have an initial <C>InfoLevel</C> other than the
1198
zero default (which means no <C>Info</C> statement is to output information)
1199
via a <C>SetInfoLevel( <A>InfoPkgname</A>, <A>level</A> );</C> statement. An initial
1200
<C>InfoLevel</C> of 1 is typical.
1201
<P/>
1202
<C>Info</C> statements have the form:
1203
<C>Info( <A>InfoPkgname</A>, <A>level</A>, <A>expr1</A>, <A>expr2</A>, ...);</C>
1204
where the expression list <C><A>expr1</A>, <A>expr2</A>, ...</C>
1205
appears just like it would in a <C>Print</C> statement. The only difference is
1206
that the expression list is only printed (or even executed) if the
1207
<C>InfoLevel</C> of <A>InfoPkgname</A> is at least <A>level</A>.
1208
1209
</Section>
1210
1211
1212
1213
<!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
1214
<Section Label="The Banner">
1215
<Heading>The Banner</Heading>
1216
1217
<Index Subkey="for a GAP package">banner</Index>
1218
Since &GAP;&nbsp;4.4, the package banner, if one is desired, should be
1219
provided by assigning a string to the <C>BannerString</C> field of the record
1220
argument of <C>SetPackageInfo</C> in the <F>PackageInfo.g</F> file.
1221
<P/>
1222
It is a good idea to have a hook into your package documentation from
1223
your banner. The banner of the &Example; package suggests to the &GAP; user:
1224
<P/>
1225
<Log><![CDATA[
1226
For help, type: ?Example package
1227
]]></Log>
1228
<P/>
1229
In order for this to display the introduction of the &Example; package
1230
the index-entry
1231
<C>&tlt;Index&tgt;Example package&tlt;/Index&tgt;</C>
1232
was added just before the first paragraph of the introductory section in
1233
the file <F>example.xml</F>. The &Example; package uses
1234
<Package>GAPDoc</Package>
1235
(see Section&nbsp;<Ref Sect="Writing Documentation and Tools Needed"/>)
1236
for documentation
1237
(you will need some different scheme to achieve this using
1238
the <F>gapmacro.tex</F> system).
1239
1240
</Section>
1241
1242
1243
<!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
1244
<Section Label="Version Numbers">
1245
<Heading>Version Numbers</Heading>
1246
1247
<Index Subkey="for a GAP package">version number</Index>
1248
Version numbers are strings containing nonnegative integers separated
1249
by non-numeric characters. They are compared by
1250
<Ref Func="CompareVersionNumbers" BookName="ref"/>
1251
which first splits them at non-digit characters and then lexicographically
1252
compares the resulting integer lists.
1253
Thus version <C>"2-3"</C> is larger than version <C>"2-2-5"</C>
1254
but smaller than <C>"4r2p3"</C> or <C>"11.0"</C>.
1255
<P/>
1256
It is possible for code to require &GAP; packages in certain
1257
versions. In this case, all versions, whose number is equal or larger
1258
than the requested number are acceptable. It is the task of the
1259
package author to provide upwards compatibility.
1260
<P/>
1261
Loading a specific version of a package (that is, <E>not</E> one with a
1262
larger version number) can be achieved by prepending <C>=</C> to the desired
1263
version number.
1264
For example, <C>LoadPackage( "example", "=1.0" )</C> will load version
1265
<C>"1.0"</C> of the package <C>"example"</C>,
1266
even if version <C>"1.1"</C> is available.
1267
As a consequence, version numbers must not start with <C>=</C>,
1268
so <C>"=1.0"</C> is not a valid version number.
1269
<P/>
1270
Package authors should choose a version numbering scheme that admits a
1271
new version number even after tiny changes to the package, and
1272
ensure that version numbers of successive package versions increase.
1273
The automatic update of package archives in the &GAP; distribution will
1274
only work if a package has a new version number.
1275
<P/>
1276
It is a well-established custom to name package archives like
1277
<F>name-version.tar.gz</F>, <F>name-version.tar.bz2</F> etc.,
1278
where <C>name</C> is the lower case name, and <C>version</C> is
1279
the version (another custom is that the archive then should extract
1280
to a directory that has exactly the name <F>name-version</F>).
1281
<P/>
1282
It is very important that there should not ever be, for a given &GAP;
1283
package, two different archives with the same package version number.
1284
If you make changes to your package and place a new archive of the
1285
package onto the public server, please ensure that a new archive has
1286
a new version number. This should be done even for very minor changes.
1287
<P/>
1288
For most of the packages it will be inappropriate to re-use the date
1289
of the release as a version number. It's much more obvious how big are
1290
the changes between versions "4.4.12", "4.5.1" and "4.5.2" than between
1291
versions "2008.12.17", "2011.04.15" and "2011.09.14".
1292
<P/>
1293
Since version information is duplicated in several places throughout the
1294
package documentation, for &GAPDoc;-based manuals you may define the
1295
version and the release manual in the comments in <F>PackageInfo.g</F>
1296
file close to the place where you specified its <C>Version</C> and
1297
<C>Date</C> components, for example
1298
<Log><![CDATA[
1299
## <#GAPDoc Label="PKGVERSIONDATA">
1300
## <!ENTITY VERSION "3.3">
1301
## <!ENTITY RELEASEDATE "11/11/2011">
1302
## <#/GAPDoc>
1303
]]></Log>
1304
notify <Ref Func="MakeGAPDocDoc" BookName="gapdoc"/> that a part of the
1305
document is stored in <F>PackageInfo.g</F> (see <F>example/makedocrel.g</F>),
1306
read this data into the header of the main document via
1307
<C>&lt;#Include Label="PKGVERSIONDATA"></C> directive and then use them via
1308
&amp;VERSION; and &amp;RELEASEDATE; entities almost everywhere where you
1309
need to refer to them (most commonly, in the title page and installation
1310
instructions).
1311
1312
</Section>
1313
1314
1315
<!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
1316
<Section Label="Testing a GAP package">
1317
<Heading>Testing a &GAP; package</Heading>
1318
1319
<Subsection Label="Tests files for a GAP package">
1320
<Heading>Tests files for a GAP package</Heading>
1321
1322
The (optional) <F>tst</F> directory of your package may contain as
1323
many tests of the package functionality as appears appropriate. These tests
1324
should be organised into test files similarly to those in the <F>tst</F>
1325
directory of the &GAP; distribution as documented in
1326
<Ref Sect="Test Files" BookName="ref"/>.
1327
<P/>
1328
For a deposited package, a test file with a basic test of the package
1329
(for example, to check that it works as expected and/or that the manual
1330
examples are correct) may be specified in the component <C>TestFile</C>
1331
in the <F>PackageInfo.g</F> to be included in the GAP standard test suite.
1332
This file can either consist of <Ref BookName="ref" Oper="Test"/>
1333
calls (in this case, it is common to call it <F>testall.g</F>) or be
1334
itself a test file having an extension <F>.tst</F> and supposed to be
1335
read via <Ref BookName="ref" Oper="Test"/>. It is assumed that the
1336
latter case occurs if and only if the file contains the substring<P/>
1337
&nbsp;<C>"gap> START_TEST("</C>
1338
<P/>
1339
<Alt Only="LaTeX">\noindent</Alt>
1340
(with exactly one space after the &GAP; prompt).
1341
<P/>
1342
For deposited packages, these tests are run by the &GAP; Group regularly,
1343
as a part of the standard &GAP; test suite. For the efficient testing it
1344
is important that the test specified in the <F>PackageInfo.g</F> file
1345
does not display any output (e.g. no test progress indicators) except
1346
reporting discrepancies if such occur and the completion report as
1347
in the example below:
1348
<Log><![CDATA[
1349
gap> Test("tst/testall.tst");
1350
Example package: testall.tst
1351
GAP4stones: 3333
1352
true
1353
]]></Log>
1354
Tests which produce extended output and/or requires substantial runtime
1355
are not supposed to be a part of the &GAP; standard test suite but may
1356
be placed in the <F>tst</F> directory of the packages with further
1357
instructions on how to run them elsewhere.
1358
1359
</Subsection>
1360
1361
1362
<Subsection Label="Testing GAP package loading">
1363
<Heading>Testing &GAP; package loading</Heading>
1364
1365
To test that your package may be loaded into &GAP; without any problems
1366
and conflicts with other packages, test that it may be loaded in various
1367
configurations:
1368
<List>
1369
<Item>
1370
starting &GAP; with no packages (except needed for &GAP;) using <C>-r -A</C> options
1371
and calling <C>LoadPackage("your-package-name");</C>
1372
</Item>
1373
<Item>
1374
starting &GAP; with no packages (except needed for &GAP;) using <C>-r -A</C> options
1375
and calling <C>LoadPackage("your-package-name" : OnlyNeeded );</C>
1376
</Item>
1377
<Item>
1378
starting &GAP; in the default configuration (with no options)
1379
and calling <C>LoadPackage("your-package-name");</C>
1380
</Item>
1381
<Item>
1382
starting &GAP; in the default configuration (with no options)
1383
and calling <C>LoadPackage("your-package-name" : OnlyNeeded );</C>
1384
</Item>
1385
<Item>
1386
finally, together with all other packages using
1387
<Ref Func="LoadAllPackages"/> (see below) in four possible combinations
1388
of starting &GAP; with/without <C>-r -A</C> options and calling
1389
<Ref Func="LoadAllPackages"/> with/without <C>Reversed</C> option.
1390
</Item>
1391
</List>
1392
The test of loading all packages is the most subtle one. Quite often
1393
it reveals problems which do not occur in the default configuration
1394
but may cause difficulties to the users of specialised packages.
1395
<P/>
1396
For your convenience, <C>make testpackagesload</C> called in the &GAP;
1397
root directory will run all package loading tests listed in this subsection
1398
and write their output in its <C>dev/log</C> directory.
1399
<P/>
1400
It will produce four files with test logs, corresponding to the
1401
four cases above (the letter <C>N</C> in the filename stands for
1402
<Q>needed</Q>, <C>A</C> stands for <Q>autoloaded</Q>):
1403
<List>
1404
<Item>
1405
<F>dev/log/testpackagesload1_...</F>
1406
</Item>
1407
<Item>
1408
<F>dev/log/testpackagesloadN1_...</F>
1409
</Item>
1410
<Item>
1411
<F>dev/log/testpackagesloadA_...</F>
1412
</Item>
1413
<Item>
1414
<F>dev/log/testpackagesloadNA_...</F>
1415
</Item>
1416
</List>
1417
Each file contains small sections for loading individual packages: among those,
1418
you need to find the section related to your package and may ignore all other
1419
sections. For example, the section for the &Example; package looks like
1420
<Log><![CDATA[
1421
%%% Loading example 3.3.3
1422
[ ]
1423
### Loaded example 3.3.3
1424
]]></Log>
1425
so it has clearly passed the test. If there are any error messages displayed
1426
between <C>Loading ...</C> and <C>Loaded ...</C> lines, they will signal on
1427
errors during loading of your package.
1428
<P/>
1429
Additionally, this test collects information about variables created since
1430
the library was read (obtained using <Ref Func="NamesUserGVars" BookName="ref"/>)
1431
with either short names (no more than three characters) or names breaking a
1432
recommended naming convention that the &GAP; core system and &GAP; packages
1433
should not use global variables starting in the lowercase
1434
(see Section <Ref Sect="Functions and Variables and Choices of Their Names"/>).
1435
Their list will be displayed in the test log (in the example above, &Example;
1436
packages does not create any such variables, so an empty list is displayed).
1437
It may be hard to attribute a particular identifier to a package, since it
1438
may be created by another package loaded because of dependencies, so when
1439
a more detailed and precise report on package variables is needed, it may
1440
be obtained using <Ref Func="ShowPackageVariables" BookName="ref"/>
1441
(also, <C>make testpackagesvars</C> called in the &GAP; root directory
1442
produces such reports for each package and writes them to a file
1443
<F>dev/log/testpackagesvars_...</F>).
1444
<P/>
1445
Finally, each log file finishes with two large sections for loading all
1446
packages in the alphabetical and reverse aplhabetical order (to check more
1447
combinations of loading one package after another). We are aiming at
1448
releasing only collections of package which do not break
1449
<Ref Func="LoadAllPackages"/> in any of the four configurations, so if
1450
it is broken when you plug in the development version of your package into
1451
the released version of &GAP;, it is likely that your package triggers
1452
this error. If you observe that <Ref Func="LoadAllPackages"/> is broken
1453
and suspect that this is not the fault of your package, please contact
1454
the &GAP; Support.
1455
</Subsection>
1456
1457
<ManSection>
1458
<Func Name="LoadAllPackages" Arg=": Reversed"/>
1459
<Description>
1460
loads all &GAP; packages from their list sorted in alphabetical order
1461
(needed and suggested packages will be loaded when required). This is a
1462
technical function to check packages compatibility, so it should NOT be
1463
used to run anything except tests; it is known that &GAP; performance is
1464
slower if all packages are loaded. To introduce some variations of the
1465
order in which packages will be loaded for testing purposes,
1466
<Ref Func="LoadAllPackages"/> accepts version <C>Reversed</C> to load
1467
packages from their list sorted in the reverse alphabetical order.
1468
</Description>
1469
</ManSection>
1470
1471
1472
<Subsection Label="Testing a GAP package with the GAP standard test suite">
1473
<Heading>Testing a &GAP; package with the &GAP; standard test suite</Heading>
1474
1475
The <F>tst</F> directory of the &GAP; installation contains a selection of
1476
test files and two scripts, <F>testinstall.g</F> and <F>testall.g</F>
1477
which are a part of the &GAP; standard test suite.
1478
<P/>
1479
It is important to check that your package does not break &GAP; standard
1480
tests. To perform a clean test and avoid interfering with other packages,
1481
first you must start a new &GAP; session with the following command
1482
(assuming that <C>gap</C> starts &GAP; in your system):
1483
<Log><![CDATA[
1484
gap -N -A -x 80 -r -m 100m -o 512m
1485
]]></Log>
1486
After that load your package and run either <F>testinstall.g</F> or
1487
<F>testall.g</F> as demonstrated below.
1488
<P/>
1489
1490
The quicker test, <F>testinstall.g</F>, requires about 512MB of memory and
1491
runs for about one minute on an Intel Core 2 Duo / 2.53 GHz machine. It may
1492
be started with the command
1493
<Log><![CDATA[
1494
gap> Read( Filename( DirectoriesLibrary( "tst" ), "testinstall.g" ) );
1495
]]></Log>
1496
You will get a large number of lines with output about the progress of
1497
the tests.
1498
<Log><![CDATA[
1499
test file GAP4stones time(msec)
1500
-------------------------------------------
1501
testing: .../gap4r5/tst/zlattice.tst
1502
zlattice.tst 0 0
1503
testing: .../gap4r5/tst/gaussian.tst
1504
gaussian.tst 0 10
1505
... further lines deleted ...
1506
]]></Log>
1507
<P/>
1508
1509
The more thorough test is <F>testall.g</F> which exercises more of &GAP;'s
1510
capabilities, containing all test files from <F>testinstall.g</F> as
1511
a subset. It requires about 512MB of memory, runs for about one hour
1512
on an Intel Core 2 Duo / 2.53 GHz machine, and produces an output
1513
similar to the testinstall.g test.
1514
To run it, also start a new &GAP; session with
1515
<C>gap -N -A -x 80 -r -m 100m -o 512m</C> and then call
1516
<Log><![CDATA[
1517
gap> Read( Filename( DirectoriesLibrary( "tst" ), "testall.g" ) );
1518
]]></Log>
1519
You may repeat the same check loading your package with <C>OnlyNeeded</C>
1520
option. Remember to perform each subsequent test in a new &GAP; session.
1521
<P/>
1522
Also you may perform individual tests from the <F>tst</F> directory of the
1523
&GAP; installation loading them with <Ref Func="Test" BookName="ref"/>,
1524
for example, the file <F>bugfix.tst</F>.
1525
<P/>
1526
1527
1528
</Subsection>
1529
1530
</Section>
1531
1532
1533
<!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
1534
<Section Label="Access to the GAP Development Version">
1535
<Heading>Access to the &GAP; Development Version</Heading>
1536
1537
We are aiming at providing a stable platform for package development and
1538
testing with official &GAP; releases. However, when it may be of benefit to
1539
obtain access to the &GAP; development version, please contact the &GAP;
1540
team by mailing to <Email>[email protected]</Email>.
1541
<P/>
1542
</Section>
1543
1544
1545
<!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
1546
<Section Label="Selecting a license for a GAP Package">
1547
<Heading>Selecting a license for a &GAP; Package</Heading>
1548
1549
It is advised to make clear in the documentation of the package the basis
1550
on which it is being distributed to users. GAP itself is distributed under
1551
the GNU Public License version 2 (version 2 or later). We would encourage
1552
you to consider the GPL for your packages, but you might wish to be more
1553
restrictive (for instance forbidding redistribution for profit) or less
1554
restrictive (allowing your software to be incorporated into commercial
1555
software). See <Q>Choosing a License for the Distribution of Your Package</Q>
1556
from <URL>http://www.gap-system.org/Packages/Authors/authors.html</URL>
1557
for further details.
1558
<P/>
1559
1560
In the past many &GAP; packages used the text
1561
<Q>We adopt the copyright regulations of GAP as detailed in the copyright
1562
notice in the &GAP; manual</Q> or a similar statement. We now advise to be
1563
more explicit and make the exact reference to the GPL license, for example:
1564
<P/>
1565
<E>
1566
<Package>package-name</Package> is free software; you can redistribute it
1567
and/or modify it under the terms of the
1568
<URL Text="GNU General Public License">http://www.fsf.org/licenses/gpl.html</URL>
1569
as published by the Free Software Foundation; either version 2 of the License,
1570
or (at your option) any later version.
1571
</E>
1572
1573
</Section>
1574
1575
<!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
1576
<Section Label="Wrapping up a GAP Package">
1577
<Heading>Wrapping up a &GAP; Package</Heading>
1578
1579
<!-- TODO: also accept .zip archives -->
1580
1581
Currently, the &GAP; distribution provides archives in four different
1582
formats.
1583
<P/>
1584
<List>
1585
<Mark><F>.tar.gz</F></Mark>
1586
<Item>
1587
a standard UNIX <C>tar</C> archive, compressed with <C>gzip</C>
1588
</Item>
1589
<Mark><F>.tar.bz2</F></Mark>
1590
<Item>
1591
a standard UNIX <C>tar</C> archive, compressed with <C>bzip2</C>
1592
</Item>
1593
<Mark><F>.zip</F></Mark>
1594
<Item>
1595
an archive in <C>zip</C> format, where text files should have
1596
UNIX style line breaks
1597
</Item>
1598
<Mark><F>-win.zip</F></Mark>
1599
<Item>
1600
an archive in <C>zip</C> format, where text files should have
1601
DOS/Windows style line breaks
1602
</Item>
1603
</List>
1604
<P/>
1605
For convenience of possible users it is sensible that you provide an
1606
archive of your package in at least one of these formats.
1607
<P/>
1608
For example, if you wish to supply a <F>.tar.gz</F> archive,
1609
you may create it with the command
1610
<P/>
1611
&nbsp;<C>tar -cvzf package-name-version.tar.gz package-name</C>
1612
<P/>
1613
<Alt Only="LaTeX">\noindent</Alt>
1614
The <F>etc</F> directory obtained from <C>tools.tar.gz</C>
1615
(described above in
1616
Section&nbsp;<Ref Sect="Writing Documentation and Tools Needed"/>)
1617
contains a file <F>packpack</F> which provides a more versatile
1618
packing-up script.
1619
<P/>
1620
Because the release of the &GAP; package is independent of the version
1621
of &GAP;, a &GAP; package should be wrapped up in separate file that
1622
can be installed onto any version of &GAP;. In this way, a package can
1623
be upgraded any time without the need to wait for new &GAP; releases.
1624
To ensure this, the package should be archived from the &GAP; <F>pkg</F>
1625
directory, that is all files are archived with the path starting at the
1626
package's name.
1627
<P/>
1628
<Index Key="GAPDocManualLab"><C>GAPDocManualLab</C></Index>
1629
The archive of a &GAP; package should contain all files necessary for the
1630
package to work. In particular there should be a compiled documentation,
1631
which includes the <F>manual.six</F>, <F>manual.toc</F> and <F>manual.lab</F>
1632
file in the
1633
documentation subdirectory which are created by &TeX;ing the documentation,
1634
if you use &GAPDoc; or the <F>gapmacro.tex</F> document formats.
1635
(The first two files are needed by the &GAP; help system,
1636
and the <F>manual.lab</F> file is needed if the main manuals or another
1637
package is referring to your package.
1638
Use the command <C>GAPDocManualLab( packagename );</C> to create this file
1639
for your help books if you use &GAPDoc;.)
1640
<P/>
1641
1642
For packages which are redistributed via the &GAP; Web site,
1643
we offer an automatic conversion of any of the formats listed
1644
above to all the others (note that this, as well as wrapping
1645
the &GAP; distribution as a single archive containing the
1646
core system and all currently redistributed packages, will
1647
change file timestamps, so one should not rely on them anywhere
1648
in the package).
1649
<P/>
1650
1651
To use the conversion and repackaging service, you can provide any of
1652
the four archive formats or even more than one, however you should
1653
adhere to the following rule: text files in <File>.tar.gz</File>
1654
and <File>.tar.bz2</File> archives must have UNIX style line breaks,
1655
while text files in <File>-win.zip</File> archives must have
1656
DOS/Windows line breaks.
1657
<P/>
1658
1659
The package wrapping tools for the &GAP; distribution and web pages
1660
then will use a sensible list of file extensions to decide if a file
1661
is a text file (being conservative, it may miss a few text files).
1662
These rules may be prepended by the application of rules from the
1663
<F>PackageInfo.g</F> file:
1664
<List>
1665
<Item>
1666
if it has a <C>.TextFiles</C> component, then consider the given files
1667
as text files before &GAP; defaults will be applied;
1668
</Item>
1669
<Item>
1670
if it has a <C>.BinaryFiles</C> component, then consider given files
1671
as binary files before &GAP; defaults will be applied;
1672
</Item>
1673
<Item>
1674
if it has a <C>.TextBinaryFilesPatterns</C> component, then apply it
1675
before &GAP; defaults will be applied;
1676
</Item>
1677
</List>
1678
<P/>
1679
1680
The <F>etc</F> directory obtained from <C>tools.tar.gz</C>
1681
(described above in
1682
Section&nbsp;<Ref Sect="Writing Documentation and Tools Needed"/>)
1683
contains a file <F>classifyfiles.py</F> and two files <F>patternscolor.txt</F>
1684
and <F>patternstextbinary.txt</F> implementing &GAP; default rules used
1685
to classify files in packages.
1686
For most of the packages these default rules perfecty detect binary and
1687
text files, so there is no need for them to use any of the three optional
1688
components. However, <C>.TextBinaryFilesPatterns</C>, or <C>.TextFiles</C>,
1689
or <C>.BinaryFiles</C> will become useful if the package has e.g. data
1690
files which are recognised as binary files by the default rules, or if the
1691
package uses standard extensions in a non-standard way (this is not
1692
recommended, of course). If things will go wrong, it is possible that one
1693
(or indeed all) created archives have wrong line breaks.
1694
<P/>
1695
1696
Utility functions available in <File>gap4r7/lib/lbutil.g</File>, namely
1697
<C>DosUnixLinebreaks</C>, <C>UnixDosLinebreaks</C>, <C>MacUnixLinebreaks</C>
1698
may be helpful. They are described in the comments to their source code.
1699
1700
</Section>
1701
1702
1703
<!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
1704
<Section Label="The WWW Homepage of a Package">
1705
<Heading>The WWW Homepage of a Package</Heading>
1706
1707
If you want to distribute your package
1708
you should create a WWW homepage containing
1709
some basic information,
1710
archives for download,
1711
the <F>README</F> file with installation instructions,
1712
and a copy of the package's <F>PackageInfo.g</F> file.
1713
<P/>
1714
The responsibility for this WWW homepage is with the package
1715
authors/maintainers.
1716
<P/>
1717
If you tell us about your package
1718
(say, by mail to <Email>[email protected]</Email>)
1719
we may consider either
1720
<List>
1721
<Item>
1722
adding a link to your package homepage from the &GAP; website
1723
(thus, the package will be an <E>undeposited contribution</E>);
1724
</Item>
1725
<Item>
1726
or redistributing the current version of your package as a part of
1727
the &GAP; distribution (this, the package will be <E>deposited</E>),
1728
also ;
1729
</Item>
1730
</List>
1731
In the latter case we can also provide some services for producing several
1732
archive formats from the archive you provide (e.g., you produce a
1733
<C>.tar.gz</C> version of your archive and we produce also a <C>.tar.bz2</C>
1734
and a <C>-win.zip</C> version from it).
1735
<P/>
1736
Please also consider submitting your package to the &GAP; package refereeing
1737
process (see <URL>http://www.gap-system.org/Contacts/submit.html</URL> for
1738
further information).
1739
</Section>
1740
1741
1742
<!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
1743
<Section Label="Upgrading the package to work with GAP 4.5">
1744
<Heading>Upgrading the package to work with &GAP;&nbsp;4.5</Heading>
1745
1746
<Subsection Label="Changes in GAP 4.5 from the packages perspective">
1747
<Heading>Changes in &GAP;&nbsp;4.5 from the packages perspective</Heading>
1748
1749
Here we list only those changes which may have some implications for the
1750
packages.
1751
1752
<List>
1753
1754
<Item>
1755
Changing the distribution format providing one archive with the core system
1756
and all currently redistributed packages.
1757
</Item>
1758
1759
<Item>
1760
The &GAP; kernel is now compiled by default to use the GMP large integer
1761
arithmetic library, speeding up arithmetic by a factor of 4 or more in many cases.
1762
This slightly changes the build process, affecting mainly packages with
1763
dynamically loaded modules (see <URL>http://www.gap-system.org/Download/</URL>
1764
for &GAP; installation instructions).
1765
</Item>
1766
1767
<Item>
1768
The &GAP; documentation has been converted to the &GAPDoc; format and extensively
1769
reviewed. Now it has only two books: the Tutorial and the Reference Manual.
1770
The two other books, <Q>Extending &GAP;</Q> and <Q>Programming Tutorial</Q> became
1771
parts of the Reference Manual. Packages that refer to parts of the &GAP; documentation
1772
may need to rebuild their manuals to update references.
1773
<P/>
1774
Some packages still use the
1775
old <Q>gapmacro</Q> format for their manuals, for which support may be discontinued
1776
in the future. There is no urgent need to convert such manuals into the &GAPDoc;
1777
format before &GAP;&nbsp;4.5 release, but we encourage you very much to consider
1778
doing this at some later point.
1779
</Item>
1780
1781
<Item>
1782
The old concept of an autoloaded package has been integrated with the <E>needed</E>
1783
and <E>suggested</E> mechanism that already exists between packages. &GAP; itself
1784
now <Q>needs</Q> certain packages (for instance &GAPDoc;) and <Q>suggests</Q> others
1785
(typically the packages that were autoloaded). The decisions
1786
which packages &GAP; should need or suggest are made by developers based on
1787
technical criteria. They can be easily overridden by a user
1788
using the new <File>gap.ini</File>
1789
(see <Ref Sect="The gap.ini and gaprc files" BookName="ref"/>).
1790
The default file ensures that all previously autoloaded packages are
1791
still loaded if present.
1792
</Item>
1793
1794
<Item>
1795
Optional <File>~/.gap</File> directory for user's customisations which may contain e.g.
1796
locally installed packages (see <Ref BookName="ref" Sect="GAP Root Directories"/>).
1797
If package installation instructions explain how to install the package in a
1798
non-standard location, they may need an update. This is intended to replace
1799
<File>.gaprc</File> files, but those are still supported for backwards
1800
compatibility (see <Ref Sect="The former .gaprc file" BookName="ref"/>).
1801
</Item>
1802
1803
<Item>
1804
Various improvements in the packages loading mechanism make it more
1805
informative, while avoiding confusing the user with warning and error
1806
messages for packages they didn't
1807
know they were loading. For example, many messages are stored but not
1808
displayed using the function <Ref Func="LogPackageLoadingMessage" BookName="ref"/>
1809
and there is a function <Ref BookName="ref" Func="DisplayPackageLoadingLog"/>
1810
to show log messages that occur during package loading.
1811
Packages are encouraged to use these mechanisms to report
1812
problems in loading (e.g. binaries not compiled), rather than printing messages directly.
1813
</Item>
1814
1815
<Item>
1816
Since &GAP;&nbsp;4.5 a package may place global variables into a local
1817
namespace as explained in <Ref Sect="Namespaces for GAP Packages" BookName="ref"/>
1818
in order to avoid name clashes and preserve compatibility.
1819
</Item>
1820
1821
<Item>
1822
In &GAP;&nbsp;4.5 the internal representation of a record has changed,
1823
as well as some of the basic functions to manipulate records. This speeds
1824
up considerably the creation of and access to records with many components.
1825
Record components are now internally stored in the order in which they were used
1826
first, and this means that the internal ordering of components (returned by
1827
<Ref Func="RecNames" BookName="ref"/> and so the ordering of records, depends
1828
on the GAP session.
1829
<!--
1830
# in new session
1831
gap> s:=rec(aa:=1,bb:=0);;
1832
gap> r:=rec(bb:=1,aa:=0);;
1833
gap> r<s;
1834
true
1835
gap> RecNames(r);
1836
[ "aa", "bb" ]
1837
1838
# in another new session
1839
gap> r:=rec(bb:=1,aa:=0);;
1840
gap> s:=rec(aa:=1,bb:=0);;
1841
gap> r<s;
1842
false
1843
gap> RecNames(r);
1844
[ "bb", "aa" ]
1845
-->
1846
Therefore, within each session everything is consistent, so one can
1847
efficiently remove duplicates with <Ref Oper="Set" BookName="ref"/>,
1848
sort lists of records, find records with binary search, etc., but a
1849
care should be taken not to rely on <Ref Func="RecNames" BookName="ref"/>
1850
always returning names of components in the same order.
1851
</Item>
1852
1853
</List>
1854
1855
</Subsection>
1856
1857
</Section>
1858
1859
1860
<!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
1861
<Section Label="Checklists">
1862
<Heading>Checklists</Heading>
1863
1864
<Index>checklists</Index>
1865
<Subsection Label="Package release checklist">
1866
<Heading>Package release checklist</Heading>
1867
1868
The following checklist may be used by package authors, members of the
1869
&GAP; team responsible for package updates, package editors and referees.
1870
1871
<List>
1872
1873
<Item>
1874
Test that the package:
1875
<List>
1876
<Item>
1877
does not break <File>testinstall.g</File> and <File>testall.g</File>
1878
and does not slow them down noticeably
1879
(see <Ref Label="Testing a GAP package with the GAP standard test suite"/>);
1880
</Item>
1881
<Item>
1882
may be loaded in various configurations (see <Ref Label="Testing GAP package loading"/>);
1883
</Item>
1884
<Item>
1885
follows the guidelines of Section
1886
<Ref Label="Functions and Variables and Choices of Their Names"/>
1887
about names of functions and variables;
1888
</Item>
1889
</List>
1890
</Item>
1891
1892
<Item>
1893
Package documentation:
1894
<List>
1895
<Item>
1896
is built and included in the package archive together with
1897
its source files;
1898
</Item>
1899
<Item>
1900
states the version, release date and package authors;
1901
</Item>
1902
<Item>
1903
has the same version, release date and package authors
1904
details as stated in the <File>PackageInfo.g</File> file;
1905
</Item>
1906
<Item>
1907
is searchable using the &GAP; help system;
1908
</Item>
1909
<Item>
1910
is clear about the license under which the package is distributed;
1911
</Item>
1912
</List>
1913
</Item>
1914
1915
<Item>
1916
<File>PackageInfo.g</File> file:
1917
<List>
1918
<Item>
1919
has the same version, release date and package authors
1920
details as stated in the package manual;
1921
</Item>
1922
<Item>
1923
has all mandatory components and also optional components where appropriate;
1924
</Item>
1925
<Item>
1926
in particular, contains hints to distinguish binary and text files in
1927
case of non-standard file names and extensions;
1928
</Item>
1929
<Item>
1930
is validated using <Ref BookName="ref" Func="ValidatePackageInfo"/>;
1931
</Item>
1932
</List>
1933
</Item>
1934
1935
<Item>
1936
Package archive(s):
1937
<List>
1938
<Item>
1939
have correct permisisons for all files and directories after their
1940
unpacking (755 for directories and executables, if any; 644 for other
1941
files);
1942
</Item>
1943
<Item>
1944
contain files with correct line breaks for the given format
1945
(see <Ref Sect="Wrapping up a GAP Package"/>);
1946
</Item>
1947
<Item>
1948
contain no hidden system files and directories that are not supposed
1949
to be included in the package, e.g. <File>.cvsignore</File>,
1950
<File>.git</File> etc.;
1951
</Item>
1952
</List>
1953
</Item>
1954
1955
<Item>
1956
Package availability:
1957
<List>
1958
<Item>
1959
not only the package archive(s), but also the
1960
<File>PackageInfo.g</File> and <File>README</File> files
1961
are available online;
1962
</Item>
1963
<Item>
1964
the URL of the <File>PackageInfo.g</File> file is validated using
1965
the online tool available from
1966
<URL>http://www.gap-system.org/Packages/Authors/authors.html</URL>;
1967
</Item>
1968
</List>
1969
</Item>
1970
1971
</List>
1972
1973
</Subsection>
1974
1975
1976
<Subsection Label="Checklist for package upgrade to work with GAP 4.5">
1977
<Heading>Checklist for package upgrade to work with &GAP;&nbsp;4.5</Heading>
1978
1979
The following checklist will help you to check how well your package is
1980
ready to work with &GAP;&nbsp;4.5.
1981
<P/>
1982
1983
<List>
1984
1985
<Item>
1986
Mandatory changes needed for package upgrade to work with &GAP;&nbsp;4.5:
1987
1988
<List>
1989
1990
<Mark>
1991
Check that the package works as expected:
1992
</Mark>
1993
<Item>
1994
<List>
1995
<Item>
1996
verify that the package functionality works as required, that examples
1997
in the manual are correct and that test files show no discrepancies;
1998
</Item>
1999
<Item>
2000
if necessary, update manual examples and test files because the order
2001
in which record components are printed has changed
2002
(but now it will be more consistent and less dependent on how the record
2003
was created);
2004
</Item>
2005
<Item>
2006
check the usage of names of record components in the code:
2007
take care not to rely on <Ref Func="RecNames" BookName="ref"/>
2008
always returning names of components in the same order
2009
(see <Ref Label="Upgrading the package to work with GAP 4.5"/>)
2010
</Item>
2011
</List>
2012
</Item>
2013
2014
<Mark>
2015
Revise package dependencies:
2016
</Mark>
2017
<Item>
2018
Check the the <F>PackageInfo.g</F> has the correct list of
2019
needed and suggested packages (see <Ref Label="Package dependencies"/>).
2020
</Item>
2021
2022
<Mark>
2023
Revise licensing information:
2024
</Mark>
2025
<Item>
2026
Check that the package states clearly under which conditions it is distributed
2027
(see <Ref Label="Selecting a license for a GAP Package"/>).
2028
</Item>
2029
2030
<Mark>
2031
Rebuild the package documentation:
2032
</Mark>
2033
<Item>
2034
whenever your package documentation is &GAPDoc; or <C>gapmacro.tex</C>-based,
2035
&GAP;&nbsp;4.5 contains new versions of both tools. This will ensure that
2036
cross-references from the package manual to the main &GAP; manuals are
2037
correct and that the &GAP; help system will be able to navigate to the more
2038
precise location in the package manual. This will also improve the layout of
2039
the package documentation. In particular, &GAPDoc; has a better
2040
<File>.css</File> file and is capable of producing the HTML version with
2041
MathJax support to display nicely mathematical formulae.
2042
<P/> Note that it's not possible for a package to have an HTML manual which
2043
contains correct links to both &GAP;&nbsp;4.4 and &GAP;&nbsp;4.5 main manuals.
2044
</Item>
2045
2046
</List>
2047
2048
</Item>
2049
2050
<Item>
2051
Optional changes recommended for package upgrade to work with &GAP;&nbsp;4.5:
2052
2053
<List>
2054
2055
<Item>
2056
When the <C>AvailabilityTest</C> component in <File>PackageInfo.g</File>
2057
differs from <Ref Func="ReturnTrue" BookName="ref"/>, use
2058
<Ref Func="LogPackageLoadingMessage" BookName="ref"/> to store
2059
a message which may be viewed later with
2060
<Ref Func="DisplayPackageLoadingLog" BookName="ref"/>
2061
instead of calling <C>Print</C> or <C>Info</C> directly
2062
(see <Ref Label="Test for the Existence of GAP Package Binaries"/>).
2063
</Item>
2064
2065
<Item>
2066
It is recommended not to call <Ref Func="LoadPackage" BookName="ref"/>
2067
from a package file while this file is read: instead one should list the
2068
package in question in the lists of needed or suggested packages.
2069
To verify whether such calls occur in the package first load it and
2070
then call <C>DisplayPackageLoadingLog( PACKAGE_WARNING );</C>. If there is
2071
a genuine need to decide whether some package will be available at runtime,
2072
use the function <Ref Func="IsPackageMarkedForLoading" BookName="ref"/>
2073
introduced in &GAP;&nbsp;4.5.
2074
</Item>
2075
2076
<Item>
2077
Check if the package still relies on some obsolete variables
2078
(see <Ref Chap="Replaced and Removed Command Names" BookName="ref"/>)
2079
and try to get rid of their usage.
2080
</Item>
2081
</List>
2082
</Item>
2083
</List>
2084
2085
</Subsection>
2086
2087
</Section>
2088
2089
</Appendix>
2090
2091
<!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
2092
<!-- %% -->
2093
<!-- %E -->
2094
2095
2096