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