s/string-cursor-backward/string-cursor-back

This commit is contained in:
Alex Shinn 2016-05-15 07:40:38 +09:00
parent d019c05150
commit 19f6ea6054
4 changed files with 7 additions and 7 deletions

View file

@ -199,7 +199,7 @@
(define (string-suffix? suffix str) (define (string-suffix? suffix str)
(string-cursor=? (string-cursor-prev suffix (string-cursor-start suffix)) (string-cursor=? (string-cursor-prev suffix (string-cursor-start suffix))
(string-cursor-backward (string-cursor-back
str str
(string-mismatch-right suffix str) (string-mismatch-right suffix str)
(- (string-size str) (string-size suffix))))) (- (string-size str) (string-size suffix)))))
@ -327,10 +327,10 @@
cursor cursor
(string-cursor-forward str (string-cursor-next str cursor) (- n 1)))) (string-cursor-forward str (string-cursor-next str cursor) (- n 1))))
(define (string-cursor-backward str cursor n) (define (string-cursor-back str cursor n)
(if (zero? n) (if (zero? n)
cursor cursor
(string-cursor-backward str (string-cursor-prev str cursor) (- n 1)))) (string-cursor-back str (string-cursor-prev str cursor) (- n 1))))
;;> \procedure{(string-cursor<? i j)} ;;> \procedure{(string-cursor<? i j)}
;;> \procedure{(string-cursor>? i j)} ;;> \procedure{(string-cursor>? i j)}

View file

@ -10,7 +10,7 @@
string-cursor<? string-cursor<=? string-cursor>? string-cursor>=? string-cursor<? string-cursor<=? string-cursor>? string-cursor>=?
string-cursor=? string-cursor-next string-cursor-prev substring-cursor string-cursor=? string-cursor-next string-cursor-prev substring-cursor
string-cursor->index string-index->cursor string-cursor->index string-index->cursor
string-cursor-forward string-cursor-backward string-cursor-forward string-cursor-back
string-null? string-every string-any string-null? string-every string-any
string-join string-split string-count string-join string-split string-count
string-trim string-trim-left string-trim-right string-trim string-trim-left string-trim-right

View file

@ -87,12 +87,12 @@
(define (string-take str n) (define (string-take str n)
(substring str 0 n)) (substring str 0 n))
(define (string-take-right str n) (define (string-take-right str n)
(let ((start (string-cursor-backward str (string-cursor-end str) n))) (let ((start (string-cursor-back str (string-cursor-end str) n)))
(substring-cursor str start))) (substring-cursor str start)))
(define (string-drop str n) (define (string-drop str n)
(substring str n)) (substring str n))
(define (string-drop-right str n) (define (string-drop-right str n)
(let ((end (string-cursor-backward str (string-cursor-end str) n))) (let ((end (string-cursor-back str (string-cursor-end str) n)))
(substring-cursor str (string-cursor-start str) end))) (substring-cursor str (string-cursor-start str) end)))
(define (string-pad str len . o) (define (string-pad str len . o)

View file

@ -4,7 +4,7 @@
string-cursor? string-cursor?
string-cursor-start string-cursor-end string-cursor-start string-cursor-end
string-cursor-next string-cursor-prev string-cursor-next string-cursor-prev
string-cursor-forward string-cursor-backward string-cursor-forward string-cursor-back
string-cursor=? string-cursor=?
string-cursor<? string-cursor>? string-cursor<? string-cursor>?
string-cursor<=? string-cursor>=? string-cursor<=? string-cursor>=?