So the
compatible way to extract a runtime record type descriptor is to
extract it from an instance.
Fair enough.
Fields do not have to have unique names when converted to symbols. So
the interface either has to build on iterators or on indices.
Indices are better, I think. Chibi has (slot-ref rtd record index) and (slot-set! rtd record index newvalue). Note that these do the work for you: they don't return a procedure to do it.grr
If we have given up SRFI 99 compatibility, then record-rtd can return #f if no rtd is available, and all we need are record-rtd, slot-ref, slot-set!, and
record-construct.mm
PS Whether such an interface helps for pattern matching is another
matter. If procedural, it cannot be a simple interface based on
symbols but will have to be tied to the low-level representations of
identifiers and will only work with procedural macros. '
Not if we require that the indices 0, ... n-1 correspond to the n fields of a record type in order.
John Cowan
http://vrici.lojban.org/~cowan xxxxxx@ccil.orgCash registers don't really add and subtract;
they only grind their gears.
But then they don't really grind their gears, either;
they only obey the laws of physics. --Unknown