From R6RS:
The equal? predicate treats pairs and vectors as nodes with outgoing edges, uses string=? to compare strings, uses bytevector=? to compare bytevectors (see library chapter on “Bytevectors”), and uses eqv? to compare other nodes.
In other words, your use of equal?
is really just doing the same thing as eqv?
since that's how it's specified for records (see last line of above).
Chapter 6.1 has this to say about eqv?
of records:
If obj1 and obj2 are both records of the same record type, and are the results of two separate calls to record constructors, then eqv? returns #f.
In your code, the two records are the results of two separate calls to the constructor. Hence they cannot be eqv?
.
Some dialects of Scheme may allow you to use structural equality on records. For example, in Racket you can declare a record as #:transparent
to get structural equality. I'm not sure you can get this behavior in standard Scheme.