Skip to content

IMapEntry protocol errors with newer clojurescript #13

Open

Description

@selfsame

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)

Activity

  1. Ramblurr commented on Jul 2, 2020

    @Ramblurr

    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.

  2. Ramblurr commented on Jul 2, 2020

    @Ramblurr

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions