guile-cvs
[Top][All Lists]
Advanced

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

guile/guile-core/ice-9 ChangeLog boot-9.scm


From: Martin Grabmueller
Subject: guile/guile-core/ice-9 ChangeLog boot-9.scm
Date: Tue, 22 May 2001 22:08:18 -0700

CVSROOT:        /cvs
Module name:    guile
Changes by:     Martin Grabmueller <address@hidden>     01/05/22 22:08:18

Modified files:
        guile-core/ice-9: ChangeLog boot-9.scm 

Log message:
        * boot-9.scm (%cond-expand-table): New hash table mapping modules
        to feature lists.
        (cond-expand): Use feature information associated with modules.
        
        * boot-9.scm (use-srfis): Do not extend the srfi-0 feature list.
        (cond-expand-provide): New procedure.

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/guile/guile-core/ice-9/ChangeLog.diff?cvsroot=OldCVS&tr1=1.435&tr2=1.436&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/guile/guile-core/ice-9/boot-9.scm.diff?cvsroot=OldCVS&tr1=1.252&tr2=1.253&r1=text&r2=text

Patches:
Index: guile/guile-core/ice-9/ChangeLog
diff -u guile/guile-core/ice-9/ChangeLog:1.435 
guile/guile-core/ice-9/ChangeLog:1.436
--- guile/guile-core/ice-9/ChangeLog:1.435      Tue May 22 15:45:36 2001
+++ guile/guile-core/ice-9/ChangeLog    Tue May 22 22:08:16 2001
@@ -1,3 +1,14 @@
+2001-05-23  Martin Grabmueller  <address@hidden>
+
+       * boot-9.scm (%cond-expand-table): New hash table mapping modules
+       to feature lists.
+       (cond-expand): Use feature information associated with modules.
+
+2001-05-21  Martin Grabmueller  <address@hidden>
+
+       * boot-9.scm (use-srfis): Do not extend the srfi-0 feature list.
+       (cond-expand-provide): New procedure.
+       
 2001-05-22  Marius Vollmer  <address@hidden>
 
        * boot-9.scm (define-module): Return the new module.
Index: guile/guile-core/ice-9/boot-9.scm
diff -u guile/guile-core/ice-9/boot-9.scm:1.252 
guile/guile-core/ice-9/boot-9.scm:1.253
--- guile/guile-core/ice-9/boot-9.scm:1.252     Tue May 22 15:45:13 2001
+++ guile/guile-core/ice-9/boot-9.scm   Tue May 22 22:08:17 2001
@@ -2723,10 +2723,24 @@
 ;;;
 ;;; Remember to update the features list when adding more SRFIs.
 
-(define cond-expand-features
+(define %cond-expand-features
   ;; Adjust the above comment when changing this.
   '(guile r5rs srfi-0))
 
+;; This table maps module public interfaces to the list of features.
+;;
+(define %cond-expand-table (make-hash-table 31))
+
+;; Add one or more features to the `cond-expand' feature list of the
+;; module `module'.
+;;
+(define (cond-expand-provide module features)
+  (let ((mod (module-public-interface module)))
+    (and mod
+        (hashq-set! %cond-expand-table mod
+                    (append (hashq-ref %cond-expand-table mod '())
+                            features)))))
+
 (define-macro (cond-expand clause . clauses)
 
   (let ((clauses (cons clause clauses))
@@ -2737,7 +2751,13 @@
          (lambda (clause)
            (cond
              ((symbol? clause)
-              (memq clause cond-expand-features))
+              (or (memq clause %cond-expand-features)
+                  (let lp ((uses (module-uses (current-module))))
+                    (if (pair? uses)
+                      (or (memq clause
+                                (hashq-ref %cond-expand-table (car uses) '()))
+                          (lp (cdr uses)))
+                      #f))))
              ((pair? clause)
               (cond
                 ((eq? 'and (car clause))
@@ -2793,8 +2813,6 @@
                       (string-append "srfi-" (number->string (car s)))))
                (mod-i (resolve-interface (list 'srfi srfi))))
           (module-use! (current-module) mod-i)
-          (set! cond-expand-features
-                (append cond-expand-features (list srfi)))
           (lp (cdr s))))))
 
 



reply via email to

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