#clojure log - Mar 27 2015

The Joy of Clojure
Main Clojure site
Google Group
IRC
List of all logged dates

0:00 TEttinger: the way I do it, because I don't use editor fanciness other than paren matching and syntax highlighting, is press ) until I'm matched

0:01 Jaood: ;)

0:04 * Jaood does the same

0:04 chr15m: that just takes you to the brace though, right? doesn't actually gather them.

0:08 bendlas: hm, I see that issue all the time when shoulder surfing people coding. and I remember it from my pre-paredit days. seems like some OSS clout to be had in releasing a cool editor plugin for that

0:09 especially since in clojure there's typically a mix of ), } and ]

0:09 Jaood: chr15m: looks like we understood you differently

0:09 chr15m: @bendlas so you can do it with paredit? i have paredit.

0:10 bendlas: or maybe I understood you wrong; you didn't mean inserting all the nessecary closing parens?

0:14 chr15m: no i mean if there are loose parens hanging around on lines after the main one

0:14 main one = the one you are working on

0:15 (fn [x] ...

0:15 )

0:15 bendlas: oh, you mean spurious white space between you closing parens

0:15 chr15m: i want a single keystroke to gather that single brace back onto the last line it can go to

0:15 yep

0:16 scottj: chr15m: in paredit in emacs pressing ) will do that for all closing brackets. (if by last line you mean previous line)

0:16 chr15m: scottj: good to know, thank you. i am in vim.

0:17 bendlas: scottj: cool, good to know that

0:17 chr15m: scottj: WAIT. paredit in vim also does this.

0:17 you are truly legendary sir!

0:17 thank you!

0:17 bendlas: I always used to jump outside of the last closing paren and press backspace until they were tidy

0:17 scottj: just repeating what everyone before said :)

0:18 chr15m: lol

0:18 my hubris chooses to ignore the fact it took three attempts to explain the obvious to me

0:18 i am great

0:19 bendlas: seconded ^^

0:19 elvis45261: is there any rule about namespaces ?

0:19 does it have to follow the folder hiearchy ?

0:20 bendlas: elvis45261: yes, plus have at least one parent folder

0:20 i.e two segments

0:20 elvis45261: alright ty

0:21 bendlas: yw

0:25 freddd: does anyone have any idea if dissoc-in will ever make it to core from core.incubator?

0:53 elvis4526: There is really no way to write macro with only clojurescript ?

0:54 if that's the case, is it okay that the clojure file for the macros live in the same place as my cljs files or there should be some "separation" ?

0:56 joe124: hi I am currently working through clojure for the brave and true, is buyign the early access ebook worth it?

0:57 bja: chr15m: go to the line to collect on and hold J

0:57 it'll bring up the previous line every time you hit J

0:57 (which if you have a bunch of parens, just collects those)

0:58 chr15m: bja ah yes, nice

0:58 bja although with paredit hitting ) seems to work better

0:58 bja: I use vim-sext

0:58 vim-sexp

0:58 chr15m: ah ok

0:58 that is tpope's plugin right?

0:58 bja: guns

0:59 chr15m: ah yes

0:59 joe124: is using atom for making clojure programs bad?

0:59 chr15m: it is in the 0.01% of vim plugins not written by tpope

0:59 gws: tpope has this one which works on top of vim-sexp (i use it) https://github.com/tpope/vim-sexp-mappings-for-regular-people

0:59 bja: joe124: do you want it to be bad?

1:00 joe124: no

1:00 bja: then it's not bad

1:00 joe124: awesome i feel great now!

1:00 bja: if you want to really level up, consider using ed to write your clojure

1:01 ed combined with your usual shell and repl for fg/bg abilities and maybe a good mouse with copy/paste

1:01 it'll really change you

1:02 joe124: i have a question why is lisp and such not popular

1:02 is it because lisp languages are harder to learn?

1:04 what is the difference between {:a 5} and (def a 5)

1:17 amalloy: joe124: honestly the differences so outnumber the similarities that they're difficult to list. the two expressions you gave do totally different things; the main similarity is that they both involve the number 5

1:19 joe124: amalloy i just was wondering because in both the number 5 is bound to a

1:19 amalloy: not really

1:19 in the second, you create a global var named a, and make its value be 5

1:20 in the second, you create a hashmap, with the single key :a and the corresponding value 5

1:20 there's no binding or assigning of anything in the second one, just a map with a key and a value

1:21 joe124: but isnt a map kind of like assigning

1:21 gws: no a map is a data structure

1:22 freddd: joe124: a map is also known as a hash or dictionary in other languages if that helps you understand at all.

