~ chicken-r7rs (master) 7da466318dc0c5270607bcc2d8e5627803c08dbc


commit 7da466318dc0c5270607bcc2d8e5627803c08dbc
Author:     Evan Hanson <evhan@foldling.org>
AuthorDate: Mon May 30 09:25:17 2016 +1200
Commit:     Evan Hanson <evhan@foldling.org>
CommitDate: Mon May 30 09:25:17 2016 +1200

    Drop now-unnecessary wrappers for "import" and "import-for-syntax"

diff --git a/r7rs-compile-time-module.scm b/r7rs-compile-time-module.scm
index 5751c66..5e5132a 100644
--- a/r7rs-compile-time-module.scm
+++ b/r7rs-compile-time-module.scm
@@ -1,7 +1,5 @@
 (module r7rs-compile-time (r7rs-cond-expand
                            r7rs-define-library
-                           r7rs-import
-                           r7rs-import-for-syntax
                            r7rs-include
                            r7rs-include-ci)
   (import scheme chicken)
diff --git a/r7rs-compile-time.scm b/r7rs-compile-time.scm
index b1e7c3f..b385971 100644
--- a/r7rs-compile-time.scm
+++ b/r7rs-compile-time.scm
@@ -54,20 +54,6 @@
     (else
      (syntax-error loc "invalid import/export specifier" spec))))
 
-(define (import-transformer type)
-  (wrap-er-macro-transformer
-   type
-   (lambda (x r c import)
-     `(##core#begin
-       ,@(map (lambda (spec)
-                (let ((spec (fixup-import/export-spec spec type))
-                      (name (import/export-spec-feature-name spec type)))
-                  (import (list type spec))
-                  (if (memq name '(scheme foreign)) ; XXX others?
-                      '(##core#undefined)
-                      `(##core#require-extension (,name) #f))))
-              (strip-syntax (cdr x)))))))
-
 (define (current-source-directory)
   (cond (##sys#current-source-filename => pathname-directory)
         (else #f)))
@@ -169,7 +155,8 @@
 	  (##sys#provide (##core#quote ,real-name))
 	  ;; Set up an R7RS environment for the module's body.
 	  (import-for-syntax r7rs) ; overwrites "syntax-rules"
-	  (import r7rs) ; overwrites existing "import" and "import-for-syntax"
+	  (import r7rs) ; overwrites "export" et al.
+	  ;; Now process all toplevel library declarations
           ,(parse-decls decls)))))
     (_ (syntax-error 'define-library "invalid library definition" form))))
 
@@ -219,12 +206,6 @@
      (cons (r 'begin)
            (append-map (cut read-forms <> #t) (cdr e))))))
 
-(define r7rs-import
-  (import-transformer 'import))
-
-(define r7rs-import-for-syntax
-  (import-transformer 'import-for-syntax))
-
 ;; NOTE Not really "r7rs" -- just the core begin rewrapped in
 ;; a transformer. Used when expanding toplevel library forms.
 (define r7rs-begin
diff --git a/r7rs.scm b/r7rs.scm
index 9c4d162..3c527b2 100644
--- a/r7rs.scm
+++ b/r7rs.scm
@@ -49,13 +49,6 @@
 			   (else (read-srfi-4-vector sym port)))))))
             (else (old-hook char port))))))
 
-;;;
-;;; 5.2. Import declarations
-;;;
-
-(define-syntax import r7rs-import)
-(define-syntax import-for-syntax r7rs-import-for-syntax)
-
 ;;;
 ;;; 5.4. Syntax definitions
 ;;;
Trap