guile-commits
[Top][All Lists]
Advanced

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

[Guile-commits] GNU Guile branch, master, updated. release_1-9-11-307-gd


From: Andy Wingo
Subject: [Guile-commits] GNU Guile branch, master, updated. release_1-9-11-307-gdcb68c0
Date: Fri, 03 Sep 2010 04:43:31 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Guile".

http://git.savannah.gnu.org/cgit/guile.git/commit/?id=dcb68c09d03cf9006c8e2c21c726a3f35be026bd

The branch, master has been updated
       via  dcb68c09d03cf9006c8e2c21c726a3f35be026bd (commit)
       via  61bac799dd1a1c004537a2ee2a21e729179d67f2 (commit)
       via  3be872798395b745ee693a2975900a81980037d2 (commit)
      from  f57fdf07d6374028f35bcb1ee748a94022deda6d (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit dcb68c09d03cf9006c8e2c21c726a3f35be026bd
Author: Andy Wingo <address@hidden>
Date:   Tue Aug 31 09:22:59 2010 -0700

    module-ref-submodule deprecation fixes
    
    * module/ice-9/boot-9.scm (module-ref-submodule)
      (module-define-submodule!): Pull deprecated shims here, as we need
      them before loading (ice-9 deprecated). Also bugfix to only define the
      module if there is no local variable, even if it is unbound.
    
    * module/ice-9/deprecated.scm: Remove from here.

commit 61bac799dd1a1c004537a2ee2a21e729179d67f2
Author: Andy Wingo <address@hidden>
Date:   Thu Sep 2 21:29:26 2010 -0700

    back-compat in (rnrs) for deprecated modules-in-value-namespace
    
    * module/rnrs.scm (rnrs): Work around some unavoidable (I think)
      behavior when back-compatible unified namespaces are enabled; see
      comments in source.

commit 3be872798395b745ee693a2975900a81980037d2
Author: Andy Wingo <address@hidden>
Date:   Thu Sep 2 20:48:08 2010 -0700

    module-local-variable optimization
    
    * libguile/modules.c (scm_module_local_variable): An optimization in the
      common no-module-binder case.

-----------------------------------------------------------------------

Summary of changes:
 libguile/modules.c          |   29 ++++++++++++++++++++++-------
 module/ice-9/boot-9.scm     |   27 +++++++++++++++++++++++++++
 module/ice-9/deprecated.scm |   23 +++--------------------
 module/rnrs.scm             |   19 ++++++++++++++-----
 4 files changed, 66 insertions(+), 32 deletions(-)

diff --git a/libguile/modules.c b/libguile/modules.c
index a0c47f2..6c3d0e8 100644
--- a/libguile/modules.c
+++ b/libguile/modules.c
@@ -412,19 +412,34 @@ SCM_DEFINE (scm_module_local_variable, 
"module-local-variable", 2, 0, 0,
   if (SCM_BOUND_THING_P (b))
     return b;
 
-  /* 2. Search imported bindings.  In order to be consistent with
-     `module-variable', the binder gets called only when no imported binding
-     matches SYM.  */
-  b = module_imported_variable (module, sym);
-  if (SCM_BOUND_THING_P (b))
-    return SCM_BOOL_F;
+  /* At this point we should just be able to return #f, but there is the
+     possibility that a custom binder establishes a mapping for this
+     variable.
+
+     However a custom binder should be called only if there is no
+     imported binding with the name SYM. So here instead of the order:
+
+       2. Search imported bindings.  In order to be consistent with
+          `module-variable', the binder gets called only when no
+          imported binding matches SYM.
+  
+       3. Query the custom binder.
+
+     we first check if there is a binder at all, and if not, just return
+     #f directly.
+  */
 
   {
-    /* 3. Query the custom binder.  */
     SCM binder = SCM_MODULE_BINDER (module);
 
     if (scm_is_true (binder))
       {
+        /* 2. */
+        b = module_imported_variable (module, sym);
+        if (SCM_BOUND_THING_P (b))
+          return SCM_BOOL_F;
+
+        /* 3. */
        b = scm_call_3 (binder, module, sym, SCM_BOOL_F);
        if (SCM_BOUND_THING_P (b))
          return b;
diff --git a/module/ice-9/boot-9.scm b/module/ice-9/boot-9.scm
index 138cf59..3ec4600 100644
--- a/module/ice-9/boot-9.scm
+++ b/module/ice-9/boot-9.scm
@@ -1803,6 +1803,33 @@ If there is no handler at all, Guile prints an error and 
then exits."
 (define (module-define-submodule! module name submodule)
   (hashq-set! (module-submodules module) name submodule))
 
+;; It used to be, however, that module names were also present in the
+;; value namespace. When we enable deprecated code, we preserve this
+;; legacy behavior.
+;;
+;; These shims are defined here instead of in deprecated.scm because we
+;; need their definitions before loading other modules.
+;;
+(begin-deprecated
+ (define (module-ref-submodule module name)
+   (or (hashq-ref (module-submodules module) name)
+       (and (module-submodule-binder module)
+            ((module-submodule-binder module) module name))
+       (let ((var (module-local-variable module name)))
+         (and var (variable-bound? var) (module? (variable-ref var))
+              (begin
+                (warn "module" module "not in submodules table")
+                (variable-ref var))))))
+
+ (define (module-define-submodule! module name submodule)
+   (let ((var (module-local-variable module name)))
+     (if (and var
+              (or (not (variable-bound? var))
+                  (not (module? (variable-ref var)))))
+         (warn "defining module" module ": not overriding local definition" 
var)
+         (module-define! module name submodule)))
+   (hashq-set! (module-submodules module) name submodule)))
+
 
 
 ;;; {Low Level Bootstrapping}
diff --git a/module/ice-9/deprecated.scm b/module/ice-9/deprecated.scm
index c0fa921..4ead075 100644
--- a/module/ice-9/deprecated.scm
+++ b/module/ice-9/deprecated.scm
@@ -64,9 +64,7 @@
             the-last-stack
             save-stack
             named-module-use!
-            top-repl)
-
-  #:replace (module-ref-submodule module-define-submodule!))
+            top-repl))
 
 
 ;;;; Deprecated definitions.
@@ -319,23 +317,8 @@
                    (lambda ()
                      (set! id old-v) ...)))))))))
 
