unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
* Problem merging generics across modules
@ 2017-10-13  0:01 Andrew Erlanger
  2017-10-13  0:03 ` Andrew Erlanger
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Andrew Erlanger @ 2017-10-13  0:01 UTC (permalink / raw)
  To: guile-user

Hello, Schemers,

I am trying to extend the definition of a few primitives,
including equal?, in a project of mine. Let's say that a.scm contains:

(define-module (project a)
  #:use-module (oop goops)  
  #:export (equal?)

...

(define-method (equal? (c1 <color>) (c2 <color>))
   (same-rgb? c1 c2))

Now I go to the REPL, and this is what I see:

scheme@(guile-user)> equal?
WARNING: (guile-user): `equal?' imported from both (ice-9 r5rs) and (capital base)
$2 = #<<generic> equal? (2)>
scheme@(guile-user)> (equal? 2 3)
ERROR: In procedure scm-error:
ERROR: No applicable method for #<<generic> equal? (2)> in call (equal? 2 3)

Now I'm aware of "#:duplicates (merge-generics)", but I don't understand
how to apply it in this case. I've tried replacing the module definition with:

(define-module (project a)
  #:use-module (oop goops)  
  #:use-module (ice-9 r5rs)
  #:duplicates (merge-generics)
  #:export (equal?)

but this doesn't seem to do anything.

Any advice? Thank you.

- Andrew



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

end of thread, other threads:[~2017-10-17 23:23 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-13  0:01 Problem merging generics across modules Andrew Erlanger
2017-10-13  0:03 ` Andrew Erlanger
2017-10-13 14:12 ` David Pirotte
2017-10-13 15:14   ` David Pirotte
2017-10-13 14:35 ` David Pirotte
     [not found]   ` <874lqxbgnf.fsf@ateguix.i-did-not-set--mail-host-address--so-tickle-me>
2017-10-17 23:23     ` David Pirotte

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