Fork me on GitHub
#beginners
<
2016-01-28
>
grounded_sage01:01:02

Can't quite map out in my head how this (assoc-in {} [1 :connections 4] 2) Converts into this {1 {:connections {4 2}}}

grounded_sage01:01:03

Can anyone help me out here simple_smile

grounded_sage01:01:21

Ah figured it out. There was a snippet on Clojure Docs which is specific to Clojure for Brave and True that explains it well.

kopasetik01:01:17

This keeps on giving me an error...

kopasetik01:01:31

Error: java.lang.ClassCastException: clojure.lang.PersistentVector$ChunkedSeq cannot be cast to clojure.lang.IFn

jonahbenton02:01:18

hey @kopasetik it's the not-every? clause. not-every? wants a pred and a collection.

jonahbenton02:01:33

so it wants the first param to be a function- an IFn

jonahbenton02:01:46

but it's getting a sequence

kopasetik02:01:21

@jonahbenton: I don’t think so. I also get the same errors when I change the function to ...

jonahbenton02:01:52

i get: user=> (defn minDot #_=> [xs ys] #_=> (reduce + (map #(* %1 %2) (sort xs) (sort > ys)))) #'user/minDot user=> (minDot [1 2] [1 2]) 4

jonahbenton02:01:26

did your repl see your change to minDot?

kopasetik05:01:39

Yeah, thanks!

kopasetik05:01:22

Does the fact that Clojure concurrency is only local put any serious limitations on it?

jeremyraines06:01:57

I’m trying to use lein cljsbuild auto test with a test build, but nothing compiles on change. In either my src or test directories, which are both in the source-paths for the build. Any obvious gotchas with that?

sooheon07:01:32

The responses of my cljs-ajax calls, even if the clj side api gives a edn datastructure, gets turned into strings. So things like #uuid, #inst lose their meaning. transit seems to be the way to hook this up correctly, are there any simple examples of doing this?

sveri08:01:25

@sooheon: There are several middlewares that need to be applied depending on the format: like: https://github.com/tailrecursion/ring-edn or https://github.com/jalehman/ring-transit

jonahbenton15:01:32

@kopasetik: no, different abstractions and implementations are appropriate for in-machine/in-process vs out-of-process/across a network. and there are plenty of multi-host/vm concurrent processing frameworks + tools, like http://www.onyxplatform.org/.

Drew Verlee16:01:31

@jonahbenton: thanks for answering my question about the expression problem!

mj_langford18:01:11

What book or webpage would you say is the best one to point a experienced designer who’s just moving into a little programming for protoyping reasons?

mj_langford18:01:16

(for clojurescript)

shaun-mahood19:01:00

@mj_langford: No programming experience at all but lots of CSS and design experience?

mj_langford19:01:22

that’s the right description for them

shaun-mahood19:01:34

Would they be comfortable with building a static site with HTML?

mj_langford19:01:22

I’d guess yes

shaun-mahood19:01:18

Ok, I'd definitely lean towards something hiccup based then. Just going to flip through a couple resources and see if there's anything that jumps out at me.

shaun-mahood19:01:15

I would probably lean towards Web Development With Clojure, the beta of the second edition is coming out in a week or 2. The original is excellent, it was one of my first Clojure books, but it's pretty out of date now. I've heard really good things about Living with Clojure and it has a chapter on web development.

shaun-mahood19:01:26

I think the big question is how deep down the rabbit hole they want to go, and what kind of prototyping they want to do. I had an absolute blast prototyping using figwheel, reagent and re-frame and was able to easily transition my prototype into a working app, but it does have a lot of up front to learn - devcards wasn't out at that point but it's amazing for prototyping as well.

shaun-mahood19:01:52

If they don't need a lot of JS work in their prototypes, it should be easy enough starting with just hiccup and ring. But at that point they would probably be just as far along using HTML if that was all they really wanted to do.

shaun-mahood19:01:55

If they can, get them to sign up for a one month trial for Safari Book Online - they've got almost every Clojure book on there so they could see which one clicked with what they wanted to do.

mj_langford19:01:34

ty, that’s great.

polymeris23:01:06

Hi. What's the idomatic way of taking some thing and applying a function to it, then applying the same function to the result, N times?

polymeris23:01:15

Something like reduce but without the seq.

polymeris23:01:49

(apply comp (repeat n f)), maybe?

jeff.engebretsen23:01:23

I'd use a loop with recur but I don't know if it's idiomatic.