(index ("make-rtd" 0) ("rtd?" 226) ("rtd-constructor" 332) ("rtd-predicate" 564) ("rtd-accessor" 717) ("rtd-mutator" 989) ("record?" 1185) ("record-rtd" 1292) ("rtd-name" 1515) ("rtd-uid" 1625) ("rtd-sealed?" 1756) ("rtd-opaque?" 1886) ("rtd-parent" 2058) ("rtd-field-names" 2179) ("rtd-all-field-names" 2317) ("rtd-field-mutable?" 2472) ("make-rtp" 2650) ("rtd-properties" 2759) ("rtd-all-properties" 2905) ("define-record-type" 3072) ("define-record-type" 3072) ("define-record-constructor" 3887) ("define-record-constructor" 3887) ("define-record-constructor" 3887) ("define-record-predicate" 4415) ("define-record-predicate" 4415) ("define-record-field" 4772) ("define-record-field" 4772) ("define-record-field" 4772) ("define-record-field" 4772) ("define-record-property" 5506) ("define-record-printer" 5721) ("define-record-printer" 5721) ("define-variant-type" 6205) ("define-variant-type" 6205) ("define-variant-constructor" 6850) ("variant-case" 7470))
(def (sig (procedure "(make-rtd NAME FIELDS [[#:parent] PARENT #f] [#:uid UID (gensym NAME)] [#:sealed SEALED? #f] [#:opaque OPAQUE? #f] [#:property RTP VALUE] ...)" (id make-rtd))) (p "Create a new record type descriptor."))
(def (sig (procedure "(rtd? V)" (id rtd?))) (p "Test whether " (tt "V") " is a record type descriptor."))
(def (sig (procedure "(rtd-constructor RTD [FIELDS])" (id rtd-constructor))) (p "Obtain a constructor procedure for records of the type described by " (tt "RTD") ", optionally restricting the " (tt "FIELDS") " to be initialized."))
(def (sig (procedure "(rtd-predicate RTD)" (id rtd-predicate))) (p "Obtain a predicate procedure for records of the type described by " (tt "RTD") "."))
(def (sig (procedure "(rtd-accessor RTD NAME)" (id rtd-accessor))) (p "Obtain an accessor procedure for the field called " (tt "NAME") " in records of the type described by " (tt "RTD") ". If the field is mutable, the accessor procedure has an attached SRFI-17 setter."))
(def (sig (procedure "(rtd-mutator RTD NAME)" (id rtd-mutator))) (p "Obtain a mutator procedure for the mutable field called " (tt "NAME") " in records of the type described by " (tt "RTD") "."))
(def (sig (procedure "(record? V)" (id record?))) (p "Test whether " (tt "V") " is some kind of record."))
(def (sig (procedure "(record-rtd V)" (id record-rtd))) (p "Obtain the record type descriptor corresponding to " (tt "V") "'s type or return " (tt "#f") " if " (tt "V") " is not an instance of a transparent record type."))
(def (sig (procedure "(rtd-name RTD)" (id rtd-name))) (p "Determine the descriptive name of a record type."))
(def (sig (procedure "(rtd-uid RTD)" (id rtd-uid))) (p "Determine the unique identifier used to tag instances of a record type."))
(def (sig (procedure "(rtd-sealed? RTD)" (id rtd-sealed?))) (p "Test whether a record type is sealed and cannot have subtypes."))
(def (sig (procedure "(rtd-opaque? RTD)" (id rtd-opaque?))) (p "Test whether a record type is opaque and cannot be extracted from instances using " (tt "record-rtd") "."))
(def (sig (procedure "(rtd-parent RTD)" (id rtd-parent))) (p "Determine the parent type descriptor of " (tt "RTD") "."))
(def (sig (procedure "(rtd-field-names RTD)" (id rtd-field-names))) (p "Compute a vector of fields defined directly by " (tt "RTD") "."))
(def (sig (procedure "(rtd-all-field-names RTD)" (id rtd-all-field-names))) (p "Compute a vector of fields defined by " (tt "RTD") " or its supertypes."))
(def (sig (procedure "(rtd-field-mutable? RTD NAME)" (id rtd-field-mutable?))) (p "Test whether the field called " (tt "NAME") " in records of type " (tt "RTD") " is mutable."))
(def (sig (procedure "(make-rtp [DEFAULT #f])" (id make-rtp))) (p "Create a new record property accessor."))
(def (sig (procedure "(rtd-properties RTD)" (id rtd-properties))) (p "Compute a list of record properties attached directly to " (tt "RTD") "."))
(def (sig (procedure "(rtd-all-properties RTD)" (id rtd-all-properties))) (p "Compute a list of all record properties attached to " (tt "RTD") " or its supertypes."))
(def (sig (syntax "(define-record-type (RTD OPTION ...) CONSTRUCTOR PREDICATE FIELD ...)" (id define-record-type)) (syntax "(define-record-type RTD CONSTRUCTOR PREDICATE FIELD ...)" (id define-record-type))) (p "Defines a new record type " (tt "RTD") ", optionally passing a set of " (tt "OPTION") "s to " (tt "make-rtd") ". The record has fields described by the given " (tt "FIELD") " specifications.") (p "If " (tt "CONSTRUCTOR") " is not " (tt "#f") ", a constructor procedure for the new record type is defined using " (tt "define-record-constructor") ", if " (tt "PREDICATE") " is not " (tt "#f") " a predicate procedure for the new record type is defined using " (tt "define-record-predicate") ".") (p "Accessors and mutators for the record type's fields are defined using " (tt "define-record-field") "."))
(def (sig (syntax "(define-record-constructor RTD (NAME FIELD ...))" (id define-record-constructor)) (syntax "(define-record-constructor RTD NAME)" (id define-record-constructor)) (syntax "(define-record-constructor RTD #t)" (id define-record-constructor))) (p "Defines " (tt "NAME") " as a constructor procedure for instances of " (tt "RTD") ", optionally restricting the set of initialized " (tt "FIELD") "s.") (p "If the only argument is " (tt "#t") ", the name is formed by prepending " (tt "make-") " to " (tt "RTD") "."))
(def (sig (syntax "(define-record-predicate RTD NAME)" (id define-record-predicate)) (syntax "(define-record-predicate RTD #t)" (id define-record-predicate))) (p "Defines " (tt "NAME") " as a predicate procedure for instances of " (tt "RTD") ".") (p "If the only argument is " (tt "#t") ", the name is formed by appending " (tt "?") " to " (tt "RTD") "."))
(def (sig (syntax "(define-record-field RTD (NAME ACCESSOR MUTATOR))" (id define-record-field)) (syntax "(define-record-field RTD (NAME))" (id define-record-field)) (syntax "(define-record-field RTD (NAME ACCESSOR))" (id define-record-field)) (syntax "(define-record-field RTD NAME)" (id define-record-field))) (p "Defines accessor and possibly mutator procedures for the field " (tt "NAME") " in instances of " (tt "RTD") ".") (p "If the accessor name is not specified (in the second or fourth form), it is formed by appending " (tt "RTD") ", " (tt "-") " and " (tt "NAME") ". If the mutator name is not specified (in the second form), it is formed by appending " (tt "RTD") ", " (tt "-") ", " (tt "NAME") " and " (tt "-set!") "."))
(def (sig (syntax "(define-record-property RTP [DEFAULT])" (id define-record-property))) (p "Defines a new record property accessor " (tt "RTP") ", optionally passing a " (tt "DEFAULT") " to " (tt "make-rtp") "."))
(def (sig (syntax "(define-record-printer (RTD . ARGS) . BODY)" (id define-record-printer)) (syntax "(define-record-printer RTD EXPR)" (id define-record-printer))) (p "Defines a record printer for direct instances of " (tt "RTD") ".") (p "In contrast to the built-in form of this macro provided by the CHICKEN standard library, " (tt "RTD") " is interpreted as an identifier bound to a record type descriptor, not as the unique identifier used to tag instances of the record type."))
(def (sig (syntax "(define-variant-type (RTD OPTION ...) PREDICATE (VARIANT FIELD ...) ...)" (id define-variant-type)) (syntax "(define-variant-type RTD PREDICATE (VARIANT FIELD ...) ...)" (id define-variant-type))) (p "Defines a new record type " (tt "RTD") ", optionally passing a set of " (tt "OPTION") "s to " (tt "make-rtd") ". The record has no fields.") (p "If " (tt "PREDICATE") " is not " (tt "#f") " a predicate procedure for the new record type is defined using " (tt "define-record-predicate") ".") (p "Variant subtypes of " (tt "RTD") " are defined using " (tt "define-variant-constructor") " for each " (tt "VARIANT") " clause."))
(def (sig (syntax "(define-variant-constructor RTD (VARIANT FIELD ...))" (id define-variant-constructor))) (p "Defines a constructor for a new variant subtype of " (tt "RTD") ". The subtype has the given immutable " (tt "FIELD") "s and the constructor initializes all fields of the record.") (p "The variant subtype is sealed and it is opaque iff " (tt "RTD") " is opaque. The UID of the subtype is formed by appending the UID of " (tt "RTD") ", " (tt "-") " and " (tt "VARIANT") ".") (p "The record type descriptor of the variant subtype is attached to the constructor " (tt "VARIANT") " as extended procedure data."))
(def (sig (syntax "(variant-case RTD V ((VARIANT FIELD ...) . BODY) [(else . BODY)])" (id variant-case))) (p "The form first ensures that " (tt "V") " is indeed an instance of " (tt "RTD") ", raising a type error otherwise.") (p "Each " (tt "VARIANT") " designates a variant subtype constructor, each " (tt "FIELD") " is an identifier to be bound to the corresponding, identically named field of the variant instance. If any of the variant clauses matches the type of " (tt "V") ", the corresponding " (tt "BODY") " is evaluated and the result is returned from the variant-case form.") (p "If none of the variant clauses match the type of " (tt "V") ", the else clause's " (tt "BODY") " is evaluated instead. If no else clause is present either, an error is raised indicating that no matching variant was found."))
