Fork me on GitHub
#beginners
<
2017-01-20
>
tbrooke03:01:47

I am using the string 2waves which is causing me problems I can use quote with 2 (quote 2) => 2 or ‘2 => 2 but ‘2waves causes a java number format exception - this doesn’t make sense to me - and is there a way to use quote wth 2waves or to treat 2waves as a string

seancorfield04:01:57

(i.e., write it with double quotes so it actually is a string @tbrooke )

gdeer8116:01:43

nothing knocks me off my high horse quicker than when I bang my head for an hour trying to use reduce-kv successfully. but when I get it right 👌:skin-tone-2: it feels so nice bowtie

beppu21:01:06

When you declare a dependency on clojure in project.clj is there a best practice for choosing a version?

beppu21:01:57

I ask, because I recently forked clj-audio to remove some bitrot so that it could work again with contemporary versions of clojure, and it depended on [org.clojure/clojure "1.5.1"].

beppu21:01:24

I want to bump that up to at least 1.7.0 so that cider doesn't complain but is that OK?

alexmiller21:01:26

if it’s a lib, then generally you should pick the oldest version that works

alexmiller21:01:35

if it’s an app, then I’d use latest stable

alexmiller21:01:54

if it helps 95+% of users are using >= clojure 1.7

alexmiller21:01:00

(based on state of clojure results)

beppu21:01:18

OK, I'm going to go with 1.7.0 then. Thank you @alexmiller .

josh_tackett21:01:52

@beppu and if you have some dependency issues then run lein tree deps to see the conflicts

beppu21:01:24

I don't have any conflicts at the moment, but that's good to know.

beppu21:01:06

@josh_tackett I just tried it out of curiosity and got 'tree' is not a task. See 'lein help'.

josh_tackett21:01:28

lein tree deps

josh_tackett21:01:47

ah did it again haha

alexmiller21:01:51

no, it’s lein deps :tree

josh_tackett21:01:51

lein deps tree

beppu21:01:45

lein deps tree ran and exited cleanly with no output. lein deps :tree gave me this:

Possibly confusing dependencies found:
[org.clojure/tools.nrepl "0.2.7"]
 overrides
[refactor-nrepl "2.3.0-SNAPSHOT"] -> [org.clojure/tools.nrepl "0.2.12"]
 and
[cider/cider-nrepl "0.15.0-SNAPSHOT"] -> [org.clojure/tools.nrepl "0.2.12" :exclusions [org.clojure/clojure]]

Consider using these exclusions:
[refactor-nrepl "2.3.0-20161231.143143-11" :exclusions [org.clojure/tools.nrepl]]
[cider/cider-nrepl "0.15.0-20170113.002518-7" :exclusions [org.clojure/tools.nrepl]]

 [cider/cider-nrepl "0.15.0-20170113.002518-7"]
   [org.tcrawley/dynapath "0.2.5" :exclusions [[org.clojure/clojure]]]
 [clojure-complete "0.2.4" :exclusions [[org.clojure/clojure]]]
 [org.clojure/clojure "1.7.0"]
 [org.clojure/tools.nrepl "0.2.7"]
 [refactor-nrepl "2.3.0-20161231.143143-11"]
It's digging in to my ~/.lein/profiles.clj.

beppu21:01:25

Right now, the only dependency of my fork of clj-audio is [org.clojure/clojure "1.7.0"]

beppu22:01:36

The original is here: https://github.com/budu/clj-audio I just removed some bitrot to make it work again.

sova-soars-the-sora22:01:57

Hello. I'm using Sente to socket-send stuff between client.cljs and server.clj .. works beautifully when I have just the data and event name, but now I want to send a map of data over the wire.

sova-soars-the-sora22:01:26

So my code looks a little somethn' like

(chsk-send! [:nu-blurb {:link blurb-link-input
                                                      :content blurb-content-input
                                                      :tag blurb-content-tag}])

sova-soars-the-sora22:01:46

However, sente doesn't know what to make of that map thang. I'm thinking it makes sense to wrap it in a transit something or other?

seancorfield23:01:15

As I recall, we were sending all sorts of data across channels / web sockets with Sente with no problems. Can you be a bit more specific about the problems you are seeing @sova?

sova-soars-the-sora23:01:42

Oh really? Hmm... So I should be able to send a map without packaging it in some special way? hmmm

sova-soars-the-sora23:01:04

@seancorfield I get something like Uncaught cljs$core$ExceptionInfo {message: "Invalid event" in my js console

sova-soars-the-sora23:01:34

However, there is a matching event name on the serverside... maybe ordering has something to do with ze defmethods..

seancorfield23:01:20

FWIW, we were sending some pretty large hash maps with nested vectors of data back and forth via Sente for a live dashboard app we built a few years ago, and displaying those directly with D3.

sova-soars-the-sora23:01:36

@seancorfield that is excellent news. I'm wishing to do something similar with live-updating & om.next. Will tinker more and see how it goes.