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

6 Records
 6.1 Functions for records

6 Records

6.1 Functions for records

6.1-1 SetIfMissing
‣ SetIfMissing( rec, name, val )( function )

This function has been transferred from package AutoDoc, where it was called AUTODOC_WriteOnce (the original will continue to exist). 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> names := RecNames( r );;
gap> Set( names );
[ "a", "b", "c" ]
gap> SetIfMissing( r, "c", 4 );
gap> r;
rec( a := 1, b := 2, c := 3 )

6.1-2 AssignGlobals
‣ AssignGlobals( rec )( function )

This function has been transferred from package RCWA.

It 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 7 8 Bib Ind

generated by GAPDoc2HTML