Fields of records may be inspected, assigned and deleted at any time.
The format of record r.
The fieldnames of the record format F returned as a sequence of strings.
The fieldnames of record r returned as a sequence of strings.
Return the field of record r with this fieldname. The format of r must include this fieldname, and the field must be assigned in r.
Reassign the given field of r to be the value of the expression. The format of r must include this fieldname, and the expression's value must satisfy (directly or by coercion) any restriction on the field.
(Statement.) Delete the current value of the given field of record r.
Returns true if and only if the given field of record r currently contains a value.
Given an expression s that evaluates to a string, return the field of record r with the fieldname corresponding to this string. The format of r must include this fieldname, and the field must be assigned in r.This syntax may be used anywhere that r`fieldname may be used, including in left hand side assignment, assigned and delete.
> RF := recformat< n : Integers(), misc, seq : SeqEnum >; > r := rec< RF | >; > s := rec< RF | misc := "adsifaj", n := 42, seq := [ GF(13) | 4, 8, 1 ]>; > t := rec< RF | seq := [ 4.7, 1.9 ], n := 51/3 >; > u := rec< RF | misc := RModule(PolynomialRing(Integers(7)), 4) >; > V4 := u`misc; > assigned r`seq; false > r`seq := Append(t`seq, t`n); assigned r`seq; true > r; rec<RF | seq := [ 4.7, 1.9, 17 ]> > // The following produces an error: > t``(s`misc); >> t``(s`misc); ^ Runtime error in `: Field 'adsifaj' does not exist in this record > delete u``("m" cat "isc"); u; rec<RF | >