I have a series of functions that all do different things but are passed the same data. Let's say I have the following as a parameter vector.
[{:keys [x y vx vy x-min x-max y-min y-max] :or {x-min 0 x-max c-width y-min 0 y-max c-height}}]
Basically the type of thing you do not want to have to repeat more than once. One thought I had was to do something like.
(def func-args [x y z])
(defn func func-args (+ x y z))
Then I could re-use func-args if I had a similar function. However the first line of the previous example throws an error that symbol x cannot be resolved.
- Is there a way to leave vector members as symbols?
- Is there a more idiomatic way to accomplish function parameter code bloat reduction than the method I am suggesting?