Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/GAP/pkg/simpcomp/   (GAP Algebra Version 4.15.1©)  Datei vom 18.2.2022 mit Größe 3 kB image not shown  

SSL language.xml   Sprache: XML

 

<!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
<!-- %% -->
<!-- %W  language.xml           GAP documentation                Martin Schönert -->
<!-- %% -->
<!-- %% -->
<!-- %Y  Copyright 1990-1992, Lehrstuhl D für Mathematik, RWTH Aachen, Germany -->
<!-- %% -->
<!-- %%  This file describes the &GAP; programming language. -->
<!-- %% -->
<Chapter Label="The Programming Language">
<Heading>The Programming Language</Heading>

This chapter describes the &GAP; programming language.  It should allow
you, in principle, to predict the result of each and every input. In order
to know what we are talking about, we first have to look more closely at
the process of interpretation and the various representations of data
involved.

<!-- %%  The &GAP; language and its interpreter in the kernel were designed by  -->
<!-- %%  Martin Sch{\"o}nert. -->


<!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
<Section Label="Language Overview">
<Heading>Language Overview</Heading>

First we have the input to &GAP;, given as a string of characters. How
those characters enter &GAP; is operating system dependent, e.g., they
might be entered at a terminal, pasted with a mouse into a window, or
read from a file. The mechanism does not matter. This representation of
expressions by characters is called the <E>external representation</E> of the
expression. Every expression has at least one external representation
that can be entered to get exactly this expression.
<P/>
The input, i.e., the external representation, is transformed in a process
called <E>reading</E> to an internal representation.  At this point the input
is analyzed and inputs  that are not legal external representations,
according to the rules given below, are rejected as errors. Those rules
are usually called the <E>syntax</E> of a programming language.
<P/>
The internal representation created by reading is called either an
<E>expression</E> or a <E>statement</E>.
Later we will distinguish between those two terms.
However for now we will use them interchangeably.
The exact form of the internal representation does not matter.
It could be a string of characters equal to the external representation,
in which case the reading would only need to check for errors.
It could be a series of machine instructions for the processor on which
&GAP; is running, in which case the reading would more appropriately
be called compilation.
It is in fact a tree-like structure.
<P/>
After the input has been read it is again transformed in a process called
<E>evaluation</E> or <E>execution</E>.
Later we will distinguish between those two terms too,
but for the moment we will use them interchangeably. The name
hints at the nature of this process, it replaces an expression with the
value of the expression. This works recursively, i.e., to evaluate an
expression first the subexpressions are evaluated and then the value of
the expression is computed from those values according to rules given below.
Those rules are usually called the <E>semantics</E> of a programming language.
<P/>
The result of the evaluation is, not surprisingly, called a <E>value</E>.
<!-- % The -->
<!-- % set of values  is of course a  much smaller set than the  set of -->
<!-- % expressions; for every value there may be several expressions that will -->
<!-- % evaluate to  this value. -->
Again the form in which such a  value is
represented internally does not  matter. It is  in fact a tree-like
structure again.
<P/>
The last process is called <E>printing</E>. It takes the value produced by
the evaluation and creates an external representation, i.e., a string of
characters again. What you do with this external representation is up to
you. You can look at it, paste it with the mouse into another window, or
write it to a file.
<P/>
Lets look at an example to make this more clear. Suppose you type in the
following string of 8 characters
<P/>
<Listing><![CDATA[
1 + 2 * 3;
]]></Listing>
<P/>
&GAP; takes  this external representation  and creates  a tree-like
internal representation, which  can picture as
<P/>
<Listing>
  +
 /\
1   *
   / \
  2   3
]]></Listing>
<P/>
This expression is then evaluated. To do this &GAP; first evaluates the
right subexpression <C>2*3</C>.  Again, to do this &GAP; first evaluates its
subexpressions 2 and 3. However they are so simple that they are their
own value, we say that they are self-evaluating. After this has been
done, the rule for <C>*</C> tells us that the value is the product of the
values of the two subexpressions, which in this case is clearly 6.
Combining this with the value of the left operand of the <C>+</C>, which is
self-evaluating, too, gives us the value of the whole expression 7. This
is then printed, i.e., converted into the external representation
consisting of the single character <C>7</C>.
<P/>
In this fashion we can predict the result of every input when we know the
syntactic rules that govern the process of reading and the semantic rules
that tell us for every expression how its value is computed in terms of
the values of the subexpressions.
The syntactic rules are given in sections <Ref Sect="Lexical Structure"/>,
<Ref Sect="Symbols"/>, <Ref Sect="Whitespaces"/>, <Ref Sect="Keywords"/>,
and <Ref Sect="Identifiers"/>,
the semantic rules are given in sections <Ref Sect="Expressions"/>,
<Ref Sect="Variables"/>, <Ref Sect="Function Calls"/>,
<Ref Sect="Comparisons"/,<Ref Sect="ArithmeticOperators">,
<Ref Sect=java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
<Ref "rocedure java.lang.StringIndexOutOfBoundsException: Range [27, 26) out of bounds for length 69
 Sect=F"> Ref Sect=F/>
and the chapters describing the individual data types.

</Section>


<!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->

< = java.lang.StringIndexOutOfBoundsException: Range [34, 33) out of bounds for length 35
<>java.lang.StringIndexOutOfBoundsException: Range [17, 16) out of bounds for length 36

java.lang.StringIndexOutOfBoundsException: Range [40, 4) out of bounds for length 70
<Pjava.lang.StringIndexOutOfBoundsException: Range [12, 11) out of bounds for length 67
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 4
<B>Newlinejava.lang.StringIndexOutOfBoundsException: Range [15, 14) out of bounds for length 72
<>
<><java.lang.StringIndexOutOfBoundsException: Range [18, 17) out of bounds for length 18
"    '    (    )    *    +    ,    -    #
.    /    :    ;    <    =    >    ~
[    \    ]    ^    _    {    }!
]>java.lang.StringIndexOutOfBoundsException: Range [13, 12) out of bounds for length 13
<P/>P>
 java.lang.StringIndexOutOfBoundsException: Range [15, 14) out of bounds for length 65