1:27 joe124: yah thanks guys i guess i just noticed a similarity was wondering if there was anything more to it

1:30 elvis4526: I am confused. How can you make a "global" js variable in cljs ?

1:31 I would have expected that (def js/myGlobal val) would work

1:34 oh nvm

2:38 Igor: How can I close http connection with http-kit? (close channel) doesn't work

2:46 vas: @Igor it doesn't automagically close?

3:32 Seylerius: Hmm... I'm kinda stuck on 4clojure #31

3:33 Pack a sequence...

3:33 Anyone got a hint?

3:50 ordnungswidrig: Seylerius: "packing" = "grouping"

3:52 Seylerius: a better hint would be "partitioning", I guess

4:13 Seylerius: ##(= [1 2 3]

4:13 ##(= [1 2 3] '(1 2 3))

4:13 lazybot: ⇒ true

4:13 * Seylerius nods

4:30 dysfun: is there a 'funcall' equivalent? i.e. apply, but doesn't take a list as arg?

4:31 opqdonut: #(%1 %2) ?

4:32 ordnungswidrig: ,(apply prn [1 2 3])

4:33 clojurebot: 1 2 3\n

4:33 ordnungswidrig: ,(apply prn [[1 2 3]])

4:33 clojurebot: #error{:cause "Unable to resolve symbol: in this context", :via [{:type clojure.lang.Compiler$CompilerException, :message "java.lang.RuntimeException: Unable to resolve symbol: in this context, compiling:(NO_SOURCE_PATH:0:0)", :at [clojure.lang.Compiler analyze "Compiler.java" 6535]} {:type java.lang.RuntimeException, :message "Unable to resolve symbol: in this context", :at [clojure.lang.Ut...

4:33 ordnungswidrig: hmmmm

4:34 ,(apply prn [[1 2 3]])

4:34 clojurebot: [1 2 3]\n

4:34 ordnungswidrig: dysfun: simple wrap the arg in a vector for apply.

4:41 dysfun: ordnungswidrig: yes, it's just that if said function already existed, it would mean no need to embed a lambda in a (filter)

5:09 borkdude: what are good reasons to choose immutant over embedded jetty or undertow (except for clustering, which I don't need)?

5:17 dysfun: it's quite fast. it's worth testing the performance vs other things

5:17 it fits nicely into the j2ee stack if you're of that persuasion (i'm not)

5:19 borkdude: do people use embedded jetty a lot in production?

5:20 oddcully: what's the key here "embedded" or "jetty"?

5:21 borkdude: jetty

5:21 oddcully: and from immutants homepage, i'd say, that if you don't need quartz, hornet, ... then maybe don't bother with the extra baggage

5:22 http://www.techwars.io/fight/jetty/tomcat/ no ;P

5:23 spinningarrow: super stupid question guys - what does the result of the (doc ...) function mean? for example, if it says `(read-csv input & options)`, what exactly does `input & options` mean there?

5:23 borkdude: spinningarrow check out http://clojure.org/functional_programming

5:24 spinningarrow especially http://clojure.org/special_forms#fn

5:25 spinningarrow basically & options means options is a variadic list of parameters

5:25 spinningarrow like in +, you can call it with an arbitrary amount of params: (+ 1 2 3 4 5 6)

5:26 oddcully: spinningarrow: above from the docs then is: ([] [x] [x y] [x y & more])

5:27 (the last one)

5:34 mpenet: borkdude: jetty is fine in production

5:35 borkdude: ex: prismatic runs on it I believe

5:36 borkdude: mpenet cool

5:38 oddcully: i also use jetty embeded and not. had not problems so far (saising fist to universe to dare)

5:49 f3ew: What's the clojure model equivalent of the Unix pipeline pattern?

5:53 mpenet: f3ew: comp or the -> functions I guess

5:55 ,(-> {:a {:b {:c [1]}}} :a :b :c first inc)

5:55 clojurebot: 2

5:59 oddcully: f3ew: or core.async

6:12 Seylerius: ,(defn dup [coll] (loop [remainder coll result []] (if (empty? remainder) result (recur (rest remainder) (conj result (repeat 2 (first remainder)))))))

6:12 clojurebot: #'sandbox/dup

6:13 Seylerius: ,(dup [1 2 3 4])

6:13 clojurebot: [(1 1) (2 2) (3 3) (4 4)]

6:13 Seylerius: Oh, of course

6:14 (defn dup [coll] (loop [remainder coll result []] (if (empty? remainder) result (recur (rest remainder) (concat result (repeat 2 (first remainder)))))))

