Subject: Rationale 15.1
From: Andre van Tonder
Date: Wed, 27 Jun 2007 11:06:32 -0400 (EDT)
Submitted by : Andre van Tonder
Section : Rationale 15.1
Priority : Apparently high (based on reaction in this list)
Summary:
--------
Objection to Rationale 15.1.
Resubmitted as formal comment on advice from an editor
because it would override a previous formal comment.
Description:
------------
- (15.1) "Therefore, the parent clause only accepts other
record types defined using the syntactic layer." - I do not think
the argument given implies the necessity of the "therefore", since
an implementation can determine for itself whether the parent
has been defined via the syntactic layer and optimize or not based
on that determination. More seriously, I think
this restriction impedes modularity - changing
a definition from syntactic to procedural in some library
may break dependent libraries even if no properties of the
record type (other than the mode of definition) has been changed.
In fact, the mode of definition becomes an extra property of the
data type, so the "syntactic layer" is not really a "layer" but
introduces new things.
RESPONSE:
With the addition of the parent-rtd clause, it is now possible to specify
record-type descriptors created by make-record-type-descriptor as parents
of syntactically defined record types. It remains impossible to do so
through the parent clause, which requires a . The
record-type descriptors of the procedural layer and the s
of the syntactic layer are not interchangeable, since it is possible to
determine the record constructor descriptor from the latter but not from
the former.
It has been suggested that s be variables bound to
record-type descriptors, that a default constructor descriptor be
associated with all record-type descriptors, and that the parent and
parent-rtd clauses be merged into one clause that requires an expression
that evaluates to a parent descriptor. While too big of a change to make
at this stage for R6RS, this would address the concerns of the comment
submitter, and it would be a worthwhile change to consider for R7RS. It
is important to note, however, that the syntactic layer is designed to
allow define-record-type to determine record-instance sizes and field
offsets (in the absense of the parent-rtd clause) so that implementations
can generate efficient code for record creation and access without
compiler support for record-type descriptors and related analyses. This
property would be lost if s were ordinary mutable variables
but can be preserved if the bindings are immutable.