chickadee » srfi-135 » textual-for-each-index

(textual-for-each-index proc textual [start end]) → unspecifiedprocedure

Calls proc on each valid index of the specified subtext or substring, in increasing order, discarding the results of those calls. This is simply a safe and correct way to loop over a subtext or substring.


(let ((txt (string->text "abcde"))
      (v '()))
   (lambda (cur) (set! v (cons (char->integer (text-ref txt cur)) v)))
  v) ⇒ (101 100 99 98 97)