|
Whole document tree repl-substring-list?DescriptionReturns #t if any target in replace-list occurs at pos in string.
Example(repl-substring-list? "this is it" ("was" "x" "is" "y") 2) returns #t: "is" could be replaced by "y". Source Code(define (repl-substring-list? string replace-list pos)
;; Perform repl-substring? with a list of target/replacement pairs
(let loop ((list replace-list))
(let ((target (car list))
(repl (car (cdr list)))
(rest (cdr (cdr list))))
(if (repl-substring? string target pos)
#t
(if (null? rest)
#f
(loop rest)))))) |