Previous: , Up: syslib structs safe   [Index]


12.14.1.6 Inspecting data structures

Function: struct? stru
Function: struct? stru std

When no std argument is given: return true if stru is a data structure. When std is given: return true if stru is a data structure and it is of type std, which must be a struct type descriptor.

Function: struct-and-std? stru std

Return #t if stru is a struct with struct–type descriptor equal to std; otherwise return #f. Raise an error if std is not a struct–type descriptor.

Function: struct-std stru

Return the struct–type descriptor of the data structure stru. Notice that this function works with both Vicare’s structs and R6RS records.

Function: struct-length stru

Return the number of fields in the data structure stru. Notice that this function works with both Vicare’s structs and R6RS records.

Function: struct-field-names stru

Return a list of symbols representing the field names of the structure stru.

Function: struct-name stru

Return a string representing the name of the data structure stru. Notice that this function works with both Vicare’s structs and R6RS records.

Function: struct-printer stru

Return #f or the procedure being the printer function for the data structure stru.

Function: struct-destructor stru

Return #f or the procedure being the destructor function for the data structure stru.

Function: struct-ref stru index

Return the value of field at index in the data structure stru.

Function: struct-set! stru index value

Store value in the field at index in the data structure stru.

Function: struct-and-std-ref stru index std

Check that stru is a struct of type std, then return the value of field at index in the data structure stru.

Function: struct-and-std-set! stru index std value

Check that stru is a struct of type std, store value in the field at index in the data structure stru.

Function: struct=? stru

All the arguments must be structs. Return #t if all the arguments have the same RTD and equal field values according to eqv?. When applied to a single argument: return #t. Note that this function also works when applied to R6RS records.

Function: struct!=? stru

All the arguments must be structs. Return #t if the arguments are all different: no two arguments are equal; otherwise return #f. When applied to a single argument: return #f.

Function: struct-reset! stru

Reset to void all the fields of a structure.


Previous: , Up: syslib structs safe   [Index]