guile-commits
[Top][All Lists]
Advanced

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

[Guile-commits] 01/01: Propagate replacement flag for autoload interface


From: Andy Wingo
Subject: [Guile-commits] 01/01: Propagate replacement flag for autoload interfaces
Date: Thu, 5 Dec 2019 08:06:52 -0500 (EST)

wingo pushed a commit to branch master
in repository guile.

commit cb14fd214365e50b6b1655616ae74d0228933bbd
Author: Andy Wingo <address@hidden>
Date:   Thu Dec 5 14:05:51 2019 +0100

    Propagate replacement flag for autoload interfaces
    
    * module/ice-9/boot-9.scm (make-autoload-interface): Propagate replaced
      binding flags to autoload interface.
---
 module/ice-9/boot-9.scm | 24 +++++++++++++++---------
 1 file changed, 15 insertions(+), 9 deletions(-)

diff --git a/module/ice-9/boot-9.scm b/module/ice-9/boot-9.scm
index a18a32b..b5ce5f3 100644
--- a/module/ice-9/boot-9.scm
+++ b/module/ice-9/boot-9.scm
@@ -3415,15 +3415,21 @@ error if selected binding does not exist in the used 
module."
   (let ((b (lambda (a sym definep)
              (false-if-exception
               (and (memq sym bindings)
-                   (let ((i (module-public-interface (resolve-module name))))
-                     (if (not i)
-                         (error "missing interface for module" name))
-                     (let ((autoload (memq a (module-uses module))))
-                       ;; Replace autoload-interface with actual interface if
-                       ;; that has not happened yet.
-                       (if (pair? autoload)
-                           (set-car! autoload i)))
-                     (module-local-variable i sym)))
+                   (let ((i (resolve-interface name #:select bindings)))
+                     (unless i
+                       (error "missing interface for module" name))
+                     (let ((uses (memq a (module-uses module))))
+                       (when uses
+                         ;; Replace autoload-interface with actual
+                         ;; interface.
+                         (set-car! uses i)))
+                     (for-each
+                      (lambda (name)
+                        (when (hashq-ref (module-replacements i) name)
+                          (hashq-set! (module-replacements a) name #t)))
+                      bindings)
+                     (or (module-local-variable i sym)
+                         (error "binding not presentin module" name sym))))
               #:warning "Failed to autoload ~a in ~a:\n" sym name))))
     (module-constructor (make-hash-table 0) '() b #f #f name 'autoload #f
                         (make-hash-table 0) '() (make-weak-value-hash-table) #f



reply via email to

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