Fork me on GitHub
#beginners
<
2017-03-18
>
yonatanel09:03:19

Can I override a lib's extend-protocol in my own code for a particular type?

dominicm11:03:32

@us3r64 As a first-hand experience of vim to weigh in, the story is pretty great! Not felt the need for an IDE at all.

jumar12:03:35

@seancorfield why do you think the ProtoREPL is superior to Emacs/Cider? (I'm just curious. I've never tried ProtoREPL)

curlyfry12:03:29

I use Cursive + IdeaVim which works great with a little configuration (https://github.com/cursive-ide/cursive/wiki/Mapping-IdeaVim-actions-to-Cursive-actions).

yonatanel13:03:30

@seancorfield Can you manage multiple projects/modules and run multiple repls with ProtoREPL? What if you also have some node.js code and also like to drill-down into 3rd party functions and look at java code etc? What's refactoring like? Those are my excuses for using cursive.

yonatanel13:03:48

Though it lacks visualizations and stuff like Sayid.

grounded_sage14:03:24

Is using the double colon now best practice for using keywords? When would I not use the double colon if that is the case?

jennifer15:03:56

hi all. i’m working on an app that has a clojurescript frontend AND clojure backend. i’m having a problem with a dependency, i think. i’m getting this message No such namespace: clojure.edn, could not locate clojure/edn.cljs, clojure/edn.cljc, or Closure namespace “ i did lein deps :tree and this was the first thing in the result (there were quite a few):

Possibly confusing dependencies found:
[lein-cljsbuild "1.1.1"] -> [lein-cljsbuild/cljs-compat "1.0.0-SNAPSHOT"] -> [org.clojure/clojure "1.5.1"]
 overrides
[lein-figwheel "0.5.8"] -> [simple-lein-profile-merge "0.1.4"] -> [org.clojure/clojure "1.6.0"]

Consider using these exclusions:
[lein-figwheel "0.5.8" :exclusions [org.clojure/clojure]]
i tried adding that exclusion, but it didn’t seem to resolve anything. i did quite a few other things as well (`lein clean`, ran lein ancient and did the suggested upgrades) but i’m still getting this error.

jennifer15:03:51

and now i’m wondering if i need to use all the exclusions suggested or if there’s some base level thing that i can do to fix this.

shaun-mahood15:03:30

@jennifer: try updating your lein-cljsbuild to the latest version 1.1.5 - figwheel could also move up to 0.5.9.

shaun-mahood15:03:27

lein ancient is great for helping to deal with these updates, usually the first thing I check now when I have dependendy issues

jennifer15:03:26

thanks @shaun-mahood. i just tried moving figwheel & lein-cljsbuild up to the newest version and now i get this which is strange, because it looks like it’s grabbing an even older version of clojure?

Possibly confusing dependencies found:
[lein-cljsbuild "1.1.5"] -> [fs "1.1.2"] -> [org.clojure/clojure “1.3.0”]

jennifer16:03:49

solution found! my mentor became available and she rubber ducked the issue with me. turns out i was using (clojure.edn/read-string data) instead of (cljs.reader/read-string data) and that mucked everything up. fixed now and i can move on with my day. 🎉

billbarnhill17:03:24

Hmm, I have a function q that generates a different value each time. What’s best way to get 10 values?

billbarnhill17:03:47

Answered my own question. (repeatedly 10 q)

seancorfield17:03:02

@jumar it's subjective. I just prefer it.

seancorfield17:03:17

@yonatanel I really only do Clojure. No Java. No JS. I don't need an IDE.

lepistane19:03:12

how would one go about doing something like this i have [question1 question2 question3...] maps look like {:question "..." :asnwers [1 2 3]} i was thinking of doing something like for question in questions print question for answer in answers print answer (result is question 1 and it's answers, then question2 and it's answers...) but i cant do more than 1 thing in for 'do' function doesn't help. is there a elegant way of doing this. i feel like i am trying to do python in clj

Prakash20:03:09

I didn't understand your question. do you have two different vectors of questions and answers, or one vector of maps with question and answers as keys, also, what is the desired output data structure for u?

lepistane20:03:44

hope this makes it clearer it's clojurescript code how do i solve the nested loops problem in right way

Prakash21:03:45

@lepistane u can use map, and a bit of destructuring -

(map (fn [{:keys [question answers]}]
                        [[:h2 question] (map (fn [a] [:p a]) answers)]) questions)