5.3.2
28 Structs
This library is unstable;
compatibility will not be maintained.
See Unstable: May Change Without Warning for more information.
(require unstable/struct) |
syntax
(make struct-id expr ...)
Creates an instance of struct-id, which must be bound as a
struct name. The number of exprs is statically checked
against the number of fields associated with struct-id. If
they are different, or if the number of fields is not known, an error
is raised at compile time.
Examples: | |||||||||
|
procedure
(struct->list v [#:on-opaque on-opaque]) → (or/c list? #f)
v : any/c on-opaque : (or/c 'error 'return-false 'skip) = 'error
Returns a list containing the struct instance v’s
fields. Unlike struct->vector, the struct name itself is not
included.
If any fields of v are inaccessible via the current inspector the behavior of struct->list is determined by on-opaque. If on-opaque is 'error (the default), an error is raised. If it is 'return-false, struct->list returns #f. If it is 'skip, the inaccessible fields are omitted from the list.
Examples: | |||||||||||||||||||||
|