I think it would be nice to have a flag/parameter to quiet "re-importing 
already imported identifier/syntax" warnings. These seem rather noisy, and in 
many cases the user is probably aware of potential collisions (as in (import 
r7rs), for example).

In the attached patch to modules.scm, I've quieted the warnings based on the 
load-verbose flag, but I don't think that's entirely appropriate as this 
warning is more to do with importing than loading (for example, you can (import 
r7rs), then (import scheme), which will issue the warnings even though scheme 
is already loaded).

Thoughts on any of this?

- Diego
From af7284e5fca4537e30d2f07b49361812b57e6138 Mon Sep 17 00:00:00 2001
From: dieggsy <dieg...@pm.me>
Date: Sun, 14 Mar 2021 23:20:33 -0400
Subject: [PATCH] index on master: b2e6c524 Allow "-cached" flag with
 chicken-install for local egg file

---
 modules.scm | 30 ++++++++++++++++--------------
 1 file changed, 16 insertions(+), 14 deletions(-)

diff --git a/modules.scm b/modules.scm
index 29fb92e5..9346bac6 100644
--- a/modules.scm
+++ b/modules.scm
@@ -746,20 +746,22 @@
     (dd `(IMPORT: ,loc))
     (dd `(V: ,(if cm (module-name cm) '<toplevel>) ,(map-se vsv)))
     (dd `(S: ,(if cm (module-name cm) '<toplevel>) ,(map-se vss)))
-    (for-each
-     (lambda (imp)
-       (and-let* ((id (car imp))
-                  (a (assq id (import-env)))
-                  (aid (cdr imp))
-                  ((not (eq? aid (cdr a)))))
-         (##sys#notice "re-importing already imported identifier" id)))
-     vsv)
-    (for-each
-     (lambda (imp)
-       (and-let* ((a (assq (car imp) (macro-env)))
-                  ((not (eq? (cdr imp) (cdr a)))))
-         (##sys#notice "re-importing already imported syntax" (car imp))))
-     vss)
+    (if (chicken.load#load-verbose)
+	(for-each
+	 (lambda (imp)
+	   (and-let* ((id (car imp))
+		      (a (assq id (import-env)))
+		      (aid (cdr imp))
+		      ((not (eq? aid (cdr a)))))
+	     (##sys#notice "re-importing already imported identifier" id)))
+	 vsv))
+    (if (chicken.load#load-verbose)
+	(for-each
+	 (lambda (imp)
+	   (and-let* ((a (assq (car imp) (macro-env)))
+		      ((not (eq? (cdr imp) (cdr a)))))
+	     (##sys#notice "re-importing already imported syntax" (car imp))))
+	 vss))
     (when reexp?
       (unless cm
         (##sys#syntax-error-hook loc "`reexport' only valid inside a module"))
-- 
2.31.0

Reply via email to