manpagez: man pages & more
info goops
Home | html | info | man
[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.11.3 Object Comparisons

generic: eqv?
method: eqv? ((x <top>) (y <top>))
generic: equal?
method: equal? ((x <top>) (y <top>))
generic: =
method: = ((x <number>) (y <number>))

Generic functions and default (unspecialized) methods for comparing two GOOPS objects.

The default method for eqv? returns #t for all values that are equal in the sense defined by R5RS and the Guile reference manual, otherwise #f. The default method for equal? returns #t or #f in the sense defined by R5RS and the Guile reference manual. If no such comparison is defined, equal? returns the result of a call to eqv?. The default method for = returns #t if x and y are numerically equal, otherwise #f.

Application class authors may wish to define specialized methods for eqv?, equal? and = that compare instances of the same class for equality in whatever sense is useful to the application. Such methods will only be called if the arguments have the same class and the result of the comparison isn't defined by R5RS and the Guile reference manual.


© manpagez.com 2000-2025
Individual documents may contain additional copyright information.