7.7
34 meta operations on structs
34.1 Typed macros and procedures
Expands to a predicate for the given
struct, with the
type
(-> any/c boolean? : s).
This macro expands to the constructor function for the given
struct,
with the type
(-> arg … s) where each
arg corresponds to an
argument expected by the
struct’s constructor.
This macro expands to the
i-th accessor function for the given
struct, with the type
(-> s t) where
t is the
struct’s
i-th field’s type.
If the second argument is an identifier, then this macro concatenates the
identifiers s and field with a - in between, and
expands to the resulting s-field. The lexical context of
s-field is the same as the lexical context of s. In some
rare cases this might not resolve to the accessor for field on
s. Passing an exact-nonnegative-integer? as the second
argument should be more reliable.
Returns #t if the given struct type can be determined
to have only immutable fields. Returns #f otherwise.
Returns
#t if
v can be determined to be an instance of an
immutable struct. Returns
#f otherwise. Note that when given an
instance of an opaque struct
struct-instance-is-immutable? cannot
access the struct info, and therefore returns
#f.
34.2 Untyped versions of the meta-struct typed macros
34.3 Untyped for-syntax utilities
Returns
#t if
v can be used by the
functions provided by this module, and
#f
otherwise. More precisely,
v must be an
identifier whose
syntax-local-value is a
struct-info?.
Changed in version 1.0 of package phc-toolkit: This function is provided at phase 1.
Changed in version 1.0 of package phc-toolkit: The identifiers are provided at phase 1.
Returns the
meta-struct-info for the given
identifier. The optional
#:srcloc keyword argument
gives the source location for error messages in case the
given identifier is not a
meta-struct?.
Changed in version 1.0 of package phc-toolkit: This function is provided at phase 1.
Returns
#t if the
struct associated to
the identifier
sub is a subtype of the
struct associated to the identifier
super, and
#f otherwise or if the current
inspector is not strong enough to know.
Changed in version 1.0 of package phc-toolkit: This function is provided at phase 1.
Returns #t if the struct with the given id can be determined
to have only immutable fields. Returns #f otherwise.
| | s : meta-struct? | srcloc : (or/c #f syntax?) = #f |
|
|
Changed in version 1.0 of package phc-toolkit: This function is provided at phase 1.
Changed in version 1.0 of package phc-toolkit: This function is provided at phase 1.
Changed in version 1.0 of package phc-toolkit: This function is provided at phase 1.
Changed in version 1.0 of package phc-toolkit: This function is provided at phase 1.
|
(!struct-mutators s maybe-srcloc)
| | s | | = | | meta-struct? | | | | | | maybe-srcloc | | = | | | | | | | | #:srcloc srcloc |
|
|
Changed in version 1.0 of package phc-toolkit: This function is provided at phase 1.
Changed in version 1.0 of package phc-toolkit: This function is provided at phase 1.