string->utf16le
string-append*
string-builder
+ string-fold
+ string-fold-right
string-joiner*
string-null?
string-padder
(else
(error:bad-range-argument grammar 'string-join)))))
-(define (string-fold kons knil string #!optional start end)
- (let* ((end (fix:end-index end (string-length string) 'string-fold))
- (start (fix:start-index start end 'string-fold)))
- (let loop ((index start) (knil knil))
- (if (fx<? index end)
- (loop (fx+ index 1)
- (kons (string-ref string index) knil))
- knil))))
-
-(define (string-fold-right kons knil string #!optional start end)
- (let* ((end (fix:end-index end (string-length string) 'string-fold-right))
- (start (fix:start-index start end 'string-fold-right)))
- (let loop ((index (fx- end 1)) (knil knil))
- (if (fx>=? index start)
- (loop (fx- index 1)
- (kons (string-ref string index) knil))
- knil))))
-
(define (string-map-index proc string #!optional start end)
(let* ((end (fix:end-index end (string-length string) 'string-map-index))
(start (fix:start-index start end 'string-map-index)))
string-find-previous-char
string-find-previous-char-ci
string-find-previous-char-in-set
+ string-fold ;SRFI 140
+ string-fold-right ;SRFI 140
string-foldcase
string-for-each
string-hash ;SRFI-69
\f
;;;; Mapping
+(define (string-fold kons knil string #!optional start end)
+ (let* ((end (fix:end-index end (string-length string) 'string-fold))
+ (start (fix:start-index start end 'string-fold)))
+ (let loop ((index start) (knil knil))
+ (if (fix:< index end)
+ (loop (fix:+ index 1)
+ (kons (string-ref string index) knil))
+ knil))))
+
+(define (string-fold-right kons knil string #!optional start end)
+ (let* ((end (fix:end-index end (string-length string) 'string-fold-right))
+ (start (fix:start-index start end 'string-fold-right)))
+ (let loop ((index (fx- end 1)) (knil knil))
+ (if (fix:>= index start)
+ (loop (fix:- index 1)
+ (kons (string-ref string index) knil))
+ knil))))
+
(define (mapper-values proc string strings)
(cond ((null? strings)
(values (string-length string)