methodical icon indicating copy to clipboard operation
methodical copied to clipboard

Interfaces

Open darkleaf opened this issue 6 years ago • 4 comments

I replaced definterface+ with definterface for further clojurescript support #20.
UPD: Also I replaced deftype+ with deftype.

Helper functions are not inlined like potemkin do because I not see any performance impact.

So we can do it:

#?(:clj
   (definterface Foo
     (fooBar []))
   :cljs
   (def Foo))

;; helper function
(defn foo-bar [^Foo foo]
  (.fooBar foo))

(deftype Bar []
  #?(:clj Foo
     :cljs Object)
  (fooBar [_] :ok))

(foo-bar (Bar.))

darkleaf avatar Sep 12 '19 08:09 darkleaf

Codecov Report

Merging #25 into master will decrease coverage by 0.14%. The diff coverage is 91.34%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #25      +/-   ##
==========================================
- Coverage   86.57%   86.43%   -0.15%     
==========================================
  Files          20       20              
  Lines         827      936     +109     
  Branches       48       57       +9     
==========================================
+ Hits          716      809      +93     
- Misses         63       70       +7     
- Partials       48       57       +9
Impacted Files Coverage Δ
src/methodical/impl/dispatcher/everything.clj 57.69% <0%> (ø) :arrow_up:
src/methodical/impl/combo/clojure.clj 62.5% <0%> (-37.5%) :arrow_down:
src/methodical/impl/combo/clos.clj 60% <0%> (ø) :arrow_up:
src/methodical/impl/combo/threaded.clj 94.11% <0%> (-3.67%) :arrow_down:
src/methodical/impl/cache/simple.clj 71.42% <100%> (ø) :arrow_up:
src/methodical/impl/multifn/standard.clj 81.81% <100%> (ø) :arrow_up:
src/methodical/impl/method_table/clojure.clj 70.58% <100%> (-29.42%) :arrow_down:
src/methodical/impl/standard.clj 93.75% <100%> (ø) :arrow_up:
src/methodical/impl/method_table/standard.clj 86.95% <100%> (ø) :arrow_up:
src/methodical/impl/multifn/cached.clj 86.36% <100%> (ø) :arrow_up:
... and 7 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 3f3b737...7ebbd0b. Read the comment docs.

codecov-io avatar Sep 12 '19 17:09 codecov-io

Hey @darkleaf, sorry I haven't followed up on this lately. I've been pretty busy shepherding some new releases at work and haven't got a change to circle back to this. Can you show me what running tests for this will look like with ClojureScript? I don't have a ton of ClojureScript experience so I would like to play around with your PR a bit so I can understand it better

camsaul avatar Sep 21 '19 01:09 camsaul

Can you show me what running tests for this will look like with ClojureScript?

Currently I can't. Because methodical havely used vars and cljs have reduced vars implementation. We should resolve #29 first.

But I write some cljc code in https://github.com/camsaul/methodical/pull/25/commits/7ebbd0b1fcb264e5c42d681b5d23959f1e235314

darkleaf avatar Sep 21 '19 12:09 darkleaf

I want to get ClojureScript support working in the near future. I'm switching from definterface+ to defprotocol in #71. I'll probably make the switch from deftype+ to plain deftype in the near future as well.

camsaul avatar Jun 12 '21 21:06 camsaul