[racket] bug? bit-vector equal problem
I can repro it on 6.1.0.3.
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
)))
....
But, you say, you're using equal? Although I'm not familiar with
gen:equal+hash, it must be that equal? checks for and uses that.
(I say "must" because I know that equal? always returns #f for a non
#:transparent struct. Since you're getting #t, at all, it can't be
plain equal?.)