This site is a static rendering of the Trac instance that was used by R7RS-WG1 for its work on R7RS-small (PDF), which was ratified in 2013. For more information, see Home. For a version of this page that may be more recent, see ExtendedRecordSyntaxCowan in WG2's repo for R7RS-large.

Extended­Record­Syntax­Cowan

cowan
2015-04-09 22:38:49
1history
source

This is a proposal for extending the syntax of R7RS record type definitions to accommodate the procedural layer of SRFI 99. It is a reduced version of the SRFI 99 syntactic layer that can be implemented with syntax-rules.

Syntactic Layer

The syntactic layer consists of R7RS define-record-type extended with single inheritance and mechanisms for abstract record types.

The syntax of a record-type definition is:

 <definition>           
   -> <record type definition>

 <record type definition>
   -> (define-record-type <type spec>
        <constructor spec>
        <predicate spec>
        <field spec> ...)

 <type spec>  -> <type name>
              -> (<type name> <parent>)

 <constructor spec>
              -> #f
              -> <constructor name>
              -> (<constructor name> <field name> ...)

 <predicate spec>
              -> #f
              -> <predicate name>

 <field spec> -> (<field name> <accessor name>)
              -> (<field name> <accessor name> <mutator name>)

 <parent>           -> <expression>

 <type name>        -> <identifier>
 <constructor name> -> <identifier>
 <predicate name>   -> <identifier>
 <accessor name>    -> <identifier>
 <mutator name>     -> <identifier>
 <field name>       -> <identifier>

The semantics of a record type definition is the same as in R7RS (or SRFI 9, except that record types are generative). The record type definition macro-expands into a cluster of definitions that:

A record type definition extends SRFI 9 with the following additional options: