The OO folks call this an "internal iterator" or "visitor". However, I'd recommend against adopting their point of view.
On Fri, Feb 20, 2009 at 10:12 AM, BerlinBrown <berlin.br...@gmail.com>wrote: > > This is a general termingology question. What is this idiom, called > where you pass a function as an argument to another function and then > use that function with in a loop. I thought it reminded me of that > aspect oriented programming? cross cutting of concerns? > > For example, I do that a lot, where I loop through a file and then > want to call a function on one particular line string. > > (defn my-func [line no] > ... > ... > > ----------- > > (defun something.... > (loop [srch-res? (. lm find) line-no 0] > (when srch-res? > ************ > (my-func (. lm group) line-no) > *********** > > (recur (. lm find) (+ line-no 1)))))) > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~----------~----~----~----~------~----~------~--~---