bug-guile
[Top][All Lists]
Advanced

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

goops: default-duplicate-binding-handler 'does not work' when global [i.


From: David Pirotte
Subject: goops: default-duplicate-binding-handler 'does not work' when global [i.e. in init.scm]
Date: Sat, 20 Aug 2011 19:56:14 -0300

Hello,

I've noticed that the following attached code [slightly modified since my 
previous
related message] only works if the third module also specify:

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

        ;; [which I deleted from the define-module precisely so to raise the bug

This means that the following form

        (default-duplicate-binding-handler
          '(merge-generics replace warn-override-core warn last))

which I added to my init.scm file, does not produce the expected global goops
behavior I think it should [unless I missed something]

As a consequence, if you use-modules 'manually in the repl, then depending on 
the
order of your use-modules sequence, you also face this same bug [since the repl 
only
depend on the global default-duplicate-binding-handler setting. Here is a track 
of 2
sessions, to illustrate [which I edited manually after pasting here to reduce to
essential input/output]

        [Note: of course you'll have to add the above
        default-duplicate-binding-handler call in your init.scm in order to 
reproduce]

Thanks,
David

;;;
;;; The first session
;;;

address@hidden:~/alto/projects/kise 23 $ guile
GNU Guile 2.0.2.49-6b1c5 ...
scheme@(guile-user)> (default-duplicate-binding-handler)
(default-duplicate-binding-handler)
$1 = (merge-generics replace warn-override-core warn last)
scheme@(guile-user)> (use-modules (mg-1)
             (mg-2))
(define widget (make-widget-b))
(dialog widget)
WARNING: (guile-user): `dialog' imported from both (mg-1) and (mg-2)
$2 = dialog-b
scheme@(guile-user)> ,q

;;;
;;; The second
;;;

address@hidden:~/alto/projects/kise 24 $ guile
scheme@(guile-user)> (use-modules (mg-2)
             (mg-1))
(define widget (make-widget-b))
(dialog widget)
WARNING: (guile-user): `dialog' imported from both (mg-2) and (mg-1)
ERROR: In procedure scm-error:
ERROR: No applicable method for #<<accessor> dialog (1)> in call (dialog 
#<<widget-b> 8677a80>)

Entering a new prompt.  Type `,bt' for a backtrace or `,q' to continue.
scheme@(guile-user) [1]> ,bt

In oop/goops/dispatch.scm:
    231:9  1 (cache-miss #<<accessor> dialog (1)> (#<<widget-b> 8677a80>))
In unknown file:
           0 (scm-error goops-error #f "No applicable method for ~S in call
           ~S" (#<<accessor>…> …) …)

Attachment: mg-1.scm
Description: Text Data

Attachment: mg-2.scm
Description: Text Data

Attachment: mg-3.scm
Description: Text Data


reply via email to

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