Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IMapEntry protocol errors with newer clojurescript #13

Open
selfsame opened this issue May 21, 2019 · 2 comments
Open

IMapEntry protocol errors with newer clojurescript #13

selfsame opened this issue May 21, 2019 · 2 comments

Comments

@selfsame
Copy link

ran into the following using [org.clojure/clojure "1.9.0"] [org.clojure/clojurescript "1.10.238"] and [tailrecursion/cljs-priority-map "1.2.1"]

user=> (def m (tailrecursion.priority-map/priority-map :a 2 :b 1 :c 3 :d 5 :e 4 :f 3))
#'user/m
user=>(vals m)
#object[TypeError TypeError: me.cljs$core$IMapEntry$_val$arity$1 is not a function]
   cljs$core$ISeq$_first$arity$1 (jar:file:/Users/Joseph/.m2/repository/org/clojure/clojurescript/1.10.238/clojurescript-1.10.238.jar!/cljs/core.cljs:8955:13)
   cljs.core/first (jar:file:/Users/Joseph/.m2/repository/org/clojure/clojurescript/1.10.238/clojurescript-1.10.238.jar!/cljs/core.cljs:1231:27)
   cljs.pprint/pprint-reader-macro (jar:file:/Users/Joseph/.m2/repository/org/clojure/clojurescript/1.10.238/clojurescript-1.10.238.jar!/cljs/pprint.cljs:2797:36)
   cljs$pprint$pprint_list (jar:file:/Users/Joseph/.m2/repository/org/clojure/clojurescript/1.10.238/clojurescript-1.10.238.jar!/cljs/pprint.cljs:2824:12)
   G__12472__2 (jar:file:/Users/Joseph/.m2/repository/org/clojure/clojurescript/1.10.238/clojurescript-1.10.238.jar!/cljs/core.cljs:10851:8)
   G__12472 (jar:file:/Users/Joseph/.m2/repository/org/clojure/clojurescript/1.10.238/clojurescript-1.10.238.jar!/cljs/core.cljs:10837:1)
   cljs.pprint/write-out (jar:file:/Users/Joseph/.m2/repository/org/clojure/clojurescript/1.10.238/clojurescript-1.10.238.jar!/cljs/pprint.cljs:747:12)
   Function.cljs$core$IFn$_invoke$arity$2 (jar:file:/Users/Joseph/.m2/repository/org/clojure/clojurescript/1.10.238/clojurescript-1.10.238.jar!/cljs/pprint.cljs:822:27)
   cljs.pprint/pprint (jar:file:/Users/Joseph/.m2/repository/org/clojure/clojurescript/1.10.238/clojurescript-1.10.238.jar!/cljs/pprint.cljs:813:1)
   figwheel$client$utils$pprint_to_string (jar:file:/Users/Joseph/.m2/repository/figwheel/figwheel/0.5.18/figwheel-0.5.18.jar!/figwheel/client/utils.cljs:82:6)
@Ramblurr
Copy link

Ramblurr commented Jul 2, 2020

Ditto on cljs 1.10.773.

This is a great little library, would hate to see it bitrot :(

Here is the protocol def for IMapEntry: https://github.com/clojure/clojurescript/blob/r1.10.773-2-g946348da/src/main/cljs/cljs/core.cljs#L657-L662

Seems related to clojure/data.avl#5

Deleting IMap and the (-dissoc..) function def fixes the error, but then of course you cannot dissoc on your priority map.

@Ramblurr
Copy link

Ramblurr commented Jul 2, 2020

I think this can be solved by replacing all instances of

  • [item (item->priority item)] with (MapEntry. item (item->priority item) nil)
  • [item priority] with (MapEntry. item priority nil)
  • [item (key f)]with (MapEntry. item (key f) nil)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants