From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Neil Jerram Newsgroups: gmane.lisp.guile.devel Subject: Re: Fixing goops-1 Date: 03 Oct 2002 22:33:26 +0100 Sender: guile-devel-admin@gnu.org Message-ID: References: <87u1k6qalv.fsf@alice.rotty.yi.org> NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1033706710 15264 127.0.0.1 (4 Oct 2002 04:45:10 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Fri, 4 Oct 2002 04:45:10 +0000 (UTC) Cc: guile-devel@gnu.org Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 17xKKq-0003y1-00 for ; Fri, 04 Oct 2002 06:45:08 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10) id 17xKI2-0003AZ-00; Fri, 04 Oct 2002 00:42:14 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10) id 17xDj5-0005V2-00 for guile-devel@gnu.org; Thu, 03 Oct 2002 17:41:43 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10) id 17xDj0-0005HW-00 for guile-devel@gnu.org; Thu, 03 Oct 2002 17:41:41 -0400 Original-Received: from mail.uklinux.net ([80.84.72.21] helo=s1.uklinux.net) by monty-python.gnu.org with esmtp (Exim 4.10) id 17xDiz-0005E6-00 for guile-devel@gnu.org; Thu, 03 Oct 2002 17:41:37 -0400 Original-Received: from portalet.ossau.uklinux.net (ppp-0-204.lond-a-1.access.uk.tiscali.com [80.225.196.204]) by s1.uklinux.net (8.11.6/8.11.6) with ESMTP id g93LfVw16013; Thu, 3 Oct 2002 22:41:32 +0100 Original-Received: from laruns.ossau.uklinux.net.ossau.uklinux.net (laruns.ossau.uklinux.net [192.168.1.3]) by portalet.ossau.uklinux.net (Postfix on SuSE Linux 7.2 (i386)) with ESMTP id D0A6C171A; Thu, 3 Oct 2002 22:42:41 +0000 (GMT) Original-To: Andreas Rottmann In-Reply-To: <87u1k6qalv.fsf@alice.rotty.yi.org> Original-Lines: 69 User-Agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7 Errors-To: guile-devel-admin@gnu.org X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Developers list for Guile, the GNU extensibility library List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.lisp.guile.devel:1412 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.devel:1412 >>>>> "Andreas" == Andreas Rottmann writes: Andreas> Hi! Remember the goops-1 bug? I'd really like this one Andreas> fixed, since it is stopping me to test Guile as an Andreas> extension language for my C++ programs - I'd be stick Andreas> with Python ;-)). However, I don't have the necessary Andreas> insight into the GOOPS internals. If someone of GOOPS Andreas> authorship or deeper GOOPS knowledge could guide me, I Andreas> would like help, though. Hi Andy, I don't fully understand this stuff, but through a kind of investigation and experimentation, I have a solution. If you change the second arg of scm_closure from SCM_EOL to scm_top_level_env (SCM_TOP_LEVEL_LOOKUP_CLOSURE), the define-method call works. Full patch (to your source) is below. I played around with this by inserting scm_shell, so that I could use the debugger interactively to look at frames, which in turn needed SCM_RECORD_POSITIONS_P = 1 and the commenting out of the `:no-backtrace' option in the GOOPS .scm files. I tested the commented out define-method call by typing it into the Guile shell. I'm guessing that you took your model from scm_add_slot, which also passes SCM_EOL to scm_closure. However, note that nothing in Guile actually uses scm_add_slot ... :-) Hope this helps, Neil cd ~/Guile/miscellany/goops-1/ diff -Naur /home/neil/Guile/miscellany/goops-1/bug.c\~ /home/neil/Guile/miscellany/goops-1/bug.c --- /home/neil/Guile/miscellany/goops-1/bug.c~ Wed Oct 2 22:13:07 2002 +++ /home/neil/Guile/miscellany/goops-1/bug.c Wed Oct 2 23:53:32 2002 @@ -19,7 +19,7 @@ SCM constr = scm_c_make_gsubr("constructor", 1, 0, 1, proc); SCM constrm = scm_closure(scm_list_2(scm_list_2(sym_obj, sym_args), scm_list_3(constr, sym_obj, sym_args)), - SCM_EOL); + scm_top_level_env (SCM_TOP_LEVEL_LOOKUP_CLOSURE)); SCM meth = scm_make(scm_list_5(scm_class_method, scm_c_make_keyword("specializers"), scm_list_2(klass, scm_class_top), @@ -32,7 +32,7 @@ static void real_main(void *closure, int argc, char *argv[]) { SCM klass, slots; - + SCM_RECORD_POSITIONS_P = 1; scm_load_goops(); slots = scm_list_1(scm_list_3(scm_str2symbol("a-slot"), @@ -48,10 +48,11 @@ scm_c_eval_string("(use-modules (oop goops))"); scm_c_eval_string("(define-class ())"); scm_c_eval_string("(make )"); + scm_shell (argc, argv); // this produces the error - scm_c_eval_string("(define-method (initialize (obj ) initargs)" - " (next-method))"); +/* scm_c_eval_string("(define-method (initialize (obj ) initargs)" */ +/* " (next-method))"); */ } int main(int argc, char *argv[]) Diff finished at Wed Oct 2 23:59:15 _______________________________________________ Guile-devel mailing list Guile-devel@gnu.org http://mail.gnu.org/mailman/listinfo/guile-devel