>From 3afa028db3ccf06af59d5874749ef7a914298f9e Mon Sep 17 00:00:00 2001
From: Evan Hanson
Date: Mon, 16 Oct 2017 22:56:05 +1300
Subject: [PATCH] Remove `use' and `use-for-syntax'
---
chicken-syntax.scm | 16 +---------------
scripts/make-wrapper.scm | 4 +---
scripts/mini-salmonella.scm | 2 +-
scripts/setversion | 3 ++-
tests/apply-test.scm | 2 +-
tests/arithmetic-test.scm | 2 +-
tests/compiler-tests-3.scm | 2 +-
tests/embedded2.scm | 2 +-
tests/embedded4.scm | 2 +-
tests/fft.scm | 4 ++--
tests/finalizer-error-test.scm | 2 +-
tests/fixnum-tests.scm | 2 +-
tests/functor-tests.scm | 2 +-
tests/library-tests.scm | 2 +-
tests/lolevel-tests.scm | 4 ++--
tests/loopy-test.scm | 4 ++--
tests/module-tests.scm | 2 +-
tests/numbers-string-conversion-tests.scm | 2 +-
tests/numbers-test-ashinn.scm | 2 +-
tests/numbers-test-gauche.scm | 2 +-
tests/numbers-test.scm | 2 +-
tests/port-tests.scm | 4 ++--
tests/pp-test.scm | 4 ++--
tests/r7rs-tests.scm | 2 +-
tests/reader-tests.scm | 6 +++---
tests/sgrep.scm | 2 +-
tests/srfi-4-tests.scm | 2 +-
tests/srfi-45-tests.scm | 4 ++--
tests/syntax-tests.scm | 10 +++++-----
tests/test-finalizers-2.scm | 2 +-
tests/test-finalizers.scm | 2 +-
tests/test-find-files.scm | 8 ++++----
tests/test-gc-hooks.scm | 2 +-
tests/test-glob.scm | 2 +-
tests/test-irregex.scm | 4 ++--
tests/test.scm | 4 ++--
tests/typematch-tests.scm | 4 ++--
tests/version-tests.scm | 2 +-
38 files changed, 57 insertions(+), 72 deletions(-)
diff --git a/chicken-syntax.scm b/chicken-syntax.scm
index 129648a0..afe62229 100644
--- a/chicken-syntax.scm
+++ b/chicken-syntax.scm
@@ -1153,14 +1153,8 @@
,(car head))
`(##core#letrec* ((,head ,@(cddr form))) ,head))))))
-;;; use
-(##sys#extend-macro-environment
- 'use '()
- (##sys#er-transformer
- (lambda (x r c)
- (##sys#check-syntax 'use x '(_ . #(_ 0)))
- `(,(r 'require-extension) ,@(cdr x)))))
+;;; SRFI-55
(##sys#extend-macro-environment
'require-extension
@@ -1310,14 +1304,6 @@
(,(r 'define) ,@(cdr form))))))
-(##sys#extend-macro-environment
- 'use-for-syntax '()
- (##sys#er-transformer
- (lambda (x r c)
- (##sys#check-syntax 'use-for-syntax x '(_ . #(_ 0)))
- `(,(r 'require-extension-for-syntax) ,@(cdr x)))))
-
-
;;; compiler syntax
(##sys#extend-macro-environment
diff --git a/scripts/make-wrapper.scm b/scripts/make-wrapper.scm
index 4b39136a..2effd459 100644
--- a/scripts/make-wrapper.scm
+++ b/scripts/make-wrapper.scm
@@ -2,9 +2,7 @@
;
; usage: csi -s make-wrapper.scm NAME BINPATH
-
-(use pathname)
-
+(import (chicken pathname))
(let* ((args (command-line-arguments))
(name (car args))
diff --git a/scripts/mini-salmonella.scm b/scripts/mini-salmonella.scm
index 211aa75a..45bffee9 100644
--- a/scripts/mini-salmonella.scm
+++ b/scripts/mini-salmonella.scm
@@ -4,7 +4,7 @@
(module mini-salmonella ()
(import scheme chicken)
-(use posix file extras data-structures setup-api (chicken process))
+(import posix file extras data-structures setup-api (chicken process))
(define (usage code)
(print "usage: mini-salmonella [-h] [-test] [-debug] [-download] [-trunk] EGGDIR [PREFIX]")
diff --git a/scripts/setversion b/scripts/setversion
index f4846b3c..54aa4123 100755
--- a/scripts/setversion
+++ b/scripts/setversion
@@ -3,7 +3,8 @@
exec csi -s "$0" "$@"
|#
-(use file format io irregex (chicken process) (chicken string))
+(import (chicken file) (chicken format) (chicken io)
+ (chicken irregex) (chicken process) (chicken string))
(define buildversion (with-input-from-file "buildversion" read-line))
diff --git a/tests/apply-test.scm b/tests/apply-test.scm
index 563effab..f1372d56 100644
--- a/tests/apply-test.scm
+++ b/tests/apply-test.scm
@@ -1,4 +1,4 @@
-(use format (chicken platform))
+(import format (chicken platform))
(define (list-tabulate n proc)
(let loop ((i 0))
diff --git a/tests/arithmetic-test.scm b/tests/arithmetic-test.scm
index 36e6c136..a3d37354 100644
--- a/tests/arithmetic-test.scm
+++ b/tests/arithmetic-test.scm
@@ -15,7 +15,7 @@
(else))
-(use pretty-print random (chicken platform))
+(import pretty-print random (chicken platform))
(define range 2)
(define random-range 32000)
diff --git a/tests/compiler-tests-3.scm b/tests/compiler-tests-3.scm
index fb3118a4..6b437ccc 100644
--- a/tests/compiler-tests-3.scm
+++ b/tests/compiler-tests-3.scm
@@ -1,6 +1,6 @@
;;; compiler-tests-3.scm - tests for unboxing
-(use flonum)
+(import flonum)
;;; unboxing introduced binding in test-position of conditional
diff --git a/tests/embedded2.scm b/tests/embedded2.scm
index d2d8eece..e7aee2f0 100644
--- a/tests/embedded2.scm
+++ b/tests/embedded2.scm
@@ -1,4 +1,4 @@
-(use gc pretty-print)
+(import gc pretty-print)
#>
#include
diff --git a/tests/embedded4.scm b/tests/embedded4.scm
index f1c49812..6550b612 100644
--- a/tests/embedded4.scm
+++ b/tests/embedded4.scm
@@ -1,6 +1,6 @@
;;; x.scm
-(use gc)
+(import gc)
(define (bar x) (gc) (* x x))
diff --git a/tests/fft.scm b/tests/fft.scm
index 5815a417..c43784a6 100644
--- a/tests/fft.scm
+++ b/tests/fft.scm
@@ -9,7 +9,7 @@
(block)
(not safe)))
(else
- (use bitwise flonum)))
+ (import bitwise flonum)))
;;; All the following redefinitions are *ignored* by the Gambit compiler
;;; because of the declarations above.
@@ -56,7 +56,7 @@
(defalias list->f64vector list->vector)
(defalias f64vector-length vector-length)) )
(chicken
- (use srfi-4))
+ (import srfi-4))
(else) )
;;; end of *ignored* definitions
diff --git a/tests/finalizer-error-test.scm b/tests/finalizer-error-test.scm
index 3785dd20..171eb1dd 100644
--- a/tests/finalizer-error-test.scm
+++ b/tests/finalizer-error-test.scm
@@ -1,6 +1,6 @@
;;;; finalizer-error-test.scm - by "megane"
-(use gc)
+(import gc)
(define n 10000)
diff --git a/tests/fixnum-tests.scm b/tests/fixnum-tests.scm
index 44648884..86e54d3a 100644
--- a/tests/fixnum-tests.scm
+++ b/tests/fixnum-tests.scm
@@ -1,4 +1,4 @@
-(use (chicken platform))
+(import (chicken platform))
(define (fxo+ x y) (##core#inline "C_i_o_fixnum_plus" x y))
(define (fxo- x y) (##core#inline "C_i_o_fixnum_difference" x y))
diff --git a/tests/functor-tests.scm b/tests/functor-tests.scm
index 1858da58..7fa5531f 100644
--- a/tests/functor-tests.scm
+++ b/tests/functor-tests.scm
@@ -1,7 +1,7 @@
;;;; functor-tests.scm
-(use data-structures port pretty-print)
+(import data-structures port pretty-print)
(include "test.scm")
diff --git a/tests/library-tests.scm b/tests/library-tests.scm
index 6e43068e..0ac5e2be 100644
--- a/tests/library-tests.scm
+++ b/tests/library-tests.scm
@@ -1,6 +1,6 @@
;;;; library-tests.scm
-(use chicken.blob bitwise flonum keyword port)
+(import chicken.blob bitwise flonum keyword port)
(define-syntax assert-fail
(syntax-rules ()
diff --git a/tests/lolevel-tests.scm b/tests/lolevel-tests.scm
index 88c84bf6..bb6c2990 100644
--- a/tests/lolevel-tests.scm
+++ b/tests/lolevel-tests.scm
@@ -1,7 +1,7 @@
;;;; Unit lolevel testing
-(use chicken.format chicken.locative chicken.platform
- chicken.memory chicken.memory.representation srfi-4)
+(import chicken.format chicken.locative chicken.platform
+ chicken.memory chicken.memory.representation srfi-4)
(define-syntax assert-error
(syntax-rules ()
diff --git a/tests/loopy-test.scm b/tests/loopy-test.scm
index 855e06d2..c32f6888 100644
--- a/tests/loopy-test.scm
+++ b/tests/loopy-test.scm
@@ -1,5 +1,5 @@
-(use (only format printf)
- (only time current-milliseconds))
+(import (only format printf)
+ (only time current-milliseconds))
(load-relative "loopy-loop.scm")
(load-relative "matchable.scm")
diff --git a/tests/module-tests.scm b/tests/module-tests.scm
index e6969e76..6fda2437 100644
--- a/tests/module-tests.scm
+++ b/tests/module-tests.scm
@@ -161,7 +161,7 @@
(module m15 ()
(import scheme chicken)
- (use (prefix (rename srfi-4 (u8vector u)) 99:))
+ (import (prefix (rename srfi-4 (u8vector u)) 99:))
(print 99:u))
diff --git a/tests/numbers-string-conversion-tests.scm b/tests/numbers-string-conversion-tests.scm
index 5c20453f..c2b21ddb 100644
--- a/tests/numbers-string-conversion-tests.scm
+++ b/tests/numbers-string-conversion-tests.scm
@@ -21,7 +21,7 @@
;; (load "~~/lib/syntax-case") and then load this file, or use gsi's -:s switch
;;;
-(use format) ; Chicken w/ numbers
+(import format) ; Chicken w/ numbers
;(use-syntax (ice-9 syncase)) ; Guile
;; Set this to #f if the Scheme has no compnums at all, 'inexact if it only
diff --git a/tests/numbers-test-ashinn.scm b/tests/numbers-test-ashinn.scm
index ca39f2eb..713cae0c 100644
--- a/tests/numbers-test-ashinn.scm
+++ b/tests/numbers-test-ashinn.scm
@@ -1,6 +1,6 @@
(include "test.scm")
-(use bitwise)
+(import bitwise)
(current-test-epsilon 0) ;; We want exact comparisons by default
diff --git a/tests/numbers-test-gauche.scm b/tests/numbers-test-gauche.scm
index 8dd9079c..61423410 100644
--- a/tests/numbers-test-gauche.scm
+++ b/tests/numbers-test-gauche.scm
@@ -48,7 +48,7 @@
;; Gauche compat
-(use bitwise)
+(import bitwise)
(define (greatest-fixnum) most-positive-fixnum)
(define (least-fixnum) most-negative-fixnum)
diff --git a/tests/numbers-test.scm b/tests/numbers-test.scm
index 83222cb3..da3c70b3 100644
--- a/tests/numbers-test.scm
+++ b/tests/numbers-test.scm
@@ -2,7 +2,7 @@
(include "test.scm")
-(use bitwise flonum format posix (chicken platform))
+(import bitwise flonum format posix (chicken platform))
;; The default "comparator" doesn't know how to deal with extended number types
(current-test-comparator
diff --git a/tests/port-tests.scm b/tests/port-tests.scm
index 40d31e88..1330b443 100644
--- a/tests/port-tests.scm
+++ b/tests/port-tests.scm
@@ -1,5 +1,5 @@
-(use chicken.condition (only data-structures constantly)
- file flonum format io port posix srfi-4 tcp)
+(import chicken.condition (only data-structures constantly)
+ file flonum format io port posix srfi-4 tcp)
(include "test.scm")
(test-begin)
diff --git a/tests/pp-test.scm b/tests/pp-test.scm
index a60670e5..af6f710d 100644
--- a/tests/pp-test.scm
+++ b/tests/pp-test.scm
@@ -1,7 +1,7 @@
;;;; pp-test.scm
-(use (only pretty-print pp)
- (only port with-output-to-string))
+(import (only pretty-print pp)
+ (only port with-output-to-string))
(define (pp->string thing)
(with-output-to-string (cut pp thing)))
diff --git a/tests/r7rs-tests.scm b/tests/r7rs-tests.scm
index 75569147..cb44d8cc 100644
--- a/tests/r7rs-tests.scm
+++ b/tests/r7rs-tests.scm
@@ -1,6 +1,6 @@
;; R7RS Tests
-(use (only port with-input-from-string with-output-to-string))
+(import (only port with-input-from-string with-output-to-string))
;; Copied from R4RS tests
(define cur-section '())
diff --git a/tests/reader-tests.scm b/tests/reader-tests.scm
index bc0cb264..d8c9a820 100644
--- a/tests/reader-tests.scm
+++ b/tests/reader-tests.scm
@@ -1,8 +1,8 @@
;;;; reader-tests.scm
-(use (only io read-line read-string)
- (only port with-input-from-string with-output-to-string)
- (only read-syntax set-read-syntax! set-sharp-read-syntax!))
+(import (only io read-line read-string)
+ (only port with-input-from-string with-output-to-string)
+ (only read-syntax set-read-syntax! set-sharp-read-syntax!))
(set-sharp-read-syntax! #\& (lambda (p) (read p) (values)))
(set-sharp-read-syntax! #\^ (lambda (p) (read p)))
diff --git a/tests/sgrep.scm b/tests/sgrep.scm
index 79e5ad67..992add09 100644
--- a/tests/sgrep.scm
+++ b/tests/sgrep.scm
@@ -1,7 +1,7 @@
;;;; sgrep.scm - grepping benchmark
-(use io irregex port)
+(import io irregex port)
(define big-string
diff --git a/tests/srfi-4-tests.scm b/tests/srfi-4-tests.scm
index a4313ab7..317d55e2 100644
--- a/tests/srfi-4-tests.scm
+++ b/tests/srfi-4-tests.scm
@@ -1,7 +1,7 @@
;;;; srfi-4-tests.scm
-(use srfi-4 port)
+(import srfi-4 port)
(import-for-syntax chicken)
(define-syntax test1
diff --git a/tests/srfi-45-tests.scm b/tests/srfi-45-tests.scm
index 10a7a636..7345e14e 100644
--- a/tests/srfi-45-tests.scm
+++ b/tests/srfi-45-tests.scm
@@ -1,8 +1,8 @@
;;; Tests adapted from SRFI 45 (for "lazy" -> "delay-force").
;;; That SRFI Copyright (C) André van Tonder (2003).
-(use (only format printf)
- (only port with-output-to-string))
+(import (only format printf)
+ (only port with-output-to-string))
(define *errors* 0)
diff --git a/tests/syntax-tests.scm b/tests/syntax-tests.scm
index f1ec80fa..29281faa 100644
--- a/tests/syntax-tests.scm
+++ b/tests/syntax-tests.scm
@@ -1,7 +1,7 @@
;;;; syntax-tests.scm - various macro tests
-(use-for-syntax pretty-print)
-(use gc pretty-print)
+(import-for-syntax pretty-print)
+(import gc pretty-print)
(define-syntax t
(syntax-rules ()
@@ -1085,10 +1085,10 @@
(foo 3)
-;; #578: "use" with import-specifier has no effect for internal modules on csi's top-level
+;; #578: import with specifier has no effect for internal modules on csi's top-level
-(use srfi-4)
-(use (prefix srfi-4 other-))
+(import srfi-4)
+(import (prefix srfi-4 other-))
u8vector
other-u8vector
diff --git a/tests/test-finalizers-2.scm b/tests/test-finalizers-2.scm
index e0bc32c9..3f1170c6 100644
--- a/tests/test-finalizers-2.scm
+++ b/tests/test-finalizers-2.scm
@@ -1,6 +1,6 @@
;;;; test-finalizers-2.scm - test finalizers + GC roots
-(use gc)
+(import gc)
(define (list-tabulate n proc)
(let loop ((i 0))
diff --git a/tests/test-finalizers.scm b/tests/test-finalizers.scm
index 0e011cf0..0b723d06 100644
--- a/tests/test-finalizers.scm
+++ b/tests/test-finalizers.scm
@@ -2,7 +2,7 @@
(import (chicken format))
-(use gc)
+(import gc)
(##sys#eval-debug-level 0) ; disable keeping trace-buffer with frameinfo
diff --git a/tests/test-find-files.scm b/tests/test-find-files.scm
index e2a0d8a3..08866b74 100644
--- a/tests/test-find-files.scm
+++ b/tests/test-find-files.scm
@@ -1,7 +1,7 @@
-(use (chicken file)
- (chicken process-context)
- (chicken sort)
- (chicken string))
+(import (chicken file)
+ (chicken process-context)
+ (chicken sort)
+ (chicken string))
(include "test.scm")
diff --git a/tests/test-gc-hooks.scm b/tests/test-gc-hooks.scm
index 45be9d74..28b9c7f3 100644
--- a/tests/test-gc-hooks.scm
+++ b/tests/test-gc-hooks.scm
@@ -1,6 +1,6 @@
;;;; test-gc-hooks.scm
-(use gc)
+(import gc)
#>
diff --git a/tests/test-glob.scm b/tests/test-glob.scm
index 62ccc6fb..9bebd3ef 100644
--- a/tests/test-glob.scm
+++ b/tests/test-glob.scm
@@ -1,7 +1,7 @@
;;;; test-glob.scm - test glob-pattern -> regex translation
-(use irregex)
+(import irregex)
(assert (irregex-match (glob->sre "foo.bar") "foo.bar"))
(assert (irregex-match (glob->sre "foo*") "foo.bar"))
diff --git a/tests/test-irregex.scm b/tests/test-irregex.scm
index c69736a3..b3e1520e 100644
--- a/tests/test-irregex.scm
+++ b/tests/test-irregex.scm
@@ -1,8 +1,8 @@
;;;: test-irregex.scm
-(use (only chicken.string string-split string-intersperse)
- format io irregex port)
+(import (only chicken.string string-split string-intersperse)
+ format io irregex port)
(include "test.scm")
diff --git a/tests/test.scm b/tests/test.scm
index 7c89a5ba..5c886f5d 100644
--- a/tests/test.scm
+++ b/tests/test.scm
@@ -2,8 +2,8 @@
;
; by Alex Shinn, lifted from match-test by felix
-(use (only chicken.string ->string))
-(use time) ; current-milliseconds
+(import (only chicken.string ->string))
+(import time) ; current-milliseconds
(define *pass* 0)
(define *fail* 0)
diff --git a/tests/typematch-tests.scm b/tests/typematch-tests.scm
index 6d5a3e57..243f11c6 100644
--- a/tests/typematch-tests.scm
+++ b/tests/typematch-tests.scm
@@ -1,8 +1,8 @@
;;;; typematch-tests.scm
-(use (only chicken.data-structures identity)
- chicken.blob chicken.memory locative)
+(import (only chicken.data-structures identity)
+ chicken.blob chicken.memory locative)
(define (make-list n x)
diff --git a/tests/version-tests.scm b/tests/version-tests.scm
index 9b98af46..6ba34ba1 100644
--- a/tests/version-tests.scm
+++ b/tests/version-tests.scm
@@ -1,4 +1,4 @@
-(use irregex chicken.platform chicken.string)
+(import irregex chicken.platform chicken.string)
(let* ((version-tokens (string-split (chicken-version) "."))
(major (string->number (car version-tokens)))
--
2.11.0