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

Re: Lexical syntax for boxes

This page is part of the web mail archives of SRFI 111 from before July 7th, 2015. The new archives for SRFI 111 contain all messages, not just those from before July 7th, 2015.

>> It would be useful to define eq?, eqv? and equal? on boxes. (F/X:  Can
>> of worms being opened.)
> The definition of eqv? in RnRS covers them well enough: they are eqv? if
> the are the product of the same call to `box`, otherwise not.  `Eq?` and
> `equal?` by their definitions must agree with `eqv?`.

If boxes are records, then eqv? behaves in this way, although eq? and equal? are not necessarily identical to eqv?. However, unless I am missing something, the SRFI does not require boxes to be records.

Defining equal? on boxes to be more like equal? on vectors of length 1 would be more useful, I think. That is, if boxes are records, then

  (equal? (box 0) (box 0))

need not return #t. I would prefer that it was required to return #t.