* GOOPS: object-equal?
@ 2003-04-16 23:44 Marko Rauhamaa
2003-04-17 19:05 ` Mikael Djurfeldt
0 siblings, 1 reply; 2+ messages in thread
From: Marko Rauhamaa @ 2003-04-16 23:44 UTC (permalink / raw)
(guile-1.6.0.tar.gz)
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? 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?
Marko
--
Marko Rauhamaa mailto:marko@pacujo.net http://pacujo.net/marko/
_______________________________________________
Bug-guile mailing list
Bug-guile@gnu.org
http://mail.gnu.org/mailman/listinfo/bug-guile
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: GOOPS: object-equal?
2003-04-16 23:44 GOOPS: object-equal? Marko Rauhamaa
@ 2003-04-17 19:05 ` Mikael Djurfeldt
0 siblings, 0 replies; 2+ messages in thread
From: Mikael Djurfeldt @ 2003-04-17 19:05 UTC (permalink / raw)
Cc: djurfeldt
Marko Rauhamaa <marko@pacujo.net> 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.
_______________________________________________
Bug-guile mailing list
Bug-guile@gnu.org
http://mail.gnu.org/mailman/listinfo/bug-guile
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2003-04-17 19:05 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-04-16 23:44 GOOPS: object-equal? Marko Rauhamaa
2003-04-17 19:05 ` Mikael Djurfeldt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).