-(define (module-ref-submodule module name)
-  (or (hashq-ref (module-submodules module) name)
-      (and (module-submodule-binder module)
-           ((module-submodule-binder module) module name))
-      (let ((var (module-local-variable module name)))
-        (and (variable-bound? var)
-             (module? (variable-ref var))
-             (begin
-               (warn "module" module "not in submodules table")
-               (variable-ref var))))))
-
-(define (module-define-submodule! module name submodule)
-  (let ((var (module-local-variable module name)))
-    (if (and var (variable-bound? var) (not (module? (variable-ref var))))
-        (warn "defining module" module ": not overriding local definition" var)
-        (module-define! module name submodule)))
-  (hashq-set! (module-submodules module) name submodule))
+;; There are deprecated definitions for module-ref-submodule and
+;; module-define-submodule! in boot-9.scm.
 
 ;; Define (%app) and (%app modules), and have (app) alias (%app). This
 ;; side-effects the-root-module, both to the submodules table and (through
diff --git a/module/rnrs.scm b/module/rnrs.scm
index 1c07e40..c329aeb 100644
--- a/module/rnrs.scm
+++ b/module/rnrs.scm
@@ -209,10 +209,17 @@
 
          ;; (rnrs syntax-case)
 
-         make-variable-transformer syntax syntax-case identifier?
-         bound-identifier=? free-identifier=? syntax->datum datum->syntax
-         generate-temporaries with-syntax quasisyntax unsyntax
-         unsyntax-splicing syntax-violation
+         make-variable-transformer syntax
+          ;; Until the deprecated support for a unified modules and
+          ;; bindings namespace is removed, we need to manually resolve
+          ;; a conflict between two bindings: that of the (rnrs
+          ;; syntax-case) module, and the imported `syntax-case'
+          ;; binding. We do so here and below by renaming the macro
+          ;; import.
+          (rename (syntax-case-hack syntax-case))
+          identifier?  bound-identifier=? free-identifier=?
+          syntax->datum datum->syntax generate-temporaries with-syntax
+          quasisyntax unsyntax unsyntax-splicing syntax-violation
 
          ;; (rnrs unicode)
          
@@ -288,5 +295,7 @@
          (rnrs records procedural (6))
          (rnrs records syntactic (6))
          (rnrs sorting (6))
-         (rnrs syntax-case (6))
+          ;; See note above on exporting syntax-case.
+         (rename (rnrs syntax-case (6))
+                  (syntax-case syntax-case-hack))
          (rnrs unicode (6))))


hooks/post-receive
-- 
GNU Guile



reply via email to

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