[r6rs-discuss] [Formal] Why are simple conditions so different from records

From: Michael Sperber <sperber>
Date: Mon Mar 12 14:23:32 2007

AndrevanTonder <andre_at_het.brown.edu> writes:

> The interface for simple conditions is different from that of records
> but redundantly reproduces much of the functionality of records.
> Consider making the interfaces more similar or even dropping simple
> conditions as a separate concept and instead using a record hierarchy
> for them.

That's certainly a valid implementation strategy. Somewhere in the
r6rs-editors archives, I posted such an implementation (of the earlier
version of the conditions, but the changes for 5.92 only make this
easier).

Here's why they're different: Because of compound conditions, the
record accessors won't be the condition accessors. (Similarly for the
predicates, and possibly for the constructors.) This is why a little
bit of scaffolding is needed. Also, in my experience, introspection
is more common for conditions than for garden-variety records.
There's also some other natural specialization, such as the fact that
fields are always immutable, and that accessor names often don't
derive straightforwardly from the type names.

Consequently, I think that the conditions are already more similar to
the records as of 5.92. Maybe it would help if you were a bit more
specific as to what kind of change you would like to see.

-- 
Cheers =8-} Mike
Friede, V?lkerverst?ndigung und ?berhaupt blabla
Received on Mon Mar 12 2007 - 14:23:24 UTC

This archive was generated by hypermail 2.3.0 : Wed Oct 23 2024 - 09:15:01 UTC