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-42-g7e


From: Andy Wingo
Subject: [Guile-commits] GNU Guile branch, master, updated. release_1-9-11-42-g7e31476
Date: Thu, 10 Jun 2010 18:01:12 +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=7e3147666b0bb2366cfaf0ce34a11147f7f55e8f

The branch, master has been updated
       via  7e3147666b0bb2366cfaf0ce34a11147f7f55e8f (commit)
      from  5a8fc758b094b7bdba83d63d385016960434ce9d (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 7e3147666b0bb2366cfaf0ce34a11147f7f55e8f
Author: Andy Wingo <address@hidden>
Date:   Thu Jun 10 19:59:17 2010 +0200

    resolve-module #:ensure argument
    
    * module/ice-9/boot-9.scm (resolve-module): Add #:ensure kwarg,
      defaulting to true. If true we make an empty module if none was found
      (the old behavior). Otherwise we return false.
    
    * test-suite/tests/modules.test ("resolve-module"): Add tests for old
      and new behavior.

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

Summary of changes:
 module/ice-9/boot-9.scm       |   11 ++++++-----
 test-suite/tests/modules.test |   17 +++++++++++++++++
 2 files changed, 23 insertions(+), 5 deletions(-)

diff --git a/module/ice-9/boot-9.scm b/module/ice-9/boot-9.scm
index c88cbdd..85b44b1 100644
--- a/module/ice-9/boot-9.scm
+++ b/module/ice-9/boot-9.scm
@@ -2420,7 +2420,7 @@ If there is no handler at all, Guile prints an error and 
then exits."
     ;; Define the-root-module as '(guile).
     (module-define-submodule! root 'guile the-root-module)
 
-    (lambda* (name #:optional (autoload #t) (version #f))
+    (lambda* (name #:optional (autoload #t) (version #f) #:key (ensure #t))
       (let ((already (nested-ref-module root name)))
         (cond
          ((and already
@@ -2433,12 +2433,13 @@ If there is no handler at all, Guile prints an error 
and then exits."
          (autoload
           ;; Try to autoload the module, and recurse.
           (try-load-module name version)
-          (resolve-module name #f))
+          (resolve-module name #f #:ensure ensure))
          (else
           ;; No module found (or if one was, it had no public interface), and
-          ;; we're not autoloading. Here's the weird semantics: we ensure
-          ;; there's an empty module.
-          (or already (make-modules-in root name))))))))
+          ;; we're not autoloading. Make an empty module if #:ensure is true.
+          (or already
+              (and ensure
+                   (make-modules-in root name)))))))))
 
 
 (define (try-load-module name version)
diff --git a/test-suite/tests/modules.test b/test-suite/tests/modules.test
index a6a955f..5b3f7a4 100644
--- a/test-suite/tests/modules.test
+++ b/test-suite/tests/modules.test
@@ -138,6 +138,23 @@
 
 
 ;;;
+;;; Resolve-module.
+;;;
+
+(with-test-prefix "resolve-module"
+
+  (pass-if "#:ensure #t by default"
+    (module? (resolve-module (list (gensym)))))
+
+  (pass-if "#:ensure #t explicitly"
+    (module? (resolve-module (list (gensym)) #:ensure #t)))
+
+  (pass-if "#:ensure #f"
+    (not (resolve-module (list (gensym)) #:ensure #f))))
+
+
+
+;;;
 ;;; Observers.
 ;;;
 


hooks/post-receive
-- 
GNU Guile



reply via email to

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