jeaye / orchestra

Complete instrumentation for clojure.spec
Eclipse Public License 1.0
619 stars 25 forks source link

Multimethod support? #6

Closed thurn closed 7 years ago

thurn commented 7 years ago

How difficult would it be to support specs for multimethods in orchestra? Currently I just get:

java.lang.ClassCastException:
orchestra.spec.test$spec_checking_fn$fn__12624
cannot be cast to clojure.lang.MultiFn

You could imagine doing something like wrapping multimethods in a regular defn with the spec attached to it.

jeaye commented 7 years ago

Hey @thurn. Orchestra should support specs for anything clojure.spec.alpha supports. In actuality, Orchestra is little more than a stripped down fork of clojure.spec.alpha which changes the spec-checking-fn to check for :ret, :fn, and :args.

Are you having the same issue with clojure.spec.alpha, I wonder, or only with Orchestra?

thurn commented 7 years ago

fair, I guess this kind of improvement is a little out of scope for what you're doing here. I'll see if there's a bug against spec.alpha for this functionality.

jeaye commented 7 years ago

Right. I think that specing multimethods is a great idea, and I'd be happy to comment on any ticket/mailing list thread where this is brought up to the Clojure devs. Orchestra focuses solely on better instrumentation for spec.

Thanks!