6:15 ,(defn dup [coll] (loop [remainder coll result []] (if (empty? remainder) result (recur (rest remainder) (concat result (repeat 2 (first remainder)))))))

6:15 clojurebot: #'sandbox/dup

6:15 justin_smith: Seylerius: or apply conj

6:16 Seylerius: (dup [1 2 3 4])

6:16 ,(dup [1 2 3 4])

6:16 clojurebot: (1 1 2 2 3 ...)

6:16 noncom: f3ew: what do you mean?

6:16 ,(conj {} '(1 2))

6:16 clojurebot: #error{:cause "java.lang.Long cannot be cast to java.util.Map$Entry", :via [{:type java.lang.ClassCastException, :message "java.lang.Long cannot be cast to java.util.Map$Entry", :at [clojure.lang.APersistentMap cons "APersistentMap.java" 42]}], :trace [[clojure.lang.APersistentMap cons "APersistentMap.java" 42] [clojure.lang.RT conj "RT.java" 610] [clojure.core$conj__4067 invoke "core.clj" 85] [sa...

6:16 Seylerius: noncom: It wants a vector, not a list.

6:16 justin_smith: that error message is so funny

6:16 noncom: yaeh, and that seemed strange to me

6:17 ,(conj {} '(:eval '(me "ok")))

6:17 clojurebot: #error{:cause "clojure.lang.Keyword cannot be cast to java.util.Map$Entry", :via [{:type java.lang.ClassCastException, :message "clojure.lang.Keyword cannot be cast to java.util.Map$Entry", :at [clojure.lang.APersistentMap cons "APersistentMap.java" 42]}], :trace [[clojure.lang.APersistentMap cons "APersistentMap.java" 42] [clojure.lang.RT conj "RT.java" 610] [clojure.core$conj__4067 invoke "core....

