GNU bug report logs - #50719
Cannot add a no-applicable-method implementation for a generic with no method

Previous Next

Package: guile;

Reported by: Vivien Kraus <vivien <at> planete-kraus.eu>

Date: Tue, 21 Sep 2021 09:44:01 UTC

Severity: normal

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Vivien Kraus <vivien <at> planete-kraus.eu>
To: bug-guile <at> gnu.org
Subject: Cannot add a no-applicable-method implementation for a generic with
 no method
Date: Tue, 21 Sep 2021 11:42:51 +0200
[Message part 1 (text/plain, inline)]
Dear guile,

The following program should just return 'foo, but it enters an
infinite loop:

(use-modules (oop goops))

(define-class <my-generic> (<generic>))

(define-method (no-method (generic <my-generic>) args)
  'foo)

(define-method (no-applicable-method (generic <my-generic>) args)
  'foo)

(define hello
  (make <my-generic>
    #:name 'hello))

(hello)

I don’t know GOOPS enough to understand what happens, but when I
slightly change the last line:

(use-modules (oop goops))

(define-class <my-generic> (<generic>))

(define-method (no-method (generic <my-generic>) args)
  'foo)

(define-method (no-applicable-method (generic <my-generic>) args)
  'foo)

(define hello
  (make <my-generic>
    #:name 'hello))

(apply-generic hello '())

Now it returns 'foo, as expected. So my guess is that the infinite
loops happens during the memoization phase. More specifically, the no-
applicable-method is called over and over again.

Please find a failing test case attached.

Best regards,

Vivien
[0001-goops-cannot-override-no-applicable-method-for-a-gen.patch (text/x-patch, attachment)]

This bug report was last modified 3 years and 266 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.