From f41be016f68e18bd95cac7e024f40ba608a6e896 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Grabm=C3=BCller?= Date: Tue, 15 May 2001 20:20:51 +0000 Subject: [PATCH] * boot-9.scm (cond-expand-features): Made the feature list public, so it can be manipulated by `use-srfis'. (use-srfis): New procedure. --- ice-9/ChangeLog | 6 ++++++ ice-9/boot-9.scm | 26 ++++++++++++++++++++------ 2 files changed, 26 insertions(+), 6 deletions(-) diff --git a/ice-9/ChangeLog b/ice-9/ChangeLog index c246c5854..6a83b18f3 100644 --- a/ice-9/ChangeLog +++ b/ice-9/ChangeLog @@ -1,3 +1,9 @@ +2001-05-15 Martin Grabmueller + + * boot-9.scm (cond-expand-features): Made the feature list public, + so it can be manipulated by `use-srfis'. + (use-srfis): New procedure. + 2001-05-15 Thien-Thi Nguyen * boot-9.scm (resolve-interface): Signal error now also if diff --git a/ice-9/boot-9.scm b/ice-9/boot-9.scm index 94ea5042d..21f4f908a 100644 --- a/ice-9/boot-9.scm +++ b/ice-9/boot-9.scm @@ -2721,15 +2721,15 @@ ;;; ;;; Currently, the following feature identifiers are supported: ;;; -;;; guile r5rs srfi-0 srfi-6 +;;; guile r5rs srfi-0 ;;; ;;; Remember to update the features list when adding more SRFIs. -(define-macro (cond-expand clause . clauses) +(define cond-expand-features + ;; Adjust the above comment when changing this. + '(guile r5rs srfi-0)) - (define features - ;; Adjust the above comment when changing this. - '(guile r5rs srfi-0 srfi-6)) +(define-macro (cond-expand clause . clauses) (let ((clauses (cons clause clauses)) (syntax-error (lambda (cl) @@ -2739,7 +2739,7 @@ (lambda (clause) (cond ((symbol? clause) - (memq clause features)) + (memq clause cond-expand-features)) ((pair? clause) (cond ((eq? 'and (car clause)) @@ -2785,6 +2785,20 @@ (else (lp (cdr c)))))))) +;; This procedure gets called from the startup code with a list of +;; numbers, which are the numbers of the SRFIs to be loaded on startup. +;; +(define (use-srfis srfis) + (let lp ((s srfis)) + (if (pair? s) + (let* ((srfi (string->symbol + (string-append "srfi-" (number->string (car s))))) + (mod (resolve-interface (list 'srfi srfi)))) + (module-use! (current-module) mod) + (set! cond-expand-features + (append cond-expand-features (list srfi))) + (lp (cdr s)))))) + ;;; {Load emacs interface support if emacs option is given.}