6:17 justin_smith: ,(conj {} '([] []))

6:17 clojurebot: #error{:cause "clojure.lang.PersistentVector cannot be cast to java.util.Map$Entry", :via [{:type java.lang.ClassCastException, :message "clojure.lang.PersistentVector cannot be cast to java.util.Map$Entry", :at [clojure.lang.APersistentMap cons "APersistentMap.java" 42]}], :trace [[clojure.lang.APersistentMap cons "APersistentMap.java" 42] [clojure.lang.RT conj "RT.java" 610] [clojure.core$conj__...

6:17 justin_smith: that message is factually false

6:17 persistentvector can be cast

6:17 noncom: :D

6:17 also:

6:17 justin_smith: it's just complaining about the type of the wrong item

6:17 noncom: ,(conj {} (:eval '(+ 1 2)))

6:17 clojurebot: {}

6:17 noncom: haha!

6:18 i know what happens, but funny still

6:18 yeah, and your example with [] is even more fun i think :)

6:19 Seylerius: justin_smith: Weirdly enough, my function isn't working, despite producing a good result.

6:19 ,(dup [1 2 3])

6:19 clojurebot: (1 1 2 2 3 ...)

6:19 justin_smith: ,((`~`~get `~`~`~`~get `~`~`~`~`~`~`~get `~`~`~`~`~`~`~`~`~`~`~get) [:a :b :c :d :e] 42 :OK)

6:19 clojurebot: :OK

6:19 justin_smith: Seylerius: what's wrong with that result?

6:20 Seylerius: It's failing #32

6:20 Can clojurebot be coerced into providing a little more of the result?

6:20 hyPiRion: oh sure

6:20 Seylerius: ,(dup [1 2])

6:20 clojurebot: (1 1 2 2)

6:20 hyPiRion: call it with str or something

6:21 ,(str (dup [1 2 3 4]))

6:21 clojurebot: "clojure.lang.LazySeq@34932041"

6:21 hyPiRion: ,(pr-str (dup [1 2 3 4]))

6:21 clojurebot: "(1 1 2 2 3 ...)"

6:21 Seylerius: Heh

6:21 ordnungswidrig: ,(take 10 (dup [1 2 3 4]))

6:21 clojurebot: (1 1 2 2 3 ...)

6:21 hyPiRion: ,(binding [*print-length* 1000] (pr-str (dup [1 2 3 4])))

6:21 clojurebot: "(1 1 2 2 3 3 4 4)"

6:21 justin_smith: ,(apply str (dup [1 2 3 4]))

6:21 clojurebot: "11223344"

6:21 ordnungswidrig: (into [] (take 10 (dup [1 2 3 4])))

6:21 ,(into [] (take 10 (dup [1 2 3 4])))

6:21 clojurebot: [1 1 2 2 3 ...]

6:22 Seylerius: We clearly now have the information we need.

6:22 ordnungswidrig: grr

6:22 hyPiRion: perhaps pr is better actually

6:22 Seylerius: And yet it's still failing #32.

6:22 hyPiRion: 4clojure #32?

6:22 Seylerius: Yep

6:23 hyPiRion: What is it failing on?

6:23 Seylerius: Okay, now that's fscking weird.

6:23 * hyPiRion just recently came into the discussion

6:23 Seylerius: I didn't change a single paren, and now it's passing.

6:23 justin_smith: Seylerius: when I paste the most recent def, it solves 32

6:23 Seylerius: 4clojure is stupid sometimes.

6:23 hyPiRion: Seylerius: might've been a timeout issue?

6:24 justin_smith: also, (concat result (repeat 2 (first remainder))) is objectively worse than (conj result remainder remainder)

6:24 also, (concat result (repeat 2 (first remainder))) is objectively worse than (conj result remainder (first remainder) (first remainder)) that is

6:24 heh

6:24 Seylerius: Noted.

6:25 hyPiRion: If 4clojure hasn't been restarted in a while, then some alright solutions may timeout.

6:25 * hyPiRion looks at amalloy_

6:25 justin_smith: oh that was still wrong :( (conj result (first remainder) (first remainder))

6:26 Seylerius: Hah

6:26 f3ew: noncom: the equivalent of a cat file |grep string | tee >(command) | some_other_command > file2

6:26 Seylerius: And the advantage of repeat becomes clear in #33, where I need to do it an arbitrary number of times.

6:26 justin_smith: Seylerius: (apply conj coll (repeat n val))

6:27 Seylerius: apply conj beats concat?

6:27 justin_smith: definitely, I'd say. If you have a vector

6:27 noncom: f3ew: ummm, well, clojure is a jvm-based programming language, so i am not really sure about what you're asking, but for interacting with bash you can use the conch library and for piping functions, well, yes, there are facilities

6:27 Glenjamin: is (apply conj) prerrable to (into) ?

6:28 justin_smith: Glenjamin: into is likely better than apply conj, yeah

6:29 Seylerius: Oooh. Shiny.

6:29 hyPiRion: and hey, if you need an eager concat on vectors, then I can recommend (defn catvec [& vecs] (reduce into vecs))

6:30 f3ew: noncom: I'm not interacting with bash, I have clojure functions I would like to chain up in a similar style

6:30 oddcully: f3ew: so you want to read a file, filter some limes, send the lines down to another process and save them also into a file? so you want to use closure _instead_ of a shell, right?

6:30 justin_smith: oddcully: he just wants the syntactic style

6:30 which is -> or ->>

6:30 f3ew: oddcully: s/file/event stream/, and process that event stream

6:31 noncom: f3ew: also https://github.com/rplevy/swiss-arrows

6:32 justin_smith: f3ew: oh, if it's explicitly a stream with new items coming in async, then core.async

6:33 f3ew: justin_smith: I'm writing riemann configs, so the reading bit is handled for me

6:34 justin_smith: f3ew: yeah, so you want one of those arrows, probably -> with the occasional nested ->> / some-> / some->> etc.

6:37 Seylerius: ,(defn ranger [a b] (if (< a b) (conj [a] (ranger (inc a) b)) []))

6:37 clojurebot: #'sandbox/ranger

6:37 Seylerius: ,(ranger 1 4)

6:37 clojurebot: [1 [2 [3 []]]]

6:37 Seylerius: Ah, right.

6:38 ,(defn ranger [a b] (if (< a b) (into [a] (ranger (inc a) b)) []))

6:38 clojurebot: #'sandbox/ranger

6:38 Seylerius: ,(ranger 1 4)

6:38 clojurebot: [1 2 3]

6:38 Seylerius: Yep

6:45 justin_smith: ,(def ranger (constantly 'Strider))

6:45 clojurebot: #'sandbox/ranger

6:57 egli: borkdude: immutant is just a nicely package if you want web, messaging, transactions, etc

6:58 it's very industrial strength but you have to dig jboss xml config files

6:59 noncom: ,ranger

6:59 clojurebot: #error{:cause "Unable to resolve symbol: ranger in this context", :via [{:type clojure.lang.Compiler$CompilerException, :message "java.lang.RuntimeException: Unable to resolve symbol: ranger in this context, compiling:(NO_SOURCE_PATH:0:0)", :at [clojure.lang.Compiler analyze "Compiler.java" 6535]} {:type java.lang.RuntimeException, :message "Unable to resolve symbol: ranger in this context", :at [...

7:26 Seylerius: ,(defn mixer [seqa seqb] (loop [one seqa two seqb result []] (if (apply or (map empty [one two])) result (recur (rest one) (rest two) (conj result (first one) (first two)))))

7:26 clojurebot: #<RuntimeException java.lang.RuntimeException: EOF while reading>

7:32 justin_smith: Seylerius: you can't apply or

7:33 ,(some? empty [[1] [2]])

7:33 clojurebot: #error{:cause "Wrong number of args (2) passed to: core/some?", :via [{:type clojure.lang.ArityException, :message "Wrong number of args (2) passed to: core/some?", :at [clojure.lang.AFn throwArity "AFn.java" 429]}], :trace [[clojure.lang.AFn throwArity "AFn.java" 429] [clojure.lang.AFn invoke "AFn.java" 36] [sandbox$eval47 invoke "NO_SOURCE_FILE" -1] [clojure.lang.Compiler eval "Compiler.java" 67...

7:33 justin_smith: ,(some empty [[1] [2]])

7:33 clojurebot: []

7:33 Empperi: or is a macro, thus you can't use apply with it

7:33 Seylerius: justin_smith: wound up just manually or-ing it.

7:34 The real problem was a missing paren. Emacs catches those so much better, what with highlighting matches.

7:34 justin_smith: ,(some empty? [[1] [2]])

7:34 clojurebot: nil

7:34 justin_smith: that's what I wanted

7:35 Seylerius: if you aren't specifically sharing with us all, you can use /msg to talk to clojurebot

7:35 Seylerius: Shiny.

7:35 Although I do value y'all's opinions a fair bit on this stuff.

7:35 It's rather handy.

7:36 All of you clever and more experienced clojure-folks are good to talk to.

7:36 justin_smith: Seylerius: sure, but I don't think you need our help with unmatched parens :)

7:36 Seylerius: :p

7:36 Other than the or bit, what d'you think of the method in that one?

7:37 justin_smith: Seylerius: looks decent enough, it would be clearer as a reduce

7:37 generally, loop is low level, and it's good to convert to one of the higher level constructs when applicable

7:38 Seylerius: Right...

7:39 justin_smith: something like (defn mixer [a b] (reduce into [] (map vector a b)))

7:40 it does the same thing, but much less verbosely

7:40 Seylerius: Oh that's nice.

7:40 I forget about map being able to pull from multiple sources.

7:40 justin_smith: ,(defn mixer [a b] (reduce into [] (map vector a b)))

7:40 clojurebot: #'sandbox/mixer

7:40 justin_smith: ,(mixer [:a :b :c :d] [1 2 3 4 5])

7:40 clojurebot: [:a 1 :b 2 :c ...]

7:40 justin_smith: that's what it should do, right?

7:40 Seylerius: Yep

7:41 ,(map vector [1 2 3] [:a :b :c])

7:41 clojurebot: ([1 :a] [2 :b] [3 :c])

7:41 Seylerius: Right.

7:41 justin_smith: oooh

7:41 ,(defn mixer [a b] (mapcat vector a b))

7:41 clojurebot: #'sandbox/mixer

7:41 justin_smith: ,(mixer [:a :b :c :d] [1 2 3 4 5])

7:41 clojurebot: (:a 1 :b 2 :c ...)

7:41 Seylerius: Oh goodness.

7:42 justin_smith: much better! don't even need reduce

7:42 ,(def mixer (partial mapcat vector))

7:42 clojurebot: #'sandbox/mixer

7:42 Seylerius: mapcat. fscking mapcat...

7:42 Wait... partial?

7:42 justin_smith: ,(mixer [:a :b :c] [1 2 3] '(l m n o p))

7:42 clojurebot: (:a 1 l :b 2 ...)

7:42 justin_smith: partial makes it varargs :)

7:42 Seylerius: I gathered that.

7:43 I'm looking that up on the cheatsheet now for the w1n it's apparently made of.

7:43 Empperi: partial creates a new function where it already has n parameters given

7:43 thus that would turn to: (mapcat vector <rest of the parameters here>)

7:44 justin_smith: Seylerius: still blows my mind that your loop can be redefined to three functions in one sexp :)

7:45 Seylerius: That makes two of us.

7:45 justin_smith: hopefully you followed along - tried to do it step by step

7:45 clgv: is there a best practice tutorial for tagged literals and data readers somewhere?

7:48 Seylerius: Indeed.

7:55 I officially love partial.

7:55 It's made of win.

7:56 justin_smith: Seylerius: yeah, I'm a fan

7:56 AeroNotix: my only gripe is that it's quite a long name, so sometimes using #(...) is shorter anyway

7:58 ordnungswidrig: AeroNotix: ,(def ∂ partial)

7:58 clgv: AeroNotix: but `partial` documents the intent better ;)

7:59 ordnungswidrig: ,(def ∂ partial)

7:59 clojurebot: #'sandbox/∂

7:59 ordnungswidrig: .((∂ + 2) 4)

7:59 ,((∂ + 2) 4)

7:59 clojurebot: 6

8:01 AeroNotix: clgv: the first time you read it, yeah

8:01 ordnungswidrig: but that's not widely used, partial is its name.

8:01 ordnungswidrig: AeroNotix: sure, but you were complaining about the length of the name :-)

8:02 clgv: AeroNotix: I meant the intent of the dev using partial. #(...) (fn ...) could be anthing - with `partial` you know, it is just that first function plus some fixed params. so you can skip to that function immediately to read up what it does

8:02 AeroNotix: I am yeah

8:02 Seylerius: ordnungswidrig: What greek letter was that?

8:02 AeroNotix: it's a trivial thing

8:03 clgv: Seylerius: delta

8:03 ordnungswidrig: Seylerius: not greek a curly d.

8:03 http://www.fileformat.info/info/unicode/char/2202/index.htm

8:03 clgv: looks like a delta ;)

8:04 ordnungswidrig: ∂ vs. ∂

8:04 clgv: ordnungswidrig: with that context it is a different styled delta ;)

8:05 ordnungswidrig: well, YMMV. The uppercasing behaviour of that codepoints is different

8:05 (I guess)

8:06 Seylerius: ,(defn poser [a coll] (mapcat vector coll (repeat a)))

8:06 clojurebot: #'sandbox/poser

8:06 Seylerius: ,(poser 0 [1 2 3])

8:06 clojurebot: (1 0 2 0 3 ...)

8:07 Seylerius: Ah

8:07 michaelr`: err

8:08 What would be a good way to use react.js components from om?

8:08 more specifically with sablono, if possible

8:09 Seylerius: ,(defn poser [a coll] (butlast (mapcat vector coll (repeat a))))

8:09 clojurebot: #'sandbox/poser

8:09 Seylerius: ,(poser 0 [1 2 3])

8:09 clojurebot: (1 0 2 0 3)

8:10 michaelr`: yeah, with sablono - how to use react components with sablono?

8:15 edbond: michaelr`, sounds like a question for #clojurescript

8:16 michaelr`, sounds like a question for #clojurescript room

8:16 AeroNotix: is there an echo in here

8:16 is there an echo in here

8:16 michaelr`: what?

8:16 what?

8:16 clojurebot: what is this

8:16 what is cells

8:17 AeroNotix: haha

8:17 edbond: haha

8:17 slipset: re partial, I know emacs, and I think Intellij can use different glyphs for partial, fn et al

8:18 AeroNotix: slipset: heathen

8:19 slipset: https://github.com/hackscience/purty-mode

8:19 michaelr`: edbond: thanks, I think that I got the answer..

8:19 slipset: I think I've seen tbaldridge use the lambda glyph for anonymous functions

8:20 tbaldridge: slipset: yep, it's from Emacs Live

8:21 slipset: and jay fields http://blog.jayfields.com/2013/05/emacs-lisp-font-lock-for-clojures.html

8:22 and he found that in emacs-live it seems

8:42 elvis4526: How do you bind a function to a js symbol in cljs ?

8:42 (def $scope.submit (fn [])) ain't doing it. :-(

8:43 edbond: elvis4526, there is a #clojurescript room for cljs questions

8:44 elvis4526: ty

8:44 lewis1711: so what's the deal with using java8 libs from clojure? looking to use one that makes use of lambdas a lot

8:50 thheller: lewis1711: lamdas are basically just syntax sugar, so it just works.

9:02 brianwr: Hi, having a problem recurrent problem with clojurescript/reagent/re-frame compiling error: sometimes i get i error like: "referred var ... does not exist at line ..." I know that is an error somewhere, but i am unable to find the origin of it using the stack trace. Any tips?

9:06 Oh, forgot to mention that im using figwheel too ;)

