Reputation: 10781
I have a simple function forwarding from ring to monger as follows:
(defn rawdata [collection id]
(str (db/get-info collection id)))
Is there an easy way to get rid of the arguments? I was thinking the following should work
(def rawdata
(comp (partial db/get-info) str))
but no-go.
Upvotes: 1
Views: 63
Reputation: 2539
Try this
(def rawdata
(comp str db/get-into))
You don't need partial comp will pass all the arguments to the last function in the form and will successively pass and execute the results to the preceding functions in the form.
Upvotes: 3