[racket] bug? bit-vector equal problem
I submitted a PR with a suggested fix:
https://github.com/plt/racket/pull/756
> Looking at bit-vector.rkt, it seems the problem might be the "TODO"
> comment here:
>
> (serializable-struct bit-vector (words size)
> ....
> #:methods gen:equal+hash
> [(define (equal-proc x y recursive-equal?)
> (let ([vx (bit-vector-words x)]
> [vy (bit-vector-words y)]
> [nx (bit-vector-size x)]
> [ny (bit-vector-size y)])
> (and (= nx ny)
> (for/and ([index (in-range (- (bytes-length vx) 1))])
> (eq? (bytes-ref vx index)
> (bytes-ref vy index)))
> ; TODO: check last word
> )))
> ....