Next: , Previous: , Up: srfi err5rs records spec   [Index]


2.32.3.2 Inspection Layer

The (srfi :99 records inspection) library exports the following procedures.

Function: record? obj

Equivalent to its R6RS namesake.

Function: record-rtd record

Equivalent to its R6RS namesake.

Function: rtd-name rtd

Equivalent to the record-type-name procedure of the R6RS.

Function: rtd-parent rtd

Equivalent to the record-type-parent procedure of the R6RS.

Function: rtd-field-names rtd

Equivalent to the record-type-field-names procedure of the R6RS. (That is, it returns a vector of the symbols that name the fields of the record–type represented by rtd, excluding the fields of parent record–types.)

Function: rtd-all-field-names rtd

Return a vector of the symbols that name the fields of the record–type represented by rtd, including the fields of its parent record–types, if any. The fields of parent record–types come before the fields of its children, with each subsequence in the same order as in the vectors that would be returned by calling rtd-field-names on rtd and on all its ancestral record–type descriptors.

Could be defined by:

(define (rtd-all-field-names rtd)
  (define (loop rtd othernames)
    (let ((parent (rtd-parent rtd))
          (names (append (vector->list
                          (rtd-field-names rtd))
                         othernames)))
      (if parent
          (loop parent names)
          (list->vector names))))
  (loop rtd '()))
Function: rtd-field-mutable? rtd field

rtd is a record–type descriptor, and field is a symbol naming a field of the record–type described by rtd. Return #t if the named field is mutable; otherwise returns #f.