* string-ref moved to ikarus.strings.

This commit is contained in:
Abdulaziz Ghuloum 2007-05-05 03:46:26 -04:00
parent b38d1f31ac
commit 3dde7f6c1a
5 changed files with 17 additions and 10 deletions

Binary file not shown.

View File

@ -162,16 +162,6 @@ description:
(primitive-set! 'string-ref
(lambda (s i)
(unless (string? s)
(error 'string-ref "~s is not a string" s))
(unless (fixnum? i)
(error 'string-ref "~s is not a valid index" i))
(unless (and ($fx< i ($string-length s))
($fx<= 0 i))
(error 'string-ref "index ~s is out of range for ~s" i s))
($string-ref s i)))

View File

@ -14,6 +14,7 @@
[(fixnum? x) #f]
[else (error 'fxzero? "~s is not a fixnum" x)]))))
(library (ikarus flonums)
(export string->flonum flonum->string)
(import

15
src/ikarus.strings.ss Normal file
View File

@ -0,0 +1,15 @@
(library (ikarus strings)
(export string-ref)
(import
(except (ikarus) string-ref)
(only (scheme) $string-ref $fx<= $fx< $string-length))
(define (string-ref s i)
(unless (string? s)
(error 'string-ref "~s is not a string" s))
(unless (fixnum? i)
(error 'string-ref "~s is not a valid index" i))
(unless (and ($fx< i ($string-length s))
($fx<= 0 i))
(error 'string-ref "index ~s is out of range for ~s" i s))
($string-ref s i)))

View File

@ -28,6 +28,7 @@
"ikarus.collect.ss"
"ikarus.records.ss"
"ikarus.cxr.ss"
"ikarus.strings.ss"
"ikarus.numerics.ss"
"ikarus.guardians.ss"