hembackslashesbutdojava.lang.StringIndexOutOfBoundsException: Range [47, 46) out of bounds for length 71
Inside strings
(Thisisjava.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 71
;Chap"java.lang.StringIndexOutOfBoundsException: Range [32, 31) out of bounds for length 50
java.lang.StringIndexOutOfBoundsException: Range [4, 3) out of bounds for length 72
supported by the computer is allowed.

<


<!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->java.lang.StringIndexOutOfBoundsException: Range [34, 32) out of bounds for length 66
<java.lang.StringIndexOutOfBoundsException: Range [9, 8) out of bounds for length 25
<java.lang.StringIndexOutOfBoundsException: Range [9, 8) out of bounds for length 26

 .e,java.lang.StringIndexOutOfBoundsException: Range [44, 43) out of bounds for length 71
In fashionwepredict the result of every input when we know the
symbols.  A <E>symbol</E> is a sequence of characters that form a syntactic rules that govern the process of reading and the semantic rules
unit. Theset  symbols consists ofkeywords,identifiers,strings
integers,the  ofthe subexpressionsjava.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
</
A <A <E"/,<Sect=Whitespaces"> < Sect"eywords",
An <E>identifier</E> is a sequence of letters, digits and underscores
(or other Ref Sect""/,
nondigit andis  a  (ee <ef =
An integer is a sequenceRef Sect""/,<RefSect=FunctionCalls/>
java.lang.StringIndexOutOfBoundsException: Range [22, 8) out of bounds for length 60
A <E>string =Statements/,<Sect=Assignments/,
doublequotes (ee< Chap" and Characters">)
</>
and the chapters describing the individual data types.
<P/>
<Listing<[[
+    -    *    /<!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
= ![
:=   .    ..   ->   ,    ;   [
]   {    }    (   )   :
]>/>
Digits uppercase and lowercase B><B, B></>,
Note  thatduringtheprocess  all  isremoved
(see<P>

<Section


<!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
<ection =Whitespaces>
< ispossibletouseothercharactersinidentifiersescaping

<Index>space</Index>
<Index>blank</Index><Index>tabulator/<java.lang.StringIndexOutOfBoundsException: Range [51, 50) out of bounds for length 66
<Index>commentsjava.lang.StringIndexOutOfBoundsException: Range [9, 8) out of bounds for length 25
java.lang.StringIndexOutOfBoundsException: Range [18, 14) out of bounds for length 74
are called <E>a subprocess, called/> assemblesjava.lang.StringIndexOutOfBoundsException: Range [61, 60) out of bounds for length 76
Whitespace is used as unit. The set of symbols consists of keywords, identifiers, strings,
gers   
<C> E/ is 
/><<K  
<C>Thdigitisajava.lang.StringIndexOutOfBoundsException: Range [31, 30) out of bounds for length 63
  java.lang.StringIndexOutOfBoundsException: Range [21, 20) out of bounds for length 70
Two or more adjacent whitespace possibly prepended by <C>-</C> and <C>+</C> sign characters.
whitespace.
 java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 4
Whitespace characters may also java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 31
where they are significant.
Whitespace]<
<P/> 
A <E>
which is
and continues to the end of java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 29
The whole comment, including <C>#</C> and the <B>Newline</B> character
is treated/>>java.lang.StringIndexOutOfBoundsException: Range [38, 36) out of bounds for length 66
java.lang.StringIndexOutOfBoundsException: Range [15, 6) out of bounds for length 74
an  called E>java.lang.StringIndexOutOfBoundsException: Range [25, 24) out of bounds for length 40
<P/    
For example, the<Th /> <<>
<P/>
!C
if i<0 then a:=-i;else a:=i;fi;
]>/
<P/>
is equivalent to
<P/>
<Listing><![CDATA[
if i < 0 then   # if i is negative
  a :=-i;         take its  
             
   itself
fi;
]]></A <E>comment>  withthe   <>/>
<P/>
(which continues to the end of the line on which the comment character appears.
comments). However the first The whole comment, including <C>#</C> and the <B>Newline</B> character
<P a  the   <>  its    just
<Listing><![CDATA[
fi<thena:-i;:=ifjava.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
]<>
<P/>
Listing<[java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
by a whitespace, and   a
and <K>else            # otherwise

<Section>


<!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->P>
< Label=Keywords>
<Heading>Keywords</comments). However the firis Enot<E>equivalentjava.lang.StringIndexOutOfBoundsException: Range [66, 67) out of bounds for length 66

<P/

<</E   words that are used to denote special operations
   .  notbe  as identifiers.The list 
keywords is contained 
<<  (ee< ="APInfo/)  willshow  to 
it in a nice table, demonstratingarepartof .They mustnotbe   .  list 
techniques
</>
<xample<[DATAjava.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
:SortedList(.eywords );; l:=Length( keys );;
gap> arr:= List( [ 0 .. gap> arr: [0 ..Int / )- ,i- {4*+[ . 4   )java.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72
gap> if l mod 4 <> 0 then Add( arr, keys{[ 4*Int(l/4) + 1 .. l ]} ); fi;
gap> Length( keys ); PrintArray( arr );
35
[ [         Assert,                       ,         atomic ]
   TryNextMethod          and,atomic ]java.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 69
   ],
  [           else,            end,          false,             fi ],
  [            for,       function,             if,             in ],
  [          local,            mod,            not,             od ],
  [             or,           quit,       readonly,      readwrite                ,          ,       readwrite ]
  ,         return,then ],
  [           true,          until,          while ] ]
]]></Example>
<P/>
Note that ()all keywords are  inlowercase   they
are case sensitive case .
 example<><>is  ;<><C,<></> <><>
and so forth are ordinary identifiers.
Keywords must   ,for  Celif<C isnot the
same  <elifK.
P>
<E>NoteE></E>
Severalfromthe list of keywordsabove may appear to 
identifiers representing functionsidentifiers representingfunctions  literalsof various
java.lang.StringIndexOutOfBoundsException: Range [59, 8) out of bounds for length 64
java.lang.StringIndexOutOfBoundsException: Range [22, 11) out of bounds for length 72
do not actually have function objects do not actually have function objects bound to them, which could be
assignedto othervariables orpassedto functions. keywordsare
<K>K>trueK> false/> <=" >eadonly<C>,<>readwrite<C> are  used
<ef="Label="  globalvariable/>
<Ref Func="Unbind" their accidental use as .
<Ref Func="Info"/> and <Ref Func="<Sectionjava.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
<Hea><Heading
<!-- Update the next paragraph to reference HPC-GAP suitably --> Eidentifier<
<><,C>eadonlyC,<readwrite<>are not 
at the moment. They are reserved for the future java.lang.StringIndexOutOfBoundsException: Range [0, 55) out of bounds for length 34
their An identifier is terminated by the first character not in this class.
<Section


<!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
<Section Label="Identifiers"<Listing<!CDATA[
<Heading>Identifiers</Heading>

An <E>identifier_00
(see <Ref Sect="Variables"/>).
An identifier java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 7
Note   ,so the   inthesecond
and java.lang.StringIndexOutOfBoundsException: Range [17, 16) out of bounds for length 40
An The backslash <C>\</C> can be used to include other characters in identifiers;
Note that the <Q>at</Q>-character <C>@<exceptthat this escape sequenceis consideredto be anordinaryletter
namespacesListing>!CDATA[
<P/>
xamples of valid identifiersare
<P/>
<Listing><![CDATAisan  atofunctionCG<>java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52
a           foo         aLongIdentifier
       HELLO
P/>
java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 41

abc@def
]]></Listing>
<>
Note that case is significant, so the java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 0
line are distinguished  Q><Q> is  used 
<P/>
The backslash <C>\</C> can be used to includejava.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 8
a backslash followed by a character is>java.lang.StringIndexOutOfBoundsException: Range [21, 20) out of bounds for length 48
except that this escape sequence The following rule is stated also in
For example
<Listing><</
GT     &AP 
]]>
is,not function<C>G</C>.
<P/>
An a backslash   keyword  for
example <C>\*</C> and <C>\modE>  letter<E>,in orderto avoid nameclashes.
<P/>
The length of identifiersFor,valid&AP;  assigns    
java.lang.StringIndexOutOfBoundsException: Range [16, 7) out of bounds for length 62
 escape C\/<newline/B>is ,
possible to long over  lines.

<#Include Label="IsValidIdentifier">

java.lang.StringIndexOutOfBoundsException: Range [9, 4) out of bounds for length 65
for global variables in packages. 
details.
<Index>namespace</Index>

<Subsection Label=  "
<Heading>Conventions about<>Expressions<>

<Index>variablejava.lang.StringIndexOutOfBoundsException: Range [36, 35) out of bounds for length 62

(The constructsthat are executed to to producea side effectand return
<ef Sect"ariables versus Objects"BookName"ut">java.lang.StringIndexOutOfBoundsException: Range [25, 24) out of bounds for length 54

<  <>1+11/> isan expression   is the integer12.

The name of almost every global variable in the &GAP; The external representation of this integer is the character sequence
and &;  witha <> <E.
(See Section <Ref Sect="Main Loop"/> for the few exceptions.)
For user variables, we recommend only choosing names that start with a
<>lower case letter</E>, in order toavoid name .

<P/>

For example, valid &GAPsimplest cases of expressions arethe:
start with Item ( &bsp< =")</tem>
java.lang.StringIndexOutOfBoundsException: Range [34, 2) out of bounds for length 50
because itmayhappenthat  variablesare  global variables
in this situation (Chapter&;Chap=">,<Item>

</Subsection<tem>  (ee  <ef =">,/>

</>

<!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
<Label="java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
<></>

<Index>evaluation</IndexExpressions  example the  expressions  above,canbe
java.lang.StringIndexOutOfBoundsException: Range [23, 2) out of bounds for length 62
Syntactic constructs that furtherwiththe  to form
no   .The <operators<>fall  threeclasses.
Expressions appear as right hand sides of assignments
(see <Ref Sect="The <E>comparisons</E> are <C>=</C>, <C><></C>, <C><</C>, <C><=</C>,
(ee <Ref="unction ">,and instatements.
<P/>
Note that an expression is not the same as a value.
For example <C>1 + 11</C> is an expression, whose value is the integer 12.
The external representation of this integer is the character sequence
<>2<C> ie,thissequence is  if   is .
This sequence is another expression whose value is the java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 49
The The following example shows a very simple expression with value 4 and a
and is called the <E>java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 4
</
The simplest cases of expressions are the gap> 2 * 2 + 9 = Fibonacci(7) and Fibonacci(13)
<List>
<Item>variables (see java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 0
<Item>function literals (see lowest, and also indicates whether the operator is left associative (aka
<Item>function calls (see Section <Ref
<Item>integer literalsIndex>associativity</Index>
<Item>floating point java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 18
<permutationjava.lang.StringIndexOutOfBoundsException: Range [27, 26) out of bounds for length 80
<Item>><E>associativity/
<Item>character java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 10
<="Lists">,/>
<Item>record literals (see Chapter ></Item>
</<java.lang.StringIndexOutOfBoundsException: Range [48, 6) out of bounds for length 69
, for example the simpleexpressionsmentionedabove,can be
combined with the java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 5
those expressions can then be combined further with the java.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 28
even more complex expressions.<>   <><> <><C<
<<>
The <E>comparisonsjava.lang.StringIndexOutOfBoundsException: Range [9, 8) out of bounds for length 10
<><,<>=/> <>n<K> <SectC/ and
<Ref Sect="Membership Test for Collections"/>).
The <<Row>
<K>od/>,and<C^<C (ee <Ref Sect"ArithmeticOperators"/)java.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 71

(see <ItemnoneItem
<P/>
The following>
more complex expression.
<P/>
<Example><![CDATA[
gap> 2<>
4
gap>2*2 +9 = Fibonacci(7)and ()in ;
true
]]></Example>
</

The following table lists java.lang.StringIndexOutOfBoundsException: Range [0, 29) out of bounds for length 28
lowest also     (ka
left-to-Item>left-ight<Item>

<Index></Table>
<Index>associativity</Index>
<<Section>
<Row>
  <Item><E>operator</E></Item>
  <Item><E>associativity</E></
</Row>
<HorLine/>
<Row>
  <Item><E>arithmetic (see&A <E>variable</E> is a location a &AP;program that points to  value.
  <Item></Item>
<Row>
<Row>
  <Item>&nbsp;&nbsp;&nbsp;&nbsp;<C>^</C></ java.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 48
  <Item>none</Item>
</Row>
<Row>
;nbsp&;nbsp; <C></> unary C><C<Item>
  <Item java.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 78
</Row>
<Rowvariable in the innermost scope that has this  as  name.
  <>;n&;<><C,<//> K>mod</K></Item>
  <Item>left-to-right</Item>
</Row>
<Row>
  <>&bsp;&bsp;nbsp;&nbspbinary <>+/>  C-C>Item>
  <values, because they denote different blocks of memory.  Note that
</
<>
<>
  <<E>comparisonnbsp<=java.lang.StringIndexOutOfBoundsException: Range [55, 54) out of bounds for length 69
  <Item></Item>
</>
<
  >&&&java.lang.StringIndexOutOfBoundsException: Range [32, 31) out of bounds for length 124
  <Item>none</Func Name="IsBound" Arg='ident' Label="for a global variable"/
</Row>
<HorLine/>
<Row>
  <Item><>logical (ee&nbsp;Ref Sect="Operations for Booleans"/>)</E></Item>
  <Item></Item>
</Row>
<ow
  <Item>&nbsp;&nbsp;&nbsp;&nbsp;<K>rid of unwanted large objects.
  <Item>right--to-</tem>
</Row>
<Row>
  <Item><!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
  <Item>left-to-> java.lang.StringIndexOutOfBoundsException: Range [27, 26) out of bounds for length 46
<
<Row>
  ;<K>/>/>
  <Item>left-to-right>java.lang.StringIndexOutOfBoundsException: Range [17, 16) out of bounds for length 24
</Row>
</Table>


</Section>


<!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->

SectionLabel"Variables">
<Heading>Variables</Heading>

<Index>scope</Index><Index>bound</Index>
A <E>variable</E> is a location in a &GAP; program that points to a value.
We can  readwriteagainbyjava.lang.StringIndexOutOfBoundsException: Range [40, 39) out of bounds for length 74
If a variable is evaluated it evaluates to this value.
<P/>
Initially an ordinary variable is not bound to any value.
The variable can be bound to a valueriables, which are created by calling
variable (see <Ref Sect="Assignments"/>).
Because of this we sometimes say that a variable that is not bound to any
value has no assigned value.
Assignment is in fact the only way by which a variable, which is not an
argument of a function, can be bound to a value.
After a variable has Insomecases,GAPcan java.lang.StringIndexOutOfBoundsException: Range [32, 31) out of bounds for length 74
to bind the variable to another value.
<P/>
A special class of variables is the class of <E>arguments</E> of functions.
They behave similarly to other variables,
except they are bound to the value of the
actual arguments upon a function call (see <Ref Sect="Function Calls"/>).
<P/>
Each variable has a name that is also called its <E>identifier</E>. This is
because in a given scope an identifier identifies a unique variable (see
<Ref Sect="Identifiers"/>).
A <E>scope</E> is a lexical part of a program text. There is
the <E>global scope</E> that encloses the entire program text, and there are
calscopes that range from the <>function<K>keyword  the
beginning of a function definition, to the corresponding <K>end</K> keyword.
A <E>local scope</E> introduces new variables, whose identifiers are given in
the formal argument list and the <K>local</K> declaration of the function (see
<Ref Sect="Function"/>). Usage of an identifier in a program text refers to the
variable in  =;java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
Because this mapping from identifiers to variables is done when the
program is read, not when it is executed, &GAP; is said to have <E>lexical
scoping</E>.  The following example shows how one identifier refers to
different variables at different points in the program text.
java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 4
<Listing><![CDATA[
>        return   2;
x := function ( a, b, c )
  local  y;
  g := c;     # c refers to>     fi;
  y := function ( y)
    local d, e, f;
    d := y;   # y >Printf)
    e := b;   # b refers to argument b of function x
    := #g to global g
    return d + e + f;
  end;
  return y( a ); # y refers to local y of function x
end;
]]></Listing>
<P/>
It isjava.lang.StringIndexOutOfBoundsException: Range [13, 12) out of bounds for length 13
different from Second, a group of are forand alteringthe
<P/>
In those languages a variable denotes a block of memory. The
 of variableisstoredinblock inlanguages
variables can have the same value, but they can never have identical
values, because they denote different blocks of memory.  Note that
some languages have the concept of a reference argument. It seems as if such an
argument and the variable from  useof,
value, since changing the argument's value also RefFunc=Unbind"Label="nbinda / and
variable used in the actual function call.  But this is not so; the
reference actually  pointerto the variable used in java.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 68
actual function call, and it is the compiler that inserts enough magic to
make the pointer invisible.  In order for this to work the compiler
needs enough information to compute the amount of memory needed for each
variable in a program, which is readily java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 24
<P/>
&;handjava.lang.StringIndexOutOfBoundsException: Range [32, 31) out of bounds for length 64
and different variables can share the same value.


<ManSection>
<Func Name="IsBound" Arg='ident' Label="for a global variable"/>

<Description>
<Ref Func="IsBound" Label="for a global variable"/> returns <K>true</K>
if the variable <A>ident</A> points to a value,
and <K>false</K> otherwise.
<P/>
For records and lists <Ref Func="IsBound" Label="for a global variable"/>
can be usedSecond, the variable names are passed as strings,
are bound
p<Ref Chap=Records">and < ="Lists">).
</Description>
</ManSection>


<ManSection>
<Func Name="Unbind" Arg='ident' Label="unbind a variable"/>

<Description>
deletes the identifier <A>ident</A<ef "java.lang.StringIndexOutOfBoundsException: Range [28, 27) out of bounds for length 65
If there is no other variable pointing to the same value as <A>ident</A> was,
this value will be removed by the next garbage collection.
Therefore <Ref Func="Unbind" Label="unbind a variable"/> can be used to get
rid of unwanted large objects.
<<
For records '/
can be used to delete components or entries, respectively
(see Chapters <Ref <Description>>
</Description>
</ManSection>

</Section>


<!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
<Section 
<Heading>More About java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 0

The vast majority of variables in &GAP; are defined at the outer
level (the global scope). They are>
objects either & or  or   s
code.
<P/>
Note that for packages there is a mechanism to implement package local
namespaces on top of this global namespace. See Section <Ref
Sect="Namespaces"/> for details.
<Index>namespace</Index>
<P/>
Certain special facilities are provided for manipulating global
variables which</>
local A warning givenif A><A hasno  bound to it or if it is
<P/>
First, such variables may be marked <E>read-only</E> using
<Ref Func="MakeReadOnlyGlobal"/>. In which case
attempts to change them will fail.Most of global variables
defined in the &GAP; library are so marked. <E>read-only</E> variables
can be made read-write again by calling <Ref Func="MakeReadWriteGlobal"/>.
GAP also features <E>constant</E> variables, which are created by calling
<Ref Func="MakeConstantGlobal"/>. Constant <java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
In  cases, GAP  optimisecode uses<constantE>variables,
as their value never changes. In this version GAP these optimisations can be
observed by printing the function back out, but this behaviour may change
in future.
<<FuncName"MakeReadWriteGlobal" Arg='ame'>
gap> globali := 1 + 2;;
gap>globalb :=true;
gap> MakeConstantGlobal("globali");
gap> MakeConstantGlobal(marksthe global variable named by the string <>ame</>as read-.
gap> f := function()
>     if globalb then
>         return globali + 1;
>     else
>         return globali + 2;
>     fi;
> end;;
gap>();
function (  )
    return 3 + 1;
end
]]></Example>


<P/>
Second, a group of functions are supplied for accessing and altering the
values assigned to global variables. Use of these functions
from the use of assignment,
<Ref Func="Unbind" Label="unbind a variable"/> and
<Ref Func="IsBound" Label="for a global variable"gap> IsReadOnlyGlobal"xx";
statements, in two ways.
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
local variables of the same names exist.
Second, the variable>")
rather than being written directly into the statements.
<P/>
Note Variable: 'xx' is read only
<Ref Funcnotinany
deal with the <E>global namespace</Eread-valloop ..


<ManSection '' outer,or
<Func Name="IsReadOnlyGlobal" Arg='name'/>

<Description>
<true/>java.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 77
read-only and <K>false</K> otherwise (the default).
</Description>
</ManSection>


<ManSection>
<Func Name="MakeReadOnlyGlobal" Arg='name'/>

<Description>
marks the global variable named by the string <A>name</A> as read-only.
<P/>
A warning is given if <A>name</A> has no value bound to it or if it is
already read-onlygap> IsReadOnlyGlobal(xx;
</Description>
</ManSection>


<
<Func Name="MakeReadWriteGlobal" Arg='name'/>

java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 13
marks the global variable named by the string <A>name</A> as read-write.
<P/>
A warning is java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 14
<P/>
<Log><![CDATA[
gap> xx := 17;
17
gap>IsReadOnlyGlobal("xx")
false
gap> xx := 15;
15
gap> MakeReadOnlyGlobal>
ap : 16;
Variable: 'xx' is read only
not in any function
Entering break read-java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 0
returnsthe  currently  globalvariable named by the
you can 'return;' after making it writable to continue
brk> quit;
gap> IsReadOnlyGlobal("xx");
true
gap> MakeReadWriteGlobal("xx");
gap> xx := 16;
16
gap> IsReadOnlyGlobal("xx");
false
]]></Log>
</Description>
</ManSection>

<#Include Label="MakeConstantGlobal">

<ManSection>
<Func Name="ValueGlobal" Arg='name'/>

<Description<
java.lang.StringIndexOutOfBoundsException: Range [0, 7) out of bounds for length 0
string <A>name</A>. An error is raised if no value is returnsK</K> valuebound
</Description>
</ManSection>


<ManSection>
<Func Name="IsBoundGlobal" Arg='name'/>

<Description>
returns <K>true</K> if
to the global variable named by the string <A<java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
</Description>
</ManSection>


<ManSection>
<Func Name="UnbindGlobal" Arg='name'/>

<Description>
removes any value currently bound
to the global variable named by the string <A>name</A>. Nothing is returned.
<P/>
A warning is given if <A>name</A> was not bound. The global variable named
by <A>name</A> must be writable, otherwise an error is raised.
</Description>
</ManSection>


<#Include Label=" warning is given if <AA not .The  named


<ManSection>
<Func Name="NamesGVars" Arg=''/>

<Description>
This function returns an immutable
(see <Ref Sect="Mutability and Copyability"/>)
sorted (see <Ref Sect="Sorted Lists and Sets"/>) list of all the global
variable names known to the system.  This includes names of variables
which were bound but have now been unbound and some other names which
have never been bound but have become known to the system by</anSection
routes
</Description>
</ManSection>


<ManSection>
<unc Name""Arg='>

<Description>
This function returns an immutable sorted list of all the global
variable names This function returns an 
</Description>
<ManSection


<ManSection>
<Func Name="NamesUserGVars" Arg=''/>

<Description>
This function returns an immutable sorted list of the global variable
names created since the library was read, to which a value is
currently bound.
</Description>
</ManSection>

java.lang.StringIndexOutOfBoundsException: Range [68, 25) out of bounds for length 25

</Section>


<!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
<Section Label="Namespaces">
<<>

As mentioned in Section <Ref Sect="More About java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
above all global variables share Func ="'/>
relatively easily lead to name clashes, in particular when many
&GAP; packages are loaded at the same<
a way to have a package local namespace without breaking backward
compatibility of the &GAP; language, the following simple rule has
been devised:
<P/>
If in package code a global variable that ends with an
<>atQ>- <<><C>is accessed in any ,the name of 
package is appended before accessing it. Here, <Q>package code</Q>
refers to everything which is read with <Ref Func="ReadPackage"/>.
As the name of the package the entry <C>PackageName</C> in its
<F>PackageInfo.g</F> file is taken. As for all identifiers,
this name is case sensitive.
<P/>
For example, if the following is done in the code of a package with name
<C>xYz</C>:

<>!CDATA[
gap> a@ := 12
]]>
</Log>

Then actually the global variable <C>a@xYz</C> is assigned. Further
accesses to <C>a@</C> within the package code will all be redirected
to <C>a@xYz</C>. This includes all the functions described in Section
<Ref Sect="More About Global Variables"/> and indeed all the functions
java.lang.StringIndexOutOfBoundsException: Range [28, 9) out of bounds for length 68
for example <Ref Func="DeclareCategory"/>. Note that from code in the
same package it is still possible to access the same global variable
via <C>a@xYz</C> explicitly.
<P/>
All other code outside the package as well as interactive user input
that wants to refer to/java.lang.StringIndexOutOfBoundsException: Range [13, 12) out of bounds for length 13
by java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
<P/>
Since in earlier releasesjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
was not
xtension of language  .

</Section>


<!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
<Section Label="Function">
<<>

<Index Subkey="definition of">functions</Index>
<Index Key="end"><K>end</K></Index>
<ex"ocal"<>/>/java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
<Index>recursion</Index>
<IndexSubkey="recursive">functions</Index>
<Index>environment</Index><Index>body</Index>
<C>function( [ <A>arg-ident</As the name of the package the<>PackageName/
<P/>
<C&&;<loc<A ,<loc<A> ;<java.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 68
<P/>
<>&<java.lang.StringIndexOutOfBoundsException: Range [33, 28) out of bounds for length 36
<P/>
<C>end</C>
<P/>
A function
literal 
java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 10
Later this function can be called as described in <Ref Sect="Function Calls"/>.
<P/>
The following is an example of a function definition.  It is a function
bonacci"/).
<P/>
<Example><![CDATA[
gap> fib := function ( nsame package it isstill possible to access the java.lang.StringIndexOutOfBoundsException: Range [59, 52) out of bounds for length 68
>     local f1, f2, f3, i;
>     f1 := 1; f2 := 1;
>     for i in [3..n] do
>       f3 := f1 + f2;
>       f1 := f2;
>       f2 := f3;
>     od;
>     return f2;
>  ;java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
gap>List 1.10],fib )
[ 1, 1, 2, 3, 5, 8, 13, e ofthe  doesjava.lang.StringIndexOutOfBoundsException: Range [54, 34) out of bounds for length 54
]]></Example>
<P/>
Because for each of the formal arguments <A>arg-identSection Label="unction">
formal locals <A>loc-ident</A> a java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 0
is called (see <Ref Sect="Function Calls"/>),
it is possible that a function calls itself.
  usually called <><E.
The following is a recursive function that computes values of the Fibonacci
sequence.
<P/>
<Example><![CDATA[
ap  
>     if n < 3 then
>       return 1;
>
    return n-) +n2)java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
>     fi;
>   end;;
gap> List( [1..10], fib );
<</java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
]]></Example>
<P/>
Note that the recursive version needs <C>2 * fib(<A>n</A>)-1</C> steps
to  <C>fib(A>n<A></>
while the java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 4
Both are not optimal however, the library function <Ref Func="Fibonacci"/>
only needs about <C>Log(<A>n</A>)</C> steps.
<P/>
<Index Subkey="with a variable number of arguments">functions</Index>
<="arg Subkey=special function "<C><C</>
As noted in Section <Ref Sect="Function Calls"/>,
to computevalues of the Fibonaccisequence (see <ef ="Fibonacci"/).
It providesP>
.  java.lang.StringIndexOutOfBoundsException: Range [25, 24) out of bounds for length 66
first ones are assigned to the new variables corresponding      f1   ;
formal arguments before the last argument, if any. The values of all the
remaining actual arguments are stored  in  a  list
and this list is assigned to 
argument. There are  two  typical>      f2 =f3;
possibility:  having  optional  arguments  and  having  any   number   of
arguments.
<P (1.] );
                
<Ref Oper="Position"/> might be encoded  and  demonstrates  the
<Q>optional argument/
<P/
<formal <loc</>anew  when  
gap> position := is called (see <Ref Sect="Function Calls"/>),
>     local  a.
>     if 0 = Length(arg) then
>       pos :  java.lang.StringIndexOutOfBoundsException: Range [38, 37) out of bounds for length 75
>     else
>       pos := arg[1];
>      : function  )
>     repeat
>       pos := pos +java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 17
>       if pos > Length>returnn- +n2)
>         return fail;
>       fi;
>     until list[pos] = obj;
>     return pos;
>    end;
function( list,]<java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
gap> position(1,4,2,4;
2
gap> position([1, 4, 2], 3);
fail
gap> position([1, 4, 2], 4, 2);
fail
]]></Example>
<P/>
The following  example  demonstratesthe  <>  number  of  arguments/Q>
scenario.
<P/>
<Example>!CDATA[
gap> sum := function ( l... )
>     local totalIndex Key="arg" Subkey="special function argument"><C>arg</C></Index>
>     total := 0;
>     forxin ldo
>       total := total + x;
>     od;
>     return total;
>    end;
  java.lang.StringIndexOutOfBoundsException: Range [15, 14) out of bounds for length 65
gap> sum(1, 2, 3);
6
gap  is    
10
gap> sum();
0
]]></Example>
<P/>
The user         function
which, for example =""    and  the
n elementwhich should the sum of an empty list return?).
<P/>
GAP will also special case a function with a single argument with the name
<C>arg</C> as function with a variable length list of arguments, as if the
user had written <C>arg...</C>.
<P/>
Note that if a function <A>f</A> is defined as above
>   java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
minus the number of formal arguments (java.lang.StringIndexOutOfBoundsException: Range [0, 47) out of bounds for length 9
(see <Ref Oper="NumberArgumentsFunction"/>).
<P/>
Using the <C>...</C() then
named argument tells &GAP; that when it encounters <A>f</A> that it should
form a list out of the arguments of <A>f</A>.
What if one wishes to do the <Q>opposite</Q>:
tell &;thata should  <Q>java.lang.StringIndexOutOfBoundsException: Range [46, 45) out of bounds for length 71
arguments to a function.
The function <Ref Oper="CallFuncList"/> is provided for this purpose.
<P/>
Also see Chapter Ref Chap=Functions"/>.
<P/>
<Index Subkey="definition by arrow notation">functions</Index>
<Index>arrow notation gap>(1 4 ] 4 2
<C>{ <A>arg-list</A> }]>/>
<P/>
This is a shorthand for
</
<C>function ( <A>arg-list</A>java.lang.StringIndexOutOfBoundsException: Range [9, 8) out of bounds for length 18
<P/>
<A>arg-list</A> is a (possibly empty) argument list. Any arguments list
which would be valid for a normal GAP function is also >for xin l do
variadicarguments)
<P/>
The following gives a couple of examples of a typical      total;
</>
<Example><![CDATA[
gap> Sum( List( [ (,2 
338350
gap> list := [3, 5, 2, 1, 3];;
gap> Sort(list, {x,y} -> x > y);
gap> list;
[ 5, 3, 3, 2, 1 ]
gap> f := {x,y]><Example
gap</
[ 2, 3, 4 ]
gap> f := {} -> 2;
function(  ) ... end
gap> Print(f);
function (  )
    return 2;
end
gap> f();
2
]]></Example>
</>
The <C>{</C> and <C>}</C> may had written<>rg../C>
functions with one argument:
<xample!CDATA[
gap> Sum( List( [1..100then<(<A>/><
338350
gap> Sum( List( [1..100], x -> x^2 ) );
338350
]]></ExampleP>

<P/>
the function<>/>is another
function <A>fun2</A>,
&GAP; binds all the identifiers inside the function <A>fun1</A> that
are identifiers listbe<unwrapped/> several
variable.
This set of bindings  Ref ""/is forthis purpose.
When <A>fun1</A> <P>
The Also see Chapter <Ref Chap="Functions"/>.
Values can be pushed onto P/
The thing is   <push<C>and <popCjava.lang.StringIndexOutOfBoundsException: Index 75 out of bounds for length 75
in the record returned by <C>Stack</C> java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 41
of <C>Stack</C>.
When <C>Stack</C> is called, a new variable for the identifier <C>stack</C>
is created.
When the function definitions of <C>push</C> and <C>pop</C> are then
A>list<>is a (possibly). list
<></>is bound to this newvariable.
Note alsovariadic arguments).
because each call of <C>Stack</C> creates a new variable for <C>stack</C>.
<P/
<Example><![CDATA[
gap> Stack := function()
>     local  stack;
>    stack : ];
>     return rec(
>       push := function( value )
>         Add( stack, value );
>       end,
>       pop := function()
>         return Remove( stack) ;
>       end
>     );
>  end;;
gap> A := Stack();;
gap> B := Stack();;
 push( ;A.ush( 2 ); A.push( 3 );
gap> B.push( 4 ); B.push( 5 ); B.push
gap> A.pop(); A.pop(); A.pop(  ;
3
2
1
gap> B.pop(); B.pop(); B.pop();]<Example>
6
5
4
]]></Example>
<P/>
This feature should be used rarely, since its implementation in &GAP; is
  .

</Section>


<!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
<Section Label="Function Calls">
<Heading>Function Calls</Heading>

<Subsection Label="Function Call With Arguments">
<Heading>Function Call With Arguments</Heading>

<C><A>var<> <><A[ A>-java.lang.StringIndexOutOfBoundsException: Range [55, 54) out of bounds for length 71
<P/>
The  call has the effect of calling the function <A>function-var</A>.
The precise semantics are as follows.
</
First &GAP;  the record returnedStackC   <>/>
Usually <A>function-var</A> is a variable,
and &GAP; does nothing more than taking the value When the function definitions of <C>push</C> and <C>pop</C> are then
It is allowed though that <A>function-var</A> is a more complex expression,
such as a reference to an element of a list
( n; "ists/>)
<C><A>list-var</A>[<A>intbecausecall  <>/  new <stackC.
or to a component of a record (see Chapter <Ref Chap="Records"/>)
<C><A>record-var</A>.<A>ident</A></C>.
In any case localstackjava.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
If it is not,java.lang.StringIndexOutOfBoundsException: Range [13, 12) out of bounds for length 33
<P/>
<Index Subkey="with a variable number of arguments, calling">pop=java.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 25
< "rg" =argument "<arg/>/java.lang.StringIndexOutOfBoundsException: Range [84, 83) out of bounds for length 84
Next &GAP; checks that the number of actual arguments <A>arg-expr</A>s agrees
ith  number of <>ormalarguments<E>as givenin the function
If gap> B: Stack);;
An exception is the case when the function has a variable length argument list,
which is denoted by adding <C>...</C> afterthe final argument.
In this case there must be at>B.( 4) B.push  ) Bpush(6 )
actual  as thereare formalarguments<E>before the
final argument</java.lang.StringIndexOutOfBoundsException: Range [0, 17) out of bounds for length 1
(see <Ref Sect
</>
Now &GAP; allocates for each formal argument and for each <E>formal local</E>
(that is, the identifiers
emember that a  is a locationin a&AP;program
lue. Thus for  each formalargument and for each
formal local such a location not veryefficientjava.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
<P/>
Next the arguments <A>arg-expr</A>s are evaluated
and the values are assigned
to the newly created variablesjava.lang.StringIndexOutOfBoundsException: Range [72, 44) out of bounds for length 72
course the first value is assigned to the new variable corresponding <>Function<Heading>
the first formal argument, the second  value  is assigned to the new
variable corresponding  to  the second  formal argument, and  so on.
An exception again occurs if the last formal argument has
the name <C>arg</C>. In C><A>function-var</A>( [<A>argA>,<>rg-<A,..])/C>
arguments not assigned to the other formal parameters are
stored in  a list and this  list is assigned to the  new java.lang.StringIndexOutOfBoundsException: Range [0, 65) out of bounds for length 46
corresponding to the formal argument <C>arg</C>.
<P/>
The new variables corresponding to the formal locals are initially not
bound to any  value.  So trying  to evaluate those  variablesand &GAP; does nothing more than taking the value of this variable.
somethinghas been assigned to them will signal an error.
<P/>
Now the body of the (see Chapter <Ref Chap=>)
identifier of one of the formal arguments or formal locals appears in the
body of the function it refers to the new variable that was allocated for
this formal argument or formal local, and evaluates to the value of this
variable.
<P/>
If during the execution of the body of the <=with a variable number   calling">functions</Index>
with an expressionIndex = java.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 84
is executed, execution of the body is
terminated and the value of the with the number of <E>formal arguments E /    java.lang.StringIndexOutOfBoundsException: Index 79 out of bounds for length 79
expression of the <K>return</K>. If An exception is the case when the functiona variablelengthargumentlist,
<java.lang.StringIndexOutOfBoundsException: Range [31, 2) out of bounds for length 75
body is terminated and the function call does not produce a value, in
which case we call this call a procedure call (see <Ref Sect="Procedure java.lang.StringIndexOutOfBoundsException: Index 74 out of bounds for length 60
If the final argumentargument<E and can beany larger number
, the function call again producesno value, and again we talk
about a procedure call.
<P/>
<[
gap> Fibonacci( 11 );
89
]]></Example>
<P/>
The above example shows a call to the function <Ref Func="Fibonacci"/> with
actual argument <C>11</C>, the followingNextthe arguments<>-xpr</A> are    to right,
<Ref Func="RightCosets"/> where the second actual argument is another
function call.
<P/>
<Log><![CDATA[
gap>RightCosets( G,Intersection(U,V));
]]></Log> the first valueis assigned to thenew variable corresponding to

<Subsection


<Subsection Label="Function Call With  exception again occurs if the last formal
<>Function  With java.lang.StringIndexOutOfBoundsException: Range [44, 35) out of bounds for length 45

<<A>arg-expr<A,...]   A>-</>[,<A>option-expr</A>, ...]])C
<P/>
As well as passing arguments to a function, providing the mathematical
input to its calculation, it is sometimes useful  to the formal  
to &GAP; how the desired result may be computed more
uickly,or specifyinga level of tolerance for random errors in a
Monte Carlo algorithm.
<P/>
Such hints may be supplied to a function-Now the body of  function which is a statement,is executed. If the
functionscalledfrom thatcall< mechanism.Options
are separated from the actual arguments by a colon <body of it  the  for
the same this formal argument or formal local, and evaluates to the value of this
exception to this is that a component name may appear without a value,
in which case the value <K>true<P/java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
</
Options are evaluated from left to right, but only after all arguments have been evaluated.
<P/>
  to Ref="/   options
<C>hard</C> (with the expression of the <K>return</K>. If during the execution of the body a
and <C>K>return</K> statement an   executed,execution  of 
</java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
<Log><![CDATA[
gap> Size( fpgrp : hard, tcselection := "external" );
]]></Log>
java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 4
Options supplied with function in this are  
the global options  .
so that the call above is exactly equivalent to
<P/>
<Log><![CDATA[
gap>]<>
gap> Size( fpgrp );
gap> PopOptions( );
]]>/Log
<P/>
<></>that any option maybe passed with, 
it has any Ref Func="RightCosets"/> where the second actual argument is another
it. The system provides no safeguard 

</Log<CDATA
</Section>


<!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
<Section Label="Comparisons">
<Heading>Comparisons</java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 0

<Index>equality test<
<C>>expr<>=<-java.lang.StringIndexOutOfBoundsException: Range [36, 35) out of bounds for length 43
<P/>
<
<C  itsjava.lang.StringIndexOutOfBoundsException: Range [25, 24) out of bounds for length 71
<P/>
The C></   ofitstwo  to
<K>true</K> if they are equal and ,ora    a
Likewise <C><></C> tests for java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 4
For each type of functions called from that call</E> using the options mechanism. Options
java.lang.StringIndexOutOfBoundsException: Range [44, 45) out of bounds for length 19
  snbspRef =Families/) ,
i.e., <C>=</C> evaluates thata component   value
< java.lang.StringIndexOutOfBoundsException: Range [14, 13) out of bounds for length 57
<Index>smaller test</Index>
<>-</>&;<><A<
<P/>
<Index>larger   java.lang.StringIndexOutOfBoundsException: Range [28, 27) out of bounds for length 76
<>left<>> >/>/>
<P/>
<smaller </>
<C><A>left-expr</
<P/>
<Index>larger or equal</Index>
<= <A>right/>/
<P/>
<C><</C> denotes less than, <C><=<>
r than or equal of its two operands.
For each kind of objects the definition of the ordering is given in the

</
Note/
can be used for example to sort a list of elementsLog<!CDATA[
<java.lang.StringIndexOutOfBoundsException: Range [53, 2) out of bounds for length 76
tested using <Ref Oper="IsSubset"/>). (gap>PopOptions )java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
example, it is possible to compare permutation groups with <C</
total orderingofall permutationgroups,not
compatible with the relation of being ait has any actual meaningfor thatfunction,or anyfunction called
<P/java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
<#Include Label="[
<P/>
Comparison operators/>
(see <Ref Sect="java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 0
are not associative,
Henceit notto C<>/  <>/>&; <><> <>d/<C,
you must use <C>(<A>a</A> = <A>b</A>Heading>Comparisons</Heading>
The comparison operators have  higher precedence than the logical operators
<Index Subkey="precedence">operators</Index>equality  test</ndex>
( <Ref Sect"perations  ")but  java.lang.StringIndexOutOfBoundsException: Range [80, 79) out of bounds for length 90
operators (see <Ref Sect="Arithmetic Operators"/>).
,instance <><><A  Ab<  Ac/>and<><<C> as
<(>a  A<A>=A<A> <><)/>
<P/>
Thefollowingexample shows a comparison wherethe left operand is an
expression.
<P/>
<Example><![CDATA[
gap 2  2+  ()java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
true
]]></Example>
P>
For the underlying operations Objects in differentfamilies(ee&bsp;Ref ="amilies/) are never equal,
see&;<ef Sect=ComparisonOperationsfor Elements/.

</Section>


<!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
<=Arithmetic>
<Heading>Arithmetic Operators/

<Index><C><A>left-expr</<>ight-expr</A></C>
<Index>associativity</Index>
<Index Subkey="arithmetic">operators</Index>
<Index Key="+"><C>+</C></Index>
<Index Key="-"><C>-</C>C>A>-<A &;= <right-xpr/>/>
<Index Key="*"><C>*</C></Index>
<Index Key="/p>A>expr/> > >-</<C
<Index Key="^"><C>^</C></Index>
<Key=" Subkey"java.lang.StringIndexOutOfBoundsException: Range [36, 35) out of bounds for length 65
<Index>modulo</Index>
<ndex Subkey="arithmetic operators">modulo</Index>
<Index>positive number</Index>
<Fo each  ofobjects the definitionof the ordering is givenin the
</>
<> </>
  C&<>a<> />  (java.lang.StringIndexOutOfBoundsException: Range [74, 75) out of bounds for length 74
<P/>
<Index;<C>will  be compatible with anyinclusion  (hich be
<C><A>left-expr</A> + <A>right-expr</A></C>
<P/>
<Index>subtraction</Index>
<>Aleft-/>-<>-<A>/>
<P/>
<Index>multiplication</Index>
<C><A>left-expr</A> * <A>right-expr</A></C>
<P/>
<>division/Index>
<C><A>left-expr</A> / <A>right-expr</A></C>
<P/>
<Index Key="mod"><K>mod</K></Index>
<C><A>left-expr</A> mod <A>Comparison operators, including operator <>n</K>
</>
<Index>power</Index>
<C><A>left-expr</A> ^ <A>right- is to <C>>aA =b<>&;<><A  Ad<>Cjava.lang.StringIndexOutOfBoundsException: Index 86 out of bounds for length 86
<>
The arithmetic operators are <CThe       
<KIndex =><>
The meanings (semantics) see; =for")  
of the operators (see <Ref Sect="Arithmetic Operators"/>).
and they are defined in the Thus, for instance, <C><A>a</A> * <A>b</A> = <A>c</A> and <A>d</A></C> is interpreted as
However basically the meanings are as follows.
<P/>
<C><C>((<A>a</A> * <A>b</A>) = <A>c</A>) and <A>d</A>)</C>.
<P/>
<><a<A>- A>/>/  the of A>a/    of</>
<P/>
<C>Aa<  A>/>/> multiplication of  elements A><A 
<A>b</A>.
<P/>
<C><A>a</A> / <A>b</A></C> denotes the multiplication of <A>a</A> with the <P/>
inverse of <A>b</A>.
<P/>
<Index Subkey="rationals">mod</Index>
<C><A>a</A> mod <A>b</A></C>java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
integer right
If <<java.lang.StringIndexOutOfBoundsException: Index 77 out of bounds for length 77
integer  ="rithmetic Operators"
for<> /
over
</
<Index<Index
<>/< prime/java.lang.StringIndexOutOfBoundsException: Range [53, 52) out of bounds for length 53
If <A>a</A> is a Index Key="-"><C>-</C></Index>
and <C><A>a</A> = <A>m</A> / <A>n</A></C> where <A>m</A> and <A>n</A> are
coprime integers  with  <A>n</A>  positive,  thenIndex ""C></C></Index>
<C><A>a</A> mod <A>b</A></C> is the integer <Index=mod = java.lang.StringIndexOutOfBoundsException: Range [46, 45) out of bounds for length 65
<C>0 .. |<A><Index Subkeyjava.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 51
such that <A>m</C><>-xpr/<>
and <A>r</java.lang.StringIndexOutOfBoundsException: Range [0, 11) out of bounds for length 4
<Q>odular</Q>of <><A>modulo <><A.
Also,  <C>1  /  <A>n</A>  mod  <A>b</A></C>  is
called the <Q>modular inverse</Q> of <A>n</>/java.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 23
(A pair of integers is said to be <P>
if their greatest common divisor is 1.)
<P/>
With>/>
  exists (is to 22,
despite the fact that 6 has no inverse modulo 32.
<P/>
<E>Note:<P/>
For rational <A>a</A>, <C><<ndex>division/>
  ->|<C
such that <C><A>a</A> - <A>c</A></C> is a multiple of <A>b</A>.
However this definition is seldom useful and <E>not< Key""<Kmod<K<Index
 for &;java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
<P/>
<C>+</C> and <C>-</C> can also be used as unaryP>
The unary<></ ignored. The unary <>-</>returns the additive inverse of
its operand; over the integers it is equivalent to multiplication by <C>-1</C>.
<K><K, C></>
<ex="ortwo   =^>C^/></Index>
<Index Subkey="with a groupof  operands involved,
<C>of a multiplicative element if the right operand  is
an integer, and is also used to denote the action of aHowever basically the meanings are as follows.
point of a set if the right operand is a group element.
In the C><A>a</A> >b//>   additive <a/ <b/>
<><  , ,
<M>g</M><C>^</C><M>h = h^{{-1}} g h</M><>A><A> <b</<C   Aa</> additive <b/java.lang.StringIndexOutOfBoundsException: Index 97 out of bounds for length 97
<P/>
<Index Subkey="precedence">arithmetic operators</Index>
The Eprecedence/E>of  operators is as follows.
The powering operator <C>^</C> has the highest precedence,
followed by the unaryC<a/  Ab/>C the  A>/   
inver <>b</A>.
<K>mod</K>,
and the additive binary Index Subkey="rationals">mod</Index>
precedence.
    C>2 ^2*3 + <C 
interpreted as <C>(-(2 ^ (-2)) * 3) + 1</C>integer right operand <A>b</A>, is defined as follows.
to If <A><A> and Ab<> areboth integers <>>a/>mod <>/>/>is the integer <></>in 
<P/>
<Index Subkey=associativity">operators</Index>
The <E>associativity</E> of the arithmetic operators is as follows.
<fo some integer Aq/>( the operations occurringhavetheirusualmeaning
java.lang.StringIndexOutOfBoundsException: Range [8, 3) out of bounds for length 77
The unary operators <C>+</C> and <C>-</C> are right associative,
because they are written to the left of their java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 4
< left
associative,
i.e., <C><Index>coprime<Index<>relatively prime<Index
Again,ifin doubt useparenthesestoclarify your.
<P/>
The arithmeticoperatorshavehigher precedence comparison
operators (see <Ref coprime integers  with  <A>n<positive,  then
&bsp;<Ref Sect="Membership Test for Collections"/>)
and the logical operators (see <Ref Sect="Operations for Booleans"/>).
Thus,for ,
<C><A>such that <></> is congruent <><>r<A><>n/A <><A,
<C>((<A>a</A> * <A>b</A>) = <A>c</A>) and <A>d</A></C>.
<P/>
<Example><![CDATA[
gap> 2 * 2 + 9;  # a very simple arithmetic expression
13
]]></Example>
<P/>
For other arithmetic operations, and for the underlying operations of
the operators introduced above,
see <Ref Sect="Arithmetic Operations for Elements"/>.

</Section>


<!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
<Section Label="Statements">
<Statements<>

<ndexexecution/ndex>
&GAP; programs consist of a sequence of so-called  <E>statements</E>.
   of  :
<List>
  <> s &bsp;RefSect=">,/>
  <Procedure  sSectionn; =" ")<Item>
  >Kif/>( &< =If"/>),</Item>
  <Item><K>while</K> loops (see Section <Ref Sect="While"/>),</Item>
  <Item><K>repeat</K> loops (see Section <Ref Sect="Repeat"/>),</Item>
  <Item>>Kfor/> (ee&<java.lang.StringIndexOutOfBoundsException: Range [48, 47) out of bounds for length 69
  <Item><K>java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 4
  <<continue<K> (ee &<Sect"ontinue/) and<
  <Item><K>return</K> statements (see Section <Ref Sect=andhence  a   
</List>
They can be entered interactively>
<Note<E
<P/>
,unlike ,have  .Theyare   to
produce an effect. For example an to thenon-egative  <Ac/   C|Ab<A>/>
a  value to a variable, a <K>for</K> loop  has the effect of executing a
sequence    ina list and so on.
We will talk about this  is seldom  <></>
ut  E></   to emphasizethis .
<P/>
Using expressions as <C>+</C> and <C>-</C> can also  operations.
java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 4
<>![
gap> i := 7;;
gap> if i</
Syntax errorIndexSubkey"or group elements" Key="^"><C>^</C></Index>
if i <> 0 then k = 16/i; fi;
                 ^
gap>
]>/>
<P/>
As youcansee the      address
those users who are used to languages^/C> ,that is,is,
denotes.
<P/>
Empty statements are permitted and <>
</>
A E><E   isas.
occur everywhere instead of a single statement.
Eachconstruct  terminatedby keyword
The simplest statement sequence is followed bythe  C+/>and <>-/>
java.lang.StringIndexOutOfBoundsException: Range [39, 4) out of bounds for length 63
sequence as in <C>for i inandthe   C+/> <-<>havethe
silently translatedThat meansthatthe <-  -*3+<C>is



<!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
<Subsection Label="Assignments">
<Heading>Assignments</Heading ="operators/>

IndexSubkey""/java.lang.StringIndexOutOfBoundsException: Range [43, 42) out of bounds for length 43
<<varA : A><A;/>
<P/>
The</E>   of thevalueofthe
<A>expr</A> to the variable <A>var</A>.
<P/>
he <><A>maybe an  
(see <Ref Sect="Variables"/>),
a list element selection <C><A>list-var</A>[<A>int.e. <1--<    C(-2)<>not <>1(-)/>
( <ef =ListAssignment/)or record  
<C><A>record-var</A>.<A>ident</A></C> 
 list elementor       a
 or record the  sideof an   
complex.
<P/>
Note that variables do not have a type. Thus any value may be assigned
to any variable.  For example a variable with an Thus,forexample,
java.lang.StringIndexOutOfBoundsException: Range [18, 8) out of bounds for length 50
>
<Example><![CDATA[
gap> data:= rec( numbers:= [ 1, 2, 3<><[[
rec( numbers := [gap>   +9;#a   expression
gap> data.stringjava.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
rec( <>
gap> data.numbers[2]:= 4;; data;
rec( numbers := [java.lang.StringIndexOutOfBoundsException: Range [69, 20) out of bounds for length 69
]<>
<P/>
If the expression/>
return a value.  If the function does not return a value an error is
signalled and you enter a break loop (<!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
As usualyou  leave break    with <>;/>
If you enter <C>return <A>return-expr</A>;</C> the java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 0
<A>return-&GAP; programs    socalled<><E.
and execution continues after the assignment.
<P/>
<Log><![CDATA[
java.lang.StringIndexOutOfBoundsException: Range [29, 3) out of bounds for length 58
gap> f2:= function( x ) return f1( x ); end;;
gap>f2 4 )
value: 4
FunctionCalls: <func> must a value at
return f1( x );
 called from
<function>( <arguments> ) called from read-eval-<tem><K>repeat</K> loops (see Section <Ref Sect="Repeat"/>),</Item>
ntering  readeval-  .java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
you can 'quit;' to   Itemcontinue/ (&; =">,and<Item>
youcan supplyone by 'eturn<value>'to continue
eturn"hello"
"hello"
]]<Log>
<P/very statementmust be terminatedby a semicolon.
In </>
<C>4</C>,
and <>1<>   a (utprintsjava.lang.StringIndexOutOfBoundsException: Range [67, 68) out of bounds for length 67
<Q><C>value:avaluea,<>or/>  hasthe  java.lang.StringIndexOutOfBoundsException: Range [72, 73) out of bounds for length 72
the K></>statement of <>f2</> cannot be executed.
The about Eevaluation<>of expressions
and the returned string <C>"hellobut about <E>execution</E> of statements to emphasize this difference.
missing return value of <C>f1</C>.

</Subsection>


<!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
<cedure Calls>
<Heading>Procedure <Heading>Procedure Calls

<Index>procedure call</Index>
<Index>call with arguments</ndex>
<C><A>procedure-var</A>g>if i < 0 thenk=16/;fi
<P/>
The <E>procedure call</E> has  the  effect  of calling  the procedure
<A>procedure-var</A>.  A procedure call is done exactly like a function call
(see <Ref Sect=Function Calls">)
The distinction between functions and procedures is only for the sake of the
discussion, &GAP; does not distinguish java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 4
So we state the following conventions.
<P/>
A <E>function</> does  a  but does
a convention the nameof a function is a noun, denoting whatthe function
returns, e.g., <C>"Length"</C>, <C>"java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 19
<P/>
A Eprocedure<E isafunction thatdoes not return a value but produces
some  effect. Procedures are called  only for  this effect. As  a
convention the name of a procedure is a verb, denoting what the procedure
does,e.., <>"Print"/C> C"Append"/C>and C>Sort</>java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62
<P/>
<Log><![CDATA[
gap> Read( "myfile.g"constructis terminated by  keyword.
[ 1,2];java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
 Append
java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
</>
There are a few exceptions java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
a value and produce some effect.
An example is <Ref Oper="Sortex"/> which sorts a list
andto<</>and thereis K/>,  java.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 68

<>


<!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
<Subsection Label="If">
<Heading>If</Heading>

<Index Key="fi"><K>fi</K></Index>
<Index Key="then"><K>then</K></Index>
<Index Key="else"><K>else</K></Index>
<Index Key="elif"><K>elif</K></Index>
<> A-</A> then </>  A-<A><</ }<>java.lang.StringIndexOutOfBoundsException: Range [120, 119) out of bounds for length 133
<Index Key="if statement"><K>if</K> statement</Index>
<P/>
The <K>if</K> statement allows one to execute statements depending on the
value of some boolean expression. The execution is done as follows.
<
First the java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 4
If it evaluates to <K>true</K> the statement sequence <>
after the first <K>then</K> is executed,
and the execution of the <K>if</K> statement is complete.
<P/>
Otherwise the expressions <A>bool-expr2</A> which would, even if legal syntax, be  meaningless, since the <K>if</K>
evaluated in turn.
There may be any numberof <>lif<K>parts,possiblynoneat all.
As soon as an expression evaluates to <K>true</K> the corresponding statement
sequence <A>statements2</A> is If one of the expressions <A>bool-expr1</A>, <A>bool-expr2</A> is evaluated
statementand its  is  K></> K><> anerror  
<P/>
fthe <>if/>expression and all,if any,<>elif<K>expressions evaluate
to <K>false</K> and there is an <K>else</K> part, which is   can  break C>;<.
its statement sequence <A>statements3</A> is  theK</> statement  as ifthe java.lang.StringIndexOutOfBoundsException: Range [68, 67) out of bounds for length 73
K>/> is 
If there is no <K>else</K> part the <K>ifIf there is no <K>K>if/K>statement continues as if the expression
executing any statement sequence.
<P/>
Since the <K>if</K> statement is terminated by the <K>fi</K> keyword
there is no question where an <K>else</K> java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 18
.,&GAP;has no <Q>dangling else<Q>
In
</java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
<><!CDATAjava.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
ifexpr1 then if expr2thenstats1 else stats2 ;fi
]]></Listing>
<P/>
the <K>else</K> part belongs to the second  <K>if</K> statement, whereas in
</>
<Listing><![CDATA[
if expr1 then if expr2 then stats1 fi; else stats2 fi;
]]></Listing>
<P/>
the <K>else</K> part belongs to the first <K>if</K
<P/>
Since an<K>if<K statementisnot an expressionit  not possibleto write
<P/>
<CDATAjava.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
abs := if x > 0 then x; else -x; fi;
]]></Listing>
<P/>
even  legal syntax,be  meaningless, sincethe <>f<K>
statement does not produce a <ndexKeywhile loop><K></>loop<Indexjava.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49
</java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
</
and itsThe Kwhile/> loopexecutes thestatementsequence <A>statements</A> while
and a break loop (see <Ref Sect="Break Loops"/>) is entered.
As usual youcanleave   break  with<quit</C>
If you enter <C>return true;</C>,
execution continues as if theexpression whose
evaluation  failed had evaluated to <K>true</K>.
Likewise,if youenter C> false;/C>
execution of the <K>if</K> statement continues as if the expression
whose evaluation failed had evaluated to <K>false</K>.
<P/>
<Example><![CDATA[

gap> if 0 < i then
>    s := 1;
>  elifP>
>    s : -;
>  else
>    s := 0;
>  fi;
gap> s;  # the sign of i
1
]]></Example>

</Subsection>


<!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
<Subsection Label="iteration.
<Heading>While</Heading>

<Index Subkey="while">loop</Index>
< <Kwhile</>loop</ndex>
<C>while <A>bool-expr</A> do <A>statements</A> od;</As usualyou canleavethebreak   <C>;/>java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56
<P/>
The <K>while</K> loop executes the statement sequence <A>statements</A> while
the condition <A>bool-expr</A> evaluates to <K>true</K>.
</>
First <A>bool-expr</A> is evaluated.
If it evaluatesto K>/>execution of the K></>loop terminates
and the statement immediately following the <K>while</K> loop is executed
java.lang.StringIndexOutOfBoundsException: Range [4, 5) out of bounds for length 4
Otherwise if it evaluates to <K>true</K> the
<A>statements</A> are executed and the whole process begins again.
<P/>
The difference  od;
and the <K>repeat</K> <K>until>sjava.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
is that the <A>statements</A> in the <K>repeat</K]><Example>
executed 
areA <>hile/>loop maybeleft prematurely K><K>
see< =Break">.
<P/>
If <A>bool-expr</java.lang.StringIndexOutOfBoundsException: Range [0, 18) out of bounds for length 13
is signalled and a break loop (see <Ref
As usual you can leave the break loop with <C>quit;</C>.
If you enter <C>return false;</C>,
execution continues with the next statement immediately java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
<K>while</K> loop.
java.lang.StringIndexOutOfBoundsException: Range [30, 2) out of bounds for length 75
after which the next evaluation of <A>bool-expr</A> may cause another errorKey="epeat "<K></>loop<Indexjava.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
<P/>
The following example shows a <K>while</K> loop that sumsThe <K>repeat</> loop executes statement  <A>tatements<A>
<M>1^2, 2^2, \ldots</M> until the sum exceeds <M>200</M>.
<P/>
<Example><![CDATA[
gap> i := 0;; s := 0;;
gap> while s <= 200 do
>    i := i + 1; s := s + i^2;
>  od;
gap ;
204
]]></Example>
<P/>
A   java.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 44
< =/>

/


<!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
<ubsection ="Repeat">
<Heading>Repeat</Heading>

<ndex Subkey="epeat"loop<Index
<Key">K><>java.lang.StringIndexOutOfBoundsException: Range [39, 38) out of bounds for length 39
<Index Key="repeat loop"><K>repeat</K> loop</Index>
<C>repeat <A>statements</A> until <A>bool-expr</A>;<.
<P/>
The <K>repeat</K> loop executes the statement sequence <A>statements</A>
until the condition <A>bool-expr</A> 
<P/>
First <>statements</> are .
Then <A>bool-expr</A> is evaluatedK></>loop.
If it evaluates to <K>true</K> the <K>repeat</K>If enter<>;/> at<></A,
and the statement immediatelyfollowing the <>loop is executed
next.
Otherwise if it evaluates to <K>false</K> the wholeThe K></K loop in the following example has the same purpose as the
with the execution of the <A>statements</A>.
<P/>
<K>while/> ( Ref =">)
and the <K>repeat</K> <K>until</K> loop is that the <A>statements</A>
nthe  <K>repeat</> <>until/K>loop  executed at leastonce,
while the>i =0;  =;
if <A>java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11
<P/>
If <A>bool-until s > 200
 error is signalled a  ( <=" Loops/)
is entered.
As usual you can leave the break loop with]/
If you enter <C>return true;</C>,
execution continues with the next statement immediately following the
<K>repeat</K> loop.
If you enter <C>return false;</C>, execution continues
which evaluation<-<A> cause
<P/>
java.lang.StringIndexOutOfBoundsException: Range [47, 3) out of bounds for length 75
<K>while</K> loop in the preceding example, namely  A-/>toof<expr<>
<M>1^  on.
<P/>
<Example><![CDATA[
> =0;  :0;
gap> repeat
>    i := i + 1; s := s + i^2;
>  until s > 200;
gap> s;
204
]]></Example>
<P/>
A <K>repeat</K> loop may be left prematurely using <K>break</K>,
see <Ref Sect="Breakselection <C<A>-var<A><int-<A]/C>

</Subsection>


<!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->/>
< ="or"
<Heading>For</Heading>

<Index Subkey="for">loop</Index>
<Index Key="do"><K>do</K></java.lang.StringIndexOutOfBoundsException: Range [0, 32) out of bounds for length 18
<Index Key="od"><K>od</K></Index>
<C>for <A>simple-var</A> in <A>list-expr<) do
<Index Key="for loop"><K>for</K> loop</Index>
<P/>
The <K>for</K> loop executes the statement sequence <A>statements</A> for
every element of the list <A>list-expr</A>.
<P/>
The statement sequence <A>statements</A> is first executed with
<A>-var<A bound to the first elementof the <>list-expr</A>java.lang.StringIndexOutOfBoundsException: Index 74 out of bounds for length 74
then with <A>simple-var</A> bound to the second i..,these variables of different Kfor<K loopsdo not interfere
and so on.
<A>simple-var</A> must be a very oftena range(seen;< java.lang.StringIndexOutOfBoundsException: Range [68, 67) out of bounds for length 80
selection <C><A>list-var</<P/>
ora record component selection <C><A>record-var</A>.<A>ident</A></C>.
<P/>
The execution of the <K<>for <>ariable<A>in <A>from<A>. <>statements/>;/>
the following <K>while</K> loop.
<P/>
<Listing><![CDATA[
loop_list := list;
loop_index: 1;
while loop_index <= Length(loop_list) do
   variable :=loop_list[oop_index]java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
  java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
  loop_index := loop_index + 1;
od;
]]></Listing>
<P/
with the  <xample><[DATA[
variables for each <K>for</K> loop,
i.e., these variables of different <K>for</K> gap>for i inljava.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
each other.
<>
The list <A>list>
<P/>
<P/>
<Index>loop over range</Index>
<C>for <A>variable</A> in [<A>from</A>..<A>to</A>]<>
<P/>
 the 
<P/>
<> A><A>from <>from/>to A></>do <>statements
</>
in other nt( "n )java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
<P/>
<Example/>
gap> s :ndex>oop over iterator</Index>
gap> for i in [1..100] do
>    s := s + i;
> od;
gap> s;
5050
]]><<P>
<P/>
Note in the following exampleIt isalso possibleto havea <>for<K>loop run over an iterator
loopbody causes  loopbody also to be executed for the new values.
<P/>
<Example><![CDATA[
gap> l := [ 1, 2, 3, 4, 5, 6 ];;
gap>!CDATA[
>Print(i," ;
>    if i mod 2 = 0 then Add( l, 3 * i / 2 ); fi;
> od; Print( "\n" );
1 2 3 4 5 6 3 6 9 9
gap>l
[ 1, 2, 3, 4, 5, 6, 3, 6, 9, <>for <A></>in<>object<A>do<A>tatements/ od;/>
]]></Example>
<P/>
Note in theK></K>loop,then &GAP; will attempt to evaluate the function call
that holds the list has no influence on the loop.
<P/>
<Example><![CDATA[
gap> l := [ 1, 2, 3, 4, 5, 6 ];;
gap> for i in l do
>    (i,"")
>    l := [];
> od; Print("n ;
1 2 3 4 G[(1,2345,(,)3,(,)]
gap> l;
[  ]
]]></Example>
P>
<Index>loop over iterator</Index>
<C>for <A>variable</A> in <A>iterator</A>gap>count;
<P/>
It is also possible to have a <K>for</K>-loop run over an471
(see <Ref Sect="Iterators"/>). In this case
the <K>for</K>-loop is equivalent to
<P/>
<Listing><![CDATA[
iteratordo
  variable := NextIterator(iterator)
  statements
<P
]>Listing>
<P/>
<Index>loop over object</Index>
<</
<P/>
Finally, if an object <>object</>which is not a listor an iterator appearsin a
<K>for</K>-loop, then &GAP; will java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 27
<C
run over the A <K>may  using<break/,
<P/>
<Example><![CDATA[
gap> gcombines especiallywell with a loop over an iterator, as a  of
Group([ (1,2,3,4,5), (1,2)(3,4)(5,6) ])
gap> count := 0;; sumord := 0;;
gap> for x in g do
> count := count + 1; sumord := sumord + Order(x); od;
gap> count;
120
gap> sumord;
471
]]></Example>
<P/>
The effect of
<P/>
<C>for <A>variable</A> in <A>domain</A> do</C>
<P/>
should thus normally be the same as
<P/>
<C>for <A>variable</A> in AsList(<A>domain</A>) do</C>
<P/>
but may use much less storage, as the iterator may be more compact than
a list of all the elements.
<P/>
See <Ref Sect="Iterators"/> for details about iterators.
<P/>
A <K>for</K> loop may be left prematurely using <K>break</K>,
see <Ref Sect="Break"/>. This
combines especially well with a loop over an iterator, as a way of
searching through a domain for an element with some useful property.

</Subsection>


<!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
<Subsection Label="Break">
<Heading>Break</Heading>

<Index Subkey="leaving">loops</Index>
<C>break;</C>
<Index Key="break statement"><K>break</K> statement</Index>
<P/>
The statement <C>break;</C> causes an immediate exit from the innermost
loop enclosing it.
<P/>
<Example><![CDATA[
gap> g := Group((1,2,3,4,5),(1,2)(3,4)(5,6));
Group([ (1,2,3,4,5), (1,2)(3,4)(5,6) ])
gap> for x in g do
> if Order(x) = 3 then
> break;
> fi; od;
gap> x;
(1,5,2)(3,4,6)
]]></Example>
<P/>
It is an error to use this statement other than inside a loop.
<P/>
<Log><![CDATA[
gap> break;
Syntax error: 'break' statement not enclosed in a loop
]]></Log>

</Subsection>


<!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
<Subsection Label="Continue">
<Heading>Continue</Heading>

<Index Subkey="restarting">loops</Index>
<C>continue;</C>
<Index Key="continue statement"><K>continue</K> statement</Index>
<P/>
The statement <C>continue;</C> causes the rest of the current iteration of
the innermost loop enclosing it to be skipped.
<P/>
<Example><![CDATA[
gap> g := Group((1,2,3),(1,2));
Group([ (1,2,3), (1,2) ])
gap> for x in g do
> if Order(x) = 3 then
> continue;
> fi; Print(x,"\n"); od;
()
(2,3)
(1,3)
(1,2)
]]></Example>
<P/>
It is an error to use this statement other than inside a loop.
<P/>
<Log><![CDATA[
gap> continue;
Syntax error: 'continue' statement not enclosed in a loop
]]></Log>

</Subsection>


<!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
<Subsection Label="Return">
<Heading>Return (With or without Value)</Heading>

<Index Key="return" Subkey="no value"><K>return</K></Index>
<C>return;</C>
<P/>
In this form <K>return</K> terminates the call of the innermost function that
is currently executing, and control returns to the calling function. An
error is signalled if no function is currently executing. No value is
returned by the function.
<P/>
<C>return <A>expr</A>;</C>
<Index Key="return" Subkey="with value"><K>return</K></Index>
<P/>
In this form <K>return</K> terminates the call of the innermost function that
is currently executing, and returns the value of the expression <A>expr</A>.
Control returns to the calling function. An error is signalled if no
function is currently executing.
<P/>
Both statements can also be used in break loops
(see <Ref Sect="Break Loops"/>).
<C>return;</C> has the effect that the computation continues where it was
interrupted by an error or the user hitting <B>Ctrl-C</B>.
<C>return <A>expr</A>;</C> can be used to continue execution after an error.
What happens with the value <A>expr</A> depends on the particular error.
<P/>
For examples of <K>return</K> statements, see the functions <C>fib</C> and
<C>Stack</C> in Section <Ref Sect="Function"/>.

</Subsection>

</Section>

<Section Label="Syntax Trees">
    <Heading>Syntax Trees</Heading>

    This section describes the tools available to handle &GAP; syntax trees.

    <#Include Label="SyntaxTree">
</Section>


<!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
<!--
<Section Label="The Syntax in BNF">
<Heading>The Syntax in BNF</Heading>

<Index>BNF</Index>
This section contains the definition of the &GAP; syntax in
Backus-Naur form. A few recent additions to the syntax may be missing
from this definition. Also, the actual rules for identifier names
implemented by the system, are somewhat more permissive than those
given below (see section <Ref Sect="Identifiers"/>).
<P/>
A  BNF is a set of rules, whose left side  is the name of  a  syntactical
construct.  Those  names  are written using <A>this font</A>.
The right side of each rule contains a possible form for that
syntactic  construct.   Each  right  side  may  contain  names  of  other
syntactic  constructs,  again  enclosed in angle brackets and written  in
<A>italics</A>,  or character  sequences that  must  occur literally; they are
written in <C>this font</C>.
<P/>
Furthermore  each right hand side  can contain  the  following metasymbols.
If the right  hand  side contains forms separated
by a pipe symbol  (<M>|</M>)  this means  that one  of the possible forms can
occur.  If a part of a form  is enclosed  in square brackets  (<C>[]</C>)  this
means that this part is optional, i.e.  might be present or  missing.  If
part  of the form is enclosed  in curly braces  (<C>{}</C>)  this means that
the part may occur arbitrarily often, or possibly be missing.
<P/>
<Table Align="lll">
<Row>
  <Item><A>Ident</A></Item>
  <Item>:=</Item>
  <Item><C>a</C><M>|\ldots|</M><C>z</C><M>|</M>
        <C>A</C><M>|\ldots|</M><C>Z</C><M>|</M>
        <C>_</C>
        <C>{a</C><M>|\ldots|</M><C>z</C><M>|</M>
                <C>A</C><M>|\ldots|</M><C>Z</C><M>|</M>
                <C>0</C><M>|\ldots|</M><C>9</C><M>|</M>
                <C>_}</C></Item>
</Row>
<Row>
  <Item><A>Var</A></Item>
  <Item>:=</Item>
  <Item><A>Ident</A></Item>
</Row>
<Row>
  <Item></Item>
  <Item><M>|</M></Item>
  <Item><A>Var</A> <C>.</C> <A>Ident</A></Item>
</Row>
<Row>
  <Item></Item>
  <Item><M>|</M></Item>
  <Item><A>Var</A> <C>. (</C> <A>Expr</A> <C>)</C></Item>
</Row>
<Row>
  <Item></Item>
  <Item><M>|</M></Item>
  <Item><A>Var</A> <C>[</C> <A>Expr</A> <C>]</C></Item>
</Row>
<Row>
  <Item></Item>
  <Item><M>|</M></Item>
  <Item><A>Var</A> <C>{</C> <A>Expr</A> <C>}</C></Item>
</Row>
<Row>
  <Item></Item>
  <Item><M>|</M></Item>
  <Item><A>Var</A> <C>(</C> [ <A>Expr</A> <C>{,</C> <A>Expr</A> <C>} ] )</C></Item>
</Row>
<Row>
  <Item></Item>
  <Item><M>|</M></Item>
  <Item><A>Var</A> <C>!.</C> <A>Ident</A></Item>
</Row>
<Row>
  <Item></Item>
  <Item><M>|</M></Item>
  <Item><A>Var</A> <C>!. (</C> <A>Expr</A> <C>)</C></Item>
</Row>
<Row>
  <Item></Item>
  <Item><M>|</M></Item>
  <Item><A>Var</A> <C>![</C> <A>Expr</A> <C>]</C></Item>
</Row>
<Row>
  <Item><A>List</A></Item>
  <Item>:=</Item>
  <Item><C>[</C> [ <A>Expr</A> ] <C>{,</C> [ <A>Expr</A> ] <C>} ]</C></Item>
</Row>
<Row>
  <Item></Item>
  <Item><M>|</M></Item>
  <Item><C>[</C> <A>Expr</A> [<C>,</C> <A>Expr</A> ] <C>..</C> <A>Expr</A> <C>]</C></Item>
</Row>
<Row>
  <Item></Item>
  <Item><M>|</M></Item>
  <Item><A>List</A> <C>{</C> <A>List</A> <C>}</C></Item>
</Row>
<Row>
  <Item><A>Record</A></Item>
  <Item>:=</Item>
  <Item><C>rec(</C> [ <A>Ident</A> <C>:=</C> <A>Expr</A>
                         <C>{,</C> <A>Ident</A> <C>:=</C> <A>Expr</A> <C>} ] )</C></Item>
</Row>
<Row>
  <Item><A>Permutation</A></Item>
  <Item>:=</Item>
  <Item><C>(</C> <A>Expr</A> <C>{,</C> <A>Expr</A> <C>} )</C>
                    <C>{ (</C> <A>Expr</A> <C>{,</C> <A>Expr</A> <C>} ) }</C></Item>
</Row>
<Row>
  <Item><A>Function</A></Item>
  <Item>:=</Item>
  <Item><C>function (</C> [ <A>Ident</A> <C>{,</C> <A>Ident</A> <C>} ] )</C></Item>
</Row>
<Row>
  <Item></Item>
  <Item></Item>
  <Item>[ <K>local</K> <A>Ident</A> <C>{,</C> <A>Ident</A> <C>} ;</C> ]</Item>
</Row>
<Row>
  <Item></Item>
  <Item></Item>
  <Item><A>Statements</A></Item>
</Row>
<Row>
  <Item></Item>
  <Item></Item>
  <Item><K>end</K></Item>
</Row>
<Row>
  <Item></Item>
  <Item><M>|</M></Item>
  <Item><A>Ident</A> <C>-></C> <A>Expr</A></Item>
</Row>
<Row>
  <Item><A>Char</A></Item>
  <Item>:=</Item>
  <Item><C>'<A>any character</A>'</C></Item>
</Row>
<Row>
  <Item><A>String</A></Item>
  <Item>:=</Item>
  <Item><C>" {</C> <A>any character</A> <C>} "</C></Item>
</Row>
<Row>
  <Item><A>Int</A></Item>
  <Item>:=</Item>
  <Item><C>0</C><M>|</M><C>1</C><M>|</M>...<M>|</M><C>9</C>
        <C>{0</C><M>|</M><C>1</C><M>|</M>...<M>|</M><C>9}</C></Item>
</Row>
<Row>
  <Item><A>Atom</A></Item>
  <Item>:=</Item>
  <Item><A>Int</A></Item>
</Row>
<Row>
  <Item></Item>
  <Item><M>|</M></Item>
  <Item><A>Var</A></Item>
<!-- java.lang.StringIndexOutOfBoundsException: Index 77 out of bounds for length 77
<Row>
  <Item></Item>
  <Item><M>|</M></Item>
  <Item><C>(</C> <A>Expr</A> <C>)</C></Item>
</Row>
<Row>
  <Item></Item>
  <Item><M>|</M></Item>
  <Item><A>Permutation</A></Item>
</Row>
<Row>
  <Item></Item>
  <Item><M>|</M></Item>
  <Item><A>Char</A></Item>
</Row>
<Row>
  <Item></Item>
  <Item><M>|</M></Item>
  <Item><A>String</A></Item>
</Row>
<Row>
  <Item></Item>
  <Item><M>|</M></Item>
  <Item><A>Function</A></Item>
</Row>
<Row>
  <Item></Item>
  <Item><M>|</M></Item>
  <Item><A>List</A></Item>  =(1,2345,,)34(,);
</Row>
<Row>
  <Item></Item>
  <Item><M>|</M></Item>
  <Item><A>Record</A></Item>
</Row>
<Row>
  <Item></Item>
  <Item><M>|</M></Item>
  <Item><C>{</C> <K>not</K> <C>}</C> <K>true</K></Item>
</Row>
<Row>
  <Item></Item>
  <Item><M>|</M></Item>
  <Item><C>{</C> <K>not</K> <C>}</C> <K>false</K></Item>
</Row>
<Row>
  <Item><A>Factor</A></Item>
  <Item>:=</Item>
  <Item><C>{+</C><M>|</M><C>-}</C> <A>Atom</A>
                [ <C>^ {+</C><M>|</M><C>-}</C> <A>Atom</A> ]</Item>
</Row>
<Row>
  <Item><A  >
  <Item>:=</Item>
  <Item><A>Factor</A> <C>{ *</C><M>|</M<C>/</><></><>mod</K><Factor/A> <>}/C/Item>
</Row>
<Row>
  <Item><A>Arith</A></Item>
  <Item>:=</Item>
  <Item><A>Term</A> <C>{ +</C
</Row>
<Row>
  <Item><A>Rel</A></Item>
  <Item>:=</Item>
  <Item><C>{</C> <Example>!CDATA[
                [ <C>=</C><M>|</M><C>&lt;></C><M>|</M><C>&lt;</C><M>|</M><C>></C><M>|</M><C>&lt;=</C><M>|</M><C>>=</C><M>|</M><K>in</K> <A>Arith</A> ]</Item>
</Row>
<Row>
  <Item><A>And</A></Item>
  <Item>:=</Item>
  <function is currently executing.
</Row>

  <Item><A>Logical</A></Item>
  <Item>:=</Item>
  <Item><A>And</A> 
java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
<Row>
  <Item><A>Expr</A></Item>
  <Item>:=</Item>
  <Item><A>Logical</A></Item>
</Row>
<Row>
em>/Item>
  <Item><M>|</M></Item>
  <Item><A>Var</A></Item>
</Row>
<Row>
  <Item><A>Statement</A></Item>
  <Item>:=</Item>
  <Item><A>Expr</A></Item>
</Row>
<Row>
  <Item></Item>
  <Item><M>|</M></Item>
  <Item><A>Var</A> <C>:=</C> <A>Expr</A></Item>
</Row>
<Row>
  <Item></Item>
  <Item><M>|</M></Item>
  <Item><K>if</K> <A>Expr</A> <K>then</K> <A>Statements</A></Item>
</Row>
<Row>
  <Item></Item>
  <Item></Item>
  <Item><C>{</C> <K>elif</K> <A>Expr</A> <K>then</K> <A>Statements</A> <C>}</C></Item>
</Row>
<Row>
  <Item></Item>
  <Item></Item>
  <Item>[ <K>else</K> <A>Statements</A> ] <K>fi</K></Item>
</Row>
<Row>
  <Item></Item>
  <Item><M>|</M></Item>
  <Item><K>for</K> <A>Var</A> <K>in</K> <A>Expr</A> <K>do</K> <A>Statements</A> <K>od</K></Item>
</Row>
<Row>
  <Item></Item>
  <Item><M>|</M></Item>
  <Item><K>while</K> <A>Expr</A> <K>do</K> <A>Statements</A> <K>od</K></Item>
</Row>
<Row>
  <Item></Item>
  <Item><M>|</M></Item>
  <Item><K>repeat</K> <A>Statements</A> <K>until</K> <A>Expr</A></Item>
</Row>
<Row>
  <     <>A</><>|ldots|<<>/<>|Mjava.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47
  <Item><M>|</M></Item>
  <Item><K>return</K> [ <A>Expr</A> ]</Item>
</Row>
<Row>
  <Item></Item>
  <Item><M>|</M></Item>
  <Item><K>break</K></Item>
<
<Row>
  <Item></Item>
  <Item><M>|<  <Item><A></><.< <Ident/>/>
  <Item><K>quit</K></Item>
</Row>
<Row>
  <Item></Item>
  <Item><M>|</M></Item>
  <Item><K>QUIT</K></Item>
</Row>
<Row>
  <Item></Item>
  <Item><M>|</M></Item>
  <Item></Item>
</Row>
<Row>
  <Item><A>Statements</A></Item>
  <Item>:=</Item>
  <Item><C>{</C> <A>Statement</A> <C>; }</C></Item>
</Row>
<Row>
  <Item></Item>
  <Item><M>|</M></Item>
  <Item><C>;</C></Item>
</Row>
<Row>
  <Item></Item>
  <Item><M>|</M></Item>
  <Item></Item>
</Row>
</Table>

</Section>
-->

</Chapter>


<!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
<!-- %% -->
<!-- %E -->

Messung V0.5 in Prozent
C=98 H=100 G=98

¤ Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.0.86Bemerkung:  ¤

*Bot Zugriff






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.