This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-02-18
Channels
- # boot (42)
- # cider (26)
- # cljs-dev (6)
- # cljsrn (6)
- # clojure (119)
- # clojure-berlin (3)
- # clojure-dev (2)
- # clojure-nl (1)
- # clojure-russia (38)
- # clojure-spec (1)
- # clojurescript (44)
- # component (3)
- # cursive (1)
- # data-science (2)
- # datomic (19)
- # dirac (60)
- # emacs (12)
- # figwheel (2)
- # hoplon (13)
- # iot (4)
- # keechma (2)
- # klipse (38)
- # leiningen (5)
- # luminus (1)
- # lumo (1)
- # off-topic (6)
- # om (2)
- # om-next (4)
- # onyx (21)
- # perun (79)
- # reagent (32)
- # untangled (39)
- # vim (36)
- # yada (1)
probably missing something slightly obvious
but if I want to generate something like this
[:select [:option "one"] [:option "two"]]
where the two options are generated by a for loop
how can I actually do it?
I can do easily something like
(mapv (fn [v] [:option v]) [1 2 3])
[[:option 1] [:option 2] [:option 3]]
but then can't find the right magic to compose the two things
argh yes sorry I managed
(vec (cons :select (mapv (fn [v] [:option v]) [1 2 3])))
I doubt it's the best way though
(into [:select] (map (fn [v] [:option v]) ..))
ah great thanks always forget about into
a proposed law: if you're looking for a coll processing fn for more than 5 min, reduce or into is probably what you're looking for
sounds reasonable 🙂
from all the other programming languages I've seen into is a bit of an outsider
that's also why I always forget it
think of it as a short cut: (into init xs)
= (reduce conj init xs)
(looking at the source...) that's actually how it's implemented!
ah thanks nice
is there an easy way to just dump the app-state while debugging in clojurescript?
should it be available in the browser console?
(js/console.log (pr-str state))
if you're using reagent, data-frisk is amazing (you can probably use it if you don't)
I'm using reagent yes
ok cool I'll have a look thanks
hey all, quick quick about how recursion vs trampoline works in cljs. building up collections via recursion that can become somewhat large (mid single digit million maps of 5-10 k/v pairs). right now I’m doing the collection buildup through a simple loop/recur, but I’m noticing serious performance degradations when I get into a collection with a few million members. I don’t know if that’s normal behavior or not. maybe I just shouldn’t be playing with collections that large. I wonder, though, if using trampoline instead of loop/recur would be more efficient. having trouble finding info about the performance characteristics of one v another, would love any insight that people can provide on that
how does one :cljs/quit a nodejs repl via piggyback so that the node process is destroyed as well? When I restart piggyback few time I start collecting zombie node processes.
what is the main disadvantage of dirac (besides setting it up)? I just got dirac working, and I can'r belineve I've been doing cljs for 6 months without dirac
when you develop a serious addiction on it and I stop updating it to work with new chrome releases, you will scream in pain, so be careful! 😉
@darwin: lol, all this time I had no idea you were active dev behind dirac; if I were you, I'd create a kickstarter every time chrome has a new release -- and only update dirac when the ransom is paid