[r6rs-discuss] [Formal] Add symbol=? and boolean=?

From: Thomas Lord <lord>
Date: Sun Feb 11 14:47:34 2007

bear wrote:
> Per's idea of making eq? undefined on values would more or less
> force people to use eqv? for values - with the result that code
> would have more consistent meaning across implementations and
> machines.
>
>

I think a good definition for eq? would be something like:

   eq? accepts any number of arguments of any type
   and never returns a true value except in cases
   where eqv? would also return true. Implementations
   are advised that eq? should never be more expensive
   (time or space) than eqv? and ideally is significantly
   less expensive.



The Report should permit this implementation:

    (define (eq? . any) #f)

However, it should encourage the use of eq? for, say,
result caching.

Maybe there should also be an eq?-ish approximation of
equal?. Maybe there should also be two equal?-ish
procedures, taking opposite sides on the handling of
circular structures.

I have a nagging feeling that the value/object distinction
is confusing things here. Is that distinction deeply reflected
in the operational semantics? I'd like to be able to explain
the various equality predicates in terms of a simple substitution
of terms in the semantics. A first-class "store" in the semantics
may be needed, but, it has to be "coordinate free" somehow so that
"everything is a value" (a formal term). No?

-t
Received on Sun Feb 11 2007 - 14:54:56 UTC

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