I have a sequence of functions (which mutate some objects) I'd like to execute, which works if I do this:
(foo1)
(foo2)
(foo3)
However, I want to put this code in a function so I can execute this sequence whenever I want. If I do this:
(defn run-foos [] (do (foo1) (foo2) (foo3)))
The mutations created by run-foos is not the same as the 3 separate statements earlier. I apologize that I can't concisely summarize the behavior of my program here, but basically I see there is some behavioral differences between the first and second versions of the code above.
What I want to do is have a function run-foos that will execute foo1, foo2, and foo3 that runs exactly like I called each one individually in a row. How can I do this?