[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Scheme-reports] Procedural equivalence: the last debate

Taylan Ulrich B. wrote:

> Actually, R5RS explicitly lists procedures as one of the types whose
> behavior is guaranteed to be same for eq? and eqv?.  (R3RS and R4RS do
> not; and I don't have the IEEE document.)

My bad.  I thought the R5RS language for this was identical to
what's in the IEEE standard, and looked only at the R3RS, R4RS,
and IEEE standards.

Adding procedures to that list was definitely a change from the
R3RS, R4RS, and IEEE standards, but the list of language changes
on page 45 doesn't list it.  That's probably my fault, because I
was primary editor for the R5RS.

I don't remember anything about this change.  Considering the
times, it probably means one of the 21 listed authors held out
for it.  Although at least 3 of the 21 listed authors would have
opposed that change just as adamantly, those 3 were no longer
participating by the time the R5RS came out.

> I believe this must have been a mistake though, because it means that
> either eqv? must be as primitive as eq? (i.e. it's prohibited from
> detecting more sophisticated cases of operational equivalence), or eq?
> must be as complex as eqv? (i.e. it cannot be implemented as pointer
> comparison anymore), except if operationally equivalent procedures are
> detected at compile-time already and made to be represented by the same
> pointer, so eq? can be as smart as eqv? for procedures and still just be
> a pointer comparison.  I see no reason for the standard to force this
> specific strategy for that optimization though[1], when allowing eqv? to
> be more capable than eq? would have allowed it to implement the same
> sophisticated operational equivalence via different strategies while eq?
> continues to be the mere object-identity test which we've always been
> used to.

I agree that the change was a mistake, but it was probably a deliberate
mistake.  Many deliberate mistakes have been made, usually to appease
one or another of the competing ideologies.

Thank you for your remarks.  I agree with everything you wrote.


Scheme-reports mailing list