just some "cosmetic" changes

This commit is contained in:
chetz 2004-08-10 11:48:40 +00:00
parent 5107390fe2
commit 11299af1a4
1 changed files with 16 additions and 30 deletions

View File

@ -21,21 +21,6 @@
(lambda (ch)
(list->string (list ch))))
(define reverse-string
(lambda (str)
(list->string (reverse (string->list str)))))
;; *** help-functions ***
(define str-palindrom?
(lambda (str)
(equal? str (reverse-string str))))
(define int-palindrom?
(lambda (i)
(str-palindrom? (number->string i))))
;; *** tests ***
;; --- is the <counter> incremented correct ---
@ -85,19 +70,20 @@
;(add-test! 'read-one-mb-line-from-file 'awk
; (lambda ()
; (let ((one-mb-line (let loop ((i 0))
; (if (= 1048576 i)
; ""
; (string-append "a" (loop (+ i 1))))))
; (read '()))
; (let* ((one-kb-line (let loop ((i 0))
; (if (= 1024 i)
; ""
; (string-append "a" (loop (+ i 1))))))
; (one-mb-line (let loop ((i 0))
; (if (= 1024 i)
; ""
; (string-append one-kb-line (loop (+ i 1))))))
; (read '()))
; ((lambda (in-port)
; (awk (read-line in-port) (line) c ()
; (#t (begin
; (set! read line)))))
; (#t (set! read line))))
; (make-string-input-port one-mb-line))
; (and (string? read)
; (= (string-length read)
; 1048576)))))
; (equal? read one-mb-line))))
;; --- special signs ---
@ -106,17 +92,17 @@
(let (( strange-sign-line
(let loop ((i 0))
(if (= i 256)
"\n"
""
(if (= i 10) ;; works with everything but line-feed
(loop (+ i 1))
(string-append (ascii->string i)
(loop (+ i 1)))))))
(loop (+ i 1)))))))
(read '()))
((lambda (in-port)
(awk (read-line in-port) (line) ()
(#t (set! read line))))
(awk (read-line in-port) (line) ()
(#t (set! read line))))
(make-string-input-port strange-sign-line))
(equal? (string-append read "\n") strange-sign-line))))
(equal? read strange-sign-line))))
;; --- sre-expr-test ---