This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
@sonnyto What's the exact trouble with read-string
? Wild guess: Do you have a leiningen
as a dependency?
its probably not a problem with read-string... i have a very large edn string that fails with read-string
CompilerException java.lang.ClassCastException: clojure.lang.Symbol cannot be cast to java.lang.Number, compiling:(form-init8554715131569529748.clj:1:11)
(defprotocol X (x [x]))
(extend-type AFunction X (x [f] 1))
CompilerException java.lang.RuntimeException: Unable to resolve symbol: AFunction in this context…
?I’m trying to remember the name of a (core?) function such that, given a collection, it applies a unary function f
to every element, then returns a map from the function’s results to the elements that gave those results.
For instance, (mystery-fn empty [[3 2] #{5} [4] {:x 3}])
would return something similar to {[] ([3 2] [4]), #{} (#{5}), {} ({:x 3})
.
@cigitia: did you mean [group-by](https://clojuredocs.org/clojure.core/group-by)?
user=> (group-by empty [[3 2] #{5} [4] {:x 3}])
{[] [[3 2] [4]], #{} [#{5}], {} [{:x 3}]}
off-topic, how did tcrayford manage to have his url displayed prettily, with page title/description n stuff. I am able to only post a vanilla url - https://clojuredocs.org/clojure.core/group-by
Yeah, s’gotta be http://clojuredocs.org.
Could be, looking at the urls posted over last few days, not all of them get the pretty url treatment. Thanks.
@amithgeorge: Yes, thank you so much.
Hi everybode, I am a Clojure noob and coming from the Node-world. I wanted to try and create a http api and got it up and running using http-kit. My question is if there is any way to get a instant reload/feedback loop going while developing? Making a change in a router and then having to recompile everything takes very long. Any tips and trix to get the dev flow up to par with node?
@bobmoff: try the code here, last time I tried it it worked - http://www.http-kit.org/migration.html#reload
Also if you feel like learning https://github.com/stuartsierra/component at some point then it has a really nice development workflow with https://github.com/danielsz/system#boot-system
Does anyone have a preference for an automatic test runner for clojure.test
? It seems like https://github.com/jakemcc/lein-test-refresh lets you put failures on a Growl or send-notify
or whatever, which is nice; but then https://github.com/jakepearson/quickie automatically reloads namespaces, which is also nice.
There was a bit of discussion about automatic test runners in #C08LK2DH7, you might want to check it
Unfortunately, until someone comes up with the $20,152/month ($8/mo, 2519 in channel right now) for Slack to archive messages for this organization, or Slack provides more features to nonprofit orgs like this one, stuff falls out of the archive very quickly.
Anyway, I think I can get the best of both worlds by combining Quickie with multitail
. If I get it working, I'll post it here!
What are people using for form validation, been using schema but wonder if Bouncer, Herbert or something else would be better. Any tips?
IMO schema only makes sense for coercion if we're talking about forms. I mean, I imagine you can user predicates to validate things other than types for sure, but it feels weird to me to use that for logic validation. For validation I've used validateur, bouncer and cats' Validation applicative with a custom map semigroup implementation that would merge error sets (in order I tried those solutions). I think bouncer seemed slightly nicer to me than validateur (YMMV though) and the last one is just me being silly.
https://github.com/jkk/verily looks interesting in that validators get the whole map as argument (thus a validator can validate how two fields relate for example) which seems interesting, but I didn't have an occasion to try it yet
@jaen agree on Schema in this use case. I mostly used it since I already know it Had not seen Verily, thanks for the tip!
So this is what ended up working for me:
multitail -cT ANSI -ex "(FAIL|ERROR|error-while-loading)" "notify-send -i stop" -l "lein quickie"
Replace notify-send
with the Growl-like command of your choice.This gives me the namespace reloading of Quickie, and the error notification of lein-test-refresh. I briefly tried it with success notifications, but it was too spammy.
Hi all, any pointers for writing ring POST endpoints to accept application/transit+json using ring-transit/wrap-transit-body. My handler, and POST request coming from re-frame is included at https://gist.github.com/paulspencerwilliams/10bf7a0bf69fbcc92308 - :body ends up nil.
@paulspencerwilliams: that gist is blank
@roberto: cheers, just like my request :body 😉 Damn intermittent internet.
request :body is nil rather than the expected json data.
@roberto: it’s the request body that’s nil, not the response body.
@roberto: I think that might be the problem, I’d updated my cljs code, but was running it with lein ring, rather than lein figwheel, and thus I don’t think my cljs had compiled.