[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Lexical syntax for boxes
>> 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.
> It does not, but the content of a box is obviously a location, and it
> would be contrary to the spirit, if not the letter, of RnRS to make things
> `eqv?` that denote distinct locations, or not `eqv?` if they denote the
> same location. As for `eq?`, it must behave the same as `eqv?` except
> for the specific and traditional exceptions of characters and bignums.
A SRFI is a mini-standard. You can invoke the spirit when you're designing it. However, the text needs to specify the behavior of eqv? and eq?.
>> Defining `equal?` on boxes to be more like `equal?` on vectors of
>> length 1 would be more useful, I think.
> It might or it might not be, depending on one's needs.
My feeling is that the spirit of equal? is "equivalent same in the absence of mutation, eqv?, and eq?". However, R7RS abandoned this for records, presumably for a good reason.
Anyway, the SRFI needs to say what the behaviour of equal? is for boxes, regardless of whether you adopt vector-like or record-like behaviour.