#clojure log - Oct 01 2014

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

0:37 joshuafcole: Are there any good tools for hunting down memory leaks in clojure? I'm interfacing with libgdx via play-clj

0:38 I'm ~80% certain that the problem is I'm spinning up a shape renderer each frame (part of an experimental mess). A refactor is planned, but I want to learn how to find the problem when it's less obvious

0:39 interestingly, trying to call dispose on the shape renderer when I'm done with it throws an exception, hence the other 20%

0:42 amalloy: joshuafcole: i've gotta go, but see: jmap for heap dumps (comes with the jdk), or yourkit for profiling

0:42 joshuafcole: Sure, I'll take a look. Thanks!

0:49 vIkSiT: hello all

0:50 danielcompton: joshuafcole: jvisualvm (also with jdk) might be helpful for profiling

0:50 vIkSiT: if I have a collection c [1 2 3 4 5] - and I want to transform it such that only every alternate element is transformed

0:50 how would I do it?

0:50 joshuafcole: first way that comes to my (novice) mind is

0:50 danielcompton: vIkSiT: partition by 2, then operate on the first element only?

0:51 vIkSiT: eg, I want to add 1 to every alternate number

0:51 danielcompton, hmm - thats a good option. would it work for a stream?

0:51 danielcompton: vIkSiT: it works on sequences, is that what you mean?

0:52 vIkSiT: danielcompton, ah. true

1:01 hmm

1:01 I guess that doesn't work

1:01 what I really want is the following:

1:02 (def a [1 2 3 4 5])

1:02 (transform a)

1:02 => [1 "2" 3 "4" 5]

1:02 assuming the function I'm applying is str

1:02 (transform a str)

1:09 sm0ke: ,(map-indexed (fn [x y] (if (odd? x) (str y) y)) [1 2 3 4])

1:09 clojurebot: (1 "2" 3 "4")

1:09 sm0ke: ,(map-indexed (fn [x y] (if (odd? x) (str y) y)) [1 2 3 4 5])

1:09 clojurebot: (1 "2" 3 "4" 5)

