This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-02-27
Channels
- # aleph (7)
- # beginners (80)
- # boot (1)
- # cider (3)
- # cljs-dev (277)
- # cljsjs (52)
- # cljsrn (1)
- # clojure (69)
- # clojure-gamedev (4)
- # clojure-italy (1)
- # clojure-losangeles (2)
- # clojure-russia (89)
- # clojure-spec (92)
- # clojure-uk (196)
- # clojured (1)
- # clojurescript (70)
- # cursive (5)
- # data-science (1)
- # datascript (84)
- # datomic (9)
- # defnpodcast (12)
- # docker (1)
- # emacs (4)
- # events (1)
- # fulcro (112)
- # graphql (1)
- # jobs (1)
- # lumo (1)
- # nrepl (21)
- # off-topic (2)
- # onyx (3)
- # protorepl (10)
- # re-frame (23)
- # reagent (66)
- # reitit (2)
- # rum (13)
- # shadow-cljs (144)
- # spacemacs (14)
- # sql (4)
- # unrepl (29)
- # vim (16)
Sorry, just got a blue screen of death. Waiting for laptop to reboot
I don't have an issue with the update-in stuff, etc. It's more to do with the recursion. In my example above, I start with [0 0], this then finds [1 0] and [0 1] which are both 0
values. [1 0] would have no more options to pursue as no adjacent values of 0
are remaining. [0 1] however would find [0 2] repeating the process, which would then find [1 2], etc... [1 3][2 2] and then stop the recursion
I don't know how far this recursion will go though until I work through it
Hello all. I am working on nREPL middleware, and wonder who I might ask questions of, particularly regarding set-descriptor!
@shawx538 Not sure how active it is but there's an #nrepl channel if no one here can answer...
@shawx538 - There is a guy you can often find in the #clojure-uk channel during U.K. - friendly hours called @dominicm who may be able to help you, but he is 99.9% sure to be sleeping right now...
@maleghast thank you. I will look them up.
He wrote this: https://juxt.pro/blog/posts/nrepl.html
I've never actually used the set-descriptor! function, but I've used alter-meta! to directly attach descriptors to vars
(this is how I expect he is likely to be able to help you - nrepl is a black box still to me and I’ve read the article, once)
@pesterhazy that's a known issue with postwalk - you get mape-entry objects if you prewalk though
@pesterhazy also if you look at the source of postwalk, you'll see how easy it would be to make your own version that preserves the map-entry type
@maleghast Yeah, this is already helpful. Though perchance this would be better served in #nrepl . Would you mind if I shared your messages to it?
@noisesmith good point. Looks like there's an open JIRA for this: https://dev.clojure.org/jira/browse/CLJ-2031
I guess that's the kind of thing that people "fix" by copy-and-pasting a modified version of the function into their code
There could be a lib that provides a unofficial.clojure.core
namespace with "fixed" versions of fns in clojure.core (clojure.walk etc.)
I double checked - you'd have to replace walk and postwalk both, I misremembered - but even walk is pretty small
@pesterhazy my best guess is it would have been changed by now except it would possibly break code that checked for vector(?)
the ticket indicates that the patch hasn't been reviewed by Rich
@noisesmith I've added a note to http://clojuredocs.org http://clojuredocs.org/clojure.walk/postwalk. Maybe this will help the next person who runs into this
that was a good idea
Hah, ClojureScript 1.10 is now finally caught up with the postwalk
/ map entry behavior (at least it will be consistent with Clojure)
@mfikes is this because of the change in the vector? predicate on map-entries in cljs?
@noisesmith Exactly. https://github.com/clojure/clojurescript/commit/d1dc3c53c778772b176fc2163bf090f56e2a75e6#diff-f9fd6d8ba81d5a2bb5b7d2cca3289103R47
pprint :: clojure data -> vector of strings (which are printed) is there a similar function, but which does:: clojure data -> svg ? [perferably with color]
@qqq Walmart Labs's datascope
seemed to be very close to what you are describing https://github.com/walmartlabs/datascope
[1 2 #?@(:clj [3 4] :cljs [5 6])]
> This form would read as [1 2 3 4] on Clojure, [1 2 5 6] on ClojureScript, and [1 2] on any other platform. Splicing is not allowed at the top level.Is there currently any existing tool to topologically sort clojure functions in a given namespace by function dependency? An underlying assumption here is that these functions are not in a file, just defined in a namespace. e.g.
(defn a []
(b))
(defn b []
(c))
(defn c []
(println "42"))
becomes
(defn c []
(println "42"))
(defn b []
(c))
(defn a []
(b))
there are some function diagramming tools that must effectively do so (although I don’t have a name or link at hand)
Thanks @alexmiller, I was going to go pilfer one of those libs if there wasn’t an obvious library or technique I was missing.
https://github.com/testedminds/lein-topology seems to be in the ballpark, but there are others
https://github.com/testedminds/lein-topology <- This looks like a perfect fit.
How would I use gen-class to make a POJO? I am trying to use getForObject from springframeworks RestTemplate class
@alexmiller Should probably use mkdir -p
in the TDEPS install file. I'm getting a bunch of "cannot create directory" when using --prefix / -p
yeah, I’ve already fixed at least one (for man files)
Anyone else known to use the JT400 library to use Clojure on the AS400/System i IBM servers? I’ve been having fun with it, and am considering building some libraries.
is there an idiomatic way to reduce while tracking a sequence index? seems like loop/recur
is probably the best option, but I also considered destructing and seeding a reduce with something like [(list) 0]
as a seed and [[acc i] val]
as the aggregator’s signature. another thing to consider is that index-based operations will be inherently un-parallelizable, right? (unless the reducers lib has some super-magic functions for handling that?)
I always thought an indexed
function would be helpful, because (map-indexed vector coll)
isn't very discoverable
medley has an indexed
(and the transducer version): https://github.com/weavejester/medley/blob/master/src/medley/core.cljc#L258
nice!
In an immutable language with good data literals and lazy mapping it's pretty easy to adjoin indices though
I generally just do (map (fn [v index] ...) my-coll (range))
? and then reduce with that if needed
but that's a different pattern, and I imagine map-indexed
is more efficient
I like the manual way because I always forget the order of arguments on the map indexed certain
I forget the order all the time too, so I just run:
(keep-indexed vector [:a :stuck_out_tongue: :c])
in the repl