mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-05-19 05:39:18 +02:00
s/string-cursor-backward/string-cursor-back
This commit is contained in:
parent
d019c05150
commit
19f6ea6054
4 changed files with 7 additions and 7 deletions
|
@ -199,7 +199,7 @@
|
|||
|
||||
(define (string-suffix? suffix str)
|
||||
(string-cursor=? (string-cursor-prev suffix (string-cursor-start suffix))
|
||||
(string-cursor-backward
|
||||
(string-cursor-back
|
||||
str
|
||||
(string-mismatch-right suffix str)
|
||||
(- (string-size str) (string-size suffix)))))
|
||||
|
@ -327,10 +327,10 @@
|
|||
cursor
|
||||
(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)
|
||||
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)}
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
string-cursor<? string-cursor<=? string-cursor>? string-cursor>=?
|
||||
string-cursor=? string-cursor-next string-cursor-prev substring-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-join string-split string-count
|
||||
string-trim string-trim-left string-trim-right
|
||||
|
|
|
@ -87,12 +87,12 @@
|
|||
(define (string-take str n)
|
||||
(substring str 0 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)))
|
||||
(define (string-drop str n)
|
||||
(substring 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)))
|
||||
|
||||
(define (string-pad str len . o)
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
string-cursor?
|
||||
string-cursor-start string-cursor-end
|
||||
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>=?
|
||||
|
|
Loading…
Add table
Reference in a new issue