9:21 Beamed: [i0jefqo'efqipj'rvjip

9:21 sorry, cat

9:25 danlentz: i wonder why there is not more buzz about dunaj. I havent spent time to study in detail, but some of the ideas sound very good to me.

9:29 arrdem: I agree that a bunch of the ideas sound good, but I don't think anyone has really had time to try it out yet.

9:29 danlentz: yeah

9:29 its overwhelming

9:30 arrdem: agreed.

9:30 danlentz: but there are only 4 people in the #dunaj group right now

9:30 somehow that does not seem appropriate level of interest

9:30 and one of them is me and the other is the author

9:30 arrdem: I mean... #oxlang is just me and cemerick

9:31 just kinda comes with being a fork / blue sky projec.t

9:32 tbaldridge: the fork bit is probably the hardest, mostly because you have to compete in the same space

9:32 arrdem: Right. I think the one sales pitch which dunaj has failed to explicitly make so far is that it is a _drop in replacement_ for Clojure built on top of Clojure that you can try out now.

9:33 danlentz: it is indeed unclear

9:33 arrdem: which is just a bandaid over the fact that grats, you're now competing with Core.

9:33 danlentz: i kindof see it as a proving ground for new ideas rather than a replacement

9:34 arrdem: agreed, but being a proving ground implies more than just experimental use IMO

9:34 cemerick: arrdem: s/fork//

9:34 danlentz: he said he hasnt gotten any feedback at all from cognitect

9:35 arrdem: cemerick: I'd merge it

9:35 cemerick: oh, but tbaldridge said this already basically

9:35 arrdem: what, dunaj?

9:35 arrdem: cemerick: your sed

9:35 cemerick: heh

9:36 there's plenty of room for more languages, but not for alt-clojures

9:36 tbaldridge: So duanj reminds me a ton of a fork of Blender3D that happened like 12 years ago. Some guy needed a bunch of features, so he forked it and worked on his own for quite some time.

9:37 puredanger: danlentz: there's interesting things in dunaj, but it's just so much stuff all together that I can't even pick out something to critique

9:37 tbaldridge: Problem was, when he was done 90% of his features were so different from master that it could never be merged, everything had changed. Forks and then remerging can never work IMO.

9:38 arrdem: agreed. I did the lib-clojure refactor a while back, and when I got it working I realized that I'd created a bunch of unmergable patches.

9:39 puredanger: there is also the issue that it is just a pile of solutions without the consideration of what the source problems or alternative solutions are

9:43 sobel: so, if i have a little clojure to deploy to an existing app that doesn't already have clojure, what's really involved, besides the clojure runtime and non-clojure deps like the oracle jar it needs

9:44 same question, command-line operation.

9:44 dstockton: quite an open question sobel

9:45 michaelr`: sobel: on thing is build integration, with the maven plugin maybe if it's a maven project

9:45 AeroNotix: sobel: I just did something similar with an Java application

9:45 I just had the Java developers use an Uberjar and put that into the project

9:45 sobel: the java app is already mavenized

9:45 noncom: i am setting up a nrepl server on macos, but i cannot conenct to it. telnet seems to do fine, but lighttable or counterclockwise don't.. any ideas?

9:45 AeroNotix: you would just put the clojuer code as a mvn dep then

9:45 noncom: (there are no firewalls on)

9:46 dnolen: for people looking for a simple Emacs ClojureScript setup, 0.0-3165 now works a charm with inf-clojure

9:46 sobel: so, publish my clojar to the internal mvn repo, add it as a dep to the app?

9:46 dnolen: https://github.com/clojure/clojurescript/wiki/Emacs-%26-Inferior-Clojure-Interaction-Mode

9:52 clgv: sobel: it might help integration if you provide a java facade for the common interop calls

9:52 (interop between the java app and you clojure lib, is meant ;) )

9:53 sobel: will i have to add clojure runtime as a dep to the java app, or can that get bundled?

9:54 clgv: pretty sure i'll need to do that

9:54 clgv: sobel: it istransitively pulled in because of your clojurelib

9:55 sobel: clgv: aha. thanks.

9:56 clgv: sobel: you'll need that offcicial API http://clojure.github.io/clojure/javadoc/

9:57 AeroNotix: sobel: I just did a really heavy amount of java interop to do exactly this

9:57 provide a clojure library that looks and smells like java

9:57 there's quite a bit which is undocumented, or documented poorly.

9:58 sobel: AeroNotix: i'm convinced. the interop surface is extremely narrow, fortunately.

9:58 AeroNotix: cool

9:58 clgv: AeroNotix: are there gundogs sniffing your libs? ;)

9:58 AeroNotix: clgv: what

9:58 sobel: clgv: that will get pulled in transitively, right?

9:58 AeroNotix: the only thing you can't do is create Enums in Clojure, or at least I couldn't figure out how

9:58 clgv: sobel: it is part of clojure since at least 1.6 (maybe 1.5?)

9:58 sobel: clgv: or..oh, you meant i'll need those docs, gotcha

9:58 AeroNotix: but you can do literally everything else as far as I know

9:59 sobel: i can live without enums.

10:00 lewis1711: what do you do with enums in a dynamically typed language?

10:00 AeroNotix: lewis1711: provide java with a nice API

10:01 I just use :java-source-paths in lein

10:01 lewis1711: I always just end up assigning symbols to variables, so I don't make mistakes through typos

10:01 AeroNotix: with an enum

10:01 sobel: if the java api becomes that classy, i'll just straight-up write it in java

10:01 lewis1711: ah, fair call

10:01 clgv: AeroNotix: they could be translated to namespaced keywords at the java facade, if the requirements permit

10:01 AeroNotix: clgv: no need for a java facade

10:01 you can write the majority nicely in just pure clojuer

10:01 with gen-class and gen-interface

10:01 along if you really want, a java Enum file.

10:02 clgv: depends on the java side requirements whether the facade is a good idea ;)

10:02 gen-class is usually not what I want to use ...

10:02 AeroNotix: I've had good experiences with it.

10:03 pure-Clojure library, gen-class'd facade code. ezpz

10:03 no java needed

10:03 but the java friends get a library that looks and feels like java

10:03 all the IDE goodies as well.

10:03 sobel: AeroNotix: that is my preference, unless i _have_ to provide Enums

10:03 which..i can't imagine, but whatever

10:03 i'll write enum-gen if it comes to that :)

10:03 AeroNotix: writing an enum in java and the rest in clojure is ez too. You just use :java-source-paths and match up the package names you used in gen-class to make it look nice.

10:04 clgv: AeroNotix: there are plenty of gen-class scenarios that are faster implemented by using java ;)

10:04 and better...

10:04 AeroNotix: quantify better

10:05 faster, perhaps, if you're not familiar with the esoterics in gen-class.

10:05 clgv: so you'll have to judge on per case basis.

10:05 sobel: i'll be back when i can't make class-gen work :)

10:05 gen-class, too

10:05 AeroNotix: cool.

10:06 sobel: thx for the consult. this org needs a healthy introductory clojure experience.

10:10 elvis4526: with java jdbc, how do I know construct the db-spec for postgresql ?

10:10 I'm not sure what I'm suppose to put as :classname

10:11 I have postgresql/postgresql pulled in with lein

10:19 om: elvis4526: :subprotocol "postgresql" should be enough

10:20 java.jdbc shall get the classname for you

10:20 elvis4526: om: awesome, thanks!

10:21 brianwr: I having a problem recurrent problem with clojurescript/reagent/re-frame/figwheel enviroment. Sometimes i get a compile error like: "referred var ... does not exist at line ..." I know that is an error somewhere, but i am unable to find the origin of it using the stack trace. Any tips on debugging this?

10:24 om: elvis4526: you're welcome (by the way, it should be org.postgresql.Driver, if you ever need it)

10:32 danlentz: there are worse things than piles of solutions

10:32 :)

10:45 ppppaul: anyone have experience using onyx and have any opinions on it?

10:48 clgv: ppppaul: what is your parallelization scenario?

10:56 timvisher: how do i reload my project.clj file without restarting my repl?

10:58 clgv: timvisher: because of new dependencies?

10:59 timvisher: there at least two libs to add dependencies on the fly

11:01 danlentz: look at vinyasa

11:01 https://github.com/zcaudate/vinyasa

11:04 clgv: right, that was one of them

11:13 danlentz: timvisher: this looks interesting also http://palletops.com/alembic-clojure-classpath-control/

11:13 timvisher: thanks!

11:17 justin_smith: alembic.still/load-project simply adds any deps that are in your project.clj but have not been loaded by the vm yet

11:19 alejandrozf: Hi all! how I could get "full" leiningen for "transporting" to an offline machine?

11:20 wink: alejandrozf: it shouldn't be more than the bat/sh called 'lein' and one corresponding jar in the correct path, i.e. under ~/.lein/

11:21 alejandrozf: wink: both are on github page?

11:22 wink: alejandrozf: you could just grab the lein.sh, do an install and then copy the jar from .lein/self-installs

11:22 it probably IS somewhere there as well, yeah

11:22 alejandrozf: wink: ohh thanks :)!

11:23 wink: the shell script is not hugely complicated, if you take a peek

11:23 if it can't find the jar, it will download it

11:23 and I think you only need to copy those 2 files and you're set

11:23 alejandrozf: wink: got it! I will take look too!

11:26 danlentz: this githib ddos attack certainly is lasting a while

11:27 chouser: thanks, china

Logging service provided by n01se.net