How to Design Programs Languages

1`` | Beginning Student
2`` | Beginning Student with List Abbreviations
3`` | Intermediate Student
4`` | Intermediate Student with Lambda
5`` | Advanced Student
| Index

On this page:

define-struct

Version: 4.0.2
contents index
← prev up next →

#### 5.2`` define-struct

(define-struct structid (fieldid ...))

The same as Intermediate’s define-struct, but defines an additional set of operations:

- make-structid : takes a number of arguments equal to the number of fields in the structure type, and creates a new instance of the structure type.

- set-structid-fieldid! : takes an instance of the structure and a value, and changes the instance’s field to the given value.

contents index
← prev up next →