1:10 sm0ke: ,(defn transform [f c] #(map-indexed (fn [x y] (if (odd? x) (f y) y)) c))

1:10 clojurebot: #'sandbox/transform

1:11 sm0ke: ,(transform str [1 2 3 4 5])

1:11 clojurebot: #<sandbox$transform$fn__77 sandbox$transform$fn__77@1fb8a15>

1:11 sm0ke: lolwut

1:11 ugh

1:11 TEttinger: you have transform defined as returning a fn

1:11 sm0ke: ,(defn transform [f c] (map-indexed (fn [x y] (if (odd? x) (f y) y)) c))

1:11 clojurebot: #'sandbox/transform

1:11 sm0ke: ,(transform str [1 2 3 4 5])

1:11 clojurebot: (1 "2" 3 "4" 5)

1:12 TEttinger: map-indexed is a weird one.

1:12 sm0ke: yep

1:12 bbloom: no

1:12 (doc map-indexed)

1:12 clojurebot: "([f coll]); Returns a lazy sequence consisting of the result of applying f to 0 and the first item of coll, followed by applying f to 1 and the second item in coll, etc, until coll is exhausted. Thus function f should accept 2 arguments, index and item."

1:13 TEttinger: ,(defn transform' [f &colls] (map (fn [idx &args] (if (odd? idx) (f args) args)) (range) colls))

1:13 clojurebot: #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: args in this context, compiling:(NO_SOURCE_PATH:0:0)>

1:13 TEttinger: ,(defn transform' [f &colls] (map (fn [idx & args] (if (odd? idx) (f args) args)) (range) colls))

1:13 clojurebot: #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: colls in this context, compiling:(NO_SOURCE_PATH:0:0)>

1:13 TEttinger: ,(defn transform' [f & colls] (map (fn [idx & args] (if (odd? idx) (f args) args)) (range) colls))

1:13 clojurebot: #'sandbox/transform'

1:14 TEttinger: ,(transform' + [1 2 3] [10 20 30])

1:14 clojurebot: #<ClassCastException java.lang.ClassCastException: Cannot cast clojure.lang.ArraySeq to java.lang.Number>

1:14 TEttinger: oh

1:14 ,(defn transform' [f & colls] (map (fn [idx & args] (if (odd? idx) (apply f args) args)) (range) colls))

1:14 clojurebot: #'sandbox/transform'

1:14 TEttinger: ,(transform' + [1 2 3] [10 20 30])

1:14 clojurebot: #<ClassCastException java.lang.ClassCastException: Cannot cast clojure.lang.PersistentVector to java.lang.Number>

1:14 TEttinger: gah

1:15 sm0ke: humm you may want to zip them

1:15 TEttinger: ,(defn transform' [f & colls] (apply map (fn [idx & args] (if (odd? idx) (apply f args) args)) (range) colls))

1:15 clojurebot: #'sandbox/transform'

1:15 TEttinger: ,(transform' + [1 2 3] [10 20 30])

1:15 clojurebot: ((1 10) 22 (3 30))

1:15 TEttinger: wat

1:15 sm0ke: lol

1:15 TEttinger: oh good

1:16 that is actually correct

1:17 ,(transform' str ["a" "b" "c" "d" "e"] [1 2 3 4 5])

1:17 clojurebot: (("a" 1) "b2" ("c" 3) "d4" ("e" 5))

1:17 sm0ke: wth is up with the list

1:17 TEttinger: it checks that the index is odd

1:17 if not, it returns the items from the colls at that index

1:18 sm0ke: yes but it doesnt apply the function

1:18 TEttinger: if yes, it applies f to both, and returns that

1:18 sm0ke: ,(defn transformz [f & colls] (apply map (fn [idx & args] (if (odd? idx) (apply f args) args)) (range) colls))

1:18 clojurebot: #'sandbox/transformz

1:18 sm0ke: ,(transformz + [1 2 3] [4 5 6])

1:18 clojurebot: ((1 4) 7 (3 6))

1:18 TEttinger: yup

1:18 sm0ke: why isnt it (5 7 9)!

1:19 TEttinger: remember, it's treating (if (odd? idx)) differently

1:19 sm0ke: oh you had a apply before map

1:19 hurm

1:19 TEttinger: ,(defn transform-all [f & colls] (apply map (fn [idx & args] (apply f args)) (range) colls))

1:19 clojurebot: #'sandbox/transform-all

1:20 TEttinger: ,(transform-all str ["a" "b" "c" "d" "e"] [1 2 3 4 5])

1:20 clojurebot: ("a1" "b2" "c3" "d4" "e5")

1:20 TEttinger: same as

1:20 ,(map str ["a" "b" "c" "d" "e"] [1 2 3 4 5])

1:20 clojurebot: ("a1" "b2" "c3" "d4" "e5")

1:21 sm0ke: yes i know that

1:21 but i am not able to spot why the function is not being applied

1:21 ,(transformz + [1 2 3] [4 5 6])

1:21 clojurebot: #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: transformz in this context, compiling:(NO_SOURCE_PATH:0:0)>

1:21 sm0ke: (apply f args) why is it giving a list

1:22 oh i get it

1:23 TEttinger: yep, it gives a list in the else case

1:23 sm0ke: its those who are not being applied

1:23 TEttinger: who told you to write such a weird function

1:24 that was a weird one

1:25 ,(range)

1:25 clojurebot: (0 1 2 3 4 ...)

2:15 blur3d: I’ve been struggling with some fairly simple clojurescipt/javascript interop. Bascially, I call a native javascript function, which returns a javascript array - however, I am having trouble using that array in the clojurescript code. The error I am getting is [object Object], [object Object], [object Object] is not iSeqable. The problem is that is it an array, and I think there might be a nodejs bug.

2:16 I’ve tried casting it to an array also, but that didn’t seem to help

2:17 (println (first #js [1 2 3])) works as expected - it returns 1

2:17 however, (println (first ports)) - where ports is an array (confirmed in webkit console), it gives the iSeqable error

2:18 **correction it prints ‘1’… returns nil.

2:20 http://imgur.com/Ctf5K45 is an image of the webkit console. It dumps the ports value (using (.dir js/console ports), which shows it is an array

2:29 dbasch: javascript arrays are not seqable, you need to convert it to clojurescript

2:32 blur3d: I’m thinking it is related to http://dev.clojure.org/jira/browse/CLJS-842

2:33 dbasch: if javascript arrays are not seqable, why does (first #js [1 2 3]) work? I’m fairly sure clojurescript has a protocol that handles the conversion now

2:42 dbasch: try (implements? ISeqable #js [1 2 3])

2:43 and

2:43 (implements? ISeqable (js->clj #js [1 2 3]))

2:45 blur3d: false, and true respectively. So you’re right

3:15 wei: is there a shortcut for (let [x …] (do-something-with! x) x)

3:21 amalloy: (doto x (do-something-with!))

3:21 &(doc doto)

3:21 lazybot: ⇒ "Macro ([x & forms]); Evaluates x then calls all of the methods and functions with the value of x supplied at the front of the given arguments. The forms are evaluated in order. Returns x. (doto (new java.util.HashMap) (.put \"a\" 1) (.put \"b\" 2))"

3:22 magopian: &(doto 1 inc)

3:22 lazybot: ⇒ 1

3:22 magopian: obviously ;)

3:22 &(doto 1 str)

3:22 lazybot: ⇒ 1

3:23 amalloy: &(doto 1 println)

3:23 lazybot: ⇒ 1 1

3:23 magopian: thanks ;)

3:23 i was thinking about something with side effect, was thinking a bit too much :)

3:23 (it's still "early" here in the morning... and yes, that's my only lame excuse :)

3:29 wei: sweet, thanks amalloy

3:42 iamcyberbird: hmm any way i can get rid of the curly f function symbol and use a lambda symbol instead?

3:42 more of an emacs question but i'm sure someone knows here

3:44 pellis: hi all. i'm trying to figure out how https://clojurecup.com was made - what javascript framework was used in addition to React (hoping authors sit in this chan)

3:44 anyone have an idea?

3:45 Rhainur: pellis: probably Om?

3:46 pellis: given that React covers the UI concerns, does Om also cover the architecture concerns? i.e. a general structure of an app?

3:46 for example, routing and event propagation?

3:47 Rhainur: oh no I meant Om is ClojureScript's interface to React

3:47 https://github.com/swannodette/om

3:49 pellis: Rhainur: ah, i see!

3:50 Rhainur: well, I think i bumped into Om somewhere - just this site brought up question such as what about routing, servers, events and such

3:51 ddellacosta_: pellis: Om is really only the "view" in MVC...sort of. More to the point, many architectures are possible with Om.

3:52 pellis: event propagation is handled by React, but routing is not. Many folks using Om use Secretary to handle client-side routing: https://github.com/gf3/secretary

3:58 wei: design question. I’m using redis/carmine to put some computation jobs on a queue. after a computation is finished, the owner of the job needs to be notified of the answer. what’s a good way to do this? (another queue?)

4:01 ucb_: hi all, where am I going wrong: https://gist.github.com/3e7814d9a56a2c5139ed ?

4:05 oh, I know, heh

4:11 oh, am I stuck with signed bytes in clojure by any chance?

4:14 bah, ignore me again

4:16 TEttinger: ucb_: there's at the very least ztellman's byte handling lib

4:17 rritoch: ucb_: It is a java limitation, you can upgrade to byte if you need to hold 8 bits without dealing with the sign, but you'll need alot of (bit-and 255 x) if your doing cryptography

4:17 ucb_: TEttinger: yeah, I'm using bytebuffer (the lib), but I was being silly with all my questions. I don't need to do any interpretation of the bytes as it were. Thanks though!

4:17 rritoch: yeah, and fortunately I am not doing crypto because I clearly don't understand all this stuff very well ^_^

4:17 rritoch: err, upgrade to int

4:18 mmeixner: Newbie question: is there an idiomatic difference between "apply + " and "reduce + " ?

4:20 pyrtsa: mmeixner: For variadic functions like +, it's probably best to use apply because it lets the function short-circuit (and not evaluate all the arguments) when it matters. Not that + would short-circuit but still.

4:20 mmeixner: I see, so this is an implementation detail somehow

4:20 thanx

4:21 TEttinger: it is important to understand the difference between apply and reduce though

4:21 mmeixner: ah ...

4:21 ucb_: mmeixner: not just, consider the gymnastics you'd have to do if you wanted to apply conj for instance

4:21 pyrtsa: mmeixner: The difference is: with apply, the function + immediately sees that it's called with a sequence of arguments. With reduce, the function always gets called with 2 arguments.

4:21 ucb_: the trouble with apply and conj is that not all parameters to conj are of the same type

4:22 pyrtsa: ucb_: Neither necessarily with reduce when you pass the init argument: (reduce f init xs)

4:23 mmeixner: I see - some REPLing necessary to work this out ...

4:23 ucb_: pyrtsa: indeed, but with apply you'd have to conj/cons the initial collection (or nil) to the collection of items you want to cons, right?

4:23 pyrtsa: ucb_: You can say (apply conj coll xs)

4:24 ucb_: oh, you can do that indeed!


4:24 pyrtsa: And again, the difference is that conj immediately sees that there are many things (i.e. xs), not just one (x).

4:24 ucb_: sure

4:25 pyrtsa: Indeed, (conj (conj (conj coll a) b) c) has a very different performance from (apply conj coll xs).

4:25 (...As far as I remember.)

4:25 ucb_: it should, right?

4:26 pyrtsa: I think it should use transients behind the scenes. At least it could.

4:26 mange: pyrtsa: A great example of the performance difference is with (apply str ...) vs (reduce str ...), I think.

4:27 pyrtsa: mange: Great. That's a good one.

4:27 mmeixner: I just found this: "+ is itself implemented in terms of reduce for the variable-arity case (more than 2 arguments). "

4:27 http://stackoverflow.com/questions/3153396/clojure-reduce-vs-apply

4:29 thanks for all input! time to think ...

4:42 rritoch: ucb_: if you need something simple, here's an ugly hack to do your byte conversion which handles the sign bit for you (-> 0x98 str javax.xml.bind.DatatypeConverter/parseByte)

4:52 TEttinger: ,(-> 0x98 str javax.xml.bind.DatatypeConverter/parseByte)

4:52 clojurebot: -104

4:52 TEttinger: ,0x98

4:52 clojurebot: 152

4:54 TEttinger: ,(bit-and 0x98 -2r1111111)

4:54 clojurebot: 128

4:54 TEttinger: hm

4:54 ,(bit-and 0x98 2r1111111)

4:54 clojurebot: 24

4:57 CookedGryphon: Does anyone know if transit needs all its dependencies in all situations? I'd like to use it, but I'm on android and it adds ~14k method references with its dependencies when my total limit is 64k

4:57 Ideally I'd proguard things out, but I want to be able to use it from the repl

4:59 TEttinger: ,(+ (bit-and 0x98 127) (* -1 (bit-and 0x98 128)))

4:59 clojurebot: -104

4:59 TEttinger: rritoch, should be... a bit faster

5:00 ,[(+ (bit-and 0xf8 127) (* -1 (bit-and 0xf8 128))) (-> 0xf8 str javax.xml.bind.DatatypeConverter/parseByte)]

5:00 clojurebot: [-8 -8]

5:00 clgv: TEttinger: proof by criterium? ;)

5:00 TEttinger: ,[(+ (bit-and 0x18 127) (* -1 (bit-and 0x18 128))) (-> 0x18 str javax.xml.bind.DatatypeConverter/parseByte)]

5:00 clojurebot: [24 24]

5:01 TEttinger: it's simple bit twiddling. it isolates the least significant 7 bits, and subtracts 128 if there's a value in the sign bit place (eighth bit, 128)

5:04 ,[(- (bit-and 0x18 127) (bit-and 0x18 128)) (-> 0x18 str javax.xml.bind.DatatypeConverter/parseByte)]

5:04 clojurebot: [24 24]

5:04 clgv: no, I mean the supposed performance improvement ;)

5:04 TEttinger: oh haha

5:04 ya think?

5:05 clgv: on the jvm I only believe in performance improvements backed up by benchmark numbers ,)

5:05 rritoch: TEttinger: The version I provided was simply for readability, there are much faster ways, the fastest being to just use (byte -104), it will really depend on the implementation as to what method is best.

5:06 TEttinger: ,(time (map #(- (bit-and % 127) (bit-and % 128)) (range 255)))

5:06 clojurebot: "Elapsed time: 0.136753 msecs"\n(0 1 2 3 4 ...)

5:06 TEttinger: ,(time (map # (-> % str javax.xml.bind.DatatypeConverter/parseByte) (range 255)))

5:06 clojurebot: #<RuntimeException java.lang.RuntimeException: Reader tag must be a symbol>

5:06 TEttinger: ,(time (map #(-> % str javax.xml.bind.DatatypeConverter/parseByte) (range 255)))

5:06 clojurebot: "Elapsed time: 0.121739 msecs"\n(0 1 2 3 4 ...)

5:06 TEttinger: waaaaat

5:06 jit.

5:07 rritoch: TEttinger: His problem though is to create a byte, neither of your codes create a byte

5:07 TEttinger: ,(time (map #(byte (- (bit-and % 127) (bit-and % 128))) (range 255)))

5:07 clojurebot: "Elapsed time: 0.143679 msecs"\n(0 1 2 3 4 ...)

5:08 TEttinger: I don't get you, hotspot jit

5:09 rritoch: TEttinger: I get it, duped by clojure's slowness, the DatatypeConverter library may be coded in binary (assembled) so it gets an unfair speed advantage.

5:09 TEttinger: ah

5:09 so if mine was AOTed it would be better

5:09 (than it is now)

5:10 clgv: TEttinger: you definitely need to use cirterium (or similar) for these measurements

5:11 and using lazy functions wont help either ;)

5:11 TEttinger: well they're both using map

5:12 clgv: yeah but (map ..) gets evaluated when printing so not within (time ...)

5:13 you measured the construction of the lazy-seq not its realization which you wanted to

5:13 (quick-bench (mapv #(- (bit-and % 127) (bit-and % 128)) (range 255))) => Execution time mean : 11.765617 µs

5:13 (quick-bench (mapv #(-> % str javax.xml.bind.DatatypeConverter/parseByte) (range 255))) => Execution time mean : 18.155778 µs

5:13 TEttinger: gah

5:14 well that's promising

5:14 clgv: you could rerun the above with `bench` to be more accurate

5:16 I have used criterium a lot lately

5:27 vanila: hi!

5:27 How does the clojure compiler work?

5:29 noidi: pretty well, thanks for asking

5:29 vanila: haha

5:29 noidi: but seriously, that's too broad a question to be answered in any meaningful way

5:30 rritoch: TEttinger: Ok, well speed wise I think this should be the fastest (.byteValue 0x98)

5:31 danielcompton: I benchmarked the bit functions with criterium, what happened next will surprise you...

5:31 rritoch: Honestly, I didn't even know Long had a byteValue method...

5:32 TEttinger: haha good point

5:33 vanila, I think it's a little atypical of lisp implementations, since it compiles to jvm .class files on-the-fly or ahead-of-time as requested.

5:34 vanila: interesting!

5:34 TEttinger: almost everything gets its own .class file, like each fn

5:35 I don't know how it assembles the .class files other than "it's complicated and don't touch it"

5:36 you can go through clojure's source on github, but it's pretty big

5:36 cfleming: And pretty ugly the first time you see it.

5:36 The compiler, that is.

5:37 TEttinger: a lot of it is in https://github.com/clojure/clojure/tree/master/src/jvm/clojure/asm

5:37 CookedGryphon: cfleming: I don't know about that. I couldn't imagine being able to go and confidently make changes to the compiler of any other language I've used, but with Clojure I can look at the source and understand most of what's going on

5:37 TEttinger: then there's this 8563-line file, https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Compiler.java

5:38 danielcompton: https://www.refheap.com/91008

5:38 TEttinger: not a lot in it between them

5:38 though I do realise they're not all doing the same thing

5:39 cfleming: CookedGryphon: I've read a few compilers but I find the Clojure one pretty difficult to read. You're right that it's pretty concise for a production language though.

5:39 TEttinger: danielcompton, why does the last one not show criterium bench stuff?

5:39 cfleming: CookedGryphon: I like the Clojurescript compiler source a lot.

5:42 vanila: What compiler might I be better to read?

5:42 TEttinger: vanila, it might be good to start with some small ones in the compile-to-JS area

5:42 what are you familiar with now, vanila? https://github.com/jashkenas/coffeescript/wiki/List-of-languages-that-compile-to-JS

5:43 vanila: thanks! I'll look at some of these

5:46 TEttinger: wat is a nice tiny core of a language that may be a good starting point. not compiled though. https://github.com/manuel/wat-js

5:47 the cola stuff is apparently fascinating to compiler buffs http://www.piumarta.com/software/cola/

5:48 vanila: these links are great cheers!

5:48 rritoch: vanilla why are you digging into the clojure compiler? If your not familiar with compiler design it may take you years. I've watched some of the MIT course on the subject (https://www.youtube.com/watch?v=k-bpyDgBxAo&list=PL0300FE43396456C1&index=1) but it put me to sleep after a few classes since most of it I'm already famliar with.

5:49 TEttinger: http://www.piumarta.com/software/maru/ is another tiny compiler in C, this one looks quite interesting but I have no idea how cross-platform it is

5:55 vanila, I would strongly consider the translator rather than compiler route, like clojurescript does (translates to js, then use a compiler like google closure to make it optimized)

5:56 ki is another apparently very small model that uses clojurescript

5:57 http://ki-lang.org/

5:58 amano-:

5:58 TEttinger: this is basically the whole thing https://github.com/lantiga/ki/blob/master/src/ki.sjs

5:58 it macroexpands to javascript, which is extremely clever

5:59 vanila: wow!

5:59 That is really nifty

6:06 rritoch: TEttinger, are you aware of a clojure form -> C "translator"? One of my clients requested I compile clojure forms to C for use with OpenCL but the project is far beyond the complexity I'm willing to swallow.

6:06 TEttinger: yes, there's a clojurec out there.

6:06 rritoch: Cool, I'll have to check it out

6:06 TEttinger: https://github.com/schani/clojurec

6:08 bertfrees' fork seems slightly further along, rritoch https://github.com/bertfrees/clojurec

6:09 oh, and there is opencl support in java, shouldn't be too hard to use if you have a JVM handy

6:09 https://github.com/ztellman/calx

6:09 oh mr. tellman, is there anything your libs don't do?

6:09 (be slow, I guess)

6:11 rritoch: TEttinger, this is the project so far, it's been sleeping for awhile https://github.com/rritoch/WarpCTL, I used JOCL for the OpenCL support..

6:13 I lost interest in the project after trying to grab Cuda GPU temperatures using swig, most Cuda libraries are very platform dependent, I had some luck with NVML, but that's as far as I got on the project.

6:14 TEttinger: cuda itself won't even run on AMD or intel graphics, so there's a limit right off the bat..

6:15 rritoch: The library itself uses OpenCL, but for temperatures you need to directly access the device drivers. For AMD it was the ADL-SDK which was fairly easy

6:17 But for Cuda I tried multiple libraries, most won't compile on linux, but the NVML library seems to work, at least on windows, I don't have a Linux+NVidia system to test on.

6:17 TEttinger: yeah sounds nasty

6:18 rritoch: Well, my linux box has 2X280X R9's crossfired, without accurate temperature controls they'll burn themselves to death in a short time.

6:19 I'm just assuming similar thermal problems with NVidia high-end GPU's

6:20 Either way, if I can find the way to translate forms to C and inject them into OpenCL that would be awesome. Right now I just make task-specific, hard-coded, kernels.

6:21 That clojurec project looks promising though, if I can find my way through to the parts that can convert forms to C

6:24 aztak: any suggestions for how to make this more dry and clojuresque? :) https://gist.github.com/metamorph/754c59eba4186c6c4981 (I'm adding a :winner entry to a map depending on existing entries in the map)

6:27 noncom: how do i select the s-expression where the cursor is currently, in emacs/prelude ?

6:27 clgv: did ClojureC progress lately? is it usable at all for non-trivial clojure functions?

6:28 TEttinger: clgv, it has not progressed lately

6:28 noncom: same as alt + shift + up in ccw

6:28 clgv: TEttinger: so probably pretty dead...

6:29 TEttinger: I'd think calx would be the way to go, but I think the client requirements may be different than what it provides

6:31 clgv: TEttinger: but calx is like embedded assembler in c/c++ ;)

6:41 pellis: ddellacosta_: thanks for the secretary tip. is there a listing of typical clojurescript frontend stack?

6:42 ddellacosta_: pellis: I don't know if there is a typical front-end stack, actually! plenty of folks using reagent along with Om, not to mention server-side rendered stuff w/enlive, etc...

6:43 pellis: take a look at the Om readme for Om-related stack stuff, at least...

6:43 pellis: ah, thanks

6:49 borkdude: I am the only one who wants to turn a C-x-f action into a dired buffer half way through cd-ing a path?

6:50 if not, how do the others do it?

6:54 just C-d does it - yes!

7:11 clgv: borkdude: I did only hear spanish ;)

7:12 vijaykiran: hey - that's emacsish

7:14 clgv: so that's emacs lisp? ;) :P

7:15 borkdude: clgv key chords

7:16 vijaykiran: borkdude: I thought (from your tweet) you are using that cursive thingie

7:16 borkdude: vijaykiran I try to be tool agnostic :)

7:17 vijaykiran normally I use emacs, but for a workshop I will recommend cursive, so I have to have some knowledge about it myself

7:17 cfleming: vijaykiran: except he loves Cursive, he can't help himself :-)

7:17 borkdude: cfleming true!

7:18 vijaykiran yesterday I tried emacs with lein ring: didn't work. cursive did. (inc cursive)

7:18 cfleming: vijaykiran: (disclaimer: I develop Cursive, so take anything I say about how much people love it with a grain of salt)

7:18 vijaykiran: man all these new-age-ide people ...

7:19 cfleming: great work, btw. I'm not a Cursive user ... yet.

7:19 cfleming: vijaykiran: Thanks! There's always time, we'll be waiting.

7:20 borkdude: vijaykiran you have emacs and cursive open on the same project and have benefits from both sides

7:20 cfleming: borkdude: Out of curiosity, what's nicer in Emacs than Cursive at the moment?

7:21 LauJensen: Has anyone here been able to connect LightTable to an nrepl started from Immutant yet?

7:21 vijaykiran: Emacs *is* nicer :) well for me it's not just for clojure dev

7:22 Not that I don't have IntelliJ open all the time (for lesser lang-dev)

7:22 borkdude: cfleming I'd have to think about that while developing. I'm just more used to emacs keybindings

7:22 clgv: LauJensen: what's the problem? unknown port? middleware problems? http transport?

7:23 borkdude: cfleming I tried C-k in Intellij. It removed the whole line instead of structurally

7:23 cfleming: borkdude: Sure, just wondering - familarity is huge.

7:23 LauJensen: clgv: Unsure - Its simply hanging in the "Connecting" phase

7:23 clgv: LauJensen: can you connect with another client? e.g. leiningen?

7:24 cfleming: borkdude: Ah, you can fix that. Bind the Kill action to C-k, it'll override the built-in action in Clojure contexts and leave it in others.

7:24 LauJensen: clgv: Connecting to the same port via cider/emacs works fine

7:24 borkdude: cfleming I'll try

7:24 clgv: LauJensen: lein repl :connect host.port

7:24 kyrre: How can I use clojure.data.zip.xml/xml-> (or any other function) to find the first occurrence of a tag in an XML file (without specifying all the parents) ?

7:24 cfleming: borkdude: The next drop actually has a keybinding panel that lets you configure all the keybindings at once to the Emacs defaults if you like.

7:24 clgv: LauJensen: ah ok. so probably a lighttable issue

7:25 borkdude: cfleming that's very nice

7:25 cfleming: borkdude: Except for the cider ones unfortunately, since I can't take over C-c by default.

7:25 LauJensen: clgv: Thats what Im thinking

7:25 cfleming: borkdude: But paredit etc should all be there.

7:26 clgv: LauJensen: they have their issues managed on github

7:27 borkdude: ah nice, C-k works now

7:27 cfleming: borkdude: Great

7:29 dysfun: is there a builtin that's equivalent to (partial filter id) ?

7:30 gfredericks: no; keep is the composition of that with map I think

7:30 (= (partial filter identity) (partial keep identity)) ;; probably

7:30 dysfun: that sounds quite handy

7:31 gfredericks: ,(keep first [[3 4] [] [5 6] [] [] [] [7]])

7:31 clojurebot: (3 5 7)

7:32 dysfun: yeah, i can use that for some of this

7:32 thanks

7:32 gfredericks: I use (remove nil? ...) a lot, which is slightly different

7:33 dysfun: ,(remove nil? (map first [[3 4] [] [5 6] [] [] [] [7]]))

7:33 clojurebot: (3 5 7)

7:34 borkdude: I wondered, does the clojure compiler optimize when you use collection literals in functions, like (fn [x (#{:a :b} x)), or does it construct the collection in every call?

7:35 (fn [x] ... I mean

7:35 gfredericks: borkdude: I *think* if the collection contains only literals, the whole thing can be stored once

7:35 I haven't double checked that it actually does that though

7:35 hey hey easy to find out

7:35 ,(defn make-a-set [] #{2 3 7})

7:35 clojurebot: #'sandbox/make-a-set

7:35 gfredericks: ,(identical? (make-a-set) (make-a-set))

7:35 clojurebot: true

7:36 gfredericks: whereas of course:

7:36 ,(defn make-a-set [x] #{2 3 7 x})

7:36 clojurebot: #'sandbox/make-a-set

7:36 gfredericks: ,(identical? (make-a-set 42) (make-a-set 42))

7:36 clojurebot: false

7:36 borkdude: clojure is fantastic :)

7:40 gfredericks: iterate-while would be a nice function to have sometimes

7:42 I hesitate to use iterate + take-while if overshooting the underlying lazy seq would throw an exception

7:47 m1dnight: My very basic actor implementation is taking shape. It gets ugly real quick though, due to not having pattern matching like Erlang.

7:48 dysfun: core.match?

7:48 clojurebot: core.match is a pattern-matching library available for use by anybody but technomancy

7:48 dysfun: :)

7:48 although i've found in a lot of cases it works out cleaner to not use it than to use it. really depends what your functions look like

7:49 m1dnight: dysfun: In parameters that is. Like pong(<something>, 1) <body> and pong(<something>, othe_than_1): <body>

7:49 dysfun: i had a particularly bad example earlier though where the smallest reasonable core.match was 9 lines and the regular clojure 3 lines

7:52 gfredericks: core.matrix is the first place I've seen the PFoo naming convention for protocols

7:57 * dysfun tends to use foo-proto

7:57 dysfun: (commonly along with (defrecord foo [] foo-proo ... )

7:58 m1dnight: you can use guards for some of that

7:59 (a :guard my-type?)

7:59 m1dnight: oh, like haskell

7:59 ill check it out dysfun

7:59 thnx

7:59 dysfun: np

7:59 you may also like core.logic

7:59 daniel___: any frameworks built on garden? a bootstrap/foundation type framework would be cool

8:00 dysfun: or core.unify

8:00 daniel___: at least with a grid and some basic components

8:00 dysfun: it wouldn't take you long to adapt blueprint, for example

8:01 much of it could be done automatically

8:01 daniel___: dysfun: how would you do it automatically?

8:01 but i might start one as a little side project

8:01 dysfun: find a css parser and process it

8:02 daniel___: problem is, im not a css expert

8:02 dysfun: why do you have to be an expert?

8:02 the syntax is intentionally very simple

8:02 daniel___: theres a lot of things to learn when it comes to responsive design

8:02 media queries etc

8:03 dysfun: what are you trying to do?

8:03 daniel___: have a framework to make sites quickly that look half decent

8:03 bootstrap and foundation are fine, i'd just like to use clojure

8:03 since i use clj/cljs all over

8:04 dysfun: i'm not seeing the problem with using bootstrap and just writing new css in garden

8:04 daniel___: if everything was written in garden from the ground up, it would be easier to extend

8:04 extending bootstrap with plain css doesnt really give you power over all the variables and functions less/sass provide

8:05 dysfun: ah. well for that, you have compass (which has blueprint mixins), but it's not garden syntax obviously

8:05 you could automatically translate bootstrap to provide garden primitives i think

8:06 daniel___: i probably could, i'll give it a go if i have time

8:06 dysfun: it seems like the element translation function would be <5 lines

8:14 daniel___: dysfun: element translation function?

8:15 to translate less into garden?

8:16 dysfun: well, slightly more to translate something like less perhaps. but the pure css, yeah

8:17 daniel___: yeah, i could try and work backwards

8:17 and then just refactor

8:47 silasdavis: is there any way to produce an (AOT'd) record with typed (non-Object) member fields

8:47 I was sort of hoping annotations might do it

8:48 stuartsierra: silasdavis: no

8:48 silasdavis: just write a Java class then I suppose.. ?

8:54 stuartsierra: ya

9:07 clgv: silasdavis: primitive member fields?

9:08 silasdavis: otherwise you won't win much except you can omit type hints

9:12 craigglennie: Stupid question… why doesn’t this return two lists, with even numbers in one and odd in the other? (split-with even? (range -5 5))

9:13 This works to split into negative and non-negative: (split-with neg? (range -5 5))

9:13 stuartsierra: craigglennie: That's not what `split-with` does.

9:14 oh, nevermind

9:14 ignore me

9:14 no, I'm right

9:14 clgv: ,(split-with neg? (range -5 5))

9:14 clojurebot: [(-5 -4 -3 -2 -1) (0 1 2 3 4)]

9:14 stuartsierra: `split-with` divides a collection into two lists, one *before* the predicate was true, and one *after*

9:15 Bronsa: craigglennie: use (comp vals group-by) to get what you want

9:15 stuartsierra: ,(split-with #(= :split %) [1 2 3 :split 4 5 6 :split 7 8 9])

9:15 clojurebot: [() (1 2 3 :split 4 ...)]

9:15 stuartsierra: bah, whatever

9:15 clgv: or `group-by` with destructuring ^^

9:15 stuartsierra: that's what it does

9:16 ,(split-with keyword? [:a :b :c 1 2 3 :d :e :f])

9:16 clojurebot: [(:a :b :c) (1 2 3 :d :e ...)]

9:16 clgv: ,(let [{negative true, others false} (group-by neg? (range -5 5))] [negative others])

9:16 clojurebot: [[-5 -4 -3 -2 -1] [0 1 2 3 4]]

9:16 craigglennie: stuartsierra: ahh, I see… I guess that makes sense, given it’s called “split-with” and not “group-by”

9:17 clgv: ,(let [{even true, others false} (group-by even? (range -5 5))] [even others])

9:17 clojurebot: [[-4 -2 0 2 4] [-5 -3 -1 1 3]]

9:17 clgv: craigglennie: ^^

9:17 stuartsierra: The docstring says exactly what it does. "Returns a vector of [(take-while pred coll) (drop-while pred coll)]"

9:18 clgv: so actually the better name would include a "first" ;)

9:18 the-kenny: Anyone using weasel with the latest clojurescript/cider/cider-nrepl releases? It seems to "forget" the current namespace when evaluating stuff. Always drops me back into the user namespace in the repl.

9:20 craigglennie: clgv: thanks, your solution makes sense

9:35 the-kenny: hm, cider just sets nrepl-buffer-ns when evaluating cider-repl-set-ns. I wonder if either weasel or austin cache the current ns somewhere else. I wonder if cider should emit a call to `in-ns' in such situations.

9:36 martinklepsch: how big is the memory overhead of having a few million maps vs. a vector just containing the values?

9:36 (stored in one big set)

9:36 clojurebot: Excuse me?

9:39 dumptruckman: hmm, can someone tell me why nothing prints on this? http://pastie.org/9610294

9:40 shouldn't seq? return false if the collection is empty?

9:41 joegallo: http://clojure.github.io/clojure/clojure.core-api.html#clojure.core/seq

9:41 dumptruckman: oh, i just want seq

9:41 switching to that and it still doesn't print

9:43 clgv: martinklepsch: you might be force to drop down to java arrays (or specific tuple classes) depending on the scenario - I had problems with millions of maps that needed to fit into 8GB at the same time

9:44 martinklepsch: clgv: I'm fine with 16GB but it's tight

9:45 clgv: martinklepsch: that's why I hated the incater approach to use persistent maps for rows

9:46 dumptruckman: ok so

9:46 http://pastie.org/9610317

9:46 it still doesn't print

9:46 and if it's not printing, how is it not stuck in an infinite loop?

9:48 clgv: dumptruckman: it fails with an exception since you call `pop` on a lazy-seq

9:49 dumptruckman: oh?

9:49 clgv: dumptruckman: https://www.refheap.com/91019

9:49 sg2002: Hello. Does anyone here uses that breakpoint macro from the Joy Of Clojure book? In the version they provided there's no way to exit the debugger. Maybe someone has an updated one?

9:50 Decided to check here before doing this myself.

9:50 dumptruckman: clgv: noooo i wanted to solve it myself D:

9:51 clgv: dumptruckman: I only fixed your strange usage of range there

9:51 dumptruckman: you can still try the version without loop-recur that's based on range

9:52 sg2002: afaik that wont work in an nrepl setup anyway

9:52 sg2002: since handling *in* and *out* is different there

9:53 dumptruckman: clgv: yes, i thought of a way to do it without recurring but this exercise is specifically for recursion

9:55 something like (defn factorial [n] (reduce 1 (range 1 (inc n)))

9:55 clgv: dumptruckman: but you should have seen the exception in your previous version

9:55 dumptruckman: almost ;)

9:55 dumptruckman: koan is not printing any exceptions

9:56 clgv: that's bad. so you should probably try out in your own repl to see those

9:56 dumptruckman: oh right

9:57 (defn factorial [n] (reduce * 1 (range 1 (inc n)))

9:57 clojurebot: Cool story bro.

9:58 dumptruckman: +)

9:59 how come you can't pop a lazy seq?

9:59 clgv: dumptruckman: because it is not a stack

10:00 dumptruckman: lists and lazy seqs can only be read from front to back

10:00 dumptruckman: you can use `first` and `rest` or `next`

10:00 but the lazy seq was not appropriate in that implementation anyway

10:03 atyz: clgv: you should be able to use peek too

10:05 clgv: ,(peek (range 10))

10:05 clojurebot: #<ClassCastException java.lang.ClassCastException: clojure.lang.LazySeq cannot be cast to clojure.lang.IPersistentStack>

10:05 clgv: atyz: nope, both are specifically for stacks

10:05 atyz: e.g. vector

10:09 justin_smith: ,(peek (list 0 1 2 3 4)) ; or list

10:09 clojurebot: 0

10:10 clgv: ,(pop (list 0 1 2 3 4))

10:10 clojurebot: (1 2 3 4)

10:11 dumptruckman: clgv: i see

10:11 clgv: yeah well stacks with different ends ^^

10:11 dumptruckman: so just not lazy seq

10:12 atyz: Ah yeah, I know I had used it with lists before, I must have just assumed it was lazy ;)

10:12 clgv: dumptruckman: you could also restrict to first, rest in the beginning. when preserving types is important you might need those other functions

10:13 atyz: though there is actually no good reason why peek/pop don't work on lazy sequences when they do in lists.

10:13 atyz: ,(peek (range 0 3))

10:13 clojurebot: #<ClassCastException java.lang.ClassCastException: clojure.lang.LazySeq cannot be cast to clojure.lang.IPersistentStack>

10:13 justin_smith: ,(peek (into () (range 0 3)))

10:13 clojurebot: 2

10:13 atyz: clgv: Thats what I thought, I was wrong I guess

10:14 justin_smith: I have never done into () before

10:14 clgv: ,(peek (cons 1 (cons 2 nil)))

10:14 clojurebot: #<ClassCastException java.lang.ClassCastException: clojure.lang.Cons cannot be cast to clojure.lang.IPersistentStack>

10:14 pyrtsa: ,(peek '(0 1 2 3))

10:14 clojurebot: 0

10:14 pyrtsa: ,(into () (range 3))

10:14 clojurebot: (2 1 0)

10:14 clgv: nice :D

10:14 ,(list* (range 3))

10:14 clojurebot: (0 1 2)

10:14 justin_smith: ,(peek (reverse (range 3)))

10:14 clojurebot: 2

10:15 clgv: ,(peek (list* (range 3)))

10:15 clojurebot: #<ClassCastException java.lang.ClassCastException: clojure.lang.ChunkedCons cannot be cast to clojure.lang.IPersistentStack>

10:15 justin_smith: (def reverse (partial into ()))

10:15 clgv: muhaha

10:15 justin_smith: ,(peek (apply list* (range 3)))

10:15 clojurebot: #<IllegalArgumentException java.lang.IllegalArgumentException: Don't know how to create ISeq from: java.lang.Long>

10:15 clgv: a rule of thumb to be safe: use peek and pop only with vectors...

10:16 pyrtsa: clgv: Well, and with clojure.lang.PersistentQueue.

10:16 clgv: just made up. but seems reasonable when you consider the above examples

10:16 pyrtsa: ,(peek (conj clojure.lang.PersistentQueue/EMPTY 1 2 3))

10:16 clojurebot: 1

10:16 clgv: pyrtsa: a queue implements ipersistentstack? TypeMismatchException!

10:17 justin_smith: pyrtsa: I was going to mention that one :)

10:17 pyrtsa: justin_smith: _o/

10:17 justin_smith: clgv: and it works on list, list* does not return a list

10:17 clgv: ,(pop (conj clojure.lang.PersistentQueue/EMPTY 1 2 3))

10:17 clojurebot: #<PersistentQueue clojure.lang.PersistentQueue@402>

10:17 justin_smith: (inc pyrtsa)

10:17 lazybot: ⇒ 8

10:17 pyrtsa: ,(seq (pop (conj clojure.lang.PersistentQueue/EMPTY 1 2 3)))

10:17 clojurebot: (2 3)

10:17 clgv: woah that's awful naming. Stack != Queue from an algorithmic point of view

10:18 justin_smith: ,(peek (pop (conj clojure.lang.PersistentQueue/EMPTY 1 2 3)))

10:18 clojurebot: 2

10:18 clgv: ~guards

10:18 clojurebot: SEIZE HIM!

10:18 pyrtsa: peek, pop and conj are all quite overloaded names in Clojure. That's their nature

10:18 Well, into as well.

10:18 clgv: pyrtsa: I comlain about the interface that powers peek and pop ;)

10:18 *complain

10:19 pyrtsa: Nod.

10:26 verma: when I do a defrecord, how do I make sure that the created record has certain fields in it with some defaults, e.g. I am creating this ModelCache record and I want to have a :state property in it that's an atom?

10:26 so far it seems to me like I need to accept it as one of the parameters to (ModelCache. (atom {}))

10:26 s/to/like

10:27 I want to create a ModelCache instance, but make sure that all of them have an internal key named :state or :__state or whatever

10:28 clgv: verma: write a constructor function for it

10:28 verma: clgv can't find any examples

10:29 clgv: verma: just a plain clojure function that creates the defrecord and initializes it

10:29 verma: oh ok ok

10:29 clgv like (defn make-cache [] (assoc (ModelCache.) :state (atom {})))

10:29 ?

10:29 nice

10:31 clgv: verma: yeah. you could also use (map->ModelCache {:state (atom {})}) - but thats probably a matter of taste

10:31 ,(defrecord ModelCache [state])

10:31 clojurebot: sandbox.ModelCache

10:32 clgv: ,(defn make-cache [] (map->ModelCache {:state (atom {})})

10:32 clojurebot: #<RuntimeException java.lang.RuntimeException: EOF while reading>

10:32 clgv: ,(defn make-cache [] (map->ModelCache {:state (atom {})}))

10:32 clojurebot: #'sandbox/make-cache

10:32 clgv: ,(make-cache)

10:32 clojurebot: #sandbox.ModelCache{:state #<Atom@1921250: {}>}

10:32 verma: nice

10:35 (inc clgv)

10:35 lazybot: ⇒ 28

10:43 dysfun: (into {} (when (map? a) (filter ... seems like a nice idiom for default-to-{} when writing map filters

10:45 notofi: Hi, does someone know why with enlive the h2 tag is not inside the a tag with this example? (html/html-snippet "<a> <h2> Foo </h2> </a>") ->> ({:tag :a, :attrs nil, :content (" ")} {:tag :h2, :attrs nil, :content (" Foo ")} " ")

10:54 xeqi: notofi: enlive uses tagsoup with closes the <a> when it hits <h2>. https://github.com/cgrand/enlive/issues/110

10:54 clgv: dysfun: you want to filter map entries? I'd do that with reduce-kv and transient

10:56 dysfun: reduce-kv is handy too, transient, not so much given the data sizes we're talking about

10:57 mikepence: hi clojurians :)

10:57 clgv: dysfun: into uses transients if possible so that point is through ;)

10:57 tbaldridge: hi mikepence :-)

10:57 TEttinger: clourers and clojurists too

10:57 mikepence: yesterday was my first day actually producing a bit of code in clojure for the day job (Living Social)

10:57 TEttinger: *clojurers

10:57 mikepence: I am wondering where the community hangs out, and is tolerant of newb questions. :)

10:57 justin_smith: clojurmancers

10:58 clgv: haha awakening the dead with lisp

10:58 mikepence: ah, that is better

10:58 TEttinger: *I've been up for 17 of the last 24 hours, give me a break

10:58 justin_smith: this place is definitely tolerant of newb questions

10:58 dysfun: clgv: clojure does a lot of smart things so i don't have to

10:58 mikepence: I knew technomancy back in the early rails days

10:58 awesome

10:58 xeqi: here and the clojure mailing list are both good places for newb questions

10:58 mikepence: is the clojure mailing list a google group?

10:58 justin_smith: yes

10:58 mikepence: thx

10:59 I am coming from ruby, and super-excited by everything about clojure

10:59 clgv: dysfun: that's a trouble some attitude in general since there are usually several choices in clojure where you should choose the appropriate one...

11:00 dysfun: clgv: practicalities depend on a few things though. i know the size of the data will never be very large so i'm not concerned about performance implications

11:00 TEttinger: mikepence, clojure is a wonderful language and I imagine it would come easily to a ruby pro

11:01 mikepence: I have also had the awesome tutelage of ghadi shaban

11:04 TEttinger: so here's a nice artificial example of some of the strengths of clojure.

11:04 ,(take-while #(> (second %) 1) (sort-by (comp - val) (frequencies "the king james bible")))

11:04 clojurebot: ([\space 3] [\e 3] [\b 2] [\i 2])

11:04 knosys: hi !

11:04 TEttinger: that finds all characters in the string "the king james bible" that show up more than 1 time. there are other ways to do it that are better, but i wanted to show comp and sort-by

11:05 grandy___: quick question: lein doesn't appear to be loading the files in src, so i have to load them manually and specifiy the paths (in the repl)... is there a way to have it load them automatically when i start the repl?

11:06 TEttinger: grandy___, have you set a :main namespace in project.clj ?

11:06 not sure quite what causes that

11:06 grandy___: TEttinger: i have not

11:07 alejandro1: grandy___: src should be on your loadpath, so all you should need to do is require them. the issue could be the naming of the files not matching what the namespaces are expected to be

11:07 I know that's bitten me a few times

11:07 grandy___: alejandro1: hmm how can i tell what it's expecting?

11:08 justin_smith: grandy___: do any namespaces have - in the name?

11:08 alejandro1: so like src/example/cool_thing.clj => example.cool-thing

11:08 TEttinger: ah, that one.

11:08 grandy___: alejandro1: i don't believe so

11:08 justin_smith: grandy___: what does your require invocation in the repl look like?

11:09 grandy___: justin_smith: well, i tried to use (in-ns 'myproject.namespace)

11:09 justin_smith: and then it couldn't find it until I typed (load "myproject/filename")

11:09 alejandro1: grandy___: also, does `lein classpath` have your src directory in the first few entries?

11:10 justin_smith: grandy___: that's not how it owrks

11:10 grandy___: (require 'myproject.namespace)

11:10 grandy___: alejandro1: it does

11:10 justin_smith: that will load it up

11:11 grandy___: justin_smith: indeed it does

11:11 thanks everyone!

11:11 justin_smith: grandy___: none of your source files are (or should be) automatically loaded in a repl. They must be required first.

11:12 grandy___: justin_smith: ok i guess that makes sense...

11:13 justin_smith: grandy___: there may be a project.clj trick for making the repl auto-require your core namespace (which then requires the rest)

11:13 grandy___: always nice when the problem was my logical reasoning :)

11:14 can anyone advise me on the best practice for using a repl with cljs?

11:14 justin_smith: grandy___: well, it's more about the conventions and expectations of the language - Clojure is often logical, but not so much so that you can figure things out by first principles :)

11:14 grandy___: :)

11:17 mikepence: so structured editing is interesting

11:17 I am using cursive

11:22 dumptruckman: what's that function that puts a string inbetween elements of a collection

11:23 schmir: dumptruckman: clojure.string/join

11:24 justin_smith: or interpose, if you want the result to be a collection too

11:24 (interpose "," (range 10))

11:24 ,(interpose "," (range 10))

11:24 clojurebot: (0 "," 1 "," 2 ...)

11:25 dumptruckman: oh

11:25 so join does the same thing but turns it into a single string?

11:26 alejandro1: dumptruckman: yup

11:26 ,(clojure.string/join "," (range 10))

11:26 clojurebot: "0,1,2,3,4,5,6,7,8,9"

11:26 dumptruckman: cool, thanks

11:34 verma: can't get :notify-command to work for lein-cljsbuild, anyone tried it/

11:35 just saying :notify-command ["pwd"] .. should at least print the current working directory after every build

11:36 ok worked this time :P

11:46 mikepence: I am not sure if I love structural editing yet, but obviously worth getting to know

11:50 jcsims: mikepence: you will

11:51 TimMc: mikepence: You'll become addicted to it soon enough.

11:54 mikepence: there has been some discusson on the cursive list about what non-emacs-inspired keyboard bindings to use on os x for structural editing commands

11:54 alejandro1: mikepence: is structural editing the same thing as paredit in emacs?

11:58 mikepence: yes, same thing

12:41 magopian: are people using the (. foo -bar) notation to stay in line with the (.. foo -bar -baz) notation?

12:42 because at first, i found the (foo.-bar) notation much shorter and readable, but maybe it's just me?

12:43 xeqi: I thought (.-bar foo) was the prefered

12:43 magopian: ah, there's also this notation, i forgot

12:43 (foo.-bar works, right?)

12:44 i'm looking at some code from https://github.com/Prismatic/om-tools#mixin-tools

12:45 there's (. owner -intervals), then (.. owner -intervals (map js/clearInterval))

12:45 btw, would (map .clearInterval) just work the same?

12:47 hiredman: .clearInterval is not a symbol that is bound to a function object in the environment

12:48 (.clearInterval foo) is syntactic sugar for (. foo (clearInterval)), where . is the interop special form

12:49 it is not calling .clearInterval as a function

12:49 magopian: I see

12:49 so (foo.clearInterval) wouldn't work either?

12:50 Bronsa: magopian: it will probably work in cljs for reasons, but don't use it

12:50 it's not clojure syntax

12:50 magopian: understood ;)

12:50 so the canonical way of writing is it (. foo clearInterval) or (. foo -className) (or whatever the property name is)

12:51 Bronsa: magopian: (.-bar foo) if it's a field, (.bar foo) if it's a method call

12:51 or (. foo -bar) if you prefer

12:51 magopian: ok ;)

12:51 thanks a lot Bronsa and hiredman

12:51 Bronsa: but it's rare to use . directly

13:05 andyf: For anyone out there who has dealt with type tags in Clojure a bit, I've written a few paragraphs about them, and ones that the next version of Eastwood will warn about. Interested in corrections, comments, etc. if you do read it: https://github.com/jonase/eastwood/blob/master/README.next.md#wrong-tag---an-incorrect-type-tag

13:06 Note: Eastwood 0.1.5 has not been released yet. Any comments you have can be filed as an issue on Github

13:07 ambrosebs: andyf: looks reasonable to me

13:07 Bronsa: andyf: I just read it and it looks fine to me -- an aside note, is this https://github.com/jonase/eastwood/blob/master/README.next.md#known-libraries-eastwood-has-difficulty-with still true? the bit about data.fressian/test.generative

13:07 andyf: Bronsa: not sure. Let me check the output from my latest test runs...

13:08 Bronsa: andyf: I believe they should now get :wrong-tag warnings rather than fail

13:10 andyf: I'm getting exception with latest Eastwood and latest of data.fressian/test.generative

13:11 because of weird tags

13:12 Eastwood still has tools.reader 0.8.4, in case that might have any bearing on it.

13:13 m1dnight: Is there a way to recur an enclosing loop/function? I found recur-to but it's a proof of concept atm

13:14 Bronsa: andyf: shouldn't be relevant, I'll look into it later, I'm pretty sure eastwood should be able to handle them now (my guess is that the wrong-tag handler needs some tweaking :)

13:15 dbasch: m1dnight: I hope there isn't a way :)

13:15 m1dnight: Well, it's be nice tbh

13:16 I need it to something like recur loop until condition is met, then recur function

13:16 andyf: Bronsa: Thanks for all the quick bug-turnarounds lately. Feels like December & January over again, albeit with fewer bugs :) Note: TGEN-5 patch you suggested has not been committed, but I guess you plan to make t.a(.j) changes that avoid throwing exception even without that test.generative change.

13:16 m1dnight: ill just have to rethink my code i guess

13:29 zenoli: So, I need to consume a continuous stream of HTTP data and do something with each chunk. Recommendations for the best library?

13:29 I've been trying with http-kit's client, but it looks like it might be trying to read in the entire (infinite) stream before returning anything.

13:30 Bronsa: andyf: yeah it looks like I forgot to handle a tag validation path with :validate/wrong-tag-handler, I'll fix that later & data.fressian/test.generative et all should work & just print a warning

13:31 andyf: Bronsa: Sounds good. Let me know and I'll give it a whirl.

13:32 Bronsa: andyf: later might mean tomorrow, depending on whether or not I can stay awake long enough to fix it :P

13:33 andyf: Bronsa: No rush on my part. I'm hoping to release 0.1.5 of Eastwood within a week or two, just to get the new linters out there.

13:34 bbyler_t_: hello! i'm running into the error "goog is not defined" when trying to boot up .. what's a good way to get around that?

13:35 (optimizations: whitespace)...

13:36 nullptr: bbyler_t_: make sure you're including the goog base.js in your html file

13:38 bbyler_t_: hmm...is there by any chance a cdn for base.js nullptr ?

13:39 i could do a quick download of closure, but just curious

13:39 nullptr: no, because you wouldn't (well, _shouldn't_) use base.js in production

13:39 base.js should get generated somewhere in your project space by cljsbuild

13:39 cd project-root; find . -name base.js

13:41 bbyler_t_: ah of course! thanks nullptr,

14:11 edbond: async question: if I have a (chan 10000), put! some values and close! chan. Values that are not consumed yet will be destroyed?

14:11 tbaldridge: edbond: no, data is not destroyed by close!. close! events happen "after" any other puts

14:12 edbond: tbaldridge, thanks, will have a better sleep now. This question bothered me for some time.

14:13 so it's safe to close after all put!s, no need to define :end-of-stream or something

14:13 tbaldridge: edbond: right, you should never need a signal value like that

14:15 mi6x3m: Is there a function like map which ignores the result?

14:15 useful for side effects

14:16 ToBeReplaced: justin_smith: do you know if this ever got resolved: http://stackoverflow.com/questions/21706497/why-is-my-clojure-project-slow-on-raspberry-pi

14:16 tbaldridge: ,(doc doseq)

14:16 clojurebot: "([seq-exprs & body]); Repeatedly executes body (presumably for side-effects) with bindings and filtering as provided by \"for\". Does not retain the head of the sequence. Returns nil."

14:16 mi6x3m: (f tbaldridge: I don't need bindings

14:16 ToBeReplaced: then dorun

14:17 mi6x3m: ToBeReplaced: I need to invoke a function with every element of the seq

14:18 (something f seq)

14:18 ToBeReplaced: (->> coll (map f) dorun)

14:19 mi6x3m: ToBeReplaced: the problem is that my sequence is large

14:19 and map constructs a new sequence

14:19 dbasch: mi6x3m: why do you need to realize your sequence for side effects?

14:19 ToBeReplaced: people often use (doseq [x coll] (f x)) because it better matches the execution paradigm -> you want to side effect, in order, so it's actually imperative

14:20 mi6x3m: dbasch: it's a bit hard to explain but there's also another way

14:20 ToBeReplaced: yes, a good compromise

14:20 it's nicely explicit

14:21 justin_smith: ToBeReplaced: hmm - are you trying to do audio with clojure on a pi?

14:22 ToBeReplaced: justin_smith: yes; i'm actually trying to do much more and getting a little frustrated since i lack the systems knowledge to debug the performance issue

14:22 i reduced down to just playback a file as in the stackoverflow question and am seeing skipping as well

14:22 justin_smith: ToBeReplaced: the behavior described in the question indicates that either there is too much work being done in the processing thread for the tiny CPU, or, more likely, lack of CPU-cache line coherency in the processing task

14:23 tbaldridge: ToBeReplaced: the rpi is a very, very slow machine. I'm surprised people get a JVM running on it at all.

14:23 justin_smith: ToBeReplaced: so if you just play back a file, and nothing else, you see skipping? What if you make a minimal java program that plays the file?

14:24 hiredman: pffft

14:25 justin_smith: ToBeReplaced: reconsidering my response to the question before, it could be the context switch from the audio data to the clojure data between buffer writes that is killing perf

14:25 ToBeReplaced: thanks guys... i don't have a size or power restriction, i just need some hardware IO, so i think i might just run a more powerful computer and a usb gpio chip, like the FTDI FT245R

14:27 justing_smith: yeah i was using AudioSystem/getClip and AudioSystem/getInputStream... i didn't override any of the defaults

14:28 m1dnight: Ugh, I'm stuck with my actors :p

14:28 justin_smith: ToBeReplaced: hmm, come to think of it, that might mean that none of clojure was competing for the cache line, so it's just the device / the quality of the jvm on that device to blame

14:28 m1dnight: I guess it could write a part in Java.. :p

14:28 ToBeReplaced: i need to ship somewhat soon... and i'm undecided between a) run down the pi rabbit hole and see what i can do... b) upgrade to something like beaglebone black... c) run a more powerful and learn the shenanigans for serial gpio over usb

14:31 justin_smith: ToBeReplaced: I've had excellent luck with using a csound process for audio processing controlled by a clojure process (either using the OSC protocol over UDP on localhost, or using stdio). csound runs very smoothly on tiny devices. I've done spectral manipulation and resynthesis without glitches on arm devices weaker than an rpi using csound.

14:33 of course supercollider (the audio backend for overtone) has a nicer api, but it will not run nicely on an rpi

14:33 ToBeReplaced: justin_smith: good to know... yeah, it's odd... i was able to run sphinx (voice recognition) without hassle... option d) rewrite in python

14:33 hiredman: ToBeReplaced: which jvm are you using?

14:33 ToBeReplaced: yeah i tried reading in keyboard notes via overtone and it creeped along

14:33 openjdk8

14:34 pidora, openjdk8, uberjar aot compiled

14:34 hiredman: ToBeReplaced: sure, but is it using shark or whatever?

14:35 shark is the jvms portable non-optimizing compiler, basically, until somewhat recently it was the only thing available on the pi

14:35 ToBeReplaced: ah i didn't know that... is there a command line check?

14:36 hiredman: dunno, on systems that use apt it tends to be part of the package name when you install a jvm

14:37 ToBeReplaced: ohhhhhh i think that's what i'm on... the package name doesn't say that... but java -version gives me: OpenJDK Zero VM... gotta mean non-optimizing? (build 25.5-b02, interpreted mode)

14:37 hiredman: I've used clojure on my beaglebone for various things (home automation, simple robots) using oracles jdk and it has worked just fine

14:37 yeah zero

14:38 http://openjdk.java.net/projects/zero/

14:39 ToBeReplaced: hiredman: thanks that's really interesting... i'll see if oracle gives me anything better... that would be the triple fistpump success story

14:39 hiredman: http://www.oracle.com/technetwork/articles/java/raspberrypi-1704896.html has some instructions that may be adaptable

15:04 mikerod: There was a cool webapp that I found one day where you could search for clojure function usages across many of the known popular libraries.

15:04 Now I can find this with a search, my bookmarks, history, etc

15:04 :(

15:04 Does anyone know the link to what I'm describing

15:06 ?*

15:07 dbasch: mikerod: you mean http://crossclj.info/ ?

15:08 mikerod: dbasch: yes!

15:08 (inc dbasch)

15:08 lazybot: ⇒ 12

15:08 mikerod: Thanks, I couldn't figure out how to refind that....

15:09 Turns out if I would have though "search clojure ecosystem"

15:09 I would have found a reddit

15:09 that would hvae linked to this :P

15:45 michaelr524: hmm

15:45 so, multiple cider sessions - is it supposed to just work - I don't get it from the documentation..

15:45 ?

15:46 do i have to be an alien for this emacs voodoo to ever make sense to me? :)

15:47 _everything_ works exactly the way you wouldn't expect it work

15:56 m1dnight: Ugh, I need some help guys. I've been breaking my head over this the entire day, I have something that shows what I want but now how I want it.

15:56 Does nyone have a minute?

15:56 clojurebot: I don't understand.

15:57 michaelr524: m1dnight: shoot

15:57 cbp: Does anyone who knows cider.el know with what the 'cider-find-or-create-repl-buffer' function was replaced?

15:58 m1dnight: I have a thread Y, and that thread has to look over a queue. I can say in that thread "get element X" and then that thread has to look at a ref/atom/.. and see if it has an element in it. If not, it has to block until that ref/atom has one. If it never gets one, the function never returns.

15:58 I have this, and it works. The point is, that function that blocks util an element is available spins and thus uses A LOT of cpu power, which I don't want.

15:59 In java, i'd go about using .wait() and .notify(), but that's not really possible in clj, afaik. So i'm not sure how to go about it..

15:59 michaelr524: m1dnight: sounds like a task for core.async - have you looked at it?

15:59 m1dnight: http://pastebin.com/0Z3e6eW1 <- This is what I have at the moment but not really good

16:00 Hmm, I was reading that a few hours ago and that looked promising indeed. It's CSP, right?

16:00 I'll have a look at it :)

16:00 Thnx

16:01 michaelr524: m1dnight: also, I see there that you are importing LinkedBlockingQueue

16:01 Why don't you use it?

16:02 m1dnight: check this also: http://clojuredocs.org/clojure.core/seque

16:05 dbasch: m1dnight: btw, (if (not (nil? match)) ...) is almost the same as (if match ...)

16:05 the only difference is that the first will return true when match is boolean false

16:08 m1dnight: michaelr524: Yeah, that was for an implementation I already had. I constructed a minimal example to figure out how to go about implementing it in the code I already have. That one involves macros and stuff so not comfy to start experimenting in it.

16:09 Perhaps I'll use a Java object to do it and use .wait and .notify. I'm not really sure yet

16:10 michaelr524: m1dnight: usually the most intimidating clojure code is the most gratifying when you finally understand it :)

16:12 m1dnight: Well, that's very much true though! :)

16:13 I was happy to accept to challenge to implement almost all concurrency models in clojure for my thesis

16:13 "Actors are going to be the easiest so i'll start with that"

16:13 * m1dnight lied to m1dnight

16:13 m1dnight: the challenge*

16:14 justin_smith: m1dnight: maybe you mistook the simplicity of a description of actors for simplicity of implementation?

16:16 ToxicFrog: Yeah, speaking as someone who has implemented actor-like APIs on two different platforms, they're a lot easier to describe than they are to implement robustly.

16:16 m1dnight: justin_smith: I did, as well as my promotors :p

16:17 it's not a lack of a feature, it's a feature something something

16:29 michaelr524: who is using cider with emacs-live here?

16:30 m1dnight: i'm using cider and emacs, no clue what emacs-live is though

16:30 michaelr524: m1dnight: C-c C-p does it popup a window or somtehing for you?

16:30 tbaldridge: michaelr524: I've used it on and off, sadly I've found it too heavy for my day-to-day use.

16:30 m1dnight: michaelr524: Undefined

16:31 tbaldridge: ...so I now use Cursive. Sad when a Java IDE is more responsive than emacs.

16:31 michaelr524: cursive is great - once the new machine arrives by mail I might switch to it :)

16:31 I'm currently on a T60

16:32 ro_st: tbaldridge: admittedly very tempted to try cursive, really enjoy seeing it in your vids. but i'm just so used to my keybinds in emacs now

16:32 michaelr524: C-c C-p is described as "Evaluate the form preceding point and pretty-print the result in a popup buffer."

16:33 but instead of poping up something it just displays a one line buffer at the bottom of the screen - a bit similar to the "echo area" of C-c C-e

16:33 ro_st: when i use C-c C-p i get the popup buffer

16:34 michaelr524: I suspect it's the combination of cider with emacs-live..

16:34 tuft: hello clojureverse

16:34 michaelr524: I really like the fact that cursive has a clojure debugger

16:34 noonian: i found the emacs setup from brave clojure to be pretty nice, and i'd heard previously from people who tried emacs-live that it felt a little bloated

16:34 michaelr524: it saves me lot's of time once in a while

16:34 noonian: hello tuft

16:35 ro_st: i use rkneufeld's gist with some addons. very light and simple

16:35 michaelr524: ro_st: url

16:35 ro_st: https://gist.github.com/rkneufeld/5126926

16:36 michaelr524: thanks

16:36 ro_st: its out of date because nrepl.el -> cider

16:39 erdos: hello everyone. i need some help with defrecords, please. i would like to type annotate an argument of my function, but when the function is called, i get the following exception: "erdos.ps.PSto" cannot be cast to "erdos.ps.PSto". the type names do match here, howerver the `instanceof?` call on the value of argument also fails. it is like there are two versions of the type with the same name, despite being defined only once. thank you

16:39 tbaldrid_: erdos: are you doing this at the REPL?

16:39 hiredman: oh, well it isn't defined only once

16:40 everytime clojure runs a defrecord it defines the type again, so if you are loading the namespace code more than once then there you go

16:40 ro_st: yup. restart jvm and see if the problem persists

16:41 michaelr524: tbaldridge: oh, btw - could you share your key bindings for cursive?

16:41 tbaldridge: you don't really have to do that, just re-eval the functions that use the record

16:42 erdos: tbaldrid_: yes, on the repl, even after completely restarting it.

16:42 tbaldridge: well hiredman is right, something is re-evaling your defrecord

16:46 erdos: tbaldridge: so you mean that requiring an ns twice from two differenc places creates the type twice?

16:46 tbaldridge: erdos: no, that's fine, I mean either two defrecords, or evaling a defrecord twice

16:46 mi6x3m: does anyone know how to easily get the post parameters out of the body with httpkit?

16:46 hiredman: or requiring with :reload and :reload-all

16:48 or if you are aot compiling and have a generate class file sitting on disk

16:48 that can cause these issues

16:48 a generated

16:48 erdos: hiredman: "lein clean" does remove these classes, right?

16:49 hiredman: erdos: I forget, it seems like it should

16:49 if are aot compiling, stop

16:49 if you are

16:52 justin_smith: mi6x3m: are you using ring?

16:52 mi6x3m: justin_smith: no

16:52 justin_smith: any particular reason not to use ring? because it's easy to get the post parameters with a ring middleware

16:53 and there is a ring adaptor for http-kit

16:53 amalloy: it's probably pretty easy with http-kit too, justin_smith, we just don't happen to know it

16:53 mi6x3m: justin_smith: because this is a demo application with nothing related to a web module :)

16:53 I just use httpkit to demonstrate something

16:54 justin_smith: so http, but not at all web?

16:54 mi6x3m: justin_smith: yes :)

16:54 clojurebot: Cool story bro.

16:54 amalloy: (inc clojurebot)

16:54 lazybot: ⇒ 46

16:54 mi6x3m: justin_smith: meh, I'll just parse them myself

16:54 justin_smith: there is an apache library for that sort of thing

16:55 amalloy: mi6x3m: it sounds like you are making things harder for yourself because the goal is "simple", as if you believe the default choices are hard to use but parsing http requests by hand is easy

16:55 justin_smith: amalloy: I think more likely http-kit gives you a stream for the body, and lets you leverage the various libs available for parsing or utilizing it

16:56 mi6x3m: yes it's just (slurp :encoding "UTF-8") in my case

16:57 justin_smith: well, that gets the text, but doesn't do the parsing - probably easier to hand the stream to the apache.data.codec or whatever it was called rather than construct a string then parse it by hand

16:59 mi6x3m: justin_smith: I can't seem to find that library :/

17:07 justin_smith: https://github.com/clojure/data.codec I misremembered, it's clojure/data.codec and it uses apache commons codec

17:07 erm, never mind, that's not it

17:12 borkdude: is http kit now seen as the future replacement for jetty also for local development?

17:12 amalloy: i can't imagine why. i'd just use jetty

17:13 or aleph/netty if asynchrony is important to me

17:13 noonian: well, i always use http-kit now just because of its support for websockets and stuff

17:13 but i had already stopped using the ring leiningen plugins in development so lack of tooling support didn't affect me

17:15 dbasch: when I see questions like this one, I just want to answer "use clojure" http://stackoverflow.com/questions/26149732/how-to-sort-an-arraylist-using-two-sorts#26149840

17:16 mi6x3m: justin_smith: indeed i'll just use form-decode in ring.util

17:16 amalloy: dbasch: it was tempting to answer http://stackoverflow.com/q/26129172/625403 with "use haskell"

17:17 dbasch: I'm tempted to upvote that answer just because it's long!

17:17 amalloy: and you'd upvote "use haskell" because it's short! everybody wins!

17:18 m1dnight: https://github.com/puniverse/pulsar/blob/master/src/main/clojure/co/paralleluniverse/pulsar/actors.clj#L479 This is the receive code for Pulsar. Why on earth would I be able to do it with less :p

17:19 tbaldridge: m1dnight: you don't need all that crap for actors, you only need it if you're trying to duplicate erlang processes

17:20 m1dnight: the stuff here is way simpler http://www.dalnefre.com/wp/

17:20 m1dnight: tbaldridge: Yeah, I kinda have to duplicate the actor model in clojure.

17:20 justin_smith: tbaldridge: it's like the difference between having a digital movie as accurate as film, vs perceptibly identical to film (the latter being orders of magnitude larger a task)

17:20 m1dnight: I might be better off doing it in Java though. I havent thought it through yet.

17:21 tbaldridge: that's kindof what I'm saying, Erlang isn't "the actor model" it's "the actor model plus a ton of stuff that complicates everything"

17:21 m1dnight: Oh, okay that's what you meant

17:21 Sorry I can't really brain properly anymore :p

17:22 noonian: the actor model is really very simple

17:22 tbaldridge: http://www.dalnefre.com/wp/2010/06/actors-in-clojure-why-not/ <- the Blog's author vs comments Rich made about actors

17:22 for the record, I agree with Rich when it comes to actors, but that post points out some really important misconceptions people have about actors

17:27 m1dnight: That was a very very very good read tbaldridge

17:28 However, I senses a bit of passive agression in Rich's statements, or is it just me?

17:28 muraiki: I'm trying to choose between erlang and clojure for concurrency currently, so that article should be a big help. thanks

17:29 m1dnight: I had a LOT of fun writing Erlang! :) But clojure has a more modern feel to it. I can't put it into words :p

17:30 * technomancy cringes at his comment on that post from 2010

17:30 devn: how do people just run a .clj file as a script (basically relying on whatever clojure version that's bundled with lein)?

17:30 technomancy: devn: lein run -m clojure.main/main myfile.clj

17:30 (is one way)

17:30 gfredericks: does anybody know if core.matrix is extensible wrt scalars? or does a new scalar type require a new matrix impl?

17:31 what I want in particular are complex scalars

17:31 technomancy: gfredericks: have you tried using SBT?

17:31 devn: technomancy: thanks -- didn't want to have to grab lein-oneoff or something

17:32 muraiki: m1dnight: that's good to know, and also the sense that I got. I've also considered elixir, but I'm not sure if it's ready yet, and it seems like I'd also have to learn erlang anyways to really take advantage of the ecosystem

17:32 technomancy: devn: the downside is that will work differently if invoked from a project directory

17:33 gfredericks: technomancy: haven't heard of that

17:33 nor is google helpful

17:34 hiredman: gfredericks: scala joke

17:34 (scala build tool)

17:34 gfredericks: it all makes sense now

17:34 I should expect technomancy to make jokes about build tools.

17:34 technomancy: lots of complicated scalars there!

17:35 complex

17:35 whatever

17:35 complected

17:35 gfredericks: hey technomancy so three build tools walk into a bar

17:36 no they don't.

17:37 amalloy: hiredman: is the s in sbt scala? i thought it was supposed to be simple

17:37 hiredman: whichever

17:37 gfredericks: or smalltalk

17:37 or sea++

17:37 dbasch: amalloy: scala was supposed to be simple

17:38 or maybe it wasn't

17:38 justin_smith: if it was, that reflects badly on their design skills

17:39 gfredericks: what does it take to get `lein repl` to use a forked version of nrepl?

17:39 dbasch: I would have called it Javaskell

17:39 technomancy: that joke works better with a non-rhotic accent, so sorry all non-commonwealth persons

17:39 justin_smith: haskpresso

17:41 m1dnight: :D

17:41 cfleming: michaelr524: The next drop of Cursive (in a day or two) has a panel to configure your keybindings in one go.

17:41 m1dnight: If Hitler ever made a programming language, I think it would Haskell

17:41 I just tried Cursive, but the formatting is WAY off :p

17:42 (formatting of source)

17:42 dbasch: Ha ࿕kell

17:42 cfleming: michaelr524: It has two sets, basically what I use (see https://cursiveclojure.com/userguide/paredit.html) and Emacs

17:42 m1dnight: What are you seeing with formatting?

17:42 m1dnight: There are various options.

17:43 m1dnight: Parts that hav too much tabbing. A manual indentation, with a tab too much, followed by a format did fix it though

17:43 might be because I edited in emacs

17:43 cfleming: m1dnight: Can you show me an example?

17:43 michaelr524: cfleming: Great! Thanks :)

17:45 m1dnight: let me look it upt cfleming it's a few commits back

17:45 cfleming: m1dnight: Thanks - a few people have mentioned this when starting with Cursive but I've never seen an example.

17:52 gfredericks: so I see tools.nrepl is included with leiningen's :base profile; does that mean the only way to exclude tools.nrepl is to somehow exclude the :base profile?

17:53 or is there some special merge feature I'm unaware of?

17:53 technomancy: gfredericks: it should defer to nrepl in :dependencies if one is present

17:54 oh, unless you're changing the group-id?

17:54 in that case you can shadow :base by putting :base {} in project.clj

18:01 gfredericks: hmm

18:01 okay

18:01 I guess a local install with the same group ID is probably easiest

18:01 although none of these options in :base look too crucial

18:02 technomancy: gfredericks: hm; oh right you would lose some other :base things

18:04 user9865: anyone around?

18:04 technomancy: nope

18:05 justin_smith: user9865: if you have a question you can go ahead and ask

18:06 user9865: Persistent data structures - can they be shared safely between threads outside STM?

18:06 justin_smith: if used as intended, yes

18:06 hiredman: of course

18:06 by definition

18:07 they are immutable

18:07 user9865: so what is the point of refs? Safe update of a single reference ?

18:07 jeremyheiler: yes

18:07 hiredman: user9865: I recommend rich's "our we there yet talk"

18:08 justin_smith: refs are a reference to an immutible datatype - the ref changes, the data it points to does not

18:08 user9865: OK i see - threads can share PDS's but single ref updates have to be co-ordinated

18:08 hiredman: I would also pretty much recommend ignoring the stm

18:08 m1dnight: Simply put: if you "change" a data structure in clojure, it tries to share as much with the original as possible

18:09 hiredman: user9865: they are by definition coordinated

18:09 m1dnight: if you cons 1 to '(2 3 4) you have a pointer to a list that starts with 1, but '(2 3 4) are shared.

18:09 Correct me if im wrong

18:09 user9865: yep that is as I understand it

18:09 noonian: yep, and all the core datastructures work that way

18:10 user9865: @midnight - why ignore STM ?

18:10 hiredman: I am pretty sure I said that

18:10 user9865: yeah sorry you did

18:10 hiredman: in practice the stm doesn't really get used

18:11 it of course depends a lot on what you are doing, maybe if you are writing a big simulation or something you may use refs

18:11 technomancy: user9865: most state change is either trivial (no need for coordination) or cross-server, where STM doesn't help

18:11 noonian: user9865: the 'ref' reference type uses the stm but you usually don't need that level of coardination between multiple mutable refs, most clojure programs have 1 or maybe 2 mutable things in them if any

18:11 gfredericks: I used refs once and it was almost as a joke

18:11 hiredman: but generally you might use an atom here or there

18:13 user9865: ok i can see why refs wouldn't be used much if you have PDS's anyway - the book i am reading made a big deal of them though

18:13 technomancy: they are conceptually very cool

18:14 gfredericks: just like erlang

18:14 technomancy: these days almost all server-side software is distributed systems, where thety don't help at all

18:14 hiredman: I dunno, most large clojure shops use it for large data processing jobs, the stm just isn't useful there

18:16 rich's example of the stm is the ants simulation, and in my limited circle I don't know people who write things like that

18:17 technomancy: if clojure got used for non-server things, STM would get used more I bet

18:18 hiredman: well, thinking about, I think the ants simulation is really a demo, if I was charged with writing such a thing, I don't think I would write it like that

18:19 gfredericks: my use was qubit simulation....so that goes with the simulation theme

18:20 hiredman: it seems like the best way to run a large scale simulation is to figure out how to formulate it as matrix algebra and turn some fortran library loose on it

18:20 so I dunno

18:20 vIkSiT: hello all

18:21 in a clojurescript om app, I'm getting an issue using transact! and update!

18:21 https://gist.github.com/viksit/ffe8a79a50e84f623128

18:21 hiredman: an important thing to realize though is the STM is just refs, the other reference types are not part of the stm (agents are slightly coupled, but entirely useable without it)

18:21 vIkSiT: Uncaught Error: No protocol method ITransact.-transact! defined for type cljs.core/Atom: [object Object]

18:21 noonian: vIkSiT: you need to use transact! and update! on a cursor that Om passes your component, not on the atom itself

18:21 vIkSiT: Do you guys know what I'm doing wrong?

18:21 hiredman: (not that I really use agents for anything either)

18:22 vIkSiT: noonian, ah - how do I simulate what om passes?

18:24 noonian: vIkSiT: are you trying to use Om? or just update your atom?

18:25 vIkSiT: noonian, well, I'm using Om.

18:25 I'm just trying to also figure out what's different in doing (om/root timeline-view timeline-state {:target (. js/document (getElementById "main"))})

18:25 vs updating it myself

18:26 how does that cursor get formed, exactly and how do I simulate to test whether it works?

18:26 noonian: vIkSiT: thats my one gripe about Om, if you want to have toplevel things affect toplevel app state you need to do some hacks to make the root cursor available

18:26 vIkSiT: because right now, I haven't figured out yet how to write an om component with the Irender and whatnot

18:26 noonian, ah :/

18:27 noonian, what kind of hacks? any documented ones/I can read about somewhere? gists?

18:27 noonian: vIkSiT: your timeline-view in that example will get passed a cursor that looks and acts like app-state that you can transact! on

18:28 vIkSiT: noonian, right- but right now, that (get-posts function isn't integrated into my view

18:28 since I haven't quite figured out the lifecycle yet

18:28 I know I need to do a reify (IWillMount (..)))

18:29 but still hacking through that hehe

18:29 I figured if I call (get-posts) before

18:29 atleast my app state is populated

18:29 and my view will render it

18:30 noonian: yeah, i can't help more right now; at work, but i usually use core.async to coordinate, a simple hack for testing would be in your views IWillUpdate lifecycle protocol store the root cursor in a top level atom

18:31 vIkSiT: ah

18:31 k thanks. Will check

18:57 theseb: 2 newb questions....1. Why/how does clojure use brackets?...[] ....I thought there was an unspoken law that lisps had to only use parens?!? 2. Does Clojure have wrappers to call Java functions?...I don't get how that works since Java functions are in a different language

18:57 any help appreciated

18:58 hiredman: clojure compiles to jvm bytecode just like java does, so clojure can emit the same jvm bytecode for a method call as java to call a java method

18:59 clojure has more data structure literals than traditional lisps and uses them as part of its syntax

18:59 [] for a vector, {} for a map, #{} for a set

18:59 theseb: hiredman: thanks..but by allowing brackets doesn't that interere with desire to have code and data look the same?

18:59 technomancy: schemes use square brackets too; the "parens are the only true form of homoiconicity" is a CL trope

19:00 hiredman: theseb: how so? vectors are both valid code and data in clojure

19:00 technomancy: being scheme it of course depends on the scheme

19:00 technomancy: hiredman: hm; I thought it was in r5rs

19:00 theseb: hiredman: ok....so they at least only allow parens, brackets and braces..at least they kept the deviations to a minimum

19:00 technomancy: been a few years so I could be thinking of something else

19:01 theseb: there's no "deviation"

19:01 theseb: hiredman: and lastly how call Java libraries from Clojure?

19:01 hiredman: technomancy: could me I just read stuff that refers to old schemes

19:01 technomancy: data structures are valid code

19:01 hiredman: theseb: checkout clojure.org or one of the many tutorials on the internet that google can find for you

19:01 technomancy: though I guess you don't see any core macros using sets; you could certainly write your own

19:02 theseb: ok thanks

19:03 hiredman: technomancy: well, you don't have to use them in a macro to be code, a literal is code

19:03 * technomancy nods

19:06 noonian: they probably don't use set syntax for code because the # makes it uglier than the other literals available

19:07 technomancy: it would scare away those with perl allergies

19:07 hiredman: code that evaluates in an undefined order is weird

19:07 (which is technically true of maps to, but array maps sort of get around that)

19:07 too

19:17 vIkSiT: eeh

19:17 how do you guys parse json in clojure?

19:17 using transit?

19:17 amalloy: cheshire

19:17 vIkSiT: ah

19:18 amalloy, cheshire vs transit? any thoughts?

19:18 justin_smith: transit is a whole other thing. It isn't a json parser.

19:18 noonian: thank god transit came out, it was getting rediculous not being able to parse json :P

19:19 vIkSiT: hehe

19:19 hiredman: transit is a new set of formats above and beyond json

19:19 chesire is a json parser

19:19 justin_smith: vIkSiT: data.json comes with clojure, but many of us prefer cheshire

19:19 hiredman: (as is clj-json and data.json)

19:19 dbasch: ibm needs to come up with transitx

19:19 technomancy: justin_smith: "comes with" clojure?

19:19 vIkSiT: ah hmm

19:19 I didn't realize data.json was included?

19:19 technomancy: vIkSiT: it's not

19:20 vIkSiT: *whew*

19:20 justin_smith: technomancy: oh, I was wrong about that

19:20 vIkSiT: of course, I wish it was :)

19:20 dbasch: vIkSiT: use cheshire

19:20 justin_smith: cheshire is better anyway, yeah

19:20 noonian: yeah, it's named after a cat

19:21 justin_smith: and would you believe, it handles smile data?

19:21 vIkSiT: ah

19:21 thanks for the info!

19:23 haha

19:24 *small problem* - clojurescript vs clojure. sigh

19:24 I forgot I was writing clojurescript.

19:25 dbasch: vIkSiT: in that case just use the native js parser

19:30 technomancy: aka eval

19:30 * technomancy flees

19:32 dbasch: well, it's eval after verifying that's it's actually json

19:32 otherwise the web would be a horrible(r) place

19:34 I'm convinced that all the unnecessary json generation/parsing we do is one of the root causes of global warming

19:42 {blake}: I'm having trouble figuring out dependencies.

19:43 I've got a rather complex project with many files. One of them :requires clj-time.core (for example).

19:43 But I don't have clj-time (anything) in my project.clj.

19:43 justin_smith: {blake}: lein deps :tree

19:44 {blake}: justin_smith Well...that's...a thing.

19:44 hiredman: {blake}: that is bad, if it works at all it is because some other dependency you do depend on is pulling in clj-time, so you are getting it transitively

19:45 {blake}: hiredman, aha...so that actually answers all of my questions. Since the next one was going to be: "Not only is it not in the project.clj, the version being used is horribly out-of-date."

19:45 hiredman: you should not directly depend on (via require, etc) any code that lein thinks you only transitively depend on

19:45 {blake}: There it is...it's in compojure.

19:47 Boy, does that seem bad. I can use different versions in the same code I presume.

19:48 hiredman: can't

19:49 {blake}: hiredman, Well, that seems like a problem. I need a newer version but rely on code that uses an older version?

19:50 hiredman: well, if the api hasn't changed, you can tell lein to ignore compojure's dependency and then specify your own dependency

19:50 technomancy: or if the API has changed only in additive ways

19:50 hiredman: right

19:51 if not then that won't work

19:51 {blake}: I think it's only additive. If I specify a particular clj-time in the project.clj, that'll override?

19:52 technomancy: yeah, direct deps win over transitive ones

19:52 hiredman: I'd suggest using :exclude too

19:53 you could upgrade your version of compojure, it doesn't look like clj-time is in the project.clj for the latest

19:53 amalloy: it seems pretty weird for compojure to depend on clj-time anyway

19:54 hiredman: yeah

19:54 {blake}: hiredman, To exclude...? And, actually, I'm not sure why compojure is in this project at all. It might just be a leftover. (Old, large project, never refactored.)

19:54 hiredman: I am trying to figure out when compojure ever depended on clj-time, and I don't see that anywhere

19:55 justin_smith: {blake}: was clj-time being used directly by compojure, or by one of compojure's deps?

19:55 hiredman: {blake}: then rip it out

19:56 {blake}: compojure 1.1.5 used ring/ring.,core 1.1.7, which in turn used clj-time 0.3.7, if I'm reading this correctly.

19:57 amalloy: {blake}: yep, sounds right to me

19:57 justin_smith: it's pulling it in for calculating intervals and seconds in cookies

19:57 https://github.com/ring-clojure/ring/search?utf8=%E2%9C%93&q=clj-time

19:57 amalloy: in fact latest compojure still depends on clj-time transitively

19:58 hiredman: ah

19:58 I assumed "it's in compojure" meant "compojure directly depends on it"

19:58 {blake}: Muchas gracias, clojuros. Very educational.

19:59 hiredman, apologies for the imprecision.

20:01 hiredman: I should have known better than to assume, and it didn't really matter anyway

20:02 {blake}: Is there any way to tell from inside a repl what version of a lib you're using?

20:02 gfredericks: sorta

20:02 it takes a lot of fumbling

20:02 amalloy: {blake}: not really. library versions don't exist at runtime

20:03 {blake}: Bummer. I notice there seems to be some sort of lag between Cursive and...well, things NOT Cursive. It can be very confusing.

20:04 hiredman: the dependency stuff comes from maven, which lein grafts on top of clojure with a lot of other stuff

20:05 {blake}: And lord knows, I'm grateful. They keep threatening to make me go back to Ruby, and I get the cold sweats thinking about gemsets.

20:05 hiredman: if you are new to clojure a good 50% of what you think of as clojure is behaviour from lein and not "clojure" per se

20:06 {blake}: hiredman, Very true. I picked that up pretty fast, I think.

20:07 (It's probably the only thing I've picked up fast in Clojure. That and the REPL.)

20:08 See, now I've got clj-time/core 0.8.0 in my app, and it knows all the functions up to line 599.

20:13 dbasch: compojure depends on ring which uses clj-time only for cookies

20:14 justin_smith: dbasch: as I showed with my above github link

20:14 dbasch: yes, that's what I was looking at. Was I typing out loud again? :P

20:52 vIkSiT: hmm

20:52 I think I'm missing something here : https://gist.github.com/viksit/8079734bf051ee1a435f

20:52 what's wrong with this JSON?

20:53 irctc: ,(time (repeatedly 10000 (vec 0)))

20:53 clojurebot: #<RuntimeException java.lang.RuntimeException: Unable to convert: class java.lang.Long to Object[]>

20:54 irctc: ,(time (repeatedly 10000 #(vec 0)))

20:54 clojurebot: #<RuntimeException java.lang.RuntimeException: Unable to convert: class java.lang.Long to Object[]>

20:54 justin_smith: ,(do (time (repeatedly 10000 (vector 0))) (time (doall (repeatedly 10000 (vector 0)))))

20:54 clojurebot: "Elapsed time: 0.046326 msecs"\n#<ArityException clojure.lang.ArityException: Wrong number of args (0) passed to: PersistentVector>

20:55 justin_smith: ,(do (time (repeatedly 10000 #(vector 0))) (time (doall (repeatedly 10000 #(vector 0)))))

20:55 clojurebot: "Elapsed time: 0.123552 msecs"\n"Elapsed time: 11.683289 msecs"\n([0] [0] [0] [0] [0] ...)

20:55 justin_smith: it's 100 times faster when you don't realize it

20:55 irctc: ,(time (doall (repeatedly 10000 (vector 0))))

20:55 clojurebot: #<ArityException clojure.lang.ArityException: Wrong number of args (0) passed to: PersistentVector>

20:56 mdeboard: Anyone using Cursive with IntelliJ?

20:56 irctc: ,(time (doall (repeatedly 10000 #(vector 0))))

20:56 clojurebot: "Elapsed time: 4.741657 msecs"\n([0] [0] [0] [0] [0] ...)

20:56 mdeboard: I'm curious if it's possible to start a new Clojure project somehow with it, and I'm just missing something

20:57 amalloy: irctc: please /msg clojurebot any test expressions you aren't intentionally making public

20:58 irctc: thanks

20:58 amalloy: vIkSiT: that's not json, it's an object. json is a string representation of a javascript object

20:58 dbasch: vIkSiT: you're assigning an object to a variable

20:58 there's nothing to parse

21:00 irctc: i think clojurebot is ignoring me :(

21:00 oh, nm, new window

21:04 theseb: is clojure authore some kind of lisp genius? he had strong options about mutability and concurrency.....most people don't even know what those terms mean let alone know enough to go their own way in lang development?!

21:04 s/authore/author

21:04 dbasch: most people don't create programming languages

21:05 cfleming: mdeboard: Yep, what's up?

21:05 theseb: dbasch: is clojure getting the love from clispers and rest of lisp community?

21:05 dbasch: it seems to attempt to solve a lot of gripes people have with lisp

21:05 cfleming: {blake}: What is the problem you're seeing with lag?

21:06 mdeboard: cfleming: Trying to sort out how to start a new project but I see that they recomend just doing lein new

21:06 dbasch: theseb: clojure is obviously quite popular within the list community for several reasons

21:06 s/list/lisp

21:07 cfleming: mdeboard: Right (I develop Cursive) - there's no way to create a new lein project from within Cursive right now, sorry

21:07 dbasch: but also pretty much everyone who has had to deal with concurrency has strong opinions about concurrency

21:07 mdeboard: it's no problem

21:07 just wanted to make sure I wasn't missing something

21:07 theseb: dbasch: is there any reason lispers would *not* love clojure?

21:07 cfleming: mdeboard: No, there's an issue out there about it and it's on at least one to-do list

21:08 mdeboard: cool

21:08 I'm coming from emacs and stuff so this is pretty normal workflow

21:08 to me

21:08 justin_smith: theseb: it's not common lisp, it has syntax and symbols that common lisp does not use

21:09 dbasch: theseb: perhaps the fact that it hard to use clojure properly without having some knowledge of java and the jvm

21:09 justin_smith: theseb: when I first started using clojure I found the many differences from other lisps annoying (now I love them)

21:09 cfleming: mdeboard: Ok great. Let me know if you have any issues.

21:10 dbasch: especially if you need to optimize for performance

21:11 mdeboard: seems awesome. emacs is pretty flakey on Windows (for me anyway) so I'm looking for a way to work on projects when I'm playing a game or watching Netflix (I do neither on Linux). And I've heard great things about Cursive

21:12 cfleming: mdeboard: Great, glad to hear it! Windows support is one of the reasons I want to be able to create a project from within Cursive actually, since people often aren't as used to using the command line.

21:13 mdeboard: yeah, no doubt

21:13 I assumed it was like a pretty easy thing to build into a plugin for IntelliJ since "Create Project" is right there on the splash page

21:13 but I guess not

21:15 dbasch: this is somewhat offtopic, but I went back to my kinesis Keyboard a few days ago and I'm trying to figure out a layout for the modifier keys that works well with emacs as well as the rest of osx. Suggestions welcome.

21:16 mdeboard: cfleming: cursive was mentioned at strangeloop in the typed clojure talk actually

21:16 as adding support or some such

21:17 cfleming: mdeboard: Yeah, there's some preliminary support in there I added recently. There's no doc for it yet unfortunately.

21:18 mdeboard: If you're interested, you can type check your current ns using Tools->REPL->Type check current NS

21:19 mdeboard: oh I don't use typed clojure whatsoever

21:19 but the talk was interesting

21:19 cfleming: mdeboard: Errors are marked in the editor and so forth.

21:19 Ah, ok

21:19 Yeah, I haven't watched it yet

21:19 mdeboard: btw do you have a theme besides darcula you use? Too much orange

21:19 I have an orange house with an orange window. Orange is the color of all that I wear

21:20 amalloy: mdeboard: you can also run emacs in a linux vm, if don't want to learn a new editor

21:20 mdeboard: amalloy: naw I like IntelliJ actually, I have the emacs keybinds all set up and so forth

21:20 cfleming: mdeboard: I'm old school, I have black on white. You can get a lot of themes (solarized etc) around.

21:20 amalloy: cfleming: old school is black on white?? i think you mean orange on black

21:21 mdeboard: i tried the emacs bindings for eclipse, and found myself in a kind of uncanny valley where some things worked well enough to make me surprised and angry at the millions of things that didn't work at all

21:21 cfleming: amalloy: Or green on black, I guess. But all the cool kids seem to be on some kind of dark theme these days.

21:22 amalloy: cfleming: i do use green on black for my terminal, although i think orange predates it a bit

21:22 a nice solid 0000FF on 000000, no compromises

21:22 errrrrr, 00FF00

21:24 dbasch: anything but a black background would destroy your monitor quickly back in the day

21:25 amalloy: interesting. "An amber screen was claimed to give improved ergonomics, specifically by reducing eye strain; this claim appears to have little scientific basis." i remember my dad telling me this is why he bought amber screens instead of green for the house

21:25 dbasch: the first monitor I bought looked like this http://cdn.arstechnica.net//wp-content/uploads/2012/06/s_p_11716_1__49099_zoom.jpg

21:25 it was significantly nicer than green

21:26 amalloy: dbasch: that's what i grew up around; i was far too young to buy them, but not so young that i don't remember them

21:26 dbasch: I went from a color tv to that, and it was much more tolerable

21:27 cfleming: amalloy: Yeah, 0000FF on 000000 might be a bit subtle - only for those really dark coding caves

21:31 theseb: say...clojure uses first and rest instead of car and cdr.....how does it access the SECOND element of a cons cell....does it is use rest?

21:31 that is only place were rest seems awkward

21:32 justin_smith: ,(second '(0 1 2))

21:32 clojurebot: 1

21:32 justin_smith: or do you mean in terms of implementation?

21:32 theseb: justin_smith: does clojure have cons cells like (a . b) ?

21:33 justin_smith: how would you access the b?

21:33 justin_smith: no

21:33 theseb: justin_smith: whoa...clojure hides the list implementation details of cons cells?

21:33 justin_smith: i'm interested

21:34 justin_smith: i personally wrote a list that hid that...i'm intrigued that clojure author avoided cons cells too

21:34 justin_smith: ,(type (cons :a nil))

21:34 clojurebot: clojure.lang.PersistentList

21:34 justin_smith: the source is open, if you want to check out how it was done

21:34 mdeboard: cfleming: Only thing I've bumped into so far is that some of the default keybinds (Ctrl-W for example) bump into emacs keybinds. You mention this somewhere in the docs, but I'm not sure how/where to modify this. Can you point me in the right direction?

21:35 dbasch: theseb: it's an interface called ISeq that has many different implementations

21:35 justin_smith: theseb: cons is not as primative and universal in clojure

21:35 mdeboard: meaning, you explicitly address the "shipping default keybinds is hard because of conflicts" issue in the docs

21:35 justin_smith: theseb: we use many different data types, without building them out of conses

21:35 dbasch: theseb: more detail here: http://clojure.org/sequences

21:35 cfleming: mdeboard: Right - there's actually a new panel coming in the next build to help with setting that up.

21:35 theseb: justin_smith: for *years* i've hearing in lisp docs about how lisp are "really conses"

21:36 cfleming: mdeboard: You're using emacs bindings, right?

21:36 mdeboard: oh, keymap, derp

21:36 Yeah

21:37 cfleming: mdeboard: Yeah, it's under Settings->Kemap. Cursive actions will take precedence in Clojure settings, so you should only have to rebind the built-in actions that your keybindings conflict with.

21:37 justin_smith: theseb: many data structures in clojure are not lists, and are in no way made of lists. It ends up being pretty useful to do things that way.

21:38 mdeboard: cfleming: The list of keybinds under the Cursive section is pretty small-ish, are the Ctrl-W/Ctrl-P etc. binds under Editor actions

21:38 dbasch: theseb: probably one of the nicest features of clojure is the data structures and the functions to interact with them

21:38 mdeboard: If this is annoying doing tech support like this let me know :P

21:38 cfleming: mdeboard: Hehe, no worries. Check the bottom of the page here: https://cursiveclojure.com/userguide/paredit.html

21:39 mdeboard: There are a couple of groups, the easiest way to find them is from Main Menu in the tree.

21:39 mdeboard: ahso

21:39 cfleming: mdeboard: The REPL commands are all under Tools->REPL

21:40 vIkSiT: amalloy, dbasch - yeah, I realized that - something in the way I'm returning json data I guess

21:43 mdeboard: cfleming: aha! great re: the docs nestled at the bottom there. May be worth breaking out into a "Keyboard Navigation" section in the docs or something.... maybe. With all the time I'm sure you have

21:43 :P

21:43 cfleming: mdeboard: haha, I'm lounging in a hammock with a cocktail right now.

21:44 mdeboard: Amazingly I actually have updated those docs for the next drop, which has the new config panel

21:44 mdeboard: well look at you

21:44 with your cocktails

21:44 and your hammocks

21:45 cfleming: mdeboard: Sadly it was a total lie

21:46 mdeboard: good

21:46 Misery loves company

21:48 raspasov: LightTable vs cursive - opinions?

21:48 mdeboard: cursive

21:49 lighttable will be abandonware eventually

21:49 if it's not already

21:49 raspasov:

21:49 raspasov: ok 0:1, more takes? :)

21:49 justin_smith: cursive

21:49 raspasov: 0:2 :)

21:49 justin_smith: oh, I know the right way to do this

21:49 (inc cursive)

21:49 lazybot: ⇒ 1

21:50 raspasov: LOL

21:50 cfleming: raspasov: I'd say Cursive but I develop it, so that's worth half a point at best

21:50 raspasov: oh, haha lol

21:50 ok 0:2.5 :D

21:50 mdeboard: raspasov: I'm basing my comment on http://www.chris-granger.com/2014/10/01/beyond-light-table/

21:50 justin_smith: cfleming: raspasov: the fact that the developer of cursive is here talking to users about bugs, docs, and features and the developer of lighttable is not is worth ∞ points.

21:50 mdeboard: well

21:50 now let's be fair

21:51 chris was a fixture in here for a long, long time

21:51 justin_smith: OK

21:51 mdeboard: but, yeah, in practical terms...

21:51 cfleming: It's actually a shame LT is gradually becoming abandonware, it had some nice ideas I think

21:52 It's still great for getting started with Clojure

21:52 mdeboard: Yeah, that's what I heard on all points

21:52 cfleming: For something like ClojureBridge it's probably still really good.

21:53 mdeboard: Yeah I need to test that hypothesis

21:53 cfleming: But I think a lot of the live-REPL ideas don't work so well once you have more complex code with state etc.

21:53 mdeboard: My girlfriend is going to the next cljbridge down here in Austin, whenever it is, wonder what they recommnd editor-wise

21:53 cfleming: I'm still planning to implement painting REPL results in the editor at some point, but I need to inc my swing-fu

21:54 raspasov: cfleming: what do you mean painting REPL?

21:54 mdeboard: justin_smith: Actually the creator of light table IS in the channel :P

21:54 raspasov: like color the REPL output?

21:55 justin_smith: mdeboard: OK

21:55 cfleming: raspasov: No, Light Table's main selling feature is that the REPL is not in a separate editor pane like in Cursive or Emacs, when you evaluate things in the REPL the result is shown right in your editor.

21:55 raspasov: Along with intermediate results like let-bindings and so on.

21:55 mdeboard: :(

21:55 justin_smith: mdeboard: my point was more about activity / responsiveness of the main developer, long term future of the tool, etc.

21:56 raspasov: cfleming: yea I know... not sure if I really see the benefit of that past the fact I have to click-erase that damn bubble in the middle of my page :)

21:56 justin_smith: in case that wasn't clear

21:56 mdeboard: justin_smith: I understand

21:56 text chat, easily misunderstood, etc., etc.

21:56 cfleming: raspasov: Yeah, it's not so useful to have them sticking around long term - I guess it should be easy to clear them though

21:57 raspasov: cfleming: are you the guy responding on Twitter as well?

21:57 mdeboard: I think ReactJS/Om would lend themselves quite well to live-REPL'ing, if done right

21:57 cfleming: Watches were also an interesting idea, but I heard they didn't work very reliably

21:57 raspasov: Yup, that's me.

21:57 mdeboard: since there's a "football" of state that's being handed off from component to component (in the worst case)

21:58 raspasov: cfleming: cool! are you doing cursive by yourself? in any case, keep up the good work!

21:58 mdeboard: in the... what's the word, pathological case?

21:58 cfleming: raspasov: Yep, it's just me, right now at least.

21:58 raspasov: cfleming: I would definitely be a buyer whenever it's ready

21:59 mdeboard: well-behaved React & Om applications don't pass state around that much at all

21:59 cfleming: what, I thought cursive was a biz

21:59 cfleming: raspasov: Great, that's the best way to make sure it stays maintained :-)

21:59 mdeboard: like you had multiple people maintaining

21:59 cfleming: mdeboard: Yup, I set up a company the other day and everything.

21:59 mdeboard: oh, wild

21:59 cfleming: But it's a small company of one.

22:00 mdeboard: So I know nothing about IntelliJ-as-a-platform development, I assumed it was like WordPress, and that the people (!) behind Cursive were in a company that did multiple plugins as their source of revenue

22:00 apparently not

22:01 cfleming: mdeboard: No, Cursive is kind of unique actually, no-one else who isn't jetbrains is charging for plugins.

22:01 raspasov: mdeboard: not at all, anyone can make I plugin I believe

22:01 cfleming: mdeboard: There's quite a lot of unknown around how that will work, but I'm optimistic.

22:01 mdeboard: Well yeah but anyone can make WordPress themes/plugins too, but there's an industry around it etc

22:02 cfleming: And I'd like to branch out into more plugins once Cursive is stable if there's a market and time allows.

22:02 OCaml, Julia or Rust, maybe - there are already OSS plugins for Go and Erlang

22:02 mdeboard: Seems like best bet might be to find some wealthy entity out there who would benefit from wider Clojure adoption?

22:03 Elixir

22:03 There's a gy working on one of those here in Austin

22:03 we were commisserating over syntax highlighting being difficult ot get right (I maintain elixir-mode for emacs)

22:03 cfleming: Yeah, I think Cursive could really help drive Clojure adoption in enterprise, atcually

22:03 mdeboard: er, s/syntax highlighting/indentation/

22:03 Ya no doubt

22:04 I am a workaday Python programmer who uses emacs exclusively but PyCharm is pretty sweet.

22:06 cfleming: Yeah, no doubt - I'm a huge fan of JetBrains and their products

22:06 raspasov: JetBrains rocks

22:07 cfleming: mdeboard: Interesting, Elixir looks really cool - I've heard a few people talking about it recently

22:07 But it does look like something you'd have to parse properly rather than regexing

22:07 mdeboard: Yeah it builds on Erlang pretty well. But from a language mode maintainer's perspective, the syntax is so squishy. So many ways to express everything

22:07 cfleming: mdeboard: Tell me about it!

22:08 mdeboard: hahaha, yeah I guess preaching to the choir with a lisp

22:08 but fortunately Emacs has pretty decent faculty for doing comprehensive indentation handling. It's just a bear to get productive in it

22:09 In Cursive is there a command for "Send this form to the repl"

22:09 cfleming: Yeah, formatting code is amazingly hard.

22:09 Steve Yegge talked about it in his article about JS2 mode - it's well worth a read if you haven't read it already

22:09 mdeboard: Yeah, it's one of those things that you never think about. Something as "simple" as triple-quoted strings """like this""" is... so hard.

22:09 Oh man I need to re-read that, been a long time

22:10 cfleming: Yup Tools->REPL->Run form before cursor/Run top form

22:10 raspasov: mdeboard: you can setup custom key combination for it as well

22:10 mdeboard: raspasov: do tell

22:11 cfleming: That article really brings home how hard it is to retrofit proper syntax analysis to an editor that isn't built for it from the ground up

22:11 raspasov: fyi I was never a Emacs person - what are some Pro tips for arranging ()?

22:11 the only thing I know is

22:11 mdeboard: oh there it is, the thing for the repl keybind

22:12 cfleming: mdeboard: Settings->Keymap then find the action in the tree under Main Menu->Tools->REPL

22:12 mdeboard: cfleming: I got it this time, I think I see how the keymap thing is laid outnow

22:13 raspasov: What do you mean, arranging ()? cider has pretty sensible defaults, and paredit works wonders (though I don't use it)

22:14 raspasov: I'm talking about the Slurp, Barf, Move Form Up, Down etc

22:16 mdeboard: oh, I don't know that stuff. I might be the most unproductive emacs person

22:16 no paredit, no structural editing, etc.

22:19 cfleming: Anyone here who might be able to help with a test.check problem?

22:20 reiddraper: cfleming: sure

22:21 cfleming: reiddraper: You sound like just the man. I'm trying to get the recursive generation working - we exchanged a couple of mails about it on the mailing list.

22:21 reiddraper: okie

22:21 mdeboard: Anyone know of a template for liberator projects

22:21 lein template*

22:22 cfleming: reiddraper: This is what I have: https://www.refheap.com/91043

22:22 mdeboard: https://github.com/flyingmachine/liberator-templates

22:22 Oh this isn't what I need at all.

22:23 cfleming: reiddraper: primitives and (compound primitives) work fine

22:24 reiddraper: (gen/sample (gen/recursive-gen compound primitives)) also works

22:24 reiddraper: But I'd like object to generate objects that can recursively contain other objects

22:24 reiddraper: I get an NPE when I try that

22:25 reiddraper: cfleming: it seems to me that your example should work, and will contain recursive objects

22:26 cfleming: for example, your refheap example should generate vectors of vectors of nil

22:27 cfleming: reiddraper: I get this: https://www.refheap.com/91044

22:28 reiddraper: cfleming: okie, let me try locally

22:28 cfleming: reiddraper: Thanks

22:30 reiddraper: cfleming: oh

22:30 cfleming: you want (def object (gen/recursive-gen compound primitives))

22:30 not (def object (gen/recursive-gen compound object))

22:31 cfleming: reiddraper: But then will the objects recursively contain other objects?

22:31 reiddraper: cfleming: yes

22:32 try it

22:32 cfleming: reiddraper: You're absolutely right, they do - thanks!

22:32 reiddraper: cfleming: no problem

22:35 bcm: anyone own an ergodox?

22:40 scottj: bcm: you might want to ask you specific question in, say, #geekhack

22:40 bcm: there are people here with ergodox, best to just ask your question

22:46 bcm: scottj: that was my only question :(

22:46 scottj: bcm: oh :)

22:47 way to troll the ,anyone police

23:08 mdeboard: idk if any cursive users are still around, but do I have to do anything specific for cursive to know where leiningen is keeping the projects it downloads?

23:09 e.g. configure Maven settings to know there are jars in C:\Users\matt\.m2

23:09 cfleming: Ummm, I'm not sure what you mean - are you talking about the libs or the sources?

23:09 mdeboard: You shouldn't have to, Cursive will find them (via lein)

23:09 mdeboard: ah ok

23:10 cfleming: How are you setting your project up? Are you importing from your lein project?

23:10 mdeboard: It should Just Work (tm) if you do that.

23:10 mdeboard: I followed the instructions (I think), everything seems to be going ok. I imported from VCS

23:10 repl works and everything, that stuff is ine

23:10 fine*

23:10 cfleming: Ok, cool

23:10 mdeboard: just getting an error notification with the following block of code

23:11 https://gist.github.com/mattdeboard/a93d80c21b28340cd172 ... complaining about the first 'section' there after defresource

23:12 "section cannot be resolved". I figured it might be because it hasn't processed the defresource macro or some such

23:12 cfleming: mdeboard: So this is the biggest problem with Cursive - there's no way for it to know what macros are doing.

23:13 mdeboard: I've taught it about a lot of them, and Cursive is built around an extension api that people will be able to use to contribute support for libs they use or write.

23:13 mdeboard: But that's not open yet, it's not totally stable yet.

23:13 mdeboard: ahh ok

23:13 interesting

23:14 cfleming: mdeboard: I keep finding new functionality I have to add to it as I add refactorings and so on, but it's getting there.

23:18 mdeboard: For my purposes (I'm in bottom 10% of users easily) I just wanna turn off the error notification :(

23:36 cfleming: mdeboard: You can do that - Settings->IDE Settings->Clojure->Highlight unresolved symbols

23:43 joshuafcole_: What's the most idiomatic way to loop through a seq and do side-effecty things that can provide the current index?

23:43 e.g.

23:44 amalloy: map-indexed

23:44 justin_smith: joshuafcole_: dotimes

23:44 joshuafcole_: (do (map my-fn some-seq (range (count some-seq)))

23:44 justin_smith: for side-effecty

23:44 joshuafcole_: ah, map-indexed is already a big improvement

23:44 amalloy: justin_smith: dotimes won't work, unless you want to call (nth mycoll n) and make it O(n*n)

23:45 justin_smith: ahh, right

23:45 joshuafcole_: thanks amalloy!

23:45 (inc amalloy)

23:45 lazybot: ⇒ 172

23:45 justin_smith: joshuafcole_: putting it in a do will ensure none of the side effects happen

23:45 use dorun instead

23:45 joshuafcole_: none of them?

23:45 amalloy: yeah, indeed

23:45 joshuafcole_: oh right

23:45 that's what I meant

23:45 that would have been fun to debug

23:46 heh

23:46 justin_smith: ahh, sorry, there was nothing else in the do block - so it would have *maybe* run :)

23:46 if there was anythinhg else after it, it would be guaranteed not to

23:46 joshuafcole_: you're right though, I would've just typed do thinking I'd done dorun and been in for a bad time

Logging service provided by n01se.net