chicken-users
[Top][All Lists]
Advanced

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

[Chicken-users] define-struct and equality


From: Carlos Pita
Subject: [Chicken-users] define-struct and equality
Date: Sun, 24 Jun 2007 23:07:19 -0300

Hi all,

is there any warranty regarding equality and records? Experimentally I got:

#;62> (define-record point x y)
#;63> (define p1 (make-point 1 1))
#;64> (define p2 (make-point 1 1))
#;65> (equal? p1 p2)
#t
#;66> (eq? p1 p2)
#f
#;68> (eqv? p1 p2)
#f

So by-value equality seems to work between different record instances with equal field values, but I'm not sure that I can infer that from this example.
Should I define my own equality predicate?

Thank you in advance
Cheers,
Carlos

reply via email to

[Prev in Thread] Current Thread [Next in Thread]