[email protected] skribis:

> Recently I noticed, that srfi-64 `assert-equal` macro do not use
> `equal?` that was redefinded via `define-method` in scope of invocation
> of `assert-equal`. It means, that
>
>       (define e1 (make <foo> #:x 2))
>         (define e2 (make <foo> #:x 2))
>         (equal? e1 e2) ;; Overloaded to return #t
>       (assert-equal (make <foo> #:x 2) (make <foo> #:x 2)) ;; fails
>
> Why it happens, is clear. Since scheme macros are hygienic, equal? in
> expansion of `assert-equal` is sealed to refer to (@@ (srfi srfi-64)
> equal?).

No, that’s normally not a problem: (define-method (equal? ...) ...)
should turn the core ‘equal?’ primitive into a generic function, and
things would work well because (@@ (srfi srfi-64) equal?) is the same as
(@ (guile) equal?).

How exactly did you define ‘equal?’ methods?

Ludo’.

Reply via email to