diff --git a/src/ikarus.boot b/src/ikarus.boot index d0e11ae..3d28e2e 100644 Binary files a/src/ikarus.boot and b/src/ikarus.boot differ diff --git a/src/ikarus.core.ss b/src/ikarus.core.ss index 60116b9..55b090e 100644 --- a/src/ikarus.core.ss +++ b/src/ikarus.core.ss @@ -73,18 +73,6 @@ - -(primitive-set! 'string->list - (lambda (x) - (unless (string? x) - (error 'string->list "~s is not a string" x)) - (let f ([x x] [i ($string-length x)] [ac '()]) - (cond - [($fxzero? i) ac] - [else - (let ([i ($fxsub1 i)]) - (f x i (cons ($string-ref x i) ac)))])))) - #|procedure:string=? synopsis: (string=? s s* ...) diff --git a/src/ikarus.strings.ss b/src/ikarus.strings.ss index 33ee6c8..c7e365a 100644 --- a/src/ikarus.strings.ss +++ b/src/ikarus.strings.ss @@ -1,10 +1,12 @@ (library (ikarus strings) - (export string-length string-ref make-string) + (export string-length string-ref make-string string->list) (import - (except (ikarus) string-length string-ref make-string) + (except (ikarus) string-length string-ref make-string + string->list) (only (scheme) - $fx+ $fx= $fx<= $fx< $string-length $string-ref + $fx+ $fxsub1 $fxzero? $fx= $fx<= $fx< + $string-length $string-ref $make-string $string-set!)) @@ -48,4 +50,19 @@ (error 'make-string "~s is not a character" c)) (fill! ($make-string n) 0 n c)])) make-string)) + + + (define string->list + (lambda (x) + (unless (string? x) + (error 'string->list "~s is not a string" x)) + (let f ([x x] [i ($string-length x)] [ac '()]) + (cond + [($fxzero? i) ac] + [else + (let ([i ($fxsub1 i)]) + (f x i (cons ($string-ref x i) ac)))])))) + + + )