[R6RS] revised draft of record srfi

Michael Sperber sperber
Sat Aug 13 13:02:23 EDT 2005


Thanks for the comments!  Sorry for replying so late---I recently
started work on a new contract, and I have very little spare time
currently.

William D Clinger <will at ccs.neu.edu> writes:

> Specification of record-constructor:
> Since "the types handled specially by equal?" is open-ended,
> with nothing to prevent equal? from handling *all* non-R5RS
> types specially, the second paragraph of this spec is equivalent
> to saying that "Two records...are equal according to equal? iff
> they are eq?, provided they are not one of the exceptions to that
> rule."  That's pretty silly, IMO.

I agree that the wording is silly---I'll fix that.  But the intent
should be clear: I wanted to specify a list of exceptions, namely
those types explicitly mentioned in the definition of EQUAL?.

>     Any two records created by such a constructor are equal
>     according to equal? iff they are eq?.  Furthermore any
>     record <VAL>r1</VAL> satisfies (eqv? <VAL>r1</VAL> <VAL>r1</VAL>).
>     This does not imply (eq? <VAL>r1</VAL> <VAL>r1</VAL>).

I don't follow this: What exactly does R1 denote in this language?  An
expression?  A value?  I presume you mean

(let ((r1 ((record-constructor rtd) ...)))
  (eq? r1 r1)
=> unspecified

This certainly allows boxing/unboxing optimizations, but also
decreases the usefulness of records, as I can't use them
straightforwardly to generate unique values.  So I'll write this up as
an issue.

Moreover, I don't think tying opaqueness to EQUAL? is not a good idea
(as I posted previously---nobody replied)---I don't see the inherent
connection.   What's the rationale for forcing

(record? (cons 1 2)) => #f

?

Moreover, what's the rationale for EQUAL? being unspecified for opaque
record types created by the user program?

> Since the record constructor for an opaque type does not return
> a record, this spec should say
>
>     Returns a procedure that, given an object obj, returns #t
>     iff obj is a value created by (record-constructor rtd).
> [...]

I don't see what's wrong with the old language---could you explain?
Specifically, this language makes a closed-world assumption---there
may be other ways to create records than through procedures created by
RECORD-CONSTRUCTOR.

> Specification of define-type:
> I don't know what the spec means by "create identical bindings".
> In Scheme, most bindings map identifiers to locations; is the
> requiring the same locations to be used for every evaluation of
> a local non-generative type definition?  If so, then the
> non-generative definition is effectively global, and it would be
> useful to say that.  This would be the first example in Scheme
> of a local binding form that creates global bindings.

No---I meant procedures that are in some sense observationally
equivalent, modulo EQ?.  Do you have a suggestion on how to word this
better?

-- 
Cheers =8-} Mike
Friede, V?lkerverst?ndigung und ?berhaupt blabla


More information about the R6RS mailing list