up previous next
record

create a record

Syntax
record[X_1 := OBJECT,...,X_n := OBJECT]

where each X_i is a variable.

Description
This function returns a record with fields X_1 ,..., X_n . The empty record is given by record[] . The records are open in the sense that new fields may be added after the record is first defined.

NB: old syntax is allowed, but obsolescent: record[X=1] .

Example
/**/  P := Record[ Height := 10, Width := 5];
/**/  P.Height * P.Width;
50

/**/  P.Area := It;
/**/  P;
Record[Area := 50, Height := 10, Width := 5]

See Also