Arc Cross Reference

reclist

[procedure] reclist test xs

[procedure] recstring test str (o start 0)

Basic traverser of the sequence until it finds the point on which test returns non-nil.

(def reclist (f xs)
  (and xs (or (f xs) (reclist f (cdr xs)))))

Go through the list until it finds the test function f returns non-nil---note that f receives the spine cell of the list, not the element.

(def recstring (test s (o start 0))
  (let n (len s)
    ((afn (i)
       (and (< i (len s))
            (or (test i)
                (self (+ i 1)))))
     start)))

Scan the string beginning with index start. The test function receives index instead of the character.

Several useful traversers are built on top of these: some, all, mem, find.