From 69df7f26647e6be97e77692e0bc37d3db442a1da Mon Sep 17 00:00:00 2001 From: Asumu Takikawa Date: Mon, 6 Jan 2014 17:47:55 -0500 Subject: [PATCH] Move `chomp` function into its own util file original commit: 4d448785cd3a256dccb5b84a59170a2b4dd0b41c --- .../typed-racket-lib/typed-racket/utils/tc-utils.rkt | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/utils/tc-utils.rkt b/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/utils/tc-utils.rkt index a3169dc2..3745b92f 100644 --- a/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/utils/tc-utils.rkt +++ b/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/utils/tc-utils.rkt @@ -6,6 +6,7 @@ don't depend on any other portion of the system |# (require syntax/source-syntax "disappeared-use.rkt" + "string.rkt" racket/list racket/match racket/promise racket/string syntax/parse (for-syntax racket/base syntax/parse) (only-in unstable/sequence in-slice)) @@ -163,13 +164,6 @@ don't depend on any other portion of the system (apply tc-error/delayed #:stx stx final-msg (reverse vals)) (apply tc-error/stx stx final-msg (reverse vals)))) -;; helper for above, remove \n at end if any -(define (chomp str) - (define len (string-length str)) - (if (eq? #\newline (string-ref str (sub1 len))) - (substring str 0 (sub1 len)) - str)) - ;; produce a type error, using the current syntax (define (tc-error msg . rest) (let* ([ostx (current-orig-stx)]