[Top][All Lists]

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

Re: GOOPS: object-equal?

From: Mikael Djurfeldt
Subject: Re: GOOPS: object-equal?
Date: Thu, 17 Apr 2003 21:05:16 +0200
User-agent: Gnus/5.090018 (Oort Gnus v0.18) Emacs/21.2 (gnu/linux)

Marko Rauhamaa <address@hidden> writes:

> The GOOPS documentation states that one should use object-eqv? and
> object-equal? instead of eqv? and equal?. Furthermore, goops.scm makes
> it look like the object-eq... methods get called from the guile core:
> ========================================================================
> ;;;
> ;;; {Standard methods used by the C runtime}
> ;;;
> ;;; Methods to compare objects
> ;;;
> (define-method (object-eqv? x y)    #f)
> (define-method (object-equal? x y)  (eqv? x y))
> ========================================================================
> However, I have found no guile code calling these methods, and my call
> to "member" definitely does not get routed to object-equal?.
> Is this a bug or a feature?

It was a feature, however one could regard the comments in goops.scm
as a bug.

> Should I not be able to override equal? for my classes? Should there
> be separate series of generic functions for lists, alists, hash
> tables and alike?

Well, I think you at least should be able to provide methods which
specialize eqv? and equal? to userdefined classes.  This has been
planned for long, but I missed doing it before the 1.6 release.

However, I've introduced it in 1.6.4 (and current 1.6 and HEAD CVS),
and updated the documentation.

Mikael D.

reply via email to

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