From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andy Wingo Newsgroups: gmane.lisp.guile.devel Subject: [PATCH] scm_module_variable, duplicate bindings handlers Date: Fri, 10 Aug 2007 11:53:19 +0200 Message-ID: <87sl6rn2b4.fsf@pobox.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: sea.gmane.org 1186750180 15306 80.91.229.12 (10 Aug 2007 12:49:40 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 10 Aug 2007 12:49:40 +0000 (UTC) To: Ludovic =?utf-8?Q?Court=C3=A8s?= , guile-devel Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Fri Aug 10 14:49:36 2007 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1IJTvr-0000is-0Y for guile-devel@m.gmane.org; Fri, 10 Aug 2007 14:49:35 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IJTvq-0007Lr-FB for guile-devel@m.gmane.org; Fri, 10 Aug 2007 08:49:34 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IJTvm-0007Lk-0I for guile-devel@gnu.org; Fri, 10 Aug 2007 08:49:30 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IJTvk-0007LP-Eu for guile-devel@gnu.org; Fri, 10 Aug 2007 08:49:28 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IJTvk-0007LM-BF for guile-devel@gnu.org; Fri, 10 Aug 2007 08:49:28 -0400 Original-Received: from ambient.dashsystems.com ([216.27.85.7] helo=kettle.ambient-hosting.net) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1IJTvc-00009x-Ub; Fri, 10 Aug 2007 08:49:21 -0400 Original-Received: from localhost.localdomain (ambient-hosting.net [10.1.6.1]) by kettle.ambient-hosting.net (Postfix) with ESMTP id 3F28588089; Fri, 10 Aug 2007 08:49:19 -0400 (EDT) Original-Received: by localhost.localdomain (Postfix, from userid 1000) id 41CC91188CF; Fri, 10 Aug 2007 11:53:19 +0200 (CEST) User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.990 (gnu/linux) X-Detected-Kernel: Linux 2.4-2.6 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:6674 Archived-At: --=-=-= Hey folks, I've gotten guile-gnome to run against guile HEAD now, with the help of the following patches: 1) misordered-module-variable-lookup.patch, fixes the lookup order in scm_module_variable to be like 1.8, which allows binders to run at the correct time 2) duplicate-binding-use-module-variable.patch, fixes the duplicate bindings handlers to lookup the resolved values using module-variable rather than module-local-variable, as it is possible that public interfaces use other modules. Cheers, Andy. -- http://wingolog.org/ --=-=-= Content-Type: text/x-diff; charset=utf-8 Content-Disposition: inline; filename=misordered-module-variable-lookup.patch Content-Transfer-Encoding: quoted-printable --- ChangeLog.~1.2396.~ 2007-08-04 16:11:09.000000000 +0200 +++ ChangeLog 2007-08-10 11:41:05.000000000 +0200 @@ -1,3 +1,9 @@ +2007-08-10 Andy Wingo + + * modules.c (scm_module_variable, scm_module_local_variable): Fix + misordered lookup sequence: it should be obarray, binder, imports + rather than obarray, imports, binder. + 2007-07-29 Ludovic Court=C3=A8s =20 * Makefile.am (INCLUDES): Added Gnulib includes. --- modules.c.~1.65.~ 2007-05-05 22:38:57.000000000 +0200 +++ modules.c 2007-08-10 11:33:50.000000000 +0200 @@ -418,15 +418,8 @@ if (SCM_BOUND_THING_P (b)) return b; =20 - /* 2. Search imported bindings. In order to be consistent with - `module-variable', the binder gets called only when no imported bindi= ng - matches SYM. */ - b =3D module_imported_variable (module, sym); - if (SCM_BOUND_THING_P (b)) - return SCM_BOOL_F; - { - /* 3. Query the custom binder. */ + /* 2. Query the custom binder. */ SCM binder =3D SCM_MODULE_BINDER (module); =20 if (scm_is_true (binder)) @@ -437,8 +430,11 @@ } } =20 - return SCM_BOOL_F; =20 + /* 3. No need to search imported bindings, because we are only looking f= or + local variables. */ + + return SCM_BOOL_F; #undef SCM_BOUND_THING_P } #undef FUNC_NAME @@ -465,13 +461,8 @@ if (SCM_BOUND_THING_P (var)) return var; =20 - /* 2. Search among the imported variables. */ - var =3D module_imported_variable (module, sym); - if (SCM_BOUND_THING_P (var)) - return var; - { - /* 3. Query the custom binder. */ + /* 2. Query the custom binder. */ SCM binder; =20 binder =3D SCM_MODULE_BINDER (module); @@ -483,6 +474,11 @@ } } =20 + /* 3. Search among the imported variables. */ + var =3D module_imported_variable (module, sym); + if (SCM_BOUND_THING_P (var)) + return var; + return SCM_BOOL_F; =20 #undef SCM_BOUND_THING_P --=-=-= Content-Type: text/x-diff; charset=utf-8 Content-Disposition: inline; filename=duplicate-binding-use-module-variable.patch Content-Transfer-Encoding: quoted-printable --- ChangeLog.~1.682.~ 2007-05-05 22:38:56.000000000 +0200 +++ ChangeLog 2007-08-10 11:43:49.000000000 +0200 @@ -1,3 +1,10 @@ +2007-08-10 Andy Wingo + + * boot-9.scm (duplicate-handlers): When looking for a variable's + binding in a interface, use module-variable rather than + module-local-variable, as public interfaces can also use other + modules. + 2007-05-05 Ludovic Court=C3=A8s =20 Implemented lazy duplicate binding handling. Fixed the --- boot-9.scm.~1.361.~ 2007-05-05 22:38:56.000000000 +0200 +++ boot-9.scm 2007-08-09 13:42:44.000000000 +0200 @@ -3088,13 +3088,13 @@ (module-name module) (module-name int2) name) - (module-local-variable int2 name)))) + (module-variable int2 name)))) =20=20=20=20=20=20 (define (first module name int1 val1 int2 val2 var val) - (or var (module-local-variable int1 name))) + (or var (module-variable int1 name))) =20=20=20=20=20=20 (define (last module name int1 val1 int2 val2 var val) - (module-local-variable int2 name)) + (module-variable int2 name)) =20=20=20=20=20=20 (define (noop module name int1 val1 int2 val2 var val) #f) --=-=-= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Guile-devel mailing list Guile-devel@gnu.org http://lists.gnu.org/mailman/listinfo/guile-devel --=-=-=--