>From 96aee13c57da662ac7919c63c904689b7b43fc9f Mon Sep 17 00:00:00 2001 From: Evan Hanson Date: Thu, 9 Nov 2017 18:25:13 +1300 Subject: [PATCH 1/2] Drop shorthand module aliases These were only added to provide some backwards compatibility while we reorganised the standard libraries. Now that this has been done for most of the core modules (data-structures is still left over), we can drop their aliases and start to use their real names instead. --- modules.scm | 30 +----------------------------- tests/apply-test.scm | 3 ++- tests/arithmetic-test.scm | 4 +++- tests/compiler-tests.scm | 6 +++--- tests/embedded2.scm | 2 +- tests/embedded4.scm | 2 +- tests/environment-tests.scm | 2 +- tests/fft.scm | 2 +- tests/finalizer-error-test.scm | 2 +- tests/functor-tests.scm | 5 ++--- tests/library-tests.scm | 2 +- tests/loopy-test.scm | 4 ++-- tests/module-tests-2.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 | 7 ++++++- tests/port-tests.scm | 3 ++- tests/pp-test.scm | 4 ++-- tests/r7rs-tests.scm | 2 +- tests/reader-tests.scm | 6 +++--- tests/reexport-tests.scm | 9 ++++++--- tests/sgrep.scm | 2 +- tests/specialization-test-1.scm | 2 +- tests/specialization-test-2.scm | 2 +- tests/srfi-4-tests.scm | 4 ++-- tests/srfi-45-tests.scm | 4 ++-- tests/syntax-tests.scm | 6 +++--- tests/test-finalizers-2.scm | 2 +- tests/test-finalizers.scm | 3 +-- tests/test-gc-hooks.scm | 2 +- tests/test-glob.scm | 2 +- tests/test-irregex.scm | 2 +- tests/test.scm | 2 +- tests/typematch-tests.scm | 2 +- tests/version-tests.scm | 2 +- 36 files changed, 61 insertions(+), 79 deletions(-) diff --git a/modules.scm b/modules.scm index bd03a241..c8484248 100644 --- a/modules.scm +++ b/modules.scm @@ -1042,36 +1042,8 @@ (##sys#register-module-alias 'r5rs 'scheme) (##sys#register-module-alias 'srfi-88 'chicken.keyword) -;; NOTE these are just here for shorthand and can be dropped whenever -(##sys#register-module-alias 'bitwise 'chicken.bitwise) -(##sys#register-module-alias 'continuation 'chicken.continuation) -(##sys#register-module-alias 'csi 'chicken.csi) +;; TODO drop when data-structures goes away (##sys#register-module-alias 'data-structures 'chicken.data-structures) -(##sys#register-module-alias 'errno 'chicken.errno) -(##sys#register-module-alias 'eval 'chicken.eval) -(##sys#register-module-alias 'file 'chicken.file) -(##sys#register-module-alias 'fixnum 'chicken.fixnum) -(##sys#register-module-alias 'flonum 'chicken.flonum) -(##sys#register-module-alias 'foreign 'chicken.foreign) -(##sys#register-module-alias 'format 'chicken.format) -(##sys#register-module-alias 'gc 'chicken.gc) -(##sys#register-module-alias 'internal 'chicken.internal) -(##sys#register-module-alias 'io 'chicken.io) -(##sys#register-module-alias 'irregex 'chicken.irregex) -(##sys#register-module-alias 'keyword 'chicken.keyword) -(##sys#register-module-alias 'locative 'chicken.locative) -(##sys#register-module-alias 'memory 'chicken.memory) -(##sys#register-module-alias 'pathname 'chicken.pathname) -(##sys#register-module-alias 'platform 'chicken.platform) -(##sys#register-module-alias 'port 'chicken.port) -(##sys#register-module-alias 'posix 'chicken.posix) -(##sys#register-module-alias 'pretty-print 'chicken.pretty-print) -(##sys#register-module-alias 'random 'chicken.random) -(##sys#register-module-alias 'read-syntax 'chicken.read-syntax) -(##sys#register-module-alias 'repl 'chicken.repl) -(##sys#register-module-alias 'syntax 'chicken.syntax) -(##sys#register-module-alias 'tcp 'chicken.tcp) -(##sys#register-module-alias 'time 'chicken.time) (define-inline (se-subset names env) (map (cut assq <> env) names)) diff --git a/tests/apply-test.scm b/tests/apply-test.scm index f1372d56..45cd65fe 100644 --- a/tests/apply-test.scm +++ b/tests/apply-test.scm @@ -1,4 +1,5 @@ -(import format (chicken platform)) +(import (chicken 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 a3d37354..496060d7 100644 --- a/tests/arithmetic-test.scm +++ b/tests/arithmetic-test.scm @@ -15,7 +15,9 @@ (else)) -(import pretty-print random (chicken platform)) +(import (chicken platform) + (chicken pretty-print) + (chicken random)) (define range 2) (define random-range 32000) diff --git a/tests/compiler-tests.scm b/tests/compiler-tests.scm index c2f0c068..a4608279 100644 --- a/tests/compiler-tests.scm +++ b/tests/compiler-tests.scm @@ -53,7 +53,7 @@ (module x (bar) - (import scheme chicken foreign) + (import scheme chicken chicken.foreign) (define (bar n) (let-location ((off integer 0)) @@ -111,7 +111,7 @@ (foreign-declare "enum intlimits {min=INT_MIN, zero=0, max=INT_MAX};") (module foo () - (import chicken scheme foreign) ; "chicken" includes an export for "void" + (import chicken scheme chicken.foreign) ; "chicken" includes an export for "void" (let-syntax ((fl (syntax-rules () @@ -148,7 +148,7 @@ ;; Unused arguments in foreign callback wrappers are not optimized away (#584) (module bla (foo) -(import chicken scheme foreign) +(import chicken scheme chicken.foreign) (define-external (blabla (int a) (c-string b) (int c) (int d) (c-string e) (int f)) diff --git a/tests/embedded2.scm b/tests/embedded2.scm index e7aee2f0..429517a1 100644 --- a/tests/embedded2.scm +++ b/tests/embedded2.scm @@ -1,4 +1,4 @@ -(import gc pretty-print) +(import chicken.gc chicken.pretty-print) #> #include diff --git a/tests/embedded4.scm b/tests/embedded4.scm index 6550b612..399f698c 100644 --- a/tests/embedded4.scm +++ b/tests/embedded4.scm @@ -1,6 +1,6 @@ ;;; x.scm -(import gc) +(import (chicken gc)) (define (bar x) (gc) (* x x)) diff --git a/tests/environment-tests.scm b/tests/environment-tests.scm index ef45b47b..c7d87d9b 100644 --- a/tests/environment-tests.scm +++ b/tests/environment-tests.scm @@ -43,7 +43,7 @@ (define foo-env (module-environment 'foo)) (define csi-env (module-environment '(chicken csi))) -(define format-env (module-environment 'format)) +(define format-env (module-environment 'chicken.format)) (test-equal (eval '(bar) foo-env) 99) (test-error (eval 'baz foo-env)) diff --git a/tests/fft.scm b/tests/fft.scm index c43784a6..99b85f58 100644 --- a/tests/fft.scm +++ b/tests/fft.scm @@ -9,7 +9,7 @@ (block) (not safe))) (else - (import bitwise flonum))) + (import chicken.bitwise chicken.flonum))) ;;; All the following redefinitions are *ignored* by the Gambit compiler ;;; because of the declarations above. diff --git a/tests/finalizer-error-test.scm b/tests/finalizer-error-test.scm index 171eb1dd..519c065c 100644 --- a/tests/finalizer-error-test.scm +++ b/tests/finalizer-error-test.scm @@ -1,6 +1,6 @@ ;;;; finalizer-error-test.scm - by "megane" -(import gc) +(import (chicken gc)) (define n 10000) diff --git a/tests/functor-tests.scm b/tests/functor-tests.scm index 61193796..e9e3351f 100644 --- a/tests/functor-tests.scm +++ b/tests/functor-tests.scm @@ -1,7 +1,7 @@ ;;;; functor-tests.scm -(import data-structures port pretty-print) +(import data-structures chicken.port chicken.pretty-print) (include "test.scm") @@ -33,8 +33,7 @@ (module queue2 QUEUE - (import (rename scheme (not empty?)) - chicken) + (import (rename scheme (not empty?)) chicken) (define-record entry q x) (define empty-queue #f) (define enqueue make-entry) diff --git a/tests/library-tests.scm b/tests/library-tests.scm index 0ac5e2be..1b62ad19 100644 --- a/tests/library-tests.scm +++ b/tests/library-tests.scm @@ -1,6 +1,6 @@ ;;;; library-tests.scm -(import chicken.blob bitwise flonum keyword port) +(import chicken.blob chicken.bitwise chicken.flonum chicken.keyword chicken.port) (define-syntax assert-fail (syntax-rules () diff --git a/tests/loopy-test.scm b/tests/loopy-test.scm index c32f6888..9a0f99d2 100644 --- a/tests/loopy-test.scm +++ b/tests/loopy-test.scm @@ -1,5 +1,5 @@ -(import (only format printf) - (only time current-milliseconds)) +(import (only chicken.format printf) + (only chicken.time current-milliseconds)) (load-relative "loopy-loop.scm") (load-relative "matchable.scm") diff --git a/tests/module-tests-2.scm b/tests/module-tests-2.scm index 0849ca91..b2fdb610 100644 --- a/tests/module-tests-2.scm +++ b/tests/module-tests-2.scm @@ -2,7 +2,7 @@ (module oo (output-of) - (import scheme port) + (import scheme chicken.port) (define-syntax output-of (syntax-rules () ((_ exp) (with-output-to-string (lambda () exp))))) diff --git a/tests/numbers-string-conversion-tests.scm b/tests/numbers-string-conversion-tests.scm index c2b21ddb..b71282de 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 ;;; -(import format) ; Chicken w/ numbers +(import (chicken 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 9fa886ff..37604f6c 100644 --- a/tests/numbers-test-ashinn.scm +++ b/tests/numbers-test-ashinn.scm @@ -1,6 +1,6 @@ (include "test.scm") -(import bitwise) +(import (chicken 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 c14f4b90..b38f4770 100644 --- a/tests/numbers-test-gauche.scm +++ b/tests/numbers-test-gauche.scm @@ -48,7 +48,7 @@ ;; Gauche compat -(import bitwise (chicken port) (chicken format) (chicken string)) +(import (chicken bitwise) (chicken port) (chicken format) (chicken string)) (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 58586676..4d7e3499 100644 --- a/tests/numbers-test.scm +++ b/tests/numbers-test.scm @@ -2,7 +2,12 @@ (include "test.scm") -(import bitwise flonum format posix (chicken platform)) +(import (chicken bitwise) + (chicken flonum) + (chicken format) + (chicken platform) + (chicken posix) + (chicken time)) ;; 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 90ffcabf..812073e3 100644 --- a/tests/port-tests.scm +++ b/tests/port-tests.scm @@ -1,5 +1,6 @@ (import chicken.condition (only data-structures constantly) - file flonum format io port posix srfi-4 tcp) + chicken.file chicken.flonum chicken.format chicken.io + chicken.port chicken.posix chicken.tcp srfi-4) (include "test.scm") (test-begin "ports") diff --git a/tests/pp-test.scm b/tests/pp-test.scm index af6f710d..02617303 100644 --- a/tests/pp-test.scm +++ b/tests/pp-test.scm @@ -1,7 +1,7 @@ ;;;; pp-test.scm -(import (only pretty-print pp) - (only port with-output-to-string)) +(import (only chicken.pretty-print pp) + (only chicken.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 cb44d8cc..3faeec50 100644 --- a/tests/r7rs-tests.scm +++ b/tests/r7rs-tests.scm @@ -1,6 +1,6 @@ ;; R7RS Tests -(import (only port with-input-from-string with-output-to-string)) +(import (only (chicken 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 d8c9a820..808f9fb6 100644 --- a/tests/reader-tests.scm +++ b/tests/reader-tests.scm @@ -1,8 +1,8 @@ ;;;; reader-tests.scm -(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!)) +(import (only chicken.io read-line read-string) + (only chicken.port with-input-from-string with-output-to-string) + (only chicken.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/reexport-tests.scm b/tests/reexport-tests.scm index bc7e4172..70280681 100644 --- a/tests/reexport-tests.scm +++ b/tests/reexport-tests.scm @@ -27,9 +27,12 @@ (import (chicken module) imp ...) (reexport imp ...))))) -(compound-module - big-chicken - chicken port file pretty-print chicken.string) +(compound-module big-chicken + chicken + chicken.file + chicken.port + chicken.pretty-print + chicken.string) (module m3 () (import scheme big-chicken) diff --git a/tests/sgrep.scm b/tests/sgrep.scm index 992add09..f4f5c9fc 100644 --- a/tests/sgrep.scm +++ b/tests/sgrep.scm @@ -1,7 +1,7 @@ ;;;; sgrep.scm - grepping benchmark -(import io irregex port) +(import chicken.io chicken.irregex chicken.port) (define big-string diff --git a/tests/specialization-test-1.scm b/tests/specialization-test-1.scm index 23327952..50d6aee3 100644 --- a/tests/specialization-test-1.scm +++ b/tests/specialization-test-1.scm @@ -2,7 +2,7 @@ (module foo (foo bar) -(import scheme chicken foreign) +(import scheme chicken chicken.foreign) #> static int inlined(int i) { diff --git a/tests/specialization-test-2.scm b/tests/specialization-test-2.scm index d63f8d80..3fed2efc 100644 --- a/tests/specialization-test-2.scm +++ b/tests/specialization-test-2.scm @@ -2,7 +2,7 @@ (module main () -(import scheme chicken foreign) +(import scheme chicken chicken.foreign) (import-syntax foo) ; note: does not load foo! #> diff --git a/tests/srfi-4-tests.scm b/tests/srfi-4-tests.scm index 317d55e2..dcea9ecf 100644 --- a/tests/srfi-4-tests.scm +++ b/tests/srfi-4-tests.scm @@ -1,8 +1,8 @@ ;;;; srfi-4-tests.scm -(import srfi-4 port) -(import-for-syntax chicken) +(import (srfi 4) (chicken port)) +(import-for-syntax (chicken)) (define-syntax test1 (er-macro-transformer diff --git a/tests/srfi-45-tests.scm b/tests/srfi-45-tests.scm index 7345e14e..5eb5bf82 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). -(import (only format printf) - (only port with-output-to-string)) +(import (only chicken.format printf) + (only chicken.port with-output-to-string)) (define *errors* 0) diff --git a/tests/syntax-tests.scm b/tests/syntax-tests.scm index 29281faa..de754e95 100644 --- a/tests/syntax-tests.scm +++ b/tests/syntax-tests.scm @@ -1,7 +1,7 @@ ;;;; syntax-tests.scm - various macro tests -(import-for-syntax pretty-print) -(import gc pretty-print) +(import-for-syntax chicken.pretty-print) +(import chicken.gc chicken.pretty-print) (define-syntax t (syntax-rules () @@ -565,7 +565,7 @@ (s:define bar 99)) (module m0002 () - (import scheme m0001 pretty-print) + (import scheme m0001 chicken.pretty-print) (pp (foo bar))) diff --git a/tests/test-finalizers-2.scm b/tests/test-finalizers-2.scm index 646c2384..d30e039e 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 -(import gc) +(import (chicken gc)) (define (list-tabulate n proc) (let loop ((i 0)) diff --git a/tests/test-finalizers.scm b/tests/test-finalizers.scm index 0b723d06..23e568f7 100644 --- a/tests/test-finalizers.scm +++ b/tests/test-finalizers.scm @@ -1,8 +1,7 @@ ;;;; test-finalizers.scm (import (chicken format)) - -(import gc) +(import (chicken gc)) (##sys#eval-debug-level 0) ; disable keeping trace-buffer with frameinfo diff --git a/tests/test-gc-hooks.scm b/tests/test-gc-hooks.scm index 28b9c7f3..ba124335 100644 --- a/tests/test-gc-hooks.scm +++ b/tests/test-gc-hooks.scm @@ -1,6 +1,6 @@ ;;;; test-gc-hooks.scm -(import gc) +(import (chicken gc)) #> diff --git a/tests/test-glob.scm b/tests/test-glob.scm index 9bebd3ef..9bba8e71 100644 --- a/tests/test-glob.scm +++ b/tests/test-glob.scm @@ -1,7 +1,7 @@ ;;;; test-glob.scm - test glob-pattern -> regex translation -(import irregex) +(import (chicken 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 19218bd8..3981131c 100644 --- a/tests/test-irregex.scm +++ b/tests/test-irregex.scm @@ -2,7 +2,7 @@ (import (only chicken.string string-split string-intersperse) - format io irregex port) + chicken.format chicken.io chicken.irregex chicken.port) (include "test.scm") diff --git a/tests/test.scm b/tests/test.scm index fc67fc51..7b47f5dc 100644 --- a/tests/test.scm +++ b/tests/test.scm @@ -3,7 +3,7 @@ ; by Alex Shinn, lifted from match-test by felix (import (only chicken.string ->string)) -(import time) ; current-milliseconds +(import (only chicken.time current-milliseconds)) (define *current-group-name* "") (define *pass* 0) diff --git a/tests/typematch-tests.scm b/tests/typematch-tests.scm index 243f11c6..d78199b9 100644 --- a/tests/typematch-tests.scm +++ b/tests/typematch-tests.scm @@ -2,7 +2,7 @@ (import (only chicken.data-structures identity) - chicken.blob chicken.memory locative) + chicken.blob chicken.memory chicken.locative) (define (make-list n x) diff --git a/tests/version-tests.scm b/tests/version-tests.scm index 6ba34ba1..c6c3ce7d 100644 --- a/tests/version-tests.scm +++ b/tests/version-tests.scm @@ -1,4 +1,4 @@ -(import irregex chicken.platform chicken.string) +(import chicken.irregex chicken.platform chicken.string) (let* ((version-tokens (string-split (chicken-version) ".")) (major (string->number (car version-tokens))) -- 2.11.0