make separate-path-strings even cleaner

svn: r3091
This commit is contained in:
Eli Barzilay 2006-05-28 02:46:57 +00:00
parent 6207c0fa5e
commit e73d32b07d

View File

@ -420,12 +420,8 @@
;; separate-path-strings : string[starting with /] -> (listof path/param)
(define (separate-path-strings str)
(if (string=? str "")
'()
(let ([str (if (char=? #\/ (string-ref str 0))
(substring str 1 (string-length str))
str)])
(map separate-params (regexp-split #rx"/" str)))))
(let ([strs (regexp-split #rx"/" str)])
(map separate-params (if (string=? "" (car strs)) (cdr strs) strs))))
(define (separate-params s)
(let ([lst (map path-segment-decode (regexp-split #rx";" s))])