chickadee » srfi-135 » textual-any

(textual-every pred textual [start end]) → valueprocedure
(textual-any pred textual [start end]) → valueprocedure

Checks to see if every/any character in textual satisfies pred, proceeding from left (index start) to right (index end). These procedures are short-circuiting: if pred returns false, textual-every does not call pred on subsequent characters; if pred returns true, textual-any does not call pred on subsequent characters; Both procedures are "witness-generating":

  • If textual-every is given an empty interval (with start = end), it returns #t.
  • If textual-every returns true for a non-empty interval (with start < end), the returned true value is the one returned by the final call to the predicate on (text-ref (textual-copy text) (- end 1)).
  • If textual-any returns true, the returned true value is the one returned by the predicate.

Note: The names of these procedures do not end with a question mark. This indicates a general value is returned instead of a simple boolean (#t or #f).