Arc Forumnew | comments | leaders | submitlogin
1 point by almkglor 5893 days ago | link | parent

Untested grep-like function:

  (def grep* (rex path)
    (let rex (re rex)
      (accum return
        (ontable k v (file-table path)
          (if (re-match rex v) (return k))))))
Persistent due to memoization, I'm afraid, so expect it to grow in memory fast.


5 points by almkglor 5893 days ago | link

If strings were lists, and lists had a promise in cdr position instead of an actual object, then more laziness could be had.

-----