From 5aca765989075b5acec228edbe6922f7c619613a Mon Sep 17 00:00:00 2001 From: Eli Barzilay Date: Tue, 6 Nov 2012 13:01:01 -0500 Subject: [PATCH] `racket' -> `racket/base' switches in `htdp' and `2htdp'. All of these look safe. Also, see comment in `2htdp/batch-io' about the splitting thing (which should probably be revised with the extensions to `racket/string'). --- collects/2htdp/batch-io.rkt | 18 +++++++++++++----- collects/2htdp/private/check-aux.rkt | 8 ++++++-- .../2htdp/private/clauses-spec-and-process.rkt | 13 +++++++++---- collects/2htdp/private/define-keywords.rkt | 5 +++-- collects/2htdp/private/launch-many-worlds.rkt | 5 +++-- collects/2htdp/private/utilities.rkt | 4 +++- collects/htdp/dir.rkt | 2 +- 7 files changed, 38 insertions(+), 17 deletions(-) diff --git a/collects/2htdp/batch-io.rkt b/collects/2htdp/batch-io.rkt index e55a9f59d4..0d0f9d922f 100644 --- a/collects/2htdp/batch-io.rkt +++ b/collects/2htdp/batch-io.rkt @@ -1,7 +1,12 @@ -#lang racket +#lang racket/base -(require (for-syntax syntax/parse) - srfi/13 htdp/error +(require racket/function + racket/file + racket/string + racket/local + (for-syntax racket/base + syntax/parse) + htdp/error (rename-in lang/prim (first-order->higher-order f2h)) "private/csv/csv.rkt") @@ -163,10 +168,13 @@ ;; split : String [Regexp] -> [Listof String] ;; splits a string into a list of substrings using the given delimiter ;; (white space by default) +;;ELI: This shouldn't be needed now, it can use `string-split' as is +;; (also, the trimming doesn't make sense if the pattern is not a +;; space--?) (define (split str [ptn #rx"[ ]+"]) - (regexp-split ptn (string-trim-both str))) + (regexp-split ptn (string-trim str))) ;; split-lines : String -> Listof[String] ;; splits a string with newlines into a list of lines (define (split-lines str) - (map string-trim-both (split str "\r*\n"))) + (map string-trim (split str "\r*\n"))) diff --git a/collects/2htdp/private/check-aux.rkt b/collects/2htdp/private/check-aux.rkt index 851b125799..c65e2e6818 100644 --- a/collects/2htdp/private/check-aux.rkt +++ b/collects/2htdp/private/check-aux.rkt @@ -1,6 +1,10 @@ -#lang racket +#lang racket/base -(require htdp/error) +(require racket/class + racket/list + racket/bool + racket/match + htdp/error) (provide (all-defined-out)) diff --git a/collects/2htdp/private/clauses-spec-and-process.rkt b/collects/2htdp/private/clauses-spec-and-process.rkt index a031791162..0b87a767f9 100644 --- a/collects/2htdp/private/clauses-spec-and-process.rkt +++ b/collects/2htdp/private/clauses-spec-and-process.rkt @@ -1,4 +1,4 @@ -#lang racket +#lang racket/base ;; --------------------------------------------------------------------------------------------------- ;; provides functions for specifying the shape of big-bang and universe clauses: @@ -12,9 +12,14 @@ ->args contains-clause?) -(require - (for-syntax syntax/parse) - (for-template "clauses-spec-aux.rkt" racket (rename-in lang/prim (first-order->higher-order f2h)))) +(require racket/function + racket/list + racket/bool + (only-in racket/unit except) ; used only as a keyword...? + (for-syntax racket/base syntax/parse) + (for-template "clauses-spec-aux.rkt" + racket + (rename-in lang/prim (first-order->higher-order f2h)))) ;; --------------------------------------------------------------------------------------------------- ;; specifying the shape of clauses diff --git a/collects/2htdp/private/define-keywords.rkt b/collects/2htdp/private/define-keywords.rkt index 7a59aa2da8..c0cdd4fa36 100644 --- a/collects/2htdp/private/define-keywords.rkt +++ b/collects/2htdp/private/define-keywords.rkt @@ -1,4 +1,4 @@ -#lang racket +#lang racket/base ;; --------------------------------------------------------------------------------------------------- ;; provide a mechanism for defining the shape of big-bang and universe clauses @@ -6,7 +6,8 @@ (provide define-keywords DEFAULT) -(require (for-syntax syntax/parse)) +(require racket/class + (for-syntax racket/base syntax/parse)) (define-syntax (DEFAULT stx) (raise-syntax-error 'DEFAULT "used out of context" stx)) diff --git a/collects/2htdp/private/launch-many-worlds.rkt b/collects/2htdp/private/launch-many-worlds.rkt index 1ecbb1d032..88da624f20 100644 --- a/collects/2htdp/private/launch-many-worlds.rkt +++ b/collects/2htdp/private/launch-many-worlds.rkt @@ -1,6 +1,7 @@ -#lang racket +#lang racket/base -(require mred/mred mzlib/etc htdp/error) +(require racket/list racket/function racket/gui + mzlib/etc htdp/error) (provide ;; (launch-many-worlds e1 ... e2) diff --git a/collects/2htdp/private/utilities.rkt b/collects/2htdp/private/utilities.rkt index 5d03ab6e22..2c2f04b1fc 100644 --- a/collects/2htdp/private/utilities.rkt +++ b/collects/2htdp/private/utilities.rkt @@ -1,4 +1,6 @@ -#lang racket +#lang racket/base + +(require racket/contract) (provide/contract ;; like the unix debugging facility diff --git a/collects/htdp/dir.rkt b/collects/htdp/dir.rkt index 155cfa23d4..9f248c1151 100644 --- a/collects/htdp/dir.rkt +++ b/collects/htdp/dir.rkt @@ -1,4 +1,4 @@ -#lang racket +#lang racket/base (provide ;; map the directory tree at the given path into a data representation according to model 3 of