specter

2021-08-26T16:26:19.001Z

$ 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?

2021-08-26T17:52:52.002800Z

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?

nathanmarz 2021-08-26T19:51:20.003300Z

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

nathanmarz 2021-08-26T19:51:24.003600Z

the error is because that's not a collection

nathanmarz 2021-08-26T19:51:54.004Z

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

nathanmarz 2021-08-26T19:52:28.004400Z

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

2021-08-26T19:54:57.004600Z

aaah, I see