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

To reply to this bug, email your comments to 50719 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-guile <at> gnu.org:
bug#50719; Package guile. (Tue, 21 Sep 2021 09:44:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Vivien Kraus <vivien <at> planete-kraus.eu>:
New bug report received and forwarded. Copy sent to bug-guile <at> gnu.org. (Tue, 21 Sep 2021 09:44:02 GMT) Full text and rfc822 format available.

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 67 days ago.

Previous Next


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