From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Pirotte Newsgroups: gmane.lisp.guile.bugs Subject: Re: module system / (oop goops) / :duplicates (merge-generics) / bug? Date: Mon, 29 Aug 2011 14:05:18 -0300 Message-ID: <20110829140518.4ad0c46a@rascar> References: <20110705183229.6f779a6b@rascar> <87vcvfcrjc.fsf@gnu.org> <20110706162244.2bf4b90a@rascar> <87ipre48zj.fsf@pobox.com> <20110707132659.2cee382d@rascar> <87box54xjg.fsf@pobox.com> <20110708140559.6ed55cd9@rascar> <87tyav3h7q.fsf@pobox.com> <20110709120816.0827236b@rascar> <87aack3jif.fsf@pobox.com> <20110711222555.4bd45679@rascar> <87bovngf01.fsf@pobox.com> <20110819024043.74a4d71e@rascar> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="MP_/ZDAeAUx6_eGIWYZsXfJDGNz" X-Trace: dough.gmane.org 1314637544 32544 80.91.229.12 (29 Aug 2011 17:05:44 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 29 Aug 2011 17:05:44 +0000 (UTC) Cc: bug-guile@gnu.org, Ludovic =?UTF-8?B?Q291cnTDqHM=?= To: Andy Wingo Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Mon Aug 29 19:05:39 2011 Return-path: Envelope-to: guile-bugs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Qy5HG-0000QA-27 for guile-bugs@m.gmane.org; Mon, 29 Aug 2011 19:05:38 +0200 Original-Received: from localhost ([::1]:50918 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qy5HF-0008LD-Db for guile-bugs@m.gmane.org; Mon, 29 Aug 2011 13:05:37 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:40901) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qy5HC-0008Kx-PT for bug-guile@gnu.org; Mon, 29 Aug 2011 13:05:35 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qy5HB-0003xA-Kf for bug-guile@gnu.org; Mon, 29 Aug 2011 13:05:34 -0400 Original-Received: from maximusconfessor.all2all.org ([62.58.108.13]:57023) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qy5HB-0003wy-BX; Mon, 29 Aug 2011 13:05:33 -0400 Original-Received: from localhost (unknown [192.168.0.2]) by maximusconfessor.all2all.org (Postfix) with ESMTP id 8AEACA04C2F4; Mon, 29 Aug 2011 19:05:31 +0200 (CEST) Original-Received: from maximusconfessor.all2all.org ([192.168.0.1]) by localhost (maximusconfessor.all2all.org [192.168.0.2]) (amavisd-new, port 10024) with ESMTP id V+50CU2cmdyJ; Mon, 29 Aug 2011 18:45:52 +0200 (CEST) Original-Received: from rascar (unknown [189.60.180.75]) by maximusconfessor.all2all.org (Postfix) with ESMTPSA id ABB32A04C286; Mon, 29 Aug 2011 19:05:22 +0200 (CEST) In-Reply-To: <20110819024043.74a4d71e@rascar> X-Mailer: Claws Mail 3.7.9 (GTK+ 2.24.4; i486-pc-linux-gnu) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 62.58.108.13 X-BeenThere: bug-guile@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Original-Sender: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.bugs:5799 Archived-At: --MP_/ZDAeAUx6_eGIWYZsXfJDGNz Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi Andy, Ludovic, > > I fixed it! > > Thank you very much! The examples I sent earlier now all work, but I still have a > problem ... I finally could reproduce the problem and wrote an example you can run 'in the cafe without internet' :) [hopefully] in addition to the comments here below, please note that these examples further differs from previous 'versions' I sent in the passed in the sense that they now also use (gnome glade) If you drop the attached somewhere in your %load-path, then you can try the following 2 tests, one which [here] produces a segfault and the other which works fine. The only 'important' difference between these 2 tests is expressed by diff mg-wgtk-0 mg-wgtk-1: mg-wgtk-0 defines and export an additional slot which is named glade-file [which is then used by mg-wgtk-3 ...] This should or crash guile or produce an error [the behavior of guile itself is not systematic [here], but it always 'fails': mg-wgtk-3 uses mg-wgtk-0 mg-wgtk-2 guile-gnome-2 (use-modules (mg-wgtk-3)) (letstry) -> Top level dialog: #< a2bbbc0> Printing dialog: Segmentation fault This will work fine: mg-wgtk-4 uses mg-wgtk-1 mg-wgtk-2 guile-gnome-2 (use-modules (mg-wgtk-4)) (letstry) -> Top level dialog: #< 8b86c30> Printing dialog: #< 8b89110> Many thanks, David --MP_/ZDAeAUx6_eGIWYZsXfJDGNz Content-Type: text/x-scheme Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=mg-wgtk-0.scm (define-module (mg-wgtk-0) :use-module (oop goops) :use-module (gnome gobject) :use-module (gnome glade) :use-module (gnome gtk) :export ( glade-file dialog make-tl-widget )) (define-class () (glade-file :accessor glade-file :init-keyword :glade-file :init-value #f) (dialog :accessor dialog :init-keyword :dialog :init-value #f)) (define (make-tl-widget glade-f) (let* ((xmlc (glade-xml-new glade-f #f "kise")) (tl-widget (make :glade-file glade-f ;; :xml-code xmlc :dialog (get-widget xmlc "kise")))) tl-widget)) --MP_/ZDAeAUx6_eGIWYZsXfJDGNz Content-Type: text/x-scheme Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=mg-wgtk-1.scm (define-module (mg-wgtk-1) :use-module (oop goops) :use-module (gnome gobject) :use-module (gnome glade) :use-module (gnome gtk) :export ( dialog make-tl-widget )) (define-class () (dialog :accessor dialog :init-keyword :dialog :init-value #f)) (define (make-tl-widget glade-f) (let* ((xmlc (glade-xml-new glade-f #f "kise")) (tl-widget (make :dialog (get-widget xmlc "kise")))) tl-widget)) --MP_/ZDAeAUx6_eGIWYZsXfJDGNz Content-Type: text/x-scheme Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=mg-wgtk-2.scm (define-module (mg-wgtk-2) :use-module (oop goops) :use-module (gnome gobject) :use-module (gnome glade) :use-module (gnome gtk) :export ( dialog make-p-widget )) (define-class () ;; (xml-code :accessor xml-code :init-keyword :xml-code :init-value #f) (dialog :accessor dialog :init-keyword :dialog :init-value #f)) (define (make-p-widget parent glade-f) (let* ((xmlc (glade-xml-new glade-f #f "kp/dialog")) (p-widget (make ;; :xml-code xmlc :dialog (get-widget xmlc "kp/dialog")))) p-widget)) --MP_/ZDAeAUx6_eGIWYZsXfJDGNz Content-Type: text/x-scheme Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=mg-wgtk-3.scm (define-module (mg-wgtk-3) :use-module (ice-9 format) :use-module (oop goops) :use-module (gnome gobject) :use-module (gnome gtk) :use-module (mg-wgtk-0) :use-module (mg-wgtk-2) :duplicates (merge-generics replace warn-override-core warn last) :export (letstry )) (define (letstry) (let* ((tl (make-tl-widget "/usr/alto/projects/kise/glade/kise.glade")) (p (make-p-widget (dialog tl) (glade-file tl)))) (format #t "Top level dialog: ~S~%" (dialog tl)) (format #t "Printing dialog: ~S~%" (dialog p)))) #! (use-modules (macros push)) (push! "/usr/local/share/guile/alto/2.0/tests" %load-path) (use-modules (mg-wgtk-3)) (letstry) ;;; ;;; 2. using glade in mg-gtk-2 as well ;;; (use-modules (mg-wgtk-3)) ,m (mg-wgtk-3) (define tl (make-tl-widget "/usr/alto/projects/kise/glade/kise.glade")) (define p (make-p-widget (dialog tl) (glade-file tl))) (dialog tl) (dialog p) !# --MP_/ZDAeAUx6_eGIWYZsXfJDGNz Content-Type: text/x-scheme Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=mg-wgtk-4.scm (define-module (mg-wgtk-4) :use-module (ice-9 format) :use-module (oop goops) :use-module (gnome gobject) :use-module (gnome gtk) :use-module (mg-wgtk-1) :use-module (mg-wgtk-2) :duplicates (merge-generics replace warn-override-core warn last) :export (letstry )) (define (letstry) (let* ((tl (make-tl-widget "/usr/alto/projects/kise/glade/kise.glade")) (p (make-p-widget (dialog tl) "/usr/alto/projects/kise/glade/kise.glade"))) (format #t "Top level dialog: ~S~%" (dialog tl)) (format #t "Printing dialog: ~S~%" (dialog p)))) #! (use-modules (macros push)) (push! "/usr/local/share/guile/alto/2.0/tests" %load-path) (use-modules (mg-wgtk-4)) (letstry) ;;; ;;; ;;; (use-modules (mg-wgtk-4)) ,m (mg-wgtk-4) (define tl (make-tl-widget "/usr/alto/projects/kise/glade/kise.glade")) (define p (make-p-widget (dialog tl) "/usr/alto/projects/kise/glade/kise.glade")) (dialog tl) (dialog p) !# --MP_/ZDAeAUx6_eGIWYZsXfJDGNz--