Indentation and typo fixes.

In particular, fix Olin's atrocious line-breaking of IFs.
This commit is contained in:
sperber 2003-01-15 10:17:43 +00:00
parent 8800f37a3b
commit abc0cdb34d
1 changed files with 31 additions and 29 deletions

View File

@ -62,15 +62,16 @@
(lp (+ i 1) hits))
hits))))
(if (and (zero? hits) (zero? start) (= end (string-length s))) s
(let* ((nlen (- (- end start) (* hits 2))) ; the new
; length of the
(if (and (zero? hits) (zero? start) (= end (string-length s)))
s
(let* ((nlen (- (- end start) (* hits 2))) ; the new length
; of the
; unescaped
; string
(ns (make-string nlen))) ; stores the result
; string stores
; the result
(ns (make-string nlen)))
(let lp ((i start) (j 0)) ; sweap over the string
(let lp ((i start) (j 0)) ; sweep over the string
(if (< j nlen)
(lp (cond
((esc-seq? i) ; unescape
@ -127,10 +128,12 @@
(lambda (c i)
(+ i
(if (char-set-contains? escaped-chars c)
3 1)))
3
1)))
0
s))) ; new length of escaped string
(if (= nlen (string-length s)) s
(if (= nlen (string-length s))
s
(let ((ns (make-string nlen)))
(string-fold
(lambda (c i) ; replace each occurance of an
@ -175,7 +178,8 @@
(string-join plist "/")) ; Insert slashes between elts of PLIST.
(define (simplify-uri-path p)
(if (null? p) #f ; P must be non-null
(if (null? p)
#f ; P must be non-null
(let lp ((path-list (cdr p))
(stack (list (car p))))
(if (null? path-list) ; we're done
@ -192,5 +196,3 @@
(lp (cdr path-list) '("")))
(else ; usual segment
(lp (cdr path-list) (cons (car path-list) stack))))))))