[iterate-devel] Between-each

Mészáros Levente Levente.Meszaros at netvisor.hu
Tue Oct 25 12:05:03 UTC 2005


Hi,

I may be wrong about this, but I could not find support for a quite commonly used loop pattern, namely when you want something to be evaluated between each loop cycles. It means if the loop runs N times it will be evaluated N - 1.

I did a patch like:

(def-special-clause BETWEEN-EACH (between)
  (return-code :body (list (if-1st-time nil (list (walk-expr between))))))

And it works like:

(iter (for i from 1 to 3) (between-each (collect (+ i 100))) (collect i))
(1 102 2 103 3)

Maybe I'm wrong, could somebody tell how to do this with iterate? If there's no support for this perhaps you could put something like this into the main branch.

Please send it to my direct mail address too, because I'm not on the list.

Levy



More information about the iterate-devel mailing list