Hi Everybody,
I’m currently using the new Keyword argument functions now also accept maps in 1.11.0-alpha1
and I’m trying to create partial function for function like this:
(defn my-example
[x y z & {:keys [foo bar] :or {foo 123} :as opts}]
...)
I can’t use partial
since I want to define second argument.
I normal situation I’d use function literal like this
(def my-partial-func #(my-example %1 "defined" %2))
But the problem is that opts
are variadic so the map would be converted into a sequence.
The only thing I came up with is:
(defn example-partial2
[x z & {:as opts}]
(my-example x 20 z opts))
Could you please tell me are there any other ways / clever ways?
Thank you!
Jeff