diff --git a/scheme/ikarus.io.ss b/scheme/ikarus.io.ss index 4b5490d..5b782c6 100644 --- a/scheme/ikarus.io.ss +++ b/scheme/ikarus.io.ss @@ -761,7 +761,7 @@ (let ([n (read! str 0 (string-length str))]) (unless (fixnum? n) (error who "invalid return value from read!" n)) - (unless (<= 0 n (fxsub1 (string-length str))) + (unless (<= 0 n (string-length str)) (error who "return value from read! is out of range" n)) ($set-port-index! p 0) ($set-port-size! p n) @@ -811,7 +811,7 @@ (let ([n (read! str 0 (string-length str))]) (unless (fixnum? n) (error who "invalid return value from read!" n)) - (unless (<= 0 n (fxsub1 (string-length str))) + (unless (<= 0 n (string-length str)) (error who "return value from read! is out of range" n)) ($set-port-size! p n) (cond diff --git a/scheme/last-revision b/scheme/last-revision index b053645..de0cde0 100644 --- a/scheme/last-revision +++ b/scheme/last-revision @@ -1 +1 @@ -1205 +1207 diff --git a/scheme/tests.libraries.ss b/scheme/tests.libraries.ss deleted file mode 100644 index c470dd9..0000000 --- a/scheme/tests.libraries.ss +++ /dev/null @@ -1,53 +0,0 @@ - - -(library (F) - (export f) - (import (ikarus)) - (define f - (lambda (x) 12)) - (printf "F invoked\n")) - -(library (G) - (export) - (import (ikarus) (F)) - (define-syntax t f) - (printf "G invoked: f=~s\n" t)) - -(library (Q) - (export foo) - (import (ikarus)) - (define-record foo (bar baz))) - -(library (R) - (export) - (import (ikarus) (Q)) - (printf "RTD=~s\n" (type-descriptor foo))) - -(invoke (R)) - -(library (F0) - (export f) - (import (ikarus)) - (define g 17) - (define-syntax f - (lambda (x) #'h)) - (define-syntax h - (lambda (x) #'g)) - (printf "F0 invoked\n")) - -;(library (F0 client) -; (export) -; (import (ikarus) (F0)) -; (unless (= (f) 17) -; (error #f "F0 client")) -; (printf "F0 client ok\n")) - - -(library (F0 client) - (export) - (import (ikarus) (F0)) - (f)) - -(invoke (F0 client)) - - diff --git a/scheme/tests/bignums.ss b/scheme/tests/bignums.ss index c77f0d1..167b532 100644 --- a/scheme/tests/bignums.ss +++ b/scheme/tests/bignums.ss @@ -7,7 +7,7 @@ (define (test1 x prefix radix) (let ([s (string-append prefix (number->string x radix))]) - (assert (equal? x (read (open-input-string s)))))) + (assert (equal? x (read (open-string-input-port s)))))) (test1 x "#x" 16) (test1 x "#o" 8) (test1 x "#b" 2)) diff --git a/scheme/tests/input-ports.ss b/scheme/tests/input-ports.ss index 7a3d85e..f2c5b4e 100644 --- a/scheme/tests/input-ports.ss +++ b/scheme/tests/input-ports.ss @@ -6,11 +6,11 @@ (define-tests test-input-ports [eof-object? - (get-line (open-input-string ""))] + (get-line (open-string-input-port ""))] [(lambda (x) (equal? x "abcd")) - (get-line (open-input-string "abcd"))] + (get-line (open-string-input-port "abcd"))] [(lambda (x) (equal? x "")) - (get-line (open-input-string "\nabcd"))] + (get-line (open-string-input-port "\nabcd"))] [(lambda (x) (equal? x "abcd")) - (get-line (open-input-string "abcd\nefg"))])) + (get-line (open-string-input-port "abcd\nefg"))])) diff --git a/scheme/tests/reader.ss b/scheme/tests/reader.ss index 0820f75..6f76565 100644 --- a/scheme/tests/reader.ss +++ b/scheme/tests/reader.ss @@ -6,7 +6,7 @@ (lambda (str) (lambda (n?) (and (number? n?) - (= (with-input-from-string str read) n?))))) + (= (read (open-string-input-port str)) n?))))) (define-syntax reader-tests (syntax-rules () @@ -75,29 +75,29 @@ (define-tests test-char-syntax [(lambda (x) (= (char->integer x) #x0)) - (read (open-input-string "#\\nul"))] + (read (open-string-input-port "#\\nul"))] [(lambda (x) (= (char->integer x) #x7)) - (read (open-input-string "#\\alarm"))] + (read (open-string-input-port "#\\alarm"))] [(lambda (x) (= (char->integer x) #x8)) - (read (open-input-string "#\\backspace"))] + (read (open-string-input-port "#\\backspace"))] [(lambda (x) (= (char->integer x) #x9)) - (read (open-input-string "#\\tab"))] + (read (open-string-input-port "#\\tab"))] [(lambda (x) (= (char->integer x) #xA)) - (read (open-input-string "#\\linefeed"))] + (read (open-string-input-port "#\\linefeed"))] [(lambda (x) (= (char->integer x) #xA)) - (read (open-input-string "#\\newline"))] + (read (open-string-input-port "#\\newline"))] [(lambda (x) (= (char->integer x) #xB)) - (read (open-input-string "#\\vtab"))] + (read (open-string-input-port "#\\vtab"))] [(lambda (x) (= (char->integer x) #xC)) - (read (open-input-string "#\\page"))] + (read (open-string-input-port "#\\page"))] [(lambda (x) (= (char->integer x) #xD)) - (read (open-input-string "#\\return"))] + (read (open-string-input-port "#\\return"))] [(lambda (x) (= (char->integer x) #x1B)) - (read (open-input-string "#\\esc"))] + (read (open-string-input-port "#\\esc"))] [(lambda (x) (= (char->integer x) #x20)) - (read (open-input-string "#\\space"))] + (read (open-string-input-port "#\\space"))] [(lambda (x) (= (char->integer x) #x7F)) - (read (open-input-string "#\\delete"))]) + (read (open-string-input-port "#\\delete"))]) )