* string-ref moved to ikarus.strings.
This commit is contained in:
parent
b38d1f31ac
commit
3dde7f6c1a
BIN
src/ikarus.boot
BIN
src/ikarus.boot
Binary file not shown.
|
@ -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)))
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
[(fixnum? x) #f]
|
[(fixnum? x) #f]
|
||||||
[else (error 'fxzero? "~s is not a fixnum" x)]))))
|
[else (error 'fxzero? "~s is not a fixnum" x)]))))
|
||||||
|
|
||||||
|
|
||||||
(library (ikarus flonums)
|
(library (ikarus flonums)
|
||||||
(export string->flonum flonum->string)
|
(export string->flonum flonum->string)
|
||||||
(import
|
(import
|
||||||
|
|
|
@ -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)))
|
|
@ -28,6 +28,7 @@
|
||||||
"ikarus.collect.ss"
|
"ikarus.collect.ss"
|
||||||
"ikarus.records.ss"
|
"ikarus.records.ss"
|
||||||
"ikarus.cxr.ss"
|
"ikarus.cxr.ss"
|
||||||
|
"ikarus.strings.ss"
|
||||||
"ikarus.numerics.ss"
|
"ikarus.numerics.ss"
|
||||||
"ikarus.guardians.ss"
|
"ikarus.guardians.ss"
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue