Next: , Previous: Records, Up: Compound Data Types

5.6.9 Structures

A structure is a first class data type which holds Scheme values or C words in fields numbered 0 upwards. A vtable represents a structure type, giving field types and permissions, and an optional print function for write etc.

Structures are lower level than records (see Records) but have some extra features. The vtable system allows sets of types be constructed, with class data. The uninterpreted words can inter-operate with C code, allowing arbitrary pointers or other values to be stored along side usual Scheme SCM values.