equal? for continuation prompt tags... Jim Rees (04 Jan 2023 18:20 UTC)
Re: equal? for continuation prompt tags... Marc Nieper-Wißkirchen (04 Jan 2023 18:41 UTC)
Re: equal? for continuation prompt tags... Jim Rees (04 Jan 2023 20:41 UTC)
Re: equal? for continuation prompt tags... Marc Nieper-Wißkirchen (04 Jan 2023 22:12 UTC)

Re: equal? for continuation prompt tags... Marc Nieper-Wißkirchen 04 Jan 2023 18:41 UTC

Am Mi., 4. Jan. 2023 um 19:20 Uhr schrieb Jim Rees <xxxxxx@gmail.com>:
>
> ...and continuation marks, and thread-privates.
>
> What's the motivation for requiring equal? to distinguish different ones?    Debuggability via distinct printed representations perhaps?

My idea was that this guarantees the most for the user of SRFI 226
because equal? is the coarsest standard equivalence predicate.  This
is what Racket does as well, so there is a compatibility argument.

> The problem I see is that R7RS does not specify the behavior of equal? on two records that are not eqv?
>
> On implementations where equal?  treats same-typed records as if the fields were vector elements, one will need something like incrementing integers in a field to distinguish these objects.   While that would enhance debuggability, it shouldn't technically be necessary for this application.

Such an implementation would need an extra clause for equal? when
continuation prompt tags, etc. are to be compared.

Even in an R6RS implementation where records are compared using eqv?,
an extra internal field may be necessary because an R6RS
implementation is allowed to treat two records with only immutable
fields the same if they are field-wise the same.

Would you prefer eqv?

Marc