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.
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: