My question is about structuring lisp code with side effects. The specific example that I have in mind relates to Clojure, but I think it can be applied to any lisp.
In this case, I am interacting with an existing library that requires some functions to be called in a specific order. The final function call creates the value that I need for the rest of the procedure.
The code is as follows:
(defn foo []
(let [_ procedure-with-side-effect
__ another-procedure-with-side-effect
value procedure-that-creates-the-value]
(do-something value)))
This works, and everything is fine, except that the let block looks disgusting. Is there a better way to do this?
source
share