From d9ebe60c7232fe25b5ca8a3a0e3190ec9898d5ce Mon Sep 17 00:00:00 2001 From: Eli Barzilay Date: Wed, 11 Nov 2009 23:10:28 +0000 Subject: [PATCH] use string-join svn: r16700 original commit: e65ab46bfdb30cdd93b4fad32682e5f83c3151e1 --- collects/net/url-unit.ss | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/collects/net/url-unit.ss b/collects/net/url-unit.ss index 4b40321..8cb55bb 100644 --- a/collects/net/url-unit.ss +++ b/collects/net/url-unit.ss @@ -11,7 +11,7 @@ ;; "impure" = they have text waiting ;; "pure" = the MIME headers have been read -(require scheme/port +(require scheme/port scheme/string "url-structs.ss" "uri-codec.ss" "url-sig.ss" @@ -433,21 +433,13 @@ (define (combine-path-strings absolute? path/params) (cond [(null? path/params) ""] - [else (let ([p (join "/" (map join-params path/params))]) + [else (let ([p (string-join (map join-params path/params) "/")]) (if absolute? (string-append "/" p) p))])) (define (join-params s) - (join ";" (map path-segment-encode - (cons (path/param-path s) (path/param-param s))))) - -(define (join sep strings) - (cond [(null? strings) ""] - [(null? (cdr strings)) (car strings)] - [else - (let loop ([strings (cdr strings)] [r (list (car strings))]) - (if (null? strings) - (apply string-append (reverse r)) - (loop (cdr strings) (list* (car strings) sep r))))])) + (string-join (map path-segment-encode + (cons (path/param-path s) (path/param-param s))) + ";")) (define (path->url path) (let ([url-path