This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-08-11
Channels
- # babashka (3)
- # beginners (70)
- # calva (15)
- # cider (34)
- # clara (10)
- # cljsrn (2)
- # clojure (28)
- # clojure-europe (21)
- # clojure-france (1)
- # clojure-uk (17)
- # clojuredesign-podcast (4)
- # clojurescript (51)
- # cursive (21)
- # data-science (1)
- # datalog (2)
- # datascript (2)
- # datomic (10)
- # emacs (5)
- # esprit (24)
- # expound (9)
- # figwheel-main (15)
- # fulcro (31)
- # graphql (3)
- # jobs-discuss (27)
- # keechma (2)
- # luminus (2)
- # malli (2)
- # minimallist (14)
- # nrepl (1)
- # off-topic (4)
- # pathom (1)
- # pedestal (8)
- # re-frame (10)
- # reagent (5)
- # reitit (2)
- # rewrite-clj (54)
- # sci (1)
- # shadow-cljs (34)
- # spacemacs (12)
- # sql (17)
- # vim (16)
- # web-security (1)
I'm building an API using pedestal, I need to extract body params, but can't seem to create a proper route:
["/api/users"
:post [(body-params/body-params)]
user-handler
:route-name :user-handler
]
keeps throwing this error:
Assert failed: In row 5, there were unused elements (#object[ping_holiday.routes$user_handler 0x4d81a56a "ping_holiday.routes$user_handler@4d81a56a"] :route-name :user-handler).
The whole route was: ["/api/users" :post [#Interceptor{:name :io.pedestal.http.body-params/body-params}] #object[ping_holiday.routes$user_handler 0x4d81a56a "ping_holiday.routes$user_handler@4d81a56a"] :route-name :user-handler]
(empty? (:remaining ctx))
any idea how to fix this?@johnwesonga Maybe ask in #pedestal ? I'm not sure how widely used it is...
Morning all. Can anyone give me any advice on accessing the content of resources
in a library?
I have aped other examples I have seen doing similar things, and when running a REPL in this project it works, however when I try to call this library from elsewhere it doesn’t recognise that there’s a file in the resources dir called bar.csv
(def foo
(with-open [file (io/input-stream (io/resource "bar.csv"))]
(u/load-csv file)))
I need to make some basic edits to namespaced XML (SOAP). What should I be reaching out for? clojure.zip
+ clojure.data.xml
?
Is there a way to unload implementations for a certain protocol?
(keys (:impls clojure.core.protocols/Datafiable))
Maybe hacking the Datafiable
var?apologies if this is the wrong forum, but I am investigating larger-than-expected JIT CodeCache sizes in my JVM; I am wondering if I can partly blame this on anonymous classes; if I have 10 million instances of an anonymous class that are all functionally the same will they get compiled into 10 million distinct CodeCache nmethods? Would convering into a named class make a noticeable difference, do you think?
can share a sample @ben.hammond? are you doing eval regularly in this JVM?
I recall vaguely that there was a discussion about making tools.analyzer for core.async optional (if you don't use go routines anyway). Was there?
sort of but not quite. the discussion was about avoiding loading tools.analyzer if the core.async code was AOTed
ah ok. I was pondering about this because core.async loads clojure.reflect (indirectly via tools.analyzer) which kinda bloats my GraalVM binary with 30mb, but there are maybe other ways of getting out of that
what I really want is to opt of out of some datafy implementations to keep my binary lean
FWIW overriding the protocol implementation for a type with something else works to keep the binary lean! Just gotta be very careful about the order (speaks for itself).
Turns out that clojure.reflect isn't the problem, it's the Datafiable for clojure.lang.Namespace that gets a bloated binary.
Is there any Clojure library I can use to syntax highlight a JSON string without parsing it to a Clojure object? Or is there something I can use to build such a library myself?