guile-commits
[Top][All Lists]
Advanced

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

[Guile-commits] 01/02: Importing modules with #:select no longer grovels


From: Andy Wingo
Subject: [Guile-commits] 01/02: Importing modules with #:select no longer grovels private bindings
Date: Tue, 21 Jun 2016 14:46:22 +0000 (UTC)

wingo pushed a commit to branch master
in repository guile.

commit d0d14f410dd7d64c3852c764f2eb6aabc89ef211
Author: Andy Wingo <address@hidden>
Date:   Tue Jun 21 16:01:50 2016 +0200

    Importing modules with #:select no longer grovels private bindings
    
    * module/ice-9/boot-9.scm (resolve-interface): Don't look in private
      interface for #:select bindings.  Fixes #17418.
    * module/system/repl/coop-server.scm: Don't rely on bad #:select
      behavior.
    * NEWS: Add entry.
---
 NEWS                               |    5 +++++
 module/ice-9/boot-9.scm            |    1 -
 module/system/repl/coop-server.scm |   14 +++++++++-----
 3 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/NEWS b/NEWS
index 651d0d7..4915b94 100644
--- a/NEWS
+++ b/NEWS
@@ -10,6 +10,11 @@ Changes in 2.1.4 (changes since the 2.1.3 alpha release):
 
 * Bug fixes
 ** Don't replace + with space when splitting and decoding URI paths
+** Fix bug importing specific bindings with #:select
+
+It used to be that if #:select didn't find a binding in the public
+interface of a module, it would actually grovel in the module's
+unexported private bindings.  This was not intended and is now fixed.
 
 
 [TODO: Fold into generic 2.2 release notes.]
diff --git a/module/ice-9/boot-9.scm b/module/ice-9/boot-9.scm
index 6eae844..0089981 100644
--- a/module/ice-9/boot-9.scm
+++ b/module/ice-9/boot-9.scm
@@ -2798,7 +2798,6 @@ written into the port is returned."
                              (orig (if direct? bspec (car bspec)))
                              (seen (if direct? bspec (cdr bspec)))
                              (var (or (module-local-variable public-i orig)
-                                      (module-local-variable module orig)
                                       (error
                                        ;; fixme: format manually for now
                                        (simple-format
diff --git a/module/system/repl/coop-server.scm 
b/module/system/repl/coop-server.scm
index c19dda1..f3f5116 100644
--- a/module/system/repl/coop-server.scm
+++ b/module/system/repl/coop-server.scm
@@ -25,14 +25,18 @@
   #:use-module (ice-9 threads)
   #:use-module (ice-9 q)
   #:use-module (srfi srfi-9)
-  #:use-module ((system repl repl)
-                #:select (start-repl* prompting-meta-read))
-  #:use-module ((system repl server)
-                #:select (run-server* make-tcp-server-socket
-                                      add-open-socket! close-socket!))
+  #:use-module ((system repl server) #:select (make-tcp-server-socket))
   #:export (spawn-coop-repl-server
             poll-coop-repl-server))
 
+;; Hack to import private bindings from (system repl repl).
+(define-syntax-rule (import-private module sym ...)
+  (begin
+    (define sym (@@ module sym))
+    ...))
+(import-private (system repl repl) start-repl* prompting-meta-read)
+(import-private (system repl server) run-server* add-open-socket! 
close-socket!)
+
 (define-record-type <coop-repl-server>
   (%make-coop-repl-server mutex queue)
   coop-repl-server?



reply via email to

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