#clojure log - Feb 19 2014

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

0:00 noprompt: ;)

0:00 _eric: doesn't help me with \" though

0:00 noprompt: _eric: youre editor doesn't help you w/ that?

0:00 _eric: what do you mean by help?

0:01 noprompt: dammit i cannot type. :(

0:01 _eric: ie. "foo | bar" (type "" at |) => "foo \" bar"

0:01 the editor doesn't automatically escape it for you?

0:02 _eric: I guess not

0:02 noprompt: _eric: hmm. are you using paredit?

0:02 _eric: intellij/cursive is failing me

0:02 I guess

0:03 noprompt: _eric: ah, i think there's a paredit mode for it. i've used it just a tincy bit when pairing w/ folks but i don't recall if it does *that* automatically. ;_;

0:03 _eric: I have to say I can't understand how to use cursive's structural editing mode

0:04 noprompt: _eric: no worries, i usually end up breaking everything all together when i try to drive on it. i end up letting my pair just take over. ha!

0:04 _eric: hah

0:09 noprompt: dnolen_: did you see that nasty slurp hack? :-P

0:09 ha, that's pretty neat. i should find some way to abuse that...

0:25 echosa: W00T! Just push some major updates to my first clojure project: https://github.com/echosa/clojure-greed

0:25 *pushed

0:25 * echosa needs sleep

0:26 echosa: I'm particularly proud of greed.grid/get-number-of-cleared-spaces... wrote that one myself. nested recudes! (that was a fun exercise....)

0:31 67% code coverage... not bad

0:39 jjttjj: anyone messing with game developement in clojurescript lately?

1:05 alandipert: ztellman, https://github.com/alandipert/hyperturbo#examples

1:05 ztellman: alandipert: wat

1:05 alandipert: ztellman, i tried to use proteus for the vars but i had some issues

1:05 ztellman: oh yeah? anything I can help with?

1:06 alandipert: digging around a little, not sure yet. does proteus walk fn*'s?

1:06 ztellman: only if you mark them as :local

1:06 otherwise it doesn't let the container escape the local context

1:07 otherwise it's anarchy

1:07 you can have race conditions, dogs lying with cats, etc

1:07 alandipert: ok sweet, :local is exactly what i need

1:07 ztellman: readme explains it in more depth: https://github.com/ztellman/proteus

1:08 alandipert: i think it makes a lot of sense to use proteus with gotos

1:08 ztellman: sweet troll library, btw

1:08 haha, I should reuse the core.async inversion of control code to implement gotos in clojure

1:08 my new goal for 2014

1:08 noprompt: lol

1:09 haha

1:09 alandipert: this is rad.

1:09 ztellman: core.goto

1:09 noprompt: i need to stop doing serious shit.

1:09 ponyprincess: I'm just getting into clojure, any good beginner resources?

1:09 noprompt: like generate haikus that pass the turing test.

1:10 or rather the ginsberg test.

1:10 as in, alan ginsberg.

1:10 the alan ginsber test.

1:11 ponyprincess: theres http://clojure-doc.org/

1:32 dsrx: there's also http://www.braveclojure.com/

1:34 ,';

1:34 clojurebot: #<RuntimeException java.lang.RuntimeException: EOF while reading>

1:41 ponyprin_: What's good noob clojure?

1:43 dsrx: ponyprin_: http://clojure-doc.org or http://www.braveclojure.com

1:43 amalloy: www.4clojure.com

1:44 ponyprin_: woah neat

1:44 I want to be brave and true.

1:56 ddellacosta: ponyprin_: +1 on 4clojure.com. I learned a lot by going through that at the beginning. I should get back into it actually...still haven't gotten through all of it.

2:03 ponyprin_: I went to a haskell meetup and they wanted me to join a cabal so I decided to learn clojure instead.

2:10 tuyenhm: Guys, good morning from russia

2:11 xuser: ponyprin_: but haskell is the ultimate lisp

2:14 Platz: what would joining a cabal entail?

2:15 is it like a fight club

2:18 minikomi: hiya

2:19 felher: Hey folks. :) I am currently reading 'Programming clojure' and it's written there that "(next seomthing)" ist equivalent to "(seq (rest something))". But it seems to me that "(rest something)" alraedy returns a seq, even if fed an array. Did I miss something, or ist "(seq (rest something))" just equivalent to "(rest something)"?

2:21 hiredman: ,(rest (lazy-seq ()))

2:21 clojurebot: ()

2:21 hiredman: ,(seq (rest (lazy-seq ())))

2:21 clojurebot: nil

2:21 felher: hiredman: ah, got it, thanks :)

3:18 quizdr: you guys working professionally with clojure (or anyone who could guess a good answer for this), how many lines of good clojure code do you strive to write on an average day?

3:19 if I can write 100 effective lines, i consider that a good day, but i'm just a noob

3:32 locks: quizdr: I don’t, but that sounds like the wrong thing to worry about

3:33 if those 100 lines are solving business problems I’d say that’s pretty good

3:33 nathan7: on a good day in a pleasant language, I delete a hundred lines of code

3:34 locks: one year into this project I’ve deleted more than I’ve added

3:34 supersym: delete 1 char in the 'system' I work in and it dies

3:34 nathan7: So, I'm trying to get ClojureScript stuff going

3:35 and I'm quite clueless about Leiningen and real-world Clojure (ie outside a REPL)

3:35 and… even trying to use the lein-cljsbuild example breaks

3:35 ~/code/lein-cljsbuild/example-projects/simple ⮀ ⭠ master ⮀ lein cljsbuild once

3:35 Compiling ClojureScript.

3:35 java.lang.IllegalArgumentException: Duplicate key: org.clojure/clojure

3:35 which seems to be some kind of dep conflict

3:36 I have no idea how to debug a dep conflict like this, however

3:37 supersym: nathan7: https://github.com/magomimmo/modern-cljs

3:38 I believe some prefer to use that one for reasons I'm not sure but seems a lot was outdated on the web

3:38 nathan7: Yeah

3:39 I can't find a lot of information at all

3:39 supersym: yeah I dont do CLJS besides a little in pedestal

3:40 nathan7: I come from node-land, but I'm quite interested in bridging the client/server gap with a more powerful language

3:41 *** Warning: This project requires Leiningen 2.2.0, but you have 2.0.0 ***

3:41 …that may explain some things

3:42 quizdr: locks valid point just curious how much code typically is written in lisp on a given day; my output is much smaller, but i feel the end result is about the same as writing many more lines of code in other languages.

3:43 supersym: nathan7: yeah thats how I came here too

3:43 amalloy: quizdr: i don't think i've had many days of producing a hundred lines of clojure. more time thinking, condensing, planning, reducing

3:43 supersym: you'll probably never go back

3:43 nathan7: supersym: It worries me

3:44 supersym: I like JS a lot

3:44 supersym: I was here for some temporary 'bridging' too :P

3:44 locks: quizdr: from my experience with clojure I’ve come to a similar conclusion

3:44 supersym: yeah well lucky for you then, stuff doesn't go *that* fast

3:45 that is with webframeworks and clj

3:46 then again, that might be exactly the problem I did have with Node.... every man and his dog poluting the ecosphere with projects :P

3:46 now a lot of people who suck at JS can write crappy code for the server too... yay

3:47 nathan7: My JS leans strongly towards the functional

3:48 quizdr: amalloy any idea the lisp background of a lot of the major contributors to 4clojure? you think most are coming from years of lisp exposure?

3:49 amalloy or how about yourself?

3:49 amalloy: no way

3:49 i'm pretty sure clojure was the first serious lisp exposure any of the main contributors had

3:50 quizdr: smart guys, getting the idioms mastered so quickly. i see the answers of others at 4clojure and am always impressed at the creative and elegant solutions they come up with

3:50 amalloy: i'd been doing clojure for...what, just under a year? when i did most of my work on 4clojure

3:50 wait, are you talking about the people who solve problems? i thought you meant writing 4clojure

3:51 quizdr: both, actually.

3:51 amalloy: i don't know about the history of people who answer the questions

3:52 quizdr: i've been at clojure for about 2 months and am making progress but when you see guys offering a 5-character solution on 4clojure where the average solution is like 30 characters, it is impressive

3:53 hhenkel: Hi all, I'm currently stuck in something completly simple...I got a multiple similar json data and now I need to create a new list with only part of those values.

3:53 What is the best way to do this?

3:57 I'm iterating over the data and now I'm stuck in appending those values to a list....

4:04 supersym: hhenkel: you are using cheshire?

4:27 hhenkel: supersym: yes

4:30 supersym: but the data is allready transformed to clojure datastructures so it doesn't matter as far as I know.

4:35 supersym: no thats why I asked. It kinda depends on your returned types

4:36 clgv: hhenkel: do you want something like `select-keys`?

4:37 ,(map #(select-keys % [:a :b]) [{:a 1 :b 2 :c 3} {:a 4 :c 5}])

4:37 clojurebot: ({:b 2, :a 1} {:a 4})

4:38 hhenkel: clgv: Yes, that looks like what I'm looking for...first I wasn't sure but with your example it looks good.

4:38 supersym: right... or dissoc

4:38 hhenkel: I'll give it a shot.

4:38 supersym: ,(dissoc {:a 1 :b 2 :c 3} :c :b)

4:38 clojurebot: {:a 1}

4:38 supersym: the other way around ;)

4:39 clgv: probably the "positive way" is the better documenting one here ;)

4:40 supersym: surely

4:41 clgv: but a while ago someone asked for the inverse of select-keys ;)

4:42 *opposite

4:59 hhenkel: clgv: I'm still struggling with this: https://www.refheap.com/41925

4:59 supersym: ^^

5:05 rurumate: hello, I've started using liberator and noticed that ring's :auto-reload option doesn't work. Is there a workaround or will I have to restart jetty after each change?

5:05 clgv: hhenkel: well you first have to get down to the level where you have the list of requests

5:06 hhenkel: (map #(select-keys % [:request]) (->> data vals first)) should work for the displayed data

5:07 hhenkel: but probably in that case you just want the content of the request

5:07 hhenkel: (map :request (->> data vals first))

5:08 well if we are threading already then: (->> data vals first (map :request))

5:23 hhenkel: clgv: I get an error regarding data...

5:24 clgv: hhenkel: "data" is the binding or var to the data you displayed in your gist

5:25 hhenkel: clgv: okay...

5:26 clgv: with the pure data I get: clojure.lang.Keyword cannot be cast to java.util.Map$Entry

5:26 clgv: with (val mydata) used I get: clojure.lang.PersistentArrayMap cannot be cast to java.util.Map$Entry

5:28 clgv: ,(->> {:30000 '({:request 1, :values 2}, {:request 2, :values 3})} vals first (map :request))

5:28 clojurebot: (1 2)

5:28 clgv: hhenkel: when you one of the exceptions you mentioned than the data layout is different from the one you provided in your gist

5:29 Anderkent]away: clgv: hhenkel: no, I think he's using 'val' instead of 'vals'

5:29 ,(doc val)

5:29 clojurebot: "([e]); Returns the value in the map entry."

5:29 Anderkent]away: ,(doc vals)

5:29 clojurebot: "([map]); Returns a sequence of the map's values."

5:30 clgv: hhenkel: the key idea here is (1) extract the list where the maps with the :request are contained (2) map over that list to extract the :request data

5:31 you can build up (1) incrementally on the REPL

5:33 hhenkel: clgv: I updated https://www.refheap.com/41925

5:33 clgv: It should now be more clear what the inital data is...as the data before was only the part I'm interested in.

5:55 ddellacosta: what do I need to have configured to ensure my ClojureScript macros (with same namespace, and file w/.clj extension) are picked up and available to my CLJS?

6:10 lvh: Hi

6:10 So I hear that clojure.contrib isn't a thing anymore? How do I get the << strint macro defined here: http://clojure.github.io/clojure-contrib/strint-api.html

6:10 maybe I am just confused :)

6:13 arcatan: yeah, the monolithic clojure-contrib isn't maintained anymore. i don't know if strint was migrated anywhere, though.

6:14 ddellacosta: lvh: http://dev.clojure.org/display/community/Where+Did+Clojure.Contrib+Go

6:14 clojure.contrib.strint — Migrated to clojure.core.incubator - lead Rich Hickey. Status: latest build status, latest release on Maven, report bugs.

6:18 lvh: ddellacosta: Thanks!

6:18 ddellacosta: lvh: np

6:36 clgv: lvh: I think clojure.core.incubator has string interpolation

6:37 oh right. as above stated ;)

6:38 _bart: Hi

6:39 I' getting "Unable to resolve symbol: mk-pool", anything I'm missing?

6:41 I included overtone.live and overtone.live and overtone.inst.piano

6:42 which means that overtone.at-at is also already included I think (I'm not allowed to add it with (use 'overtone.at-at))

6:42 lvh: How do I chain seqs ([:a :b :c], [:d :e :f]) into one seq :a :b :c :d :e :f

6:42 _bart: because that creates an IllegalStateException interspaced already refers to: #'overtone.live/interspaced

6:42 lvh: I think flatten does that, but that seems kind of elephant-gunny.

6:43 concat!

6:43 _bart: lvh yeah concat

6:43 hhenkel: clgv: Had you time to have a look at the refheap stuff? I guess my problem once more is based on the interating.

6:43 _bart: (lvh, I usually check http://adambard.com/blog/clojure-in-15-minutes/ )

6:50 clgv: hhenkel: well, as hinted before. extract the list and map over it

6:57 hhenkel: clgv: Currently I'm failing to get your example working on the repl... :(

6:58 ,(->> {:30000 '({:request 1, :values 2}, {:request 2, :values 3})} vals first (map :request))

6:58 clojurebot: (1 2)

6:58 hhenkel: Same thing on the repl gives me: RuntimeException EOF while reading, starting at line 1 clojure.lang.Util.runtimeException (Util.java:219)

7:01 clgv: Full error on the repl: https://www.refheap.com/41964

7:03 clgv: hhenkel: thats because of a different data structure. in the example above there is one map whose only value contains the list of requests

7:04 oh you mean that example.

7:04 hhenkel: clgv: yes, the example you provided.

7:04 clgv: you probably have some copy&paste error there

7:05 since you see that it works with clojurebot ;)

7:14 hhenkel: clgv: nope, it's not a c&p problem...seems like it is something within my project resulting in problems.

7:16 clgv: hhenkel: try it on a fresh repl. you'll see it works there as well as in clojurebot

7:17 hhenkel: clgv: Yes, allready did that...currently trying to figure out what's wrong with my lein project.

7:18 lvh: So, I did added [:require [clojure.core.incubator :refer [<<]]] to my ns; but it doesn't work

7:18 I get java.lang.IllegalAccessError: << does not exist

7:20 hhenkel: clgv: I just created a complete new lein project, started the repl and I fail with that code...can you confirm that?

7:21 clgv: With a native clojure repl session your code works for me.

7:25 lvh: Can I require names from other test source files in a test?

7:31 hhenkel: clgv: looks like there is an issue with numbers as keywords when using leiningen?

7:35 dsrx: is it intended right now that js->cljs's keywordize-keys option does not apply recursively?

7:35 er, js->clj

7:35 hhenkel: clgv: https://www.refheap.com/41965 => my test cases that seem to indicat a problem with leiningen.

7:36 lvh: is it normal that I can't destructure a #{:a :b} as [one two]?

7:39 CookedGryphon: lvh: vector destructuring like that relies on nth

7:40 sets have no order so nth doesn't make sense

7:40 lvh: CookedGryphon: That's how I'm interpreting the error message; but I don't care about order

7:40 I guess I should throw the set through seq first?

7:40 dsrx: what would you expect 'one two' to be bound to?

7:40 er one and two

7:43 lvh: dsrx: the set has two elements; I would expect either element to be bound to one, and the other element to be bound to two.

7:43 clgv: hhenkel: hmm weird. in a "lein repl" I have the same problem. but not in counterclockwise....

7:44 dsrx: ,(let [[x y] (seq #{1 2})] (+ x y))

7:44 clojurebot: 3

7:44 clgv: hhenkel: it is the keyword starting with a digit in that case

7:46 hhenkel: clgv: yes, had an issue with that in my json config data and had to change that to "30000": to get it going...

7:46 clgv: It's kind of strange as it works in a pure repl.

7:46 clgv: hhenkel: it's either repl-y or leiningen

7:47 hhenkel: clgv: I'm currently thinking about my options - maybe I can fill up the data differently?

7:48 clgv: hhenkel: oh. replace the quoted list with a vector then it works

7:48 (->> {:30000 [{:request 1, :values 2}, {:request 2, :values 3}]} vals first (map :request))

7:48 ,(->> {:30000 [{:request 1, :values 2}, {:request 2, :values 3}]} vals first (map :request))

7:48 clojurebot: (1 2)

7:48 clgv: so it is definitely some reader (or eval) bug in leiningen or repl-y

7:51 hhenkel: clgv: hmm, the datastructure I get from parsing yaml (not json as I wrote before) - not sure if I'm able to change the behavior which datastructures are used.

7:51 clgv: Also good thing is, that it seems like it does not matter when used with lein run.

7:52 Anderkent: hhenkel: clgv: reply bug; lein run -m clojure.main works, lein run -m reply.main doesn't

7:54 hhenkel: Anderkent: okay...good to know that I'm not completly dumbthen.... ;)

7:56 Anderkent: one of you want to raise the ticket or should I?

7:57 clgv: Anderkent: go ahead

7:58 jonasen: I'm trying to use core.async pub/sub but I get "Uncaught Error: No protocol method Mux.muxch* defined for type null" if I have a topic that no subs are registered for. Is this expected? I'm probably missing something since I don't fully understand this stuff yet.

7:58 dsrx: blehh

7:59 CookedGryphon: jonasen: refheap?

7:59 sounds like your arguments are just in the wrong order or something and you're passing in nil instead of a channel somewhere

8:00 jonasen: I'll try to come up with a minimal example

8:06 CookedGryphon: lvh: what happens if you pass in a bigger set though? You get two sort-of-but-not-always random elements from it

8:06 lvh: destructuring like that doesn't make sense for sets. If you want to do something with all the elements, reduce over it or something

8:07 allowing destructuring makes it very easy to do something which will break weirdly later on down the line

8:09 jonasen: CookedGryphon: https://www.refheap.com/42002

8:10 Anderkent: clgv: hhenkel: https://github.com/trptcolin/reply/issues/132

8:10 jonasen: CookedGryphon: this is in cljs. I have not tried the clojure version

8:12 CookedGryphon: jonasen: I think you need to capture the returned channel from sub

8:13 I don't quite get the reasoning behind it, but I think it'll work if you do let [c (async/sub my-pub :foo (async/chan))] ...

8:14 jonasen: CookedGryphon: thanks, that works too. But I still get the same error if noone is listening to :foo

8:15 but maybe that is to be expected?

8:43 CookedGryphon: I don't see the same behaviour in Clojure..

9:03 CookedGryphon: I think it's a bug in the cljs source: the line at https://github.com/clojure/core.async/blob/master/src/main/clojure/clojure/core/async.clj#L869 is missing from the cljs version: https://github.com/clojure/core.async/blob/master/src/main/clojure/cljs/core/async.cljs#L646

9:22 CookedGryphon: jonasen: that does look a little suspicious doesn't it...

9:24 jonasen: CookedGryphon: I opened a ticket on JIRA: http://dev.clojure.org/jira/browse/ASYNC-56

9:25 Anderkent: CookedGryphon: jonasen: yeah, compare https://github.com/clojure/core.async/commit/cf8dc1bf#diff-5c087e8e400be45f4d03e0a618ef9d46L855 and https://github.com/clojure/core.async/commit/76b25bf91c6#diff-eff29afee9dd0dffc6769d2702ff9eadL636

9:25 seems like a simple mistake

9:26 rkneufeld: Is there anyone who's read or worked on the Clojure Cookbook who would care to render a quote for the back cover? (Think: "Is this an important book for the community?" "Was their an aspect of its development you thought was novel?" "Is it a particularly good book you would recommend to others?")

9:26 Looking for a quote today, with name and job title for attribute. Feel free to email me at ryan@cognitect.com if you'd rather share privately

9:29 dnolen_: jonasen: fixed in master

9:29 jonasen: dnolen_: thanks

9:29 Anderkent: 26 minutes turnaround? Nice!

9:30 _bart: Hello, I'm getting this exception: ClassCastException overtone.sc.node.SynthNode cannot be cast to java.lang.Runnable overtone.at-at/schedule-job

9:30 with this line: (overtone.at-at/every (/ 60 bpm) (kick) beats-pool :desc "kick")

9:30 thesaskwatch: Hi, I tried to do git diff <(echo abc) <(echo def) ... but it says unsuported file type

9:30 jonasen: dnolen_: when are new versions released to maven central?

9:30 _bart: It's probably the (kick) thing that's being cast, but why?

9:31 thesaskwatch: is it possible to bypass it somehow?

9:31 dnolen_: jonasen: I think tbaldrige usually pushes the button these days?

9:31 jonasen: no specific schedule, just when some significant changes have landed

9:31 _bart: If I replace (kick) with #(println "I am cool!") I get: IllegalArgumentException java.util.concurrent.ScheduledThreadPoolExecutor.scheduleAtFixedRate (ScheduledThreadPoolExecutor.java:420)

9:32 jonasen: dnolen_: ok. I can use a local version for now

9:32 dnolen_: does 'lein install' work for core.async?

9:32 dnolen_: jonasen: yep

9:32 Anderkent: _bart: in the first case, is kick a function or does it return a function?

9:32 stuartsierra: You can always get latest -SNAPSHOT builds of Clojure artifacts dev.clojure.org/display/community/Maven+Settings+and+Repositories

9:32 Anderkent: _bart: in the second, what does (/ 60 bpm) return?

9:32 _bart: Anderkent: kick is: (def kick (sample (freesound-path 171104)))

9:33 stuartsierra: Hudson on build.clojure.org polls GitHub every 5 minutes, rebuilds and uploads -SNAPSHOTS to Sonatype.

9:33 Anderkent: right, so you probably want (every (/ 60 bpm) kick beats-pool :desc "kick")

9:33 I'd also check if your beats-pool is initialized properly!

9:34 because the second example should work

9:34 jonasen: stuartsierra: where are the docs on using contrib -SNAPSHOT? I remember reading about it somewhere...

9:34 _bart: Andorkent: yes now I get #<RecurringJob id: 1, created-at: Wed 03:29:30s, ms-period: 600, initial-delay: 0, desc: "kick", scheduled? true>

9:34 stuartsierra: jonasen: ^^^ dev.clojure.org/display/community/Maven+Settings+and+Repositories

9:35 _bart: Anorkent: which is great, but I don't hear the kick. When I run (kick) I do hear it though

9:35 jonasen: stuartsierra: thanks

9:35 Anderkent: _bart: hm, make it #(do (println "Kicking") (kick)) instead and see if the print happens?

9:36 _bart: Anderkent: just did #(do (kick)) and it works, hearing the kicks :)

9:37 Anderkent: weird!

9:37 as in, really weird. You sure your speakers werent off? :P

9:38 _bart: Anderkent: now I don't know how to stop it though :p

9:38 Anderkent: (overtone.at-at/stop-and-reset-pool! beats/beats-pool) not working

9:38 Anderkent: do :strategy :kill, maybe

9:39 _bart: Anderkent: no difference, it just says 0 jobs but I'm definitely hearing the kicks

9:39 (this is all in REPL by the way)

9:39 Anderkent: I think you must have another job scheduled against a different pool then

9:40 just kill the repl :P

9:41 _bart: yeah :p I should start to use the vim fireplace thing, maybe that's better.

9:41 Anderkent: are you using the lein repl or vim-clojure?

9:41 I'd expect everything to work in the lein repl

9:42 if you're doing everything from vim then you might be getting weird behaviour if it reevaluates your file, for example

9:42 for example your current issue could be caused by you running a job against a pool, then reevaulating the file that creates the pool (thus replacing the reference)

9:43 now you try to shutdown-pool but it's a different pool than the one that actually runs your kick

9:43 (that can be fixed by using (defonce beats-pool) rather than (def beats-pool) btw)

9:44 _bart: Yes that's messy, but now I'm constantly switching tabs, :reload'ing the namespaces and then executing the functions

9:44 Anderkent: yrgh, yeah. At least use defonce in that case :

9:45 (for the pool)

9:45 having your files behave nicely when reevaluated is always nice

9:53 _bart: Anderkent: just tried to reset the pool, it works. maybe I reloaded stuff in between last time

9:55 lgs32a: wow, just switched over to cider. company-complete is really awesome. what a difference from ac-nrepl

9:56 how fast it interacts, and all that in emacs.

9:56 jonasen: stuartsierra: not sure which version I should be using? Is it "0.1.0-SNAPSHOT"? Also, I don't see any activity on http://build.clojure.org/builds

9:56 lgs32a: is something like popup integration planned for docstrings again?

9:57 stuartsierra: jonasen: build.clojure.org polls the Git `master` branch periodically, I forget what interval. The SNAPSHOT version number is in the pom.xml file for the project.

9:59 Oh, drat. core.async isn't in the standard set of builds, because someone had to get clever with version strings.

9:59 So forget everything I just said.

9:59 jonasen: stuartsierra: heh.. ok

10:00 stuartsierra: I'll try 'lein install' instead then

10:00 stuartsierra: or `mvn install` if there's no project.clj file

10:01 Anderkent: there is in async; though until recently it didnt have the group name :p

10:05 CookedGryphon: Does anybody else have issues AOT compiling macros that expand into other macros?

10:06 I have had issues aot compiling core.match macros in combination with go blocks

10:06 and have come across the same thing now with a macro that expands to a core.match

10:06 Anderkent: is that the <! not used in go block thing?

10:06 or just compiler barfing?

10:06 stuartsierra: core.match does some weird things with &env I think

10:06 Anderkent: ah.

10:06 CookedGryphon: where I get OrPattern not defined on first run, but then if i compile again without a clean it works

10:08 jonasen: 'lein install' worked fine. Thanks stuartsierra dnolen_ and CookedGryphon. Back to coding then!

10:10 laurentpetit: Hi. Say I want the same feature as agents, but in java: like a producer / consumer process, guaranteed with one consumer, but no imperative loop in the consumption side. And reaching for clojure is not a solution in the current case. Any ideas?

10:11 mdrogalis: laurentpetit: j.u.c Blocking Queue?

10:12 clgv: laurentpetit: threadpoolexecutor

10:12 laurentpetit: mdrogalis: I'm really not an expert in concurrent programming, so excuse my noob questions. With Blocking Queue, i'll need a single blocking thread, right ? So I'll have to do some cleanup when e.g. the webapp is reloaded (the app disposed) ? I'd like to avoid that, if possible.

10:14 mdrogalis: laurentpetit: I think GC should pick that off for you

10:14 But yeah, one thread will block

10:14 laurentpetit: clgv: a threadpoolexecutor and fixing the params so that I'm certain only one consumer thread can execute place anytime ?

10:15 s/place//

10:15 llasram: laurentpetit: Why can't you actually just use a Clojure agent?

10:15 clgv: laurentpetit: that would work, yes

10:16 laurentpetit: llasram: because even if i'm a clojure afficionado, it's for a java-only project

10:16 clgv: laurentpetit: how is work with CCW going recently?

10:17 laurentpetit: clgv: sorry, no time to develop on this this afternoon, lots of things on my plate. But in a nutshell, going well, even if some family events have cut a little bit of work time off recently. Nothing too bad, and I intend to catch up during the following weeks.

10:18 clgv: laurentpetit: good to hear :)

10:19 laurentpetit: clgv: threadpoolexecutor seems like a big gun for my problem. Not even sure I'll set all the right parameters to use it correctly ...

10:21 llasram: laurentpetit: Do you just need a separate dedicated chewing through a linear queue of tasks?

10:21 tim_: laurentpetit: I think if you start up the thread as a daemon thread you won't have to kill it at the end

10:21 clgv: laurentpetit: well, a thread and a blocking queue will work as well

10:21 llasram: s,dedicated,dedicated thread,

10:21 Like everyone else is suggesting :-)

10:21 clgv: laurentpetit: yeah you can set backgroundthread to true

10:22 tbaldridge: laurentpetit: that being said, use a fixed size thread pool

10:22 laurentpetit: clgv: will it not create a memory leak if the application is restarted again and again from tomcat's manager interface without restarting the JVM ?

10:22 tbaldridge: laurentpetit: http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/Executors.html#newFixedThreadPool(int) with the size set to 1

10:23 laurentpetit: then you can just do execute(runnable) to queue new tasks.

10:23 laurentpetit: tbaldridge: ok, so new tasks will be queued, and executed one at a time? Exactly what I want.

10:23 tbaldridge: yeah, assuming you use a size of 1.

10:24 laurentpetit: executors also include .shutdown that allows you to flush the queue before shutting down the executor. That'll make sure that you won't end up throwing away work.

10:24 laurentpetit: tbaldridge: yeah, I'll do that. I guess I'll have to hook a call to the shutdown method of the ExecutorService when the webapp is noticed that it is shut down

10:25 tbaldridge: ok

10:26 lvh: uh, is it normal that when I call functions something with -> in the name that the error message drops everything starting with the dash

10:26 I may be misdiagnosing but I appear to be getting this error: ArityException Wrong number of args (1) passed to: csv$pair clojure.lang.AFn.throwArity (AFn.java:437)

10:26 about a function named pair->rows

10:26 (there is no function named pair)

10:26 laurentpetit: tbaldridge tim_ clgv llasram mdrogalis thanks all for your help and your time

10:27 mdrogalis: :)

10:35 quizdr: is it possible to throw a custom string when an assert fails?

10:38 ah, i was using assert, i see that clojure.test/is is a better choice for custom error messages

11:09 btcNeverSleeps: re everyone... In Emacs / cider is there an easy way and is it a good idea to do something like this: switch to the namespace of the buffer the cider-jack-in is called from and then call also (use 'clojure.repl) and (use 'clojure.pprint). Does this already exist in cider?

11:11 for example I take it I could set a hook (?) calling (cider-repl-set-ns) upon after running cider-jack-in? But then how do I do to execute (use 'clojure.repl) and (use 'clojure.pprint) inside the REPL? (I tend to do these two all the time after creating a new REPL)

11:18 AeroNotix: is https://github.com/technomancy/s3-wagon-private still what I should use for private jars?

11:18 I have some artefacts I want to push out privately.

11:21 clgv: AeroNotix: you can also set up apache archiva or something similar. archiva was set up here pretty fast without any problem

11:21 AeroNotix: clgv: cheers!

11:21 michaniskin: btcNeverSleeps: perhaps you can use some "magic" like this: https://github.com/pjstadig/scopes-magic

11:22 llasram: *shiver*

11:22 pjstadig: what have you done? don't people get the joke?

11:23 michaniskin: llasram: i hate it when i don't get the joke

11:25 llasram: michaniskin: The way scopes-magic works is an awesome kludge, in pretty much all senses of "awesome."

11:25 For actual use though -- and I think pjstadig may disagree -- I would argue there are very few situations where the kludge is appropriate

11:25 michaniskin: llasram: but adding things to the repl seems like a reasonable use case to me, no?

11:26 you wouldn't have to include that dependency in production or testing

11:26 just in the repl profile

11:27 llasram: I could see the argument, but for just REPLs there are cleaner ways to get the same effect

11:27 Clojure will actually auto-load any file named `user.clj` which it finds on the classpath

11:28 jasoncof: I just installed Clojure mode and Paredit for Emacs and I notice the indention doesn't match most Clojure code I see online; for example, when starting a vector with '[' followed by newline the next symbol is aligned one space to the right of the '[' rather than two spaces to the right of the first character of the previous line.

11:28 Anderkent: llasram: but if you then switch namespace won't that get rid of the bindings?

11:28 michaniskin: llasram: but if you do (in-ns 'foo) you'd still have to refer in vars from 'clojure.repl and so on?

11:28 Anderkent: jasoncof: that's the common indentation for clojure code. You're viewing badly indented code online, apparently :)

11:28 llasram: michaniskin, Anderkent: If you just load things into the 'user namespace, but your user.clj could inject things into core, just like scopes-magic does

11:29 Anderkent: llasram: ah, good point

11:29 michaniskin: llasram: so what's the difference?

11:29 llasram: michaniskin, Anderkent: My objection is to the specific mechanism of hijacking data_readers.clj loading

11:29 It's a really cool hack, but (IMHO) doesn't buy you anything over user.clj for dev, and shouldn't be used in production

11:30 michaniskin: but how is that any different? i mean other than the fact that the code is weird in there because the #= evaluation is weird

11:30 jasoncof: Anderkent is the project.clj located here not using the normal Clojure indention? https://github.com/swannodette/om

11:31 michaniskin: llasram: what it buys you over user.clj is you can package it as a versioned dependency and deploy to maven

11:31 llasram: michaniskin: For one example, it will totally break if you build an uberjar w/ it in Leiningen >=2.3.3

11:31 michaniskin: Yes, which in mind is a *negative*

11:31 Anderkent: michaniskin: that's good. Where do you see vectors have 2-space indent rather than aligning to [?

11:31 michaniskin: llasram: but you don't include that dependency in builds, only in dev profiles, of course

11:31 Anderkent: ouf

11:31 i ment jasoncof

11:32 I keep doing that, sorry!

11:32 llasram: michaniskin: We seem to have differing opinions here. I'm willing to admit that mine is just opinion, so -- agreeing to disagree :-)

11:32 michaniskin: llasram: i see your point, too :)

11:32 Anderkent: jasoncof: {<newline> causes next line to be indented by 2 spaces, [<newline> causes next line to be indented one space to the right of [

11:32 jasoncof: Anderkent Ah, I'm looking at another example; but the same exact thing happens with my hashes, with the beginning '{'.

11:33 Anderkent: now that'd be a mistake

11:33 llasram: jasoncof, Anderkent: yeah for some reason dnolen doesn't like standard (Emacs) Lisp indentation

11:33 jasoncof: Anderkent anyway to fix it? I don't think I did anything unusual.

11:34 llasram: Where that's "Standard (Emacs)" and not "(Emacs) Lisp"

11:34 Anderkent: though I'd still say the right way to write that is https://www.refheap.com/42166

11:34 i.e. don't leave hanging open braces

11:34 `cbp: I don't think it makes too much sense either for clojure since we don't really use lists outside of code :P

11:34 jasoncof: Anderkent ah, I see

11:36 michaniskin: do clojure projects generally adhere to semantic versioning conventions?

11:36 Anderkent: >working on windows >double-clicking '.xml' opens IE. Wat.

11:36 btcNeverSleeps: I was more thinking of a pure Emacs hack to send a few Clojure function everytime a new cider-repl-mode buffer pops up

11:36 Anderkent: michaniskin: I think most projects attempt that

11:36 sjl: Anderkent: you sometimes see the hanging-brace style for maps of big elements, you almost never see it for vectors in the wild

11:37 Anderkent: sjl: I'd rather see {:key<newline>long-value<newline><newline>:next-key ... in those cases

11:37 sjl: yeah that's another way to do it

11:39 btcNeverSleeps: disgressing but... Regarding number of spaces, tabs vs no tabs, where brace should go, etc. I so wish new language designers would simply make that part of the language's specs, with a tool (not unlike Go's gofmt, but stricter) that formats the code in the "one true way" the language designer meant. And then there'd be no arguing anymore :-/

11:40 teslanick: That's called Python. And man is that annoying. :)

11:40 AeroNotix: teslanick: python is a clusterfuck of styles.

11:40 btcNeverSleeps: teslanick: but Python uses the number of spaces to determine what to execute right?

11:40 AeroNotix: Go is literally the only language which gets this right

11:41 btcNeverSleeps: I'm talking about something which would have no influence on the compilation. But just a standard, which nobody could argue about (well, they could argue that the standard is bad... But not following it -> no compilation).

11:41 AeroNotix: which *mostly* get this right : )

11:42 it would be great if in the future language designer were to follow that lead that Go showed

11:42 michaniskin: btcNeverSleeps: that future language designer is you! doit!

11:45 i mean no reason not to, i'm writing a clojure editor that uses my own preferred syntax and just emits regular clojure to files

11:49 btcNeverSleeps: regarding my issue, I ended up using: blog.jenkster.com/2013/12/a-cider-excursion.html and the cider-interactive-eval and it seems to be working nicely

11:58 toxmeister: hi, if i want to support `apply` for a deftype in clojure i can provide an `applyTo` implementation, what is the equivalent in CLJS? It doesn't seem to be the same...

12:00 michaniskin: toxmeister: did you implement IFn for your deftype? i believe that is enough to get apply, too.

12:00 toxmeister: yes, i did.. but IFn only specifies `invoke`

12:01 even in CLJ i have to provide an `applyTo` fn

12:01 michaniskin: toxmeister: https://github.com/tailrecursion/hoplon/blob/master/src/tailrecursion/hoplon.cljs#L115-121

12:01 toxmeister: apply works on those

12:03 toxmeister: michaniskin: interesting, I thought you can't have varargs for protocol methods

12:03 michaniskin: toxmeister: sssh

12:03 toxmeister: michaniskin: is that a recent change?

12:03 michaniskin: no, it just works

12:04 toxmeister: michaniskin: oki, thanks - will give that a try

12:04 clgv: toxmeister: very likel CLJS specific ;)

12:05 toxmeister: michaniskin: think so too, since every fn has potentially varargs

12:05 michaniskin: ...in JS i mean

12:05 michaniskin: toxmeister: totally agree with you there

12:05 hopefully nobody will "fix the bug"

12:06 toxmeister: michaniskin: then let's quickly change topic :)

12:07 michaniskin: …so i told the man, bangor, i hardly even know her!

12:07 dnolen_: michaniskin: definitely undefined behavior, I wouldn't recommend relying on it.

12:08 michaniskin: dnolen_: i know

12:08 clgv: dnolen_: so there is a CLJS protocol for applyTo?

12:08 michaniskin: is there a way to achieve the same without varargs?

12:09 dnolen_: clgv: what for?

12:09 michaniskin: no protocols just don't support varargs.

12:10 michaniskin: dnolen_: do protocols collect arguments after a certain number into a seq or something?

12:10 dnolen_: michaniskin: this long a outstanding compiler enhancement a ticket exists

12:10 noprompt: dnolen_: is there anybody reason i might see warnings for goog imports in the latest cljs?

12:10 dnolen_: michaniskin: should put them into a seq after 20th argument

12:10 noprompt: 2156?

12:11 noprompt: there some spurious warnings you'll see around goog.string, fixed in master

12:12 noprompt: dnolen_: i'm seeing stuff like WARNING: No such namespace: goog.net.XhrIo

12:12 dnolen_: the same code in 2138 didn't complain.

12:12 dnolen_: noprompt: that isn't a namespace

12:12 noprompt: dnolen_: those are being :imported

12:12 dnolen_: noprompt: namespace resolution has been broken for a while.

12:12 noprompt: (:import [goog.next XhrIo])

12:13 toxmeister: dnolen_: hey david, so if i want to support apply with seqs upto 3 args do i just provide different arities for (-invoke) impl?

12:13 noprompt: dnolen_: right. anyway, everything still works so the warnings don't bother me. ;)

12:14 dnolen_: toxmeister: I don't see why you need to implement applyTo, apply will work.

12:15 toxmeister: dnolen_: it doesn't seem to work in clj without and I wasn't sure what the correct cljs way is

12:17 dnolen_: toxmeister: try it

12:17 want this so bad, http://twitter.com/suprematic_aav/status/436184769420738561

12:20 toxmeister: dnolen_: will prep a gist

12:22 dnolen_: toxmeister: ok, but like I said you don't need to implement applyTo to, IFn generates the apply implementation for you.

12:27 abp: Hi, can i get junit xml out of expectation tests for ci? I've seen the class for intellij integration but a pointer on how to run that using junit.jar or something would be helpful.

12:27 toxmeister: dnolen_: is that specific only for CLJS then? here's my issue in compressed form: https://gist.github.com/postspectacular/9096806

12:28 dnolen_: toxmeister: only true for CLJS

12:28 ambroseb_: ,(meta (symbol (with-meta 'a {:my-foo 1})))

12:28 clojurebot: {:my-foo 1}

12:29 ambroseb_: I wonder if that is intentional behaviour.

12:29 seems like it

12:34 dnolen_: toxmeister: michaniskin: relevant code, http://github.com/clojure/clojurescript/blob/master/src/clj/cljs/core.clj#L722

12:35 we generate call and apply methods for you. call is necessary for the case where don't have a type.

12:35 michaniskin: dnolen_: maybe i'll have a look at the protocol argument collecting ticket, do you have a link handy?

12:35 dnolen_: michaniskin: this is why doing var args is bound to break in the future, if we start using more type inference information in the compiler we want to direct invoke

12:35 michaniskin: we're not going to make your usage work

12:36 and it will break under more aggressive optimizations

12:36 michaniskin: dnolen_: as long as it works for now i'm ok :)

12:37 clgv: famous last words? ;)

12:37 michaniskin: dnolen_: although if i implement the enhancement you mentioned with the argument collecting i can make a macro to obtain vararg support

12:37 this is something we've done with clojure already

12:38 toxmeister: dnolen_: thanks mister! that helps a lot

12:38 dnolen_: michaniskin: CLJS-364 CLJS-365

12:38 toxmeister: np

12:38 toxmeister: dnolen_: btw. a big hello to your neighbor amit :)

12:39 michaniskin: dnolen_: ty

12:39 dnolen_: toxmeister: haha, I'll let him know!

12:39 michaniskin: so the only place you need to change to make this work is :invoke in compiler.clj

12:40 michaniskin: it's pretty gnarly, should be refactored - but that where all the function calling optimization occurs

12:41 michaniskin: dnolen_: ok great, i'll have a look and see what i can do

12:41 dnolen_: michaniskin: we might not need to fix apply - it may already be handled today

12:49 clgv: does anyone know of a small program that enables client-server interaction to check whether I can perform two-way communication (client->server, server->client) with a remote machine?

12:49 or what would be the easiest was to do that? provided the client runs within a cluster with some scheduling machinery around

12:50 technomancy: clgv: netcan?

12:50 netcat, rather

12:50 clgv: I dont know on which remote machine the client program will run in advance.

12:51 llasram: clgv: What are you trying to do? :-)

12:52 clgv: llasram: trying to find out whether there is a firewall that might forbid to call the remote machines from outside the cluster. there is no documentation about that

12:53 in principle. I could fall back to java's sockets for the test. but maybe something more comfortable is available to have a small ping-pong-protocol with two different conenctions

12:54 llasram: clgv: Um, but what's your actual end goal? WHy do you need to know this?

12:54 clgv: (1) client ->ping-> server (2) server remembers IP (3) server ->pong-> client

12:55 llasram: Are there not already services running on these cluster nodes which you could simply attempt to contact?

12:55 clgv: llasram: I have some task distribution thats currently implemented on a per-message basis where clients and server initiate communication (kind of like for P2P)

12:56 llasram: What sort of cluster is this?

12:56 clgv: llasram: you can only access the cluster nodes through submitting a task to the scheduling system

12:57 llasram: Well... then haven't you answered your question already? :-)

12:58 clgv: not really. there is a login node where I submit the tasks.

12:59 the question is whether there is a firewall prohibiting that these client programs (tasks) can be reached by my server program

13:00 llasram: Ok... That just really sounds like a policy question, to resolve by asking someone

13:01 clgv: llasram: humm yes, gotta try to find out who is in charge there

13:28 gtrak: how would I get this back to a clojure.java.io/resource-able form? "file:/home/gary/.m2/repository/org/clojure/clojurescript/0.0-SNAPSHOT/clojurescript-0.0-SNAPSHOT.jar!/clojure/string.cljs"

13:29 this actually works: (clojure.java.io/resource "clojure/string.cljs")

13:29 returns #<URL jar:file:/home/gary/.m2/repository/org/clojure/clojurescript/0.0-SNAPSHOT/clojurescript-0.0-SNAPSHOT.jar!/clojure/string.cljs>

13:29 just trying to do something not too fragile

13:30 my best guess at this point is to prepend jar: if it contains 'jar!'

13:34 cemerick: seems like the issue is on my end of things, the piggieback patch you pulled and the pending cljs patch should be enough :-)

13:34 stuartsierra: gtrak: It's on the classpath? Use (clojure.http://java.io/resource "classpath/relative/file/name.foo")

13:35 WTF is up with my IRC client.

13:35 gtrak: stuartsierra: yea, but I'm not in control of how that string gets generated.

13:35 so, I could truncate... or something :-).

13:36 need a reliable way to both detect and convert to a classpath-relative form.

13:37 or I can just pass it straight through, maybe it'll work.

13:37 but it'd be nice to normalize these things.

13:39 no such luck, cider doesn't like it

13:45 TravisD: Is there any way to get the clojure REPL to align multi-line entries?

13:45 ohcibi: hi.. how to easily manipulate nested data structures? e.g. if i have a set of maps whichs values are also sets of maps and I want to remove certain members of those sets based on values in the maps. I kinda know how to get them easily but to set I end up doing some nasty merge-with or merge or *somethingother* constructs?

13:45 isn there a "simpler" approach?

13:47 delluminatus: ohcibi: depending on what you want to do, maybe take a look at the update-in function

13:47 TravisD: ohcibi: I'm not an expert, so disregard this if you want. But it seems like your best bet might be to find some primitive operations that are suitable to your data structure, and implement those however you want. Then hopefully you can write everything else you wan to do in terms of those more primitive operations

13:48 amalloy: ohcibi: (set (for [m set-of-maps] (into {} (for [[k v] m :when (keep? v)] [k v]))))?

13:49 where keep? is whatever function you use to decide whether to keep an inner set-of-map

13:49 cemerick: gtrak: nice :-)

13:50 ohcibi: delluminatus: update-in would only work if there are only maps, but in my nested structure are also sets

13:50 amalloy: looks very interesting... thanks

13:50 amalloy: probably better written as (set (for [m set-of-maps] (into {} (filter (comp keep? val) m))))

13:51 delluminatus: oh, I guess I just skimmed the question, sorry

13:53 jonasen: dnolen_: I'm still looking at Om cursors. They seem to extend lots of protocols.. in particular I find it strange that they extend IDeref (i.e. they are mutable) as well as protocols that are often associated with immutable things: ICollection, ILookup, ISeqable etc. Is this for convenience or are all the protocol extensions essential?

13:53 dnolen_: jonasen: have you gone through the tutorials?

13:54 jonasen: dnolen_: I have read the first one

13:54 dnolen_: jonasen: then just think a bit more about why they are implemented they way they are.

13:55 jonasen: also consider consistency issues brought upon by rendering on requestAnimationFrame

13:58 jonasen: dnolen_: I'll read through the tutorials again. I would have guessed that all you would need is IDeref to get the value out and something like ITransact to move to the next state. I must have missed something essential..

13:58 dnolen_: jonasen: a clue is that during render the value of a cursor is consistent and can be treated as a value - all access outside the render phase is problematic - go loops and event handlers. Thus deref.

13:59 jonasen: dnolen_: So I would have thought that you always have to deref if you want to access the value. Like the rest of clojure ref types

13:59 dnolen_: jonasen: deref during the render aka React phase is not allowed, and outside the render phase, cursor is an inert handle you can only deref or transact

14:00 mr-foobar: in cljs, how do I convert an atom to json, for console logging ?

14:00 dnolen_: jonasen: deref means getting a value, but you would just get another cursor another reference type - I don't see the point

14:00 jonasen: uglier and doesn't reify the phase distinction

14:01 ohcibi: mr-foobar: (console.log @atom-name) ?

14:03 zilti: I'm tying to call a Java-function, like this: "(.setTopAnchor root content (double 0))" It does exist and all, but something seems to not match. I get an exception saying this method doesn't exist.

14:03 AeroNotix: clgv: So I'm evaluating archiva. It's running. I have :repositories with [["releases" "http://localhost:8081/archiva/releases"]] (according to the lein docs) but `lein deploy releases' gives me a 405

14:04 mr-foobar: ohcibi: i'm getting a very complex datastructure as output for a simple Hashmap. I just want to print the kv as json.

14:04 clgv: AeroNotix: you need to provided your login credentials, e.g. in ~/.lein/profiles.clj

14:04 AeroNotix: clgv: it prompts me for login creds

14:04 `cbp: mr-foobar: (clj->js @atom)

14:05 zilti: "#<IllegalArgumentException java.lang.IllegalArgumentException: No matching method found: setTopAnchor for class javafx.scene.layout.AnchorPane>"

14:05 joegallo: zilti: this is on a javafx.scene.layout.AnchorPane?

14:05 zilti: joegallo: Yes

14:05 joegallo: that method is stati

14:05 static, even

14:05 you don't pass in root

14:05 zilti: ...oh. That explains a lot. Why didn't I notice that. Thanks!

14:05 joegallo: np

14:05 clgv: AeroNotix: I have :auth data in my :user profile - it works with that configuration

14:06 mr-foobar: `cbp++

14:06 AeroNotix: clgv: let me try that then, seems odd that it would prompt for me it

14:06 prompt me for it**

14:07 clgv: AeroNotix: I use ^:replace for the :repositories data as well

14:07 AeroNotix: clgv: what does ^:replace do?

14:07 clgv: AeroNotix: getting rid of all the default repos so that my archiva acts as proxy

14:08 AeroNotix: clgv: ok

14:08 clgv: my archiva url looks like archiva.mydomain.de/archiva/repository/internal

14:09 AeroNotix: hmm, ok

14:09 clgv: AeroNotix: though I have the old 1.3.6 - didnt notice that 2.0.0 was already released

14:10 AeroNotix: clgv: so I have tried auth in the profiles.clj and still 405

14:10 your url pattern 404s

14:10 clgv: https://github.com/technomancy/leiningen/blob/master/doc/DEPLOY.md

14:10 AeroNotix: Already read it

14:11 clgv: AeroNotix: skip the virtual host.

14:11 semperos: trying out Om 0.5.0-rc1, inside IDidMount's did-mount, if I do transact!/update! on cursor or even a simple set-state! on owner, I get an error "No protocol method IDidUpdate.did-update defined for [my top-level component]"

14:11 clgv: I think the URL scheme in the DEPLOY.md is the correct one if you add the archiva port

14:11 AeroNotix: clgv: it says it prompts for password -- which it does. I can't imagine it would prompt me for password if it needed them in profiles.clj

14:11 clgv: I'm using the same one as the DEPLOY.md

14:11 semperos: dnolen_: if/when you have a moment ^^

14:12 clgv: AeroNotix: just to make sure - you created a user account that has all the rights it needs?

14:12 AeroNotix: clgv: yeah

14:14 clgv: AeroNotix: well cant diagnose it from here.... gotta go home now anyway

14:14 AeroNotix: clgv: cheers anyway

14:15 dnolen_: jonasen: also note that people can technically transact the app state during render, and that won't affect render because cursors are using values when the render phase began.

14:15 semperos: did you run a lein-cljsbuild clean? CHANGES.md points out did-mount and did-update changed, they no longer take dom node.

14:15 semperos: this is to match React 0.9.0-rc1

14:16 semperos: right, I did a full clean and changed sig for did-mount to take just one arg

14:16 if I don't touch the component state in did-mount, no error is thrown

14:16 will re-clean just to make doubly sure

14:17 dnolen_: semperos: if that doesn't fix it then open an issue w/ a minimal example exhibiting the problem. Thanks.

14:17 semperos: dnolen_: can do, thx

14:18 wink: wtf, this has got to be the sneakiest bug in a while. I used to use (pos? (Integer/parseInt x)) on a varchar field, i.e. string. but the field is now integer, so the 2 is a clojure Long. so this fails. doh

14:22 `cbp: wink: use Long/valueOf :-p

14:24 Although if it changes to a double then it will not work again so I guess you need a better parser :-D

14:24 semperos: dnolen_: do you mean for this page to still show did-update as taking 4 args instead of the new 3?

14:24 https://github.com/swannodette/om/wiki/Documentation#wiki-ididupdate

14:25 dnolen_: semperos: feel free to update

14:25 semperos: cool

14:25 wanted to make sure you weren't trying to pin the page to a particular version of Om

14:25 dnolen_: semperos: I prefer that docs reflect the latest released version.

14:25 0.5.0-rc1 is out so docs should match it.

14:25 semperos: thought so and makes sense, given your pace of dev :)

14:25 that was my issue

14:26 had [_ _ _ _] to did-update instead of [_ _ _]

14:26 bbloom: [_O_o_]

14:27 semperos: exactly :)

14:30 dnolen_: semperos: thank for updating the docs

14:30 semperos: alrighty, corrected did-mount and did-update, quick search for 'node' on that page is now limited to references to om.core/get-node

14:30 np

14:31 abp: so i'm taking the Paradigms of Computer Programming course on edx, so glad i didn't miss it and regretful i weren't forced to go through that stuff earlier. van roy does an incredibly good job so far :)

14:32 toxmeister: is there a fixed hashing procedure for vectors in CLJS? is it the same as in CLJ (prior to 1.6.0)? are there plans to adopt 1.6.0 changes in CLJS too?

14:33 abp: is Concepts, Techniques, and Models of Computer Programming worth studying in its entirety? the course only cover about 1/3

14:33 dnolen_: toxmeister: on the list of todos - need to port Murmur3

14:33 toxmeister: I've got a 32bit murmur3 lying around somewhere

14:33 (in JS)

14:34 dnolen_: toxmeister: would want a pure CLJS port

14:34 Murmur3.java is like 130 lines long, seems easy enough todo

14:34 ro_st: should i be able to use binding with defmethod?

14:35 toxmeister: dnolen_: yeah, only issue is doing this without 64bit longs needed as intermediates

14:35 ro_st: i'm not seeing the bound values inside the defmethod when it's invoked. it still has the old unbound value

14:35 dnolen_: toxmeister: I don't see long requirement looking at Murmur3.java

14:36 ro_st: (def ^:dynamic foo false) (defmulti a :b) (defmethod a 1 [] (prn foo)) (binding [foo :woohoo] (a {:b 1})) ; prints false, not :woohoo

14:37 is this expected behaviour?

14:38 Anderkent: ro_st: doesn't happen to me. Also your defmethod seems wrong, should take 1 arg

14:38 amalloy: ro_st: you have a stale defmulti - expected behavior for that code is an ArityException

14:38 ro_st: grr. that toy example works. thanks guys. will dig

14:41 looking forward to seeing your clojurewest talk, dnolen. a pity i can't be there this year

14:45 does the bindable var need to be declared before the defmulti?

14:46 grar. toy example works, but prod code does not. weird.

14:49 `cbp: e

14:49 er sorry

14:53 ro_st: to clear the way for a new compilation of a multimethod, i use (ns-unmap *ns* 'the-defmulti)

14:53 if i then recompile the ns with the multi in it, will that remove stale defmethods?

14:55 amalloy: all defmethods vanish when you unmap the multimethod (or when you (def the-defmulti nil)

14:55 ro_st: great, thanks

15:03 found the issue. the binding doesn't survive a (partial) boundary

15:07 toxmeister: dnolen_: correct don't *need* them, but in JS you can't rely on normal int32 overflow as in java which is caused by multiplies with the 2 murmur constants - so need to manually simulate it...

15:08 ro_st: no;

15:08 lazy sequence. sequence realised outside the binding. doh!

15:11 dnolen_: toxmeister: i guess we can do this with bit shifting, and given modern JS engines (and tuning for asm.js) hopefully not much of a hit.

15:21 toxmeister: looks promising http://jsperf.com/bit-multiply

15:28 xpera: Hello, any recommendations for large scale caching? My project is a big computational project with lots of intermediate results. I'd like to keep as much as possible in RAM, but some might need to go to disk if it is not used as recently.

15:30 TravisD: is there a strict version of map?

15:30 turbofail: mapv is strict, though it returns a vector

15:31 TravisD: ah, that's actually good for this case :)

15:31 thanks

15:31 hiredman: xpera: I'd look at guava's caching

15:37 TravisD: Would you guys mind crituiqing some code I wrote to incrementally compute the mean of a lazy-seq of numbers? https://www.refheap.com/42316 I ran into some issues writing a similar bit of code in Haskell

15:43 gfredericks: docstrings on individual args is an interesting idea

15:44 llasram: TravisD: In what way is it incremental?

15:44 TravisD: ah, actually, in the snippet I pasted it's bad to define nn the way it is there, since that prevents the rest of the sequence from being freed

15:44 llasram: The memory usage is O(1)

15:46 llasram: TravisD: Ok. Well, you might think about using `map-indexed` or even just manually tracking the index in the `reduce` function

15:46 xpera: hiredman: thanks

15:47 llasram: TravisD: Outside of the immediate code, this algorithm is prone to loss of significance, and would not be advisable for real-world use

15:49 TravisD: sorry, somehow my IRC client crashed

15:49 I missed any messages you sent

15:49 llasram: One:

15:49 TravisD: Outside of the immediate code, this algorithm is prone to loss of significance, and would not be advisable for real-world use

15:49 Well, and the earlier one you might have missed:

15:49 TravisD: Ok. Well, you might think about using `map-indexed` or even just manually tracking the index in the `reduce` function

15:50 TravisD: llasram: Ah yeah, shouldn't compute the sum and length

15:52 llasram: that is all good advice

15:56 xpera: hiredman: looks like Guava's Cache doesn't have disk persistence but it does have "removal notifications" so I could roll my own disk layer

16:06 toxmeister: dnolen_: yes, that's the kind of hoop i ended up jumping through, didn't realise that it causes almost no hit though. v.good to know

16:22 seangrove: technomancy: It seems better for far. Haven't had any timeouts yet.

16:26 technomancy: seangrove: cool. our perc99 for clojure builds hasn't gone over 250s in a while

16:27 TravisD: What is perc99?

16:30 technomancy: 99th percentile

16:41 amalloy: TravisD: you might find it an interesting exercise to have incremental-mean return a lazy sequence of "average so far"

16:42 then you can write actual-mean as (last (incremental-mean xs))

16:42 TravisD: amalloy: ah, that would be neat

16:44 amalloy: i expect the lazy version to be more natural, because it avoids some of the gotchas you had to deal with, like using mapv to avoid stackoverflow

16:44 marce808: simple question for you guys: if I define an env var to the JVM using -Dfoo=bar, shouldn't I be able to recover it using (System/getenv "foo")?

16:44 stuartsierra: marce808: That's a system property, not an environment variable.

16:44 (System/getProperty "foo")

16:46 Wild_Cat: marce808: note that if you're doing that, it might be a good idea to use the "env" library.

16:46 marce808: er, environ. https://github.com/weavejester/environ

16:48 marce808: ah, rookie error. thanks guys.

16:59 jasoncof: Is there an idiomatic way to store application settings/config in Clojure apps? Perhaps by tying into Leiningen's profile system?

17:01 stuartsierra: (read-string (slurp (clojure.java.io/resource "my/app/config.clj")))

17:01 ahem, config.edn

17:02 gfredericks: oh snap we gotta learn a new file extension now

17:03 stuartsierra: also edn/read-string

17:03 stuartsierra: yeah, doesn't really matter if it's part of your code

17:03 jasoncof: stuartsierra Thank you. I figured something like that. I was wondering if there was a way to tie it into leiningen's profiles because I my configuration usually matches the profiles (different db setting for dev vs production for example).

17:03 stuartsierra: "If you can't trust your config file, who can you trust?"

17:04 jasoncof: You can use profiles with different resource dirs.

17:04 jasoncof: stuartsierra: ah right! thank you, I didn't think of that.

17:05 shoepie: any here using vim-clojure-static?

17:06 delluminatus: shoepie: I just started with it a few days ago

17:06 shoepie: wondering why clojure keywords arent highlighted differently

17:06 or maybe i'm doing something wrong

17:07 delluminatus: shoepie: there is another package for keyword highlighting

17:07 shoepie: delluminatus: know what that would be?

17:07 delluminatus: shoepie: actually, I just looked it up, and it's only for highlighitng refered/aliased vars

17:08 so you oughtn't need it

17:08 shoepie: delluminatus: oh, yeah, already have that one

17:08 delluminatus: are you sure you installed the packages right? ;)

17:09 shoepie: pretty sure but know knows :)

17:09 delluminatus: if you're not using something like Vundle (or at least pathogen) I recommend it

17:09 shoepie: everything else is highlighted but i'd like my hash keywords highlighted

17:09 I'm using Vundle

17:09 delluminatus: like hash-map?

17:09 shoepie: yeah

17:09 delluminatus: oh

17:09 well look

17:10 are they not all highlighted?

17:10 well anyway they should be. I guess I can't help you much beyond that

17:10 shoepie: nuh uh, i wonder if it's just my colorscheme

17:10 delluminatus: maybe

17:10 I'm using vundle as well and have no issues

17:11 in fact I love it, with the rainbow parens plugin, my source files are gorgeous :)

17:12 shoepie: wow, i'm stupid

17:12 it was the colorscheme

17:12 delluminatus: it happens

17:12 shoepie: well, thanks for letting me talk it out

17:13 delluminatus: np

17:13 shoepie: i like rainbow parens, too. getting used to paredit

17:14 delluminatus: hmm, I'll have to take a look at that

17:21 TravisD: amalloy: That is a much nicer solution: https://www.refheap.com/42343

17:22 this one also has fewer numerical issues

17:27 stcredzero: I am confuzzed. The send-a message-around-a-ring example here <http://clojure.org/agents> seems to suggest that send/send-off can contain side effects?

17:28 justin_smith: stcredzero: yes, an action sent to an agent will only be run once for each send / send-off

17:28 (unlike atoms there are no retries with agents)

17:29 stcredzero: justin_smith: Ok, cool!

17:37 amalloy: TravisD: well, it's always fun to use reductions, but i often find it hard to see what's going on. i would have just written it as https://www.refheap.com/42345 (the second version if you have lazy-loop from flatland/useful available)

17:37 stcredzero: How bad an idea is it to use add-watch/remove-watch? (Says alpha - subject to change)

17:38 amalloy: stcredzero: it will never chaneg

17:38 i think 1.6.0-alpha1 finally removed the warning, even

17:38 justin_smith: lot's of things still say "subject to change" in clojure

17:38 *lots

17:38 amalloy: justin_smith: except the values! those never change

17:39 TravisD: amalloy: Ah, I ended up using reductions because it's meaning is clearer with the naive implementation. You could use reduce to compute the sum, and reductions is a good way of getting all the partial sums

17:39 stcredzero: What folks used to say about Lispers: Lispers know the value of everything and the cost of nothing.

17:39 TravisD: amalloy: but it's not particularly clear

17:39 toxmeister: what is the role of the ASeq protocol in CLJS? I guess a marker protocol, but what for? What's the diff to ISequential?

17:42 whodidthis: http://www.closurecheatsheet.com/ damn, should have found this sooner=(

17:44 delluminatus: whodidthis: this is #clojure not #closure ;)

17:44 Get out of here with your S's

17:45 whodidthis: im telling nolen on you!

17:49 TravisD: Ah, trampoline is a cool idea

17:51 dnolen_: toxmeister: it's just a marker protocol, at one point I used it to optimize something which has since been removed.

17:52 toxmeister: dnolen_: thx, so I can leave it out from my types?

17:53 dnolen_: toxmeister: you can

17:53 toxmeister: dnolen_: oki (sorry for spamming w/ all those cljs Q's today...)

17:53 dnolen_: toxmeister: np

17:55 `cbp: whodidthis: nice thanks

18:08 bfn: ,(keyword '1)

18:08 clojurebot: nil

18:08 bfn: ,(keyword "1")

18:08 clojurebot: :1

18:08 bfn: why doesn't (keyword '1) give :1?

18:09 amalloy: because '1 is a number

18:09 keyword wants instances of Named, ie keyword/symbol/string

18:09 Cr8: ' isn't "interpret this as a symbol", it's short for (quote ...)

18:09 amalloy: i mean, quietly returning nil is not necessarily great, but it's defensible

18:10 Cr8: and '1 is just 1

18:10 ,'1

18:10 clojurebot: 1

18:10 bfn: oh thanks, I thought ' was "interpret this as a symbol"

18:10 amalloy: Cr8: the clojurebot example doesn't really help, since a symbol would print the same way

18:10 Cr8: nah, it's "don't apply evaluation rules, use the following form as is"

18:10 yeah

18:10 amalloy: &(class '1)

18:10 lazybot: ⇒ java.lang.Long

18:11 amalloy: or even, ##(identical? 1 '1)

18:11 lazybot: ⇒ true

18:11 Cr8: ,[(+ 1 2) '(+ 1 2)]

18:11 clojurebot: [3 (+ 1 2)]

18:11 Cr8: ,(map class '(+ 1 2))

18:11 clojurebot: (clojure.lang.Symbol java.lang.Long java.lang.Long)

18:12 bfn: ,(= '"foo" "foo")

18:12 clojurebot: true

18:13 Cr8: ,(= = '=)

18:13 clojurebot: false

18:15 bfn: thank you all for your quick explanations

18:19 benkay: anyone know why the test in this function isn't running?

18:19 https://www.refheap.com/42320

18:23 justin_smith: benkay: how are you running the tests?

18:25 cespare|home: do people typically just use clojure.test for unit tests? We've been using midje but are thinking of moving off of it.

18:25 just looking for anecdotes and personal opinions :)

18:25 justin_smith: I find clojure.test does everything I need for reasonably fp code

18:25 ie. pure functions reduce the need for mocking etc.

18:26 technomancy: cespare|home: there was a blog post a while back about circle CI moving from midje to clojure.test

18:26 good stuff

18:26 cespare|home: technomancy: yep, I read that.

18:27 we may end up using their translation code.

18:27 TimMc: Any news on the clojure-tests-as-library front?

18:27 e.g. futile's test2

18:27 shoepie: dnolen_: i keep getting "prepareEnvironmentForDOM" errors in om. Looks like it might be a known issue...?

18:27 dnolen_: shoepie: never heard any one complain about that one before.

18:28 shoepie: known issue?

18:28 shoepie: like in React?

18:28 shoepie: https://github.com/swannodette/om/issues/21

18:28 dnolen_: shoepie: that's not an issue, that's user error

18:28 shoepie: read the thread

18:29 `cbp: TimMc: Sorry for the dumb question but what would be the use of that?

18:30 TimMc: `cbp: If the test-runner is more of a library than a framework, you can control it with external tools or hook it into an IDE or a reporting function.

18:30 shoepie: dnolen_: I did, and I'm using the tutorial markup. Just wondering if you've seen anything related lately. I'll keep trying

18:31 justin_smith: benkay: https://www.refheap.com/42354 <- it works, and that's how

18:31 dnolen_: shoepie: so you're making sure to load your script tags *after* your markup?

18:31 shoepie: dnolen_: Had it working at one point. I must've screwed something up.

18:31 justin_smith: may not work with lein test unless one of your test namespaces causes the function with the test to be loaded

18:31 shoepie: dnolen_: yep

18:31 TimMc: `cbp: As opposed to the tests themselves being a library, which I suspect is how my question could also have been interpreted.

18:31 dnolen_: shoepie: gist of your markup?

18:31 justin_smith: benkay: since I think lein test just loads your test definitions under test/ by default

18:32 benkay: justin_smith: splice that assertion out of the function definition in the metadata and recompile it.

18:32 justin_smith: ?

18:32 OK

18:33 shoepie: dnolen_: https://gist.github.com/kevincolyar/152deb68c1f3525d52aa

18:33 benkay: ,(defn ^{:test {(assert (= 1 (adder 1)))} adder [thing] (+ 1 thing))

18:33 clojurebot: #<RuntimeException java.lang.RuntimeException: Map literal must contain an even number of forms>

18:33 benkay: ,(defn ^{:test (assert (= 1 (adder 1)))} adder [thing] (+ 1 thing))

18:33 clojurebot: #<CompilerException java.lang.AssertionError: Assert failed: (= 1 (adder 1)), compiling:(NO_SOURCE_FILE:0:0)>

18:33 justin_smith: https://www.refheap.com/42354 updated, same repl

18:34 test passes without the assertion in it

18:34 if that is what you meant

18:35 benkay: nah not really

18:35 updated: https://www.refheap.com/42320

18:35 second function definiiton throws the expected error

18:36 dnolen_: shoepie: oh what version of Om are you using?

18:36 justin_smith: well the second version should throw at compile time

18:37 I guess I don't understand what you were trying to do

18:37 benkay: get tests to fail at compile time :)

18:38 but include multiple tests.

18:38 justin_smith: but that isn't running the test

18:38 that's just throwing an error at compile time

18:38 shoepie: dnolen_: 0.3.6, I tried 0.5.0-rc1 but run into autobuild slowness so I switched back

18:39 benkay: justin_smith: so then why does the third (updated: https://www.refheap.com/42320) function definition pass compilation?

18:39 dnolen_: shoepie: yeah I can't say, not supporting anything but the latest release at this point. 0.3.6 -> 0.5.0-rc1 is not a difficult upgrade path

18:39 shoepie: autobuild slowness doesn't make sense to me, same build times for all version of Om IME

18:40 justin_smith: benkay: it's not a test, it's arbitrary code run at compile time

18:40 `cbp: TimMc: I'm not sure what that would look like :( But I'm free for a OSS project

18:40 shoepie: dnolen_: I'll give it another try. Might just need to step away from the machine for a minute.

18:40 dnolen_: Thanks for the help

18:40 justin_smith: benkay: on my machine, that throws an error (as it should) because adder is not yet defined

18:40 it's not a test

18:41 dnolen_: shoepie: also 0.8.0 was bad about swallowing errors, 0.9.0-rc1 much better, so there's that.

18:41 React

18:41 should be less confusing now

18:42 shoepie: dnolen_: oh yeah, should I be including react in my project.clj and index.html? I don't see it listed in the readme anymore under :dependencies.

18:43 dnolen_: shoepie: Om depends on a React JAR that I put together and push to Clojars, no need to specify yourself.

18:43 shoepie: dnolen_: k, cool

18:44 dnolen_: shoepie: but yes react needs to be included in your index.html during dev, in the production case you can use :prelude compiler option

18:44 benkay: got it. so i'm testing the stale function definition.

18:45 justin_smith: benkay: yeah, and it isn't a "test", it's just an assertion built into the compiling code

18:45 shoepie: dnolen_: good to know, thanks

18:46 justin_smith: benkay: tests defined in metadata are meant to be run the same way any other test is, with an explicit run-tests call

18:46 benkay: (test-var adder) would run those tests though, correct?

18:46 justin_smith: I think it should, I haven't tried it that way

18:46 benkay: got it. thanks for clearing that up for me, justin_smith

18:46 justin_smith: but I think the test should be a function

18:47 np

18:47 note how in my examples I used an fn, and it ran with run-tests

18:47 benkay: yup.

18:48 justin_smith: also you probably want some call to is or are, of course

19:21 shoepie: dnolen_: doesn't seem related to om, but when I changed to 0.5.0-rc1 my "lein cljsbuild auto" is really flakey

19:22 dnolen_: works about 1 of 5 times, build times from <1 to 10 seconds

19:24 dnolen_: lot's of "Unexpected end of input" js errors and "EOF" clojurescript compile exceptions

19:31 dnolen_: wow, nevermind. protip: don't run a second cljsbuild autobuild in another tmux window...

19:34 dnolen_: shoepie: yep that's burned a few people including myself

19:41 shoepie: dnolen_: been one of those days :)

19:50 logic_prog: are there any langauges that form some way of halfway point between erlang and clojure?

19:51 I want the convenience of clojure + clojurescript via cljx + read-string + pr-str .... but I really want erlang's supervision trees and error handling

19:53 dnolen_: logic_prog: http://lfe.github.io/?

19:53 AmnesiousFunes: This suggestion is not very related to your specifics on read-string and pr-str, but Elixir has been receiving a fair amount of attention in Erlang circles

19:53 logic_prog: dnolen_: !

19:53 dnolen_: I

19:54 AmnesiousFunes: In addition to what dnlone said, of course.)

19:54 logic_prog: dnolen_: I've been wanting ot talk to you about facebook react / your Om library.

19:54 dnolen_: logic_prog: though there's not really a good story as far as running Erlang on the client like Clojurescript, far as I know

19:54 logic_prog: I recently implemented a tree-diff algorithm

19:54 so it does the dom-tree diffing part of React.

19:54 Besides virtual-events, does React have anything else?

19:54 i.e. I believe React = diff on dom-tree + virtual events

19:55 dnolen_: lfe looks interesting, though the _opposite_ would be even better, erlang like semantics, on clojure / the jvm

19:56 dnolen_: logic_prog: you mean besides 1 year of performance optimizations and real users battle testing it production? :)

19:57 logic_prog: dnolen_: what preformance optimizations are there besides 1) use js/requestAnimationFrame, 2) _never_ read back from the DOM -- my system only reads to the DOM, never reads from the DOM, and 3) clojure equality testing is even fatster than testing javascript data structures

19:57 dnolen_: my system has been used by 1 user for 2 weeks now; everything appears to be fine with my drag/drop window system in cljs

19:57 dnolen_: logic_prog: don't know of anything like that, Erjang is Erlang on the JVM, but the JVM is somewhat ill suited for Erlang's design.

19:58 logic_prog: damn it, cljs + erlang is just not as nice as cljs + clj

19:58 brehaut: in todays issue of news that surprises nobody ;)

19:59 dnolen_: logic_prog: there aren't really any performance optimizations in Om beyond using identical? checks when we can and batching updates + requestAnimationFrame

19:59 ticking: logic_prog dnolen_: I think joxa is far more similar to clojure than LFE http://joxa.org/

19:59 dnolen_: logic_prog: almost all the value in Om is derived from the model which emphasizes modularity w/o sacrificing global time management

20:00 technomancy: really not a fan of LFE

20:00 lisp-2 is just =(

20:00 Raynes: Elixir

20:01 <3

20:01 I'm a heathen, I know.

20:01 ticking: technomancy: yeah, joxa is a lisp-1 thoug

20:02 technomancy: ticking: yeah, it looks way nicer

20:02 Wild_Cat: Raynes: is irclj still under development/support? I might have a minor pull request for it soonish

20:02 Raynes: Wild_Cat: It is if you send that there pull request!

20:03 ticking: technomancy: it was heavily inspired by clojure, the only bad thing is that it looks like very old clojure (stuff like use instead of refer)

20:03 Wild_Cat: Raynes: good good. I'm still investigating the bug, but the PR is likely to be a simple (.setKeepAlive) call. :p

20:05 quizdr: what is the appropriate comparator to use when sorting keywords in alphabetical order? I would have though < or > could work, but apparently not

20:06 technomancy: ticking: if that's the main complaint I'd say that's a great sign =)

20:07 Raynes: &(compare :a :b)

20:07 lazybot: ⇒ -1

20:07 Raynes: &(compare :c :b)

20:07 lazybot: ⇒ 1

20:07 Raynes: &(compare :c :c)

20:07 lazybot: ⇒ 0

20:07 quizdr: Raynes well that was easy. I was looking for what to pass to sort-by, thanks

20:07 ticking: technomancy: yeah, they have a horribly small userbase though and all the perks that come with it :(

20:09 Raynes: So did Clojure once.

20:09 Never forget.

20:09 * Raynes takes his cap off.

20:09 Wild_Cat: well, even when very young Clojure had the advantage of Java interop

20:10 which mitigates a large part of the "small userbase" problem (lack of libs)

20:11 quizdr: If you write a function that takes a single parameter (arity of 1) and then pass to this function a map { ... } shouldn't this satisfy the arity?

20:12 I'm finding it gives me error based on arity

20:13 Raynes: Could you show the code in question?

20:13 dacc: example?

20:13 Raynes: What you describe is indeed very unlikely, which is why the code is necessary.

20:14 quizdr: Raynes dacc here: https://www.refheap.com/42378

20:14 I try: (kfdefaults {:a [1 2 3]}) and get Wrong Number of Args error

20:16 oops i see a syntax error

20:17 geez i need to go for a jog or something.

20:36 is there a rule for which arity overload is chosen if more than one suffices, such as if you pass two args and arities exist of [a b] and [& a] ?

20:40 gfredericks: ,((fn ([& zs] :zs] ([a b] :ab)) 1 2)

20:40 clojurebot: #<RuntimeException java.lang.RuntimeException: Unmatched delimiter: ]>

20:41 amalloy: quizdr: you can't define such a function

20:41 gfredericks: ,((fn ([& zs] :zs) ([a b] :ab)) 1 2)

20:41 clojurebot: #<CompilerException java.lang.RuntimeException: Can't have fixed arity function with more params than variadic function, compiling:(NO_SOURCE_PATH:0:0)>

20:41 stcredzero: What's the time complexity of (keys) and (vals) on a map?

20:41 gfredericks: ,((fn ([z1 z2 & zs] :zs) ([a b] :ab)) 1 2)

20:41 clojurebot: :ab

20:41 gfredericks: stcredzero: it returns a lazy sequence in constant time

20:41 amalloy: yeah, time complexity is a slippery notion with laziness

20:42 gfredericks: ignoring the laziness I have a hard time imagining it could reasonably be anything other than linear

20:42 stcredzero: gredericks: woohoo!

20:42 amalloy: it's O(1) time to return, and then probably O(n) to traverse it all

20:42 quizdr: amalloy ok good to know thanks

20:42 gfredericks: I guess worst case O(n log n) wouldn't be shocking

20:43 amalloy: gfredericks: pretty hard to imagine, though

20:43 hyPiRion: amalloy: well, depends on input data structure

20:44 it'll be O(n log n) for sorted collections

20:44 amalloy: hyPiRion: how confident are you in that? i wouldn't be at all surprised if it were O(n)

20:45 stcredzero: hyPiRion: aren't sorted collections implemented as a tree? That would be O(n)

20:45 amalloy: to traverse from one key to the next will usually take O(1) time, since they're adjacent; sometimes it will take longer as it retraces its path back up a few levels towards the root, but perhaps it amortizes out to O(n)

20:49 stcredzero: amalloy: yes, it amortizes quite simply. Every time you follow a link "down" you go back "up". It's freshman year binary tree stuff.

20:50 (At least it was back in the 80's)

20:50 hyPiRion: stcredzero: right, assuming they are balanced

20:50 amalloy: hyPiRion: his argument doesn't depend on balance at all

20:50 hyPiRion: wait, nevermind that. It's O(n) anyway

20:50 yeah

20:51 stcredzero: hyPiRion: it doesn't matter a whit if it's balanced or not

20:51 amalloy: stcredzero: that is what i would expect too, but i don't think either one of us actually knows enough about how the sorted collections are laid out to be sure that it actually applies

20:51 stcredzero: amalloy: yeah. they're based on trees, but then they have the persistent magic layered on top of them.

20:53 hyPiRion: yeah

20:55 It's log(n) for the first key, then constant time thereafter for the remaining keys

20:55 You know, I think I should just shut up, because that's not true either

20:55 :p

20:58 amalloy: hyPiRion: it's much safer to just say O(1) to create the seq, and amortized O(n) to traverse it. you can sweep all kinds of silly nonsense under the amortized rug

20:59 hyPiRion: amalloy: well, that's no fun.

21:00 but I guess that's the easiest thing

21:01 stcredzero: hyPiRion: I recommend going over algorithms again. That stuff is genuinely useful.

21:01 hyPiRion: And uh, if lazy seqs need to realise the first element, then it would actually take O(log n) time to create it for sorted collections.

21:01 stcredzero: Yeah, laziness does complicate things a bit

21:02 johnwalker: i'm pretty sure okasaki pushed laziness under the rug in his book

21:03 hyPiRion: johnwalker: well, there are still similar complications for e.g. persistent queues

21:04 johnwalker: if you blog about it i'll read it lol

21:04 hyPiRion: I think he mentions he calculates amortized time for those structures. But as he's working through the parts in ML, stuff is being realised eagerly.

21:05 stcredzero: I'm just tired and have knee-jerk reactions where I don't think before hitting enter, really. It's a bad habit

21:06 stcredzero: hyPiRion: A friend of mine was runnig a project with really good metrics, and he managed to reduce the number of bugs checked in to the repo by disallowing check-ins after 4:00 pm.

21:06 hyPiRion: I'm not surprised

21:10 johnwalker: hyPiRion, do you know if there's been any progress on #1411 for leiningen

21:11 hyPiRion: johnwalker: no, it's mostly technomancy who's pushing that one. AFAIK noone has started working on it

21:12 johnwalker: i feel like it might not be a great idea, given the amount of pain most scms deliver to developers

21:13 technomancy: johnwalker: as long as the `lein release` stuff turns out fine, I might just close that.

21:13 they're basically addressing the same problem

21:14 johnwalker: technomancy: which issue addresses lein release?

21:14 oh, i found it

21:14 yeah, i'd be happy with that

21:16 technomancy: just keep having issues piling up; not sure when I'll get to the release stuff

21:17 johnwalker: i'll try to help out with the programmatic modifications, i've gotten a lot of utility out of leiningen and appreciate the work that you've done

21:18 toxmeister: in CLJS what's the equivalent (or closest) solution to `extends?` or `satisfies?`?

21:19 johnwalker: rewrite-clj looks like it solves the problem of preserving comments

21:21 toxmeister: basically, I'm having a bunch of unit tests verifying that a type implements certain protocols & I'd really like to have this test in CLJS as well

21:22 dsrx: toxmeister: satisfies? exists in cljs

21:22 it's used all over core.cljs

21:23 i think it's a macro though

21:25 toxmeister: i thought so too, but i'm working in the chrome js repl... just realized in the compiled version, satisfies lives in cljs.core.native ns... couldn't find it, sorry

21:26 dsrx: toxmeister: satisfies? is a macro that expands to something using cljs.core/native-satisfies? (which is an implementation detail I imagine) https://github.com/clojure/clojurescript/blob/master/src/clj/cljs/core.clj#L1013

21:58 ddellaco_: how do I get foo-macro to evaluate the argument foo-fn is passing it not as a symbol, but as the thing it is bound to--is it possible? https://www.refheap.com/42465

22:01 oh, I should add--there is an unstated requirement here that I cannot modify the macro, only the function.

22:01 (which is why I'm bothering at all)

22:01 johnwalker: oh. well for the macro, i think you would just use ` on v

22:02 vladimust: Which http server do you guys recommend?

22:03 brehaut: it depends on your needs

22:03 jetty (perhaps with an nginx proxy pass for the front end) does great for smaller sites

22:04 johnwalker: i'm not actually clear on your question. doesn't foo-fn already evaluate to a symbol?

22:05 do you want foo-fn to return not a symbol?

22:05 vladimust: brehaut: thanks for the recommendation. So jetty is probably better than http-kit?

22:06 brehaut: vladimust: depends on your needs. jetty is very simple to get started with

22:06 johnwalker: http-kit is a drop in replacement, and has support for websockets

22:06 brehaut: johnwalker: almost all ring server adapters are drop in replacements. its the point

22:06 johnwalker: it's not hard to use or change from either

22:06 yep

22:17 n0n3such: why do all scala developers have hyphenated last names ?

22:18 brehaut: is this a joke?

22:18 n0n3such: lol yes

22:18 i asked the same question on #scala and nobody responded.

22:18 glad to see that there is life in the universe

22:19 systemfault: Haha

22:20 vladimust: sorry to ask a dumb question, but can anyone tell me what ring is?

22:20 brehaut: vladimust: not a dumb question. its the common HTTP abstraction used in clojure

22:20 analogous to wsgi in python or rack in ruby

22:20 https://github.com/ring-clojure/ring

22:22 vladimust: brehaut, so I noticed that a few of the clojure http frameworks are built off of it? If I look into jetty, will I also need ring?

22:22 brehaut: vladimust: yes. basically all of clojures web stuff is built on top of it.

22:23 vladimust: thanks brehaut :)

22:23 brehaut: the ring project provides a jetty adaptor that wraps up an internal jetty server.

22:23 how about http://brehaut.net/blog/2011/ring_introduction

22:24 still relevant even though the clojure and lib versions are old

22:24 vladimust: thanks, I have another dumb question

22:25 Are namespaces used to do the job of classes in oop languages?

22:25 for instance, a models namespace?

22:25 brehaut: not really no

22:25 vladimust: so more like node modules?

22:25 brehaut: lets hope not ;)

22:26 they are just a way of group related names together

22:26 vladimust: haha!

22:26 so I can group related functions together, with them?

22:26 brehaut: yes

22:26 but functions dont have datatype ownership like methods in a class

22:28 vladimust: By datatype ownership, do you mean inheritance, or..? (sorry, I'm new haha)

22:28 brehaut: or anything like that

22:28 'classical oo' (oo with classes) bundles a lot of ideas together in 'object' and 'class' concepts

22:29 one of those things is that methods that operate on a piece of data are owned by that data

22:29 you might have some data that is created in a function in ns foo.bar, but a function in baz.bop has just as much right to work on it

22:29 vladimust: ah

22:30 so namespaces don't own the functions in them?

22:30 and there is nothing stopping functions from one namespace calling on functions from another namespace?

22:31 brehaut: that'll do for now

22:31 just keep in mind that in clojure you generally dont create datatypes, you use maps and vectors etc

22:31 so as an example

22:31 ring creates a request map for you

22:32 but when your code gets it, its just a map and you have as much access to its internals as ring

22:33 vladimust: Thanks for your help, brehaut. I've saved your page to my Pocket, and will read it when I get home :)

22:33 brehaut: cool

23:04 s1gs3gv: so how does the performance and scalability of net applications written in clojure compare to those written with the typesafe reactive framework ?

23:16 bob2: sounds like it'd be up to your code, rather than the frameworks

23:27 TEttinger: s1gs3gv, from what I've observed on single-user applications (not servers), clojure can perform very well but things like pmap for auto-parallel aren't as useful as you'd hope. all my slowdowns in clojure have been algorithmic in my code rather than a result of using a lib or framework

23:28 s1gs3gv: bob2: TEttinger: ty for your reply

23:28 benchmarks show clojure much slower than scala

23:30 akyte: It depends how it's written. Type annotations can remove much of a performance difference

23:30 TEttinger: s1gs3gv, kinda. I think the PL benchmarks game has some pretty slow implementations for the clojure programs, but they're idiomatic

23:31 s1gs3gv: akyte: ty

23:32 arubin: The TechEmpower benchmarks are more interesting.

23:32 But not every framework has an implementation for every test yet.

23:34 s1gs3gv: hadn't seen those techempower figures before. ty.

23:40 i am surprised at go's consistent placing near the top of tehempower's benchmarks

23:41 bob2: also depends on whether you include the scala compile time

23:42 s1gs3gv: techempower's figures include compile time ?????

23:44 noprompt: dnolen_: pretty close to having a beta of this inspector. :)

23:45 TEttinger: I really consider clojure useful primarily for how expressive it is, and how easy it is to do fairly complex operations on data. if performance was extremely constrained I wouldn't choose it, but I really find it a good language to get stuff done in.

23:46 s1gs3gv: TEttinger: ^

23:46 noprompt: TEttinger: one thing i appreciate about clojure, and this is for me personally, is that i find a minimum amount of friction between an idea in my head and code on the screen.

23:47 TEttinger: s1gs3gv, no idea about techempower's benchmarks and compile time, but I doubt they include it

23:47 s1gs3gv: ^

23:47 TEttinger: scala has really awful compile times is the thing

23:47 noprompt: so far the limits are really to the extent of my abilities as a programmer. ie. if i can't solve a problem it's because i don't know *how* to solve it.

23:48 s1gs3gv: TEttinger: we've been spoilt lol. Scala compile times are not really the problem that some make it out to be.

23:48 noprompt: scala looks like a syntax bomb went off.

23:48 sm0ke: no shit

23:48 TEttinger: s1gs3gv, I knew someone who had to stop using scala because it was taking over a minute to compile... anything

23:48 s1gs3gv: well there is the static typing system ... but if it compiles, it generally works

23:49 TEttinger: his computer wasn't exactly great

23:49 s1gs3gv: i think noprompt has expressed the critical issue : how well a language maps to the abstractions in which we think

23:49 noprompt: i've always been curious as to why no type safe lisp has surfaced.

23:49 TEttinger: shen?

23:50 inahandizha: http://VisitsToMoney.com/index.php?refId=386970

23:50 TEttinger: I'm guessing that's spam

23:50 s1gs3gv: Tettinger: when I started programming, a build was an excuse to hang out in the hallway for half an hour with colleagues lol

23:50 noprompt: TEttinger: aside frome shen. i've heard mixed opinions about it but have never given it a shot so can't speak to that.

23:50 sm0ke: jscheme

23:51 TEttinger: s1gs3gv, sure but it's still wasted time

23:51 dsrx: s1gs3gv: having watched paul phillips's collections talk, I believe less in the "if it compiles it probably works" claim :P

23:51 bob2: shen is both a statically typed non-free lisp and a dynamically typed non-free lisp!

23:51 noprompt: wrt the clojure as a language dicussion, i wrote garden w/in the first six months of learning clojure.

23:51 s1gs3gv: Tettinger: its not wasted, its an opportunity to interact

23:51 we have become slaves to instant results

23:52 sm0ke: hmm weird that creator of jscheme is tim hickey

23:52 whats the odd

23:52 s1gs3gv: dsrx: in my limited experience, its true

23:52 dsrx: http://www.youtube.com/watch?v=uiJycy6dFSQ

23:53 s1gs3gv: dsrx: i'm sure there are exceptions

23:53 dsrx: s1gs3gv: but yeah, it's generally true in the case of languages with powerfulish type systems

23:54 s1gs3gv: it takes a while to wrap your head around all the complexity of the type systems for sure

23:55 dsrx: one example is that the scala collections library map doesn't follow the basic law that fmap (f . g) == fmap f . fmap g

23:56 and if you're relying heavily on inference it can break your code in subtle ways

23:56 s1gs3gv: dsrx: the world isn't perfect, you are correct

23:56 but i didn't come here to pimp scala

23:57 i like the feel of clojure. i'm just concerned about performance.

23:58 is it possible to write a scalable reliable maintainable net app in clojure that can scale to 100000 users

23:58 mark[oz]: s1gs3gv: it's still a young language.. it'll improve.. I think the important thing unless you're crunching a lot of data is developer speed & happiness :)

23:58 dsrx: it isn't a perfection thing, the example phillips gives in the talk is something anyone might write and then end up refactoring into the (broken) state

23:58 bob2: how could anyone answer that for any language

23:58 depends on what the app does

23:58 noprompt: for some reason as much as i enjoy languages which rely heavily on type systems, i've never been convinced in one of them that it was the *right* way to program.

23:58 sm0ke: s1gs3gv: given enought machines, yes

23:58 s1gs3gv: configurable scalability ?

23:58 noprompt: of course, type heads will fight you tooth and nail and tell you how stupid you are.

23:59 mark[oz]: lol @ s1gs3gv. you're an idiot :)

23:59 s1gs3gv: lol what's new ?

23:59 mark[oz]: obviously not the "can it scale" conversation

23:59 bob2: noprompt, have you tried haskell?

Logging service provided by n01se.net