This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-10-03
Channels
- # aleph (1)
- # beginners (42)
- # boot (34)
- # cider (157)
- # cljs-dev (12)
- # cljsrn (3)
- # clojure (165)
- # clojure-conj (1)
- # clojure-india (1)
- # clojure-italy (6)
- # clojure-russia (20)
- # clojure-spec (27)
- # clojure-uk (173)
- # clojurescript (116)
- # cursive (30)
- # datomic (87)
- # devcards (1)
- # docs (9)
- # emacs (2)
- # ethereum (2)
- # events (2)
- # fulcro (60)
- # graphql (10)
- # hoplon (2)
- # jobs-rus (6)
- # keechma (1)
- # lein-figwheel (9)
- # leiningen (36)
- # luminus (2)
- # mount (3)
- # off-topic (16)
- # om (14)
- # onyx (12)
- # pedestal (19)
- # portkey (107)
- # re-frame (9)
- # reagent (5)
- # ring (26)
- # shadow-cljs (149)
- # spacemacs (3)
- # sql (6)
I’m running into an issue with xml-zip/xml->
on nested repeated tags (i.e. <a><a>FOO</a></a><a><a>BAR</a></a>
) returning all the results as a list of one element.
has anyone else had problems with cider? eval-ing anything throws "java.lang.IllegalAccessError: with-safe-transport does not exist"
@bwstearns does xml-zip/xml-> work with something like <a>FOO</a><a>BAR</a> ?
i added a stackoverflow question for my problem with cider + emacs https://stackoverflow.com/questions/46545049/cider-repl-throws-java-lang-illegalaccesserror-with-safe-transport-does-not-exi
@boogie666 check the issue thread: https://github.com/clojure-emacs/cider/issues/2092
(defun cider--connected-handler ()
(let ((cider-enlighten-mode nil))
(cider-make-connection-default (current-buffer))
(cider-repl-init (current-buffer))
(cider--check-required-nrepl-version)
(cider--check-clojure-version-supported)
(cider--check-middleware-compatibility)
(cider--subscribe-repl-to-server-out)
(when cider-auto-mode
(cider-enable-on-existing-clojure-buffers))
(sleep-for 0.1) ;; <-- Increase timeout till it works
(cider--debug-init-connection)
(run-hooks 'cider-connected-hook)))
@boogie666 https://stackoverflow.com/questions/46535423/cant-access-deeply-nested-xml-with-clojure-data-zip-xml/46537389#46537389
It was actually a bug with the library. I wish I had started looking into that possibility sooner but it's never the library lol.
is there a short way of defining this function that takes two words, converts to lower-case then compares them for match?
(defn same? [w cw] (= (str/lower-case w) (str/lower-case cw)))
I don’t think the shorter versions would be better, but if we’re golfing here’s my go
(def same? #(apply = (map str/lower-case %&)))
or, maybe more useful (defn equal-by [f] (comp (partial apply =) (partial map f) vector))
then (def same? (equal-by str/lower-case))
at least that way there’s an abstraction that makes some kind of sense backing up the terseness
@noisesmith thanks! Should have been a little clearer, wasn't necessarily trying for golf, more so just still new to the lang and a lot of times I find out later there's some core function that makes things simpler
fair enough, nothing specific for this case
unless you are frequently comparing things based on some pre-processing function, your original is likely the best way to do it
Gotcha, this is just a practice problem for http://exercism.io, so I guess I'll stick with the original 😉
Lets say I am hitting my head against a wall trying to get a filter
function to work. I really want to see what it is looping over each time, would the best way to debug this be using a doseq
?
My thought process is that I can't do side effects in filter
but I can inside of doseq
- printing each line is the side effect - to sum up: what is the best way to debug filter
@tkjone I’d start by calling the predicate function on some individual values, from the REPL. If you need to dig deeper than that (eg if the predicate is really complicated), it’s a great candidate for running in a debugger.
eg if I’m doing (filter even? (range 5))
, I’d start in the repl by calling (even? 0)
, (even? 1)
, etc, until the behavior is totally clear.
Also you can definitely cause side effects from within filter
. eg you could do (filter #(do (println %) (even? %)) (range 5))
ahhhh! Very nice, thank you! Forgot about do