@qythium looks like a bug in parsing entries.
weird thing that haven’t bumped into it before.
I was wondering, is there dedicated support in function schemas to handle things like (fn [a, b, & {:keys [c, d]})
I'd like to be able to do: (m/=> fn-name [:=> [:cat Foo, Bar, [:map?? [:c Baz] [:d Other]]]]
I couldn't find something to put in place of :map??
in my example
I don't think so
You could do [:cat Foo, Bar, [:* [:alt [:cat [:= :c] :any] [:cat [:= :d] :any]]]]
(permits duplicates, but so does the fn itself)
It would be good to have something more convenient especially with Clojure 1.11: https://clojure.org/news/2021/03/18/apis-serving-people-and-programs
Like [:cat Foo, Bar, [:alt [:* [:alt [:cat [:= :c] :any] [:cat [:= :d] :any]]] [:map [:c {:optional true} :any] [:d {:optional true} :any]]]
or something can handle the 1.11 feature as well but who likes to write it even once
You could write your own utility fn to generate that but really it should be built in to the fn schemas somehow
maybe: [:cat Foo, Bar, [:& [:c Baz] [:d Other]]]
?
But it does not do normal varargs so :&
could be confusing. :&n
?