1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-20 18:50:21 +02:00

* goops.scm (equal?): Provide default method for `equal?'.

(compute-getters-n-setters): Check for bad init-thunks.

* eq.c (scm_eqv_p, scm_equal_p): Turned into a primitive generics.

* goops.texi (Object Comparisons): Removed object-eqv? and
object-equal? and added eqv?, equal? and =.
This commit is contained in:
Mikael Djurfeldt 2003-04-17 18:47:18 +00:00
parent 071d6b0ecc
commit e672dd0208
6 changed files with 37 additions and 15 deletions

View file

@ -1,3 +1,8 @@
2003-04-17 Mikael Djurfeldt <djurfeldt@nada.kth.se>
* goops.texi (Object Comparisons): Removed object-eqv? and
object-equal? and added eqv?, equal? and =.
2002-11-08 Neil Jerram <neil@ossau.uklinux.net>
* goops.texi (Top): Say "Indices" before index nodes in main menu.

View file

@ -26,7 +26,7 @@ Guile
@ifinfo
This file documents GOOPS, an object oriented extension for Guile.
Copyright (C) 1999, 2000, 2001 Free Software Foundation
Copyright (C) 1999, 2000, 2001, 2003 Free Software Foundation
Permission is granted to make and distribute verbatim copies of
this manual provided the copyright notice and this permission notice
@ -2372,17 +2372,30 @@ as done by @code{scm-error}.
@node Object Comparisons
@subsection Object Comparisons
@deffn generic object-eqv?
@deffnx method object-eqv? ((x <top>) (y <top>))
@deffnx generic object-equal?
@deffnx method object-equal? ((x <top>) (y <top>))
@deffn generic eqv?
@deffnx method eqv? ((x <top>) (y <top>))
@deffnx generic equal?
@deffnx method equal? ((x <top>) (y <top>))
@deffnx generic =
@deffnx method = ((x <number>) (y <number>))
Generic functions and default (unspecialized) methods for comparing two
GOOPS objects.
The default methods always return @code{#f}. Application class authors
may wish to define specialized methods for @code{object-eqv?} and
@code{object-equal?} that compare instances of the same class for
equality in whatever sense is useful to the application.
The default method for @code{eqv?} returns @code{#t} for all values
that are equal in the sense defined by R5RS and the Guile reference
manual, otherwise @code{#f}. The default method for @code{equal?}
returns @code{#t} or @code{#f} in the sense defined by R5RS and the
Guile reference manual. If no such comparison is defined,
@code{equal?} returns the result of a call to @code{eqv?}. The
default method for = returns @code{#t} if @var{x} and @var{y} are
numerically equal, otherwise @code{#f}.
Application class authors may wish to define specialized methods for
@code{eqv?}, @code{equal?} and @code{=} 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.
@end deffn
@node Cloning Objects