This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-04-02
Channels
- # asami (24)
- # babashka (85)
- # beginners (137)
- # calva (46)
- # cider (16)
- # clj-kondo (19)
- # cljs-dev (7)
- # clojure (13)
- # clojure-australia (1)
- # clojure-europe (10)
- # clojure-nl (4)
- # clojure-spec (6)
- # clojure-uk (3)
- # clojurescript (5)
- # conjure (21)
- # cursive (15)
- # datascript (46)
- # datomic (13)
- # depstar (32)
- # figwheel-main (1)
- # fulcro (6)
- # honeysql (20)
- # lsp (53)
- # malli (7)
- # meander (9)
- # off-topic (35)
- # other-languages (1)
- # polylith (41)
- # re-frame (5)
- # reagent (4)
- # releases (3)
- # rewrite-clj (2)
- # shadow-cljs (22)
- # spacemacs (15)
- # tools-deps (3)
- # xtdb (17)
hm, does anyone have a handy solution to printing maps without namespace collapsing? for instance, if I have this map: {:player/name "Bob" :player/position :defense}
, the result in Conjure prints like this:
#:player{:name "Bob", :position :defense}
most of the time it's ok with me, but sometimes I want to use that output as a literal in my code (like running ,e!
to format a map in my code), and this syntax is not as nice as {:player/name "Bob" :player/position :defense}
.
I've taken to doing this:
#_(binding [*print-namespace-maps* false]
(clojure.pprint/pprint player))
and transplanting the output into my code, but I was wondering if anyone else had a better way of doing that.. Any thoughts?could you set that var to false globally in a user ns?
alter-var-root maybe?
cider-nrepl supports settings :print-namespace-maps
in the nrepl messages, so maybe that can be configured in conjure?
https://github.com/Olical/conjure/blob/46b766dee43a97266741087085889751b474fb56/fnl/conjure/client/clojure/nrepl/init.fnl#L30-L32 ah, here you are. If you have cider-nrepl installed, you can change this to cider.nrepl.pprint/pprint and add the print-namespace-maps option. While at it, you could also switch to zprint or something, which might not do this anyway.
https://github.com/Olical/conjure/blob/a2298d12aaa2065f4a395f017ee1f3d392db283c/fnl/conjure/client/clojure/nrepl/server.fnl#L67-L76 oh, looks like there's just a short hardcoded list of options supported, even though it varies from printer to printer.
Just had a poke at conjure's docs. Am I right that there's no evaluation operator? Just mappings which run the commands on visual selections and such?
What do you mean?
There's no plug mappings right now, it's prefixed by local leader by default, https://github.com/Olical/conjure/issues/186 is open until I get around to reworking mappings to be plug based for those that like that