bug-guile
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: module system / (oop goops) / :duplicates (merge-generics) / bug?


From: Andy Wingo
Subject: Re: module system / (oop goops) / :duplicates (merge-generics) / bug?
Date: Fri, 02 Sep 2011 13:26:20 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux)

Hi David,

On Mon 29 Aug 2011 19:05, David Pirotte <address@hidden> writes:

> I finally could reproduce the problem and wrote an example you can run 'in 
> the cafe
> without internet' :) [hopefully] 

Well.  This was indeed an amusing issue :)

I am indeed sitting in the café, and so thank you :)  However right now
I trust Guile more than I trust Guile-GNOME, so an more minimal
case is even better :)  Like this:

a.scm:

    (define-module (a)
      #:use-module (oop goops)
      #:export (<a> foo bar make-a))

    (define-class <a> ()
      (foo #:accessor foo #:init-keyword #:foo #:init-value #f)
      (bar #:accessor bar #:init-keyword #:bar #:init-value #f))

    (define (make-a)
      (make <a> #:foo "qux" #:bar "a"))

b.scm:

    (define-module (b)
      #:use-module (oop goops)
      #:export (<b> bar make-b))

    (define-class <b> ()
      (bar #:accessor bar #:init-keyword #:bar #:init-value #f))

    (define (make-b)
      (make <b> #:bar "b"))

test.scm:

    (define-module (test)
      #:use-module (ice-9 format)
      #:use-module (oop goops)
      #:use-module (a)
      #:use-module (b)

      #:duplicates (merge-generics 
                    replace
                    warn-override-core
                    warn
                    last)

      #:export (run-test))

    (define (run-test)
      (let* ((a (make-a))
         (b (make-b)))
        (format #t "(bar a): ~S~%" (bar a))
        (format #t "(bar b): ~S~%" (bar b))))

The ultimate issue was a cache coherency problem.  The set of methods of
an extended (merged) generic depends on the sets of methods of the
extendees.  Some aspects about the method set are cached.  This cache
was not being managed properly.  I believe that I have fixed it in
Guile.

Thanks for the report,

Andy
-- 
http://wingolog.org/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]