GAP (Utils) - Chapter 5: Records

Goto Chapter: Top 1 2 3 4 5 6 Bib Ind
[Top of Book] [Contents] [Previous Chapter] [Next Chapter]

[MathJax on]

5 Records
5.1 Functions for records
5.1-1 SetIfMissing
5.1-2 AssignGlobals

### 5 Records

#### 5.1 Functions for records

##### 5.1-1 SetIfMissing

`‣ SetIfMissing`( rec, name, val ) | ( function )

This function is in the process of being transferred from package AutoDoc, where it was called `AUTODOC_WriteOnce`. It writes into a record provided the position is not yet bound.

    gap> r := rec( a := 1, b := 2 );;
    gap> SetIfMissing( r, "c", 3 );
    gap> RecNames( r );
    [ "b", "c", "a" ]
    gap> SetIfMissing( r, "c", 4 );
    gap> r;
    rec( a := 1, b := 2, c := 3 )

##### 5.1-2 AssignGlobals

`‣ AssignGlobals`( rec ) | ( function )

This function is in the process of being transferred from package RCWA: for now you should `LoadPackage("rcwa")` in order to use it.

This function assigns the record components of rec to global variables with the same names.

    gap> AssignGlobals( r );
    The following global variables have been assigned:
    [ "a", "b", "c" ]
    gap> [a,b,c];
    [ 1, 2, 3 ]

[Top of Book] [Contents] [Previous Chapter] [Next Chapter]
Goto Chapter: Top 1 2 3 4 5 6 Bib Ind

generated by GAPDoc2HTML