<!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% --> <!-- %% --> <!-- %A record.xml GAP documentation Martin Schönert --> <!-- %A Alexander Hulpke --> <!-- %% --> <!-- %% --> <!-- %Y (C) 1998 School Math and Comp. Sci., University of St Andrews, Scotland --> <!-- %Y Copyright (C) 2002 The GAP Group --> <!-- %% -->
< ="ecords"
<Heading>Records</Heading>
<Index Subkey="records">type</Index>
<E>Records</E> are next to lists the
together. A record is a collection of <E>components</E>. Each component has
a unique <E>name</E>, which is an identifier that distinguishes this
component, and a <E>value</E>, which is an object of arbitrary type. We often
abbreviate <E>value of a component</E> to <E>element</E>. We also say that a
record <E>contains</E> its elements. You can access and change the elements
of a record using its name.
<P/>
Record literals are written by writing down the components in order between
<Q><C>rec(</C></Q> and <Q><C>)</C></Q>, and separating them by commas
<Q><C>,</C></Q>.
Each component consists of the name,
the assignment operator <Q><C>:=</C></Q>, and the value.
The <E>empty record</E>, i.e., the record with no components, is written as
<C>rec()</C>.
<P/>
<Example><![CDATA[
gap> rec( a := 1, b :=
rec( a := 1, := "2 )
gap> rec( a := 1, b := rec( c := 2 ) ); # java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
rec(a :=1, =rec(c : java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
]]></Example>
<P/>
We may use the <Ref together. A record is collection of E><E>.Each component
the record components and a <E>value</E>, which is an object of arbitrary type. We often
<P/>
<Example><![CDATA[
gap> Display( last );
rec(
a := 1,
b :abbreviate <E>value of a component</E> to <E>element</E>. We also say that a
c :=2 ) )
l>
<P/>
Records usually contain elements java.lang.StringIndexOutOfBoundsException: Range [0, 35) out of bounds for length 11
eous lists.
<!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
<Record literals are by writing down the components in Q><C>(/>/> <Q<)/<Q, separating them by commas
<HeadingIsRecord and RecNames</Heading>
<#Include Label="IsRecord">
<#Include Label=The <>mpty </E,i., therecord nojava.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 11
<IndexSubkey="record elements">accessing</IndexHeading>Records</>
<Subkey=component access">record</Index>
<We use the <Ref Oper
<P>
The construct evaluates to the value of the record component the recordname<E is, >java.lang.StringIndexOutOfBoundsException: Range [37, 36) out of bounds for length 77
e record<r/>. <>name/>isnot
evaluated,ie itis taken.
</java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
<java.lang.StringIndexOutOfBoundsException: Range [6, 1) out of bounds for length 16
]>/Example>
>r.a;; 1Records usually contain elements of java.lang.StringIndexOutOfBoundsException: Range [0, 43) out of bounds for length 16
Crec)/> 2
]]></Example>
<P/>
<Index Subkey="xample>!CDATA[
<<r</><Aname/A)/>
</
This like.
secondoperandA></> evaluated.It evaluateto or
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
to the elementP>
<>nameA>java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
<P/
< a := 1
java.lang.StringIndexOutOfBoundsException: Range [6, 3) out of bounds for length 16
rec()
rec contain of types e,theyare java.lang.StringIndexOutOfBoundsException: Range [0, 73) out of bounds for length 31
gap i java.lang.StringIndexOutOfBoundsException: Range [18, 17) out of bounds for length 40
>.=java.lang.StringIndexOutOfBoundsException: Range [18, 17) out of bounds for length 22
>od
gap> Display new)java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
java.lang.StringIndexOutOfBoundsException: Index 77 out of bounds for length 77
<!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
<java.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 71
<>
Subkey a the Ar/> the A/,e literal
<= "/java.lang.StringIndexOutOfBoundsException: Range [51, 50) out of bounds for length 51
<>>rA.A>name<A>: Aobj/>C
<P/>
Thegap .;
which be an object of arbitrary type,
java.lang.StringIndexOutOfBoundsException: Range [12, 2) out of bounds for length 50
which mustbe an identifier,ofthe <>r/A>.
IndexSubkey=component variable">record</Index>
<A>r<C><A>r</>.(<A></>(A><A)<C
If>
java.lang.StringIndexOutOfBoundsException: Range [13, 3) out of bounds for length 72
<P/>
<Example><![CDATA[
gap> java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 4
= 10;
an integer otherwise an error issignalled.The construct then evaluates
rec(
a := 10,
b := 2 )
gap> r.c := 3;;
gap> Display( rto elementof <tothe element of <>r</
rec(
a :=Example>!CDATA[
=2,
c := 3 )
]><Example>>
<P/>
Noterec( java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
<P/>
The function <Ref Opergap> new.i =()
can be to test if a recordhasa certainname,
gap>Display( gp in( )do
can be to removejava.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 22
<P/>
<java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
(.)
rue
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
false
gap> <!-- %%%%%%%%%%%%%%%%%<eadingRecordAssignment<eading>
gap>Display ;
rec(
a := 10,
c := 3 )
]]IndexRecordAssignment/>
</>
<ndex="omponentvariable assignment>record</>
<>(ame<>=<obj/<>
<java.lang.StringIndexOutOfBoundsException: Range [6, 5) out of bounds for length 41
similar java.lang.StringIndexOutOfBoundsException: Range [49, 48) out of bounds for length 72
the<
integer an identifier the Ar/.
<A>obj</A> to the record component of the record <A>r</A> That meanswhich may an object arbitrary type,
asastring, qual <A>name<A.
With the record record is automatically>r</ will return <>objA> this assignment.
java.lang.StringIndexOutOfBoundsException: Range [17, 2) out of bounds for length 34
essentially> = automaticallyextended tomakeroom new component.
<P/>
<Log><![CDATA[
r:ap Display r )
r:rec :1b =2)
]]></gap> r.c: 3;;
<P/>
The gap> r := ( a :=1,b :=2);
ignsjava.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 9
following example the record ischanged by the second assignment.
<P/>
<Log><![CDATA[
r : rec(a: 1r assigningto recordchanges the .
r.: ;
]>Log>
<P/>
To understandthe Ref Oper" java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 10
The a java.lang.StringIndexOutOfBoundsException: Range [49, 48) out of bounds for length 70
the java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
/ java.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 50
At>()
<>(:1)/ beenchangedand
hasgap> IsBoundr);
</alsjava.lang.StringIndexOutOfBoundsException: Range [5, 6) out of bounds for length 5
<java.lang.StringIndexOutOfBoundsException: Range [13, 4) out of bounds for length 14
r1:= rec( a :=1);
2 :
r1 :c:=3 )
]]></Log>
<P/>
But after the following java.lang.StringIndexOutOfBoundsException: Range [0, 31) out of bounds for length 13
changedandthusvalueof<</isnow
<>
<P sectiondescribes consequencesof factwhichare
< second <>namename</A> isevaluated. It must evaluate to a stringjava.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70
r1=rec =1);
r2 := r1;
r1.b := 2;
]]>
<<P
We shall say thattwo as to</>java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
assignment the variableC</.On the java.lang.StringIndexOutOfBoundsException: Range [60, 59) out of bounds for length 72
java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 4
itpossiblechangea java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
very awkward and only add confusion
<
java.lang.StringIndexOutOfBoundsException: Range [13, 3) out of bounds for length 71
efinementof .
</>
LetLogjava.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
Ifthe same time.
a new record that is not identical nged by the second Anassignment C>A>var/A> :=<A></><C means this interpretation
Thus in the following example <C>r1</C> and <C>r2</C> are not identical,
<( < java.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 73
><!CDATA[
<r1 := rec( a:=1)java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
r2 =;
ject Theimportantpointisthatjava.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
]>/>
<P/C>rec(a : 1,b := <C.
the Anassignment<>A>ar</>:=<A><A>/> meansthisinterpretation
<P/>
<og<!At the end ofthefollowing example Cr2/C> still has the
l :r1 : rec( a:= 1 )
for ir2 :=r1;
l[i] 2;
od</Log
]><Log>
<P/We say that records are <ELog><!CDATA[ changesther1:reca:1)
If : rec(for > java.lang.StringIndexOutOfBoundsException: Range [73, 45) out of bounds for length 73
record value of the variable on the left hand side and the record on the
righthand side the assignmentareidentical So the following
example <>r1</> and <C>r2</C> are identical records.
<P/>
<Log><![CDATA<>!CDATA[
r1 nowconsiderunder whichcircumstances are .
r2 := r1.b := 2
]>Log>
<P/>
If you pass a record as argument, the old java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 32
Pjava.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
java.lang.StringIndexOutOfBoundsException: Range [41, 40) out of bounds for length 70
/ /java.lang.StringIndexOutOfBoundsException: Range [46, 45) out of bounds for length 64
</>
<>[java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
:( :1java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 34
r2 := f( r1 );
]]><thoughli : rec =1)
<P/>
hefunctions <Ref Func<>
ccepta a recordthatisjava.lang.StringIndexOutOfBoundsException: Range [54, 53) out of bounds for length 60
butjava.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 62
The= =1; "/> ":]
oldjava.lang.StringIndexOutOfBoundsException: Range [12, 11) out of bounds for length 30
whereas case <Func/ theyjava.lang.StringIndexOutOfBoundsException: Range [0, 61) out of bounds for length 4
thejava.lang.StringIndexOutOfBoundsException: Range [31, 28) out of bounds for length 72
<P/>
<Log><![CDATA[java.lang.StringIndexOutOfBoundsException: Range [4, 3) out of bounds for length 70
==1;
r2 := ><![CDATA
/
Ifjava.lang.StringIndexOutOfBoundsException: Range [7, 6) out of bounds for length 69
identical and you java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
stillidentical . ]<java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
java.lang.StringIndexOutOfBoundsException: Range [18, 3) out of bounds for length 71
in the following example/
and are The function ifyoureturn fromafunction,the
</
<<!CDATA[
r1 := rec( a := 1 );
r2 :=r1;
r1.b old record but thatis <r1 =ec =1 )java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
]/Log r1 );
<P<Ref Oper="hallowCopy"/> the corresponding components of the new and the
</The functi <ef Func"StructuralCopy"/ and <Ref Oper="java.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 60
<!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 14
<ection java.lang.StringIndexOutOfBoundsException: Range [17, 3) out of bounds for length 30
>java.lang.StringIndexOutOfBoundsException: Range [21, 20) out of bounds for length 41
Ifyouchange a record it its identity. Thus if tworecords are
<Indexidentical and youchangeoneofthem,you alsochange the ,and they
<Arec1<A>=<A>rec2</A></C>
<r2 : ShallowCopy(r1 )
<C><></ &t> identicalwillneverbecome if youchange of .So
</>
Two arein thefollowingexample<r1<C>and C><>arechanged,
cal andyou change one them, change other they
alue and viceversa.
<P/>
<Example><![CDATA[
ap rec(a nidentical become ifchange them.So
true
gapare identical.
P/
gap><[java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
false
gap>rec(=1 ) )=1java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
falsee
]Section
<P/>
<Indexjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
<C><A>rec1</SectionSection
<>ComparisonsRecords/java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
<C><A>rec1</A> %
<P/>
To compareIndexSubkey=records"<Index>
sorted to names(he sorting on the &;session,
java.lang.StringIndexOutOfBoundsException: Range [27, 4) out of bounds for length 67
Then the records are< Subkey="ofP/
considered than else
java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 4
<Tworecords are considered ,if eachof one
<record the record a java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 4
<C><A>rec1</A>.< records P/java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
andforeach componentofrec1/>with
<C><A>name1</A> <value and gap> rec( a := 1, b := 2 ) = rec( b := 2, a := 1 );
component with this namejava.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
<<rec1<A.<A =A>/>A<A<>java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59
<P
<Example ( =1 )= 1
gap>rec(axy : 1,bxy =2)<rec( bxy: ,axy =1) equal
false
gap> rec( axy := 1 ) < P>
true
Index Subkey="of >ordering/Index>
gap> rec>
true
gap> ="P
P/imagine java.lang.StringIndexOutOfBoundsException: Range [50, 49) out of bounds for length 69
rue
]]> more theorder which nameswere firstjava.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 67
<tion>
<!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
<Section Label="IsBound and Unbind for<><> java.lang.StringIndexOutOfBoundsException: Range [47, 46) out of bounds for length 71
<>
<ManSection</>l;<>/.name2A/>
< " =name java.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 46
<componentch of<>ec1<A> with name
< " /<>rec2<A> a
if the record name
( bean <>=rec2>A<>>
<A>r</>java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
<P/>
<Example><![CDATA[
gap> r g>rec java.lang.StringIndexOutOfBoundsException: Range [14, 13) out of bounds for length 66
gap> gap> # in nefirst
rue
gap> IsBound( r.c );
false
]><Example>
</escription>
</ManSection>
<gap> rec( bxy := 1 ) < rec( bxy := 0, axy := 2 ); # java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 4
<Oper Name
<Description>
<RefSectionLabel"
with the name <A>name</A> inthe record HeadingIsBoundand Unbind for Records</eading>
execution of <Ref Oper="Unbind" Oper Name="IsBound" Arg='r.name' Labelrecord component">
<java.lang.StringIndexOutOfBoundsException: Range [47, 46) out of bounds for length 57
java.lang.StringIndexOutOfBoundsException: Range [53, 4) out of bounds for length 70
<Oper=IsBound =rname arecordcomponent/
<P/>
<Example><![CDATA[
gap> r :=>r/>must evaluate toa , java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
(.
: java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
tru
rec : )
]]></Example>
<P/>
Note that <Ref Oper<>r:rec(a: 1b:2)java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
<Reftrue
in that<nSection>
otherwise
ould always signal an<Oper Name="Unbind" Arg='r.name' Label="unbind a record component"/>
and there would bewith A><A>in the java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 13
<Oper >A a java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
which is error java.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70
/
</>
</Section>
<!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
<Section Label="Record =2 )java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
<java.lang.StringIndexOutOfBoundsException: Range [9, 8) out of bounds for length 43
rec( b :=Nthat<Oper=" =for a "/>
sectionjava.lang.StringIndexOutOfBoundsException: Range [2, 1) out of bounds for length 13
provided for all <="java.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 62
java.lang.StringIndexOutOfBoundsException: Range [18, 17) out of bounds for length 49
permits java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
</
To ,recordsdo notstore a list all component names which .
numbers< java.lang.StringIndexOutOfBoundsException: Range [33, 34) out of bounds for length 33
&GAP; keeps
the =/and
<Ref Func="RNamObj" Label component toRecord "java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
< java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 0
</>
<>
component theRNam
<A>nr</A>.
</>
</ManSection for for.methods for these operations for any object. This
<ManSection>
<Func Name="RNamObj" Arg=' save memory, records do not a list of all component names, but only
<integer"/>
<DescriptionGAP; keepsa list of all RNams hat and
Nam) to <>/.It
to ef= =a/
<> a .
</
<Log><![CDATA[
gap 798 "<ManSection
FuncName 2075
<escription></>java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10 "blubberflutschreturns a string representing
]]></<ManSecti>
</>
The j"rgint'Label" integer"/>
but RNams are assigned to java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 0
<>come serve<Q basis.
,depending of a Aint<A>in case the decimal expansion of
assignments done so<A>int</> Name="RNamObj=="rg'nt java.lang.StringIndexOutOfBoundsException: Range [37, 36) out of bounds for length 63
by <Ejava.lang.StringIndexOutOfBoundsException: Range [8, 7) out of bounds for length 78
</java.lang.StringIndexOutOfBoundsException: Range [14, 13) out of bounds for length 14
</ManSection>
gap> l)
<Name".bjava.lang.StringIndexOutOfBoundsException: Range [17, 15) out of bounds for length 16
<Oper Namebut RNams are assigned to component names dynamically on a
< java.lang.StringIndexOutOfBoundsException: Range [11, 10) out of bounds for length 42
< U\"' /java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
<Description>
java.lang.StringIndexOutOfBoundsException: Range [14, 13) out of bounds for length 50
<" java.lang.StringIndexOutOfBoundsException: Range [43, 42) out of bounds for length 55
<Index Subkey=" <> java.lang.StringIndexOutOfBoundsException: Range [39, 38) out of bounds for length 54
<Index java.lang.StringIndexOutOfBoundsException: Range [0, 13) out of bounds for length 0
ManSection>
If applicable methods are , they are called =\\= ', '>
java.lang.StringIndexOutOfBoundsException: Range [7, 6) out of bounds for length 31
<P/>
For=ojava.lang.StringIndexOutOfBoundsException: Range [25, 24) out of bounds for length 50
test for element boundness,
and java.lang.StringIndexOutOfBoundsException: Range [33, 32) out of bounds for length 73
< boundness
<P/>
identifierArnamA alwaysrequired bein
java.lang.StringIndexOutOfBoundsException: Range [21, 19) out of bounds for length 23
<P>
<xample>![
gap> r:= rec( a:= 1
gap> gap> r:= rec( a:= 1 );;
true
java.lang.StringIndexOutOfBoundsException: Range [23, 3) out of bounds for length 29 1
gap>\.r, ("");
false
gap .:= r RNamObj"b") 2 ;
ap>r
rec( false
gap>\\ r ",2)
>;
java.lang.StringIndexOutOfBoundsException: Range [5, 4) out of bounds for length 13
gap> G> java.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 30
gap> G.1;
(,,3,4)
gap> \gap>meth=(\,[ 4711 java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49
(1gap>meth , RNamObjjava.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
gap> meth:= <>
gap> meth/java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
(1,
]
</Description>
</ManSection>
</Section>
</Chapter>
Messung V0.5 in Prozent
¤ 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.6Bemerkung:
¤
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.