unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
From: Andy Wingo <wingo@pobox.com>
To: David Pirotte <david@altosw.be>
Cc: bug-guile@gnu.org, "Ludovic Courtès" <ludo@gnu.org>
Subject: Re: module system / (oop goops) / :duplicates (merge-generics) / bug?
Date: Fri, 02 Sep 2011 13:26:20 +0200	[thread overview]
Message-ID: <87ehzz423n.fsf@pobox.com> (raw)
In-Reply-To: <20110829140518.4ad0c46a@rascar> (David Pirotte's message of "Mon, 29 Aug 2011 14:05:18 -0300")

Hi David,

On Mon 29 Aug 2011 19:05, David Pirotte <david@altosw.be> 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/



  parent reply	other threads:[~2011-09-02 11:26 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-05 21:32 module system / (oop goops) / :duplicates (merge-generics) / bug? David Pirotte
2011-07-06 16:17 ` Ludovic Courtès
2011-07-06 19:22   ` David Pirotte
2011-07-07 11:37     ` Andy Wingo
2011-07-07 16:26       ` David Pirotte
2011-07-07 20:59         ` Andy Wingo
2011-07-08 17:05           ` David Pirotte
2011-07-09 10:02             ` Andy Wingo
2011-07-09 15:08               ` David Pirotte
2011-07-11 15:49                 ` Andy Wingo
2011-07-12  1:25                   ` David Pirotte
2011-08-18 11:01                     ` Andy Wingo
2011-08-19  5:40                       ` David Pirotte
2011-08-29 17:05                         ` David Pirotte
2011-08-30  2:56                           ` David Pirotte
2011-09-02 11:26                           ` Andy Wingo [this message]
2011-09-06 15:41                             ` David Pirotte
2011-08-03 12:28                   ` David Pirotte

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ehzz423n.fsf@pobox.com \
    --to=wingo@pobox.com \
    --cc=bug-guile@gnu.org \
    --cc=david@altosw.be \
    --cc=ludo@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).