unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
* bug#37461: define-generic doesn't promote equal? to generic
@ 2019-09-19 15:37 Rob Browning
  2019-09-19 23:27 ` Rob Browning
  0 siblings, 1 reply; 7+ messages in thread
From: Rob Browning @ 2019-09-19 15:37 UTC (permalink / raw)
  To: 37461


Version: 2.2.6

  scheme@(guile-user)> (use-modules (oop goops))
  scheme@(guile-user)> equal?
  $1 = #<procedure equal? (#:optional _ _ . _)>
  scheme@(guile-user)> (define-generic equal?)
  scheme@(guile-user)> equal?
  $2 = #<procedure equal? (#:optional _ _ . _)>

The same appears to be true for other primitives like + too, but if I'm
reading it right, this makes it sound like it was intended to work:

  https://www.gnu.org/software/guile/docs/master/guile.html/Extending-Primitives.html

You can work around the problem by stashing equal? somewhere else, and
then define-generic will work after a (define equal? #f).  Presumably
you'd then need to define a base specialization using the original
equal? or do something equivalent.

I also noticed goops itself does this: https://git.savannah.gnu.org/gitweb/?p=guile.git;a=blob;f=module/oop/goops.scm;h=837a667e602\
5b6f8ed7818e5a8efe064cca7843d;hb=791cae940afcb2b2eb2c167fe438be1dc1008a73#l2335

Thanks
-- 
Rob Browning
rlb @defaultvalue.org and @debian.org
GPG as of 2011-07-10 E6A9 DA3C C9FD 1FF8 C676 D2C4 C0F0 39E9 ED1B 597A
GPG as of 2002-11-03 14DD 432F AE39 534D B592 F9A0 25C8 D377 8C7E 73A4





^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-09-28 17:31 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-19 15:37 bug#37461: define-generic doesn't promote equal? to generic Rob Browning
2019-09-19 23:27 ` Rob Browning
2019-09-21 15:15   ` Rob Browning
2019-09-21 17:08   ` Rob Browning
2019-09-23 15:01     ` Mikael Djurfeldt
2019-09-28 16:51       ` Mikael Djurfeldt
2019-09-28 17:31         ` Rob Browning

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).