Fork me on GitHub
#specter
<
2021-08-26
>
Joshua Suskalo16:08:19

$ clj -Sdeps '{:deps {com.rpl/specter {:mvn/version "1.1.3"}}}'
Clojure 1.10.3
user=> (use 'com.rpl.specter)
nil
user=> (setval (compact :a :b :c) NONE {:a {:b {:c 1}}})
:com.rpl.specter.impl/NONE
user=> (multi-transform (compact :a :b :c (terminal-val NONE)) {:a {:b {:c 1}}})
Execution error (IllegalArgumentException) at com.rpl.specter.navs/if-transform (navs.cljc:412).
Don't know how to create ISeq from: clojure.lang.Keyword
Is this intended behavior? Is compact not designed to work with multi-transform?

Joshua Suskalo17:08:52

Also hey @nathanmarz I heard from borkdude that you've started using clj-kondo. I use specter a lot, and I'd be open to working on a proper config with support for hooks for a lot of the macros for making custom navigators. Would you be open to adding that properly to specter as resources, or should I be looking at making a pr in clj-kondo/config?

nathanmarz19:08:20

@suskeyhose that's just because of how compact works – it's trying to compact the result of terminal-val, which is NONE

nathanmarz19:08:24

the error is because that's not a collection

nathanmarz19:08:54

the way to write that would be: (multi-transform [:a (compact :b :c) (terminal-val NONE)] {:a {:b {:c 1}}})

nathanmarz19:08:28

I think it's better to add that to clj-kondo rather than specter