I'm working on the following function:
(defn process-request [request]
(if (not (db/empty?))
{:person (db/get-person!) :violations (:violations (process-violations request))}
{:person {} :violations ["no-person"]}))
I need the process-violations function to only be called if the db is not empty. That's why it's in the if block.
However, I also need it to be called before the db/get-person! function. Otherwise, the value will be outdated.
So I wonder:
- How would I do that?
- And anyway, is the order of values in a map enough to guarantee that a function will always be called before another?