#clojure log - Nov 04 2013

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

0:14 bitemyapp: Raynes: http://logs.lazybot.org/irc.freenode.net/%23clojure/2012-11-11.txt ctrl-f "I want a driver for rethinkdb."

0:14 Raynes: no excuses. hue hue hue hue hue hue hue hue

0:14 Raynes: bitemyapp: Yes, and that hasn't changed.

0:15 bitemyapp: you has one :D

0:15 Raynes: If I said "I sure wish there was a driver for rethinkdb so I could spend a bunch of time rewriting refheap to use it, that'd be great." then you should start sending me angry emails.

0:15 bitemyapp: sorry, I'm uber excited :)

0:15 Raynes: oh no, I know.

0:15 Raynes: :p

0:15 I'm excited about it too.

0:15 Just more restrained.

0:15 bitemyapp: I don't think I grok restraint.

0:16 Raynes: I've got some projects I've been thinking of doing, so it'll see use by me soon I'm sure.

0:16 I just really hate to fix what ain't broken in refheap.

0:16 bitemyapp: oh that's exciting!

0:16 Totally understandable.

0:34 jared314: when you manually load leiningen project middleware, is there a way to force your middleware to the first?

0:35 or rerun the middleware with a new project map?

0:36 ddellacosta: jared314: what is leiningen project middleware?

0:36 jared314: ddellacosta: https://github.com/technomancy/leiningen/blob/master/doc/PLUGINS.md#project-middleware

0:37 ddellacosta: jared314: ah, cool, didn't know about that.

0:37 jared314: trying to restructure my current lein plugin

0:37 ddellacosta: gotcha

2:06 ubikation: can someone help me figure out this code?: https://gist.github.com/ubikation/7299061 I'm getting the error: "IllegalArgumentException Don't know how to create ISeq from: clojure.lang.Symbol clojure.lang.RT.seqFrom (RT.java:505)"

2:08 arrdem: ubikation: '(0 char-to-nums) is your problem

2:08 ,(let [char-to-nums :foo] (= '(0 char-to-nums) (list 0 char-to-nums)))

2:08 clojurebot: false

2:11 ubikation: arrdem: how do I correct that?

2:12 arrdem: ubikation: use a sequence literal. (list 0 char-to-nums) or [0 char-to-nums] would do the trick.

2:12 s/literal/expression/

2:13 ubikation: arrdem: thanks! but I seem to still be getting a different version of that error: "IllegalArgumentException Don't know how to create ISeq from: java.lang.Long"

2:14 arrdem: ubikation: well structurally you've got a major problem... recur doesn't do what you seem to think it does.

2:14 http://clojure.org/special_forms#Special%20Forms--%28recur%20exprs*%29

2:16 ubikation: arrdem: so what do I do if I want to escape the arity?

2:16 arrdem: ubikation: you should also probably be using reduce, rather than a recursive apply

2:16 ubikation: ^ that. reduce not apply.

2:16 ubikation: arrdem: thank you! I'll look into that.

2:19 arrdem: ubikation: you are trying to keep a running sum here, right?

2:20 ubikation: arrdem: yes

2:21 hmm I'm getting stuck with this small part: (reduce (fn [x] (+ 26 x)) [1 2 3])

2:22 arrdem: ubikation: reduce takes a function f:[last-partial,this-step]->next-partial

2:22 ubikation: I think you want #(+ 26 %1 %2)

2:22 or (fn [x y] (+ x y 26)) without the # notation.

2:23 also you don't need to (seq) a string... strings are already ISeqable so (map) will do that for you.

2:24 ubikation: arrdem: thank you so much for explaining things

2:24 arrdem: ubikation: no worries mate

2:39 bja: I don't think I've ever been as productive doing frontend stuff as I have recently with jquery+cljs

7:53 mikerod: (defrecord MyRec [x])

7:54 (def m (->MyRec 5))

7:54 (instance? MyRec m)

7:54 (eval (defrecord MyRec [x]))

7:54 (def m2 (->MyRec 5))

7:54 (instance? MyRec m)

7:54 (instance? MyRec m2)

7:54 (= (type m) (type m2))

7:54 hyPiRion: wrong emacs window there

7:55 mikerod: hyPiRion: This is my question ... Probably should have done it differently

7:55 tbaldridge: mikerod: use gist

7:55 mikerod: https://gist.github.com/mjr4184/7302050

7:56 sorry

7:56 Although, I understand why m and m2 in this example are not the same instance

7:56 with how the dynamic classes are created through different classloaders,

7:57 this behavior has bit me quite a bit, with clj files being loaded from differetn classloaders

7:57 "reloaded"

7:58 I guess, should it just be frowned upon to use instance? checks with dynamically generated classes, like via defrecord

7:59 I meant why m and m2 do not have the same `type` ***

8:16 clgv: mikerod: when you reevaluate a defrecord/deftype you create a new class that has just the same name but is a different class

8:19 mikerod: clgv: I understand that. What I'm saying is I have a clj file that had a defrecord in it. This file is used from two separate jars, the one that it is defined in, and another that is dependent on it. The second jar is loaded at runtime, and when it stumbles across a :require of this clj file, it reloads it, which reload the defrecord.

8:20 So then the second jar, creates instances of the reloaded defrecord.

8:20 When these are passed as args to fn's from the original jar, if those functions have instance? checks on this defrecord type, they will not work.

8:39 dabd: what is the clojure operator that given (nth s [1 2 3]) would transform it into (nth (nth (nth s 1) 2) 3)?

8:41 pyrtsa: dabd: (get-in s [1 2 3]) gets close

8:41 AimHere: pyrtsa, would that work on lists?

8:41 pyrtsa: Oh, probably not.

8:42 clgv: mikerod: you should not have the namespace only once included in one of the jars

8:42 -not

8:42 liszt: dabd: Look at reduce.

8:42 AimHere: ,(reduce (partial nth [:a :b :c :d]) [1 2 3])

8:42 clojurebot: #<ClassCastException java.lang.ClassCastException: clojure.lang.Keyword cannot be cast to java.lang.Number>

8:42 dabd: my guess is this could be a job for the threading macros, or maybe juxt or iterate but i'm not sure how

8:42 clgv: mikerod: if you need the namespace with the defrecord in two jars create a lib and lot those other two projects depend on the lib

8:43 pyrtsa: (reduce nth s [1 2 3]) works

8:46 dabd: ,(reduce nth [[1 [2 [3 4 5] 6]]] [0 1 2])

8:46 clojurebot: 6

8:47 mikerod: clgv: Hmm the namespace is only included in one jar, I guess the way this dependent jar is being loaded is somehow circumventing the typical load-once semantics of require

8:48 I'm skeptical that clojure.core/*loaded-libs* is not being shared when the dependent jar is loaded

8:49 clgv: mikerod: oh I had this before

8:49 dabd: I would like to write a function that given a possibly nested list would return me a list of the indexes of each leaf. Such that I can reduce the list with nth and those indexes and obtain each leaf. Ex: Given ((a b) c) it would return ((0 0) (0 1) (1)) because (nth (nth lst 0) 0) = a (nth (nth lst 0) 1) = b and (nth lst 1) =

8:49 clgv: mikerod: be sure that all namespaces with "-" use "-" in the require statements and "_" in the import statements

8:49 dabd: c

8:50 clgv: mikerod: probably worth a ticket on jira

8:52 mikerod: clgv: I'm fairly sure I've handled the hyphen/underscore issues, though that is a fun one :)

8:53 clgv: mikerod: yeah I was sure as well

8:53 mikerod: until I saw an underscore in *loaded-libs* after digging into it for a longer time

8:56 mikerod: hmm ok, I will double check on that then

8:57 jcromartie: am I crazy or do I remember a "named?" in clojure.core

8:58 clgv: jcromartie: I have the same memory but needed to use instance? lately

9:00 Bronsa: there has never been a clojure.core/named? AFAIK

9:01 clgv: maybe it was discussed as useful inclusion

9:05 llasram: Hot code, fresh to the githubs: https://github.com/damballa/parkour

9:05 As a bonus for early users, the first 100 copies downloaded from clojars will contain a tiny fragment of my soul

9:06 cemerick: OK, what alternative Clojure/ClojureScript implementations/targets are people aware of? I'm pretty sure I have a comprehensive list, but I'd like to make sure.

9:06 bbloom: cemerick: where is your list?

9:07 cemerick: bbloom: nowhere public at the moment; clojurec, clojurescript-lua, clojure-py, Clojure.NET, clojure-scheme

9:08 oh, four of them were in last year's survey

9:08 clgv: cemerick: you prepare the next survey? ;)

9:08 cemerick: clgv: yeah, probably going to publish later today

9:12 bbloom: llasram: pretty interesting stuff

9:12 llasram: bbloom: Thanks!

9:17 bbloom: llasram: also good motivation docs. i'm so glad that motivation.md or similar is something that frequently happen in this community :-)

9:18 llasram: are you using this for something in particular? or was this just for fun?

9:18 llasram: also, the "Reference" link in the readme is broken

9:31 llasram: bbloom: On my team at Damballa we've moved most of our Hadoop jobs to using this

9:32 bbloom: nice, good stuff

9:33 llasram: Not sure I how missed external-izing the Reference link... Fixed now. Thanks for catching!

9:36 I need to drop off for a bit, but would be glad to talk more later. I'm still in that project honeymoon stage where could talk about it all day :-)

9:43 mdrogalis: tbaldridge: Played around with pipelining in core.asyc this weekend. I knew how to do it in theory, just never sat down to actually write the code to do it. Very fun.

9:43 tbaldridge: mdrogalis: take a look at core.async/pipe sometime, may help with what you were doing in the blog.

9:44 mdrogalis: tbaldridge: Still need to take the time to look at all the new things you guys implemented.

9:45 Ah, pretty cool. Pretty much wrapped the idiom. Nice.

9:48 At least I remembered to use put! this time. Hah

9:48 tbaldridge: mdrogalis: lol nice

10:06 dnolen: ClojureScript source maps with relative paths to original sources in master, should be good enough to integrate into web based setups - enhancement patches of course welcome :)

10:09 hoeck: dnolen: Great!

10:15 dnolen: also enhanced :import for working with GClosure stuff more like Clojure http://github.com/clojure/clojurescript/commit/dbf31380b925815d832a6cc53364d063a59dafad

10:15 :import for deftype/record dead as it never actually worked

10:16 bbloom: dnolen: so does that make goog.provide a future enhancement for something gen-class like?

10:20 dnolen: bbloom: hmm, don't think so. that's come up before, but I don't think that many people would use it.

10:20 stuartsierra1: dnolen: nitpicking, but `import` specifies a list, not a vector

10:20 dnolen: stuartsierra1: huh, but vector allowed?

10:20 stuartsierra1: dnolen: Yes, all the `ns`-related macros/functions are notoriously permissive in their arguments.

10:24 bbloom: stuartsierra1: at this point, i think the spec needs to expand. too much code just go all willy nilly with sequence literals in ns forms. there is no way it will ever change to be less permissive

10:25 dnolen: stuartsierra1: k, fixing that

10:25 stuartsierra1: thanks

10:25 stuartsierra1: bbloom: Yes, but core examples should be consistent with the docstrings.

10:25 dnolen: thanks

10:53 dabd: I am attempting to use clojure.zip to solve this http://stackoverflow.com/questions/19769208/nested-list-traversal but so far I couldn't do it. Is there anyone that can show me how to use zippers for this task? Thanks

11:01 why this works ,(let [x [0]] (update-in x [(- (count x) 1)] inc))

11:01 but this doesn't ,(let [x (butlast [0 1])] (update-in x [(- (count x) 1)] inc))

11:01 ,(let [x [0]] (update-in x [(- (count x) 1)] inc))

11:01 clojurebot: [1]

11:02 dabd: ,(let [x (butlast [0 1])] (update-in x [(- (count x) 1)] inc))

11:02 clojurebot: #<NullPointerException java.lang.NullPointerException>

11:03 andrewmcveigh: ,(class (butlast [0 1]))

11:03 clojurebot: clojure.lang.PersistentVector$ChunkedSeq

11:03 rplaca: dabd: butlast gives you back a seq, not a vector

11:03 dabd: so i need to call vec on it?

11:04 rplaca: that should work

11:14 dabd: I wrote a solution to this problem http://stackoverflow.com/questions/19769208/nested-list-traversal using clojure.zip. Any suggestions for improvement?

11:15 It's the first time I am using clojure.zip

11:23 ubikation: hello! I am having some trouble getting a somewhat simple example to work...

11:23 (reduce #(+ (* 10 ( - (int %1) 48)) %2) [\0 [\4 \4 \4]])

11:24 actually it's (reduce #(+ (* 10 ( - (int %1) 48)) %2) '(\4 \4 \4 \4))

11:25 andrewmcveigh: ubikation: This what you're trying to do? ##(reduce #(+ (* 10 ( - (int %1) 48)) (int %2)) '(\4 \4 \4 \4))

11:25 lazybot: ⇒ 4492

11:34 ubikation: andrewmcveigh: thank you!

11:35 also what's the best way to turn a list like '((\4 \4 \4)) into '(\4 \4 \4 \4)

11:35 gfredericks: ...with a different number of 4's?

11:35 TimMc: first

11:36 (constantly '(\4 \4 \4 \4)) :-P

11:36 gfredericks: ubikation: it's not really clear what your question means

11:36 ubikation: haha yeah first is exactly what I'm looking for.

11:39 TimMc: &(#(`[~@%](+)) '((\4 \4 \4 \4)))

11:39 lazybot: ⇒ (\4 \4 \4 \4)

11:39 TimMc: ^ There's a worse way

11:43 mdrogalis: TimMc: You're certifiably insane. :P

11:46 * TimMc grins

11:46 ubikation: can someone help me with lein? for some reason it's not working any more: https://gist.github.com/ubikation/7305498

11:46 clojurebot: It's greek to me.

11:47 TimMc: ubikation: That top-level map has :user and two {} forms.

11:47 I think you want to combine those to {} forms.

11:47 *two

11:48 &{:user 'thing 'other-thing}

11:48 lazybot: java.lang.RuntimeException: Map literal must contain an even number of forms

11:53 ubikation: TimMc: thanks!

11:53 hey, I have this new problem though:

11:53 error in process sentinel: cond: Could not start nREPL server: Error loading ritz.nrepl.middleware.doc: Could not locate ritz/nrepl/middleware/doc__init.class or ritz/nrepl/middleware/doc.clj on classpath:

11:53 java.lang.RuntimeException: Unable to resolve var: ritz.nrepl.middleware.doc/wrap-doc in this context, compiling:(NO_SOURCE_PATH:0:0)

11:53 That's when I'm trying to jack into cider

11:57 muhoo: TimMc: is that swearjure?

11:57 TimMc: It is indeed.

11:58 What else could it be?

12:00 kolemannix: So guys. If you were to try to dress up as a monad, how would you go about doing it?

12:01 TimMc: kolemannix: http://laurenvenell.com/wordpress/wp-content/uploads/tilted-860.jpg

12:02 gws: kolemannix: http://www.bostoncostume.com/images/products/7561.jpg

12:03 kolemannix: TimMc http://www.youtube.com/watch?v=46Z7Hq4fhN0

12:03 coventry`: Maybe as the Emperor with No Clothes? :-)

12:05 kolemannix: gwd TimMc The burrito is actually a decent idea though. Maybe both a burrito and a spacesuit in one costume

12:11 gws: i think of monads more like this http://i00.i.aliimg.com/wsphoto/v0/388873690/1-Male-font-b-VGA-b-font-to-2-font-b-VGA-b-font-Female-Adapter.jpg but that's not really a costume

12:23 silasdavis: if I have a sorted subset of some objects and I want to an ordered list with the sorted object in their sorted order and the rest in some arbitrary order will (concat (set/difference (set all-objects) (set sorted-objects)) sorted-objects) work?

12:23 can I do any better, will I ended up with my sorted-objects in the correct order?

12:25 `cbp: silasdavis: I don't understand the question very well but have you tried it in a repl? Seems like you have the code already. Also you might wanna use sorted-sets?

12:25 ubikation: how do I fix this error?: (:use [dk.ative.docjure.spreadsheet]) gives me "CompilerException java.lang.ClassNotFoundException: dk.ative.docjure.spreadsheet, compiling:(NO_SOURCE_PATH:1:1)"

12:26 hiredman: (:use [dk.ative.docjure.spreadsheet]) needs to be part of a (ns ...) form like it was in the example you took it from

12:26 silasdavis: `cbp, it seems to work in a repl, something like (concat #{ 3 9 7} [9 4 2])

12:27 I'm just wondering if under some circumstances I might end up conj'ing onto a set

12:27 and thus lose the order of my ordered items

12:27 the only reason the set is there is so I can take the difference

12:27 `cbp: silasdavis: If you want order in a set use sorted-set

12:27 silasdavis: `cbp, I don't want order in the set

12:28 ubikation: I still get the same error when I try the whole ns thing: "(ns excel-test.core (:gen-class) (:use [dk.ative.docjure.spreadsheet] :reload-all))"

12:29 `cbp: silasdavis: you want the set difference between 2 vectors?

12:29 silasdavis: yes

12:29 well probably a seq

12:30 `cbp: you could do (remove (set v2) v1)

12:31 justin_smith: what about (concat (remove (set sorted-objects) all-objects) sorted-objects)

12:31 oh, like `cbp just mentioned

12:31 jcromartie: I'm not loving the mustache templating libs I've seen so far

12:32 justin_smith: jcromartie: what do they lack? / have that you don't want?

12:33 mmitchell: Anyone here using Pristmatic's "schema"?

12:33 jcromartie: justin_smith: performance, consistency, resource focus, ability to use strings as keys, concurrent rendering, deref, etc.

12:33 justin_smith: jcromartie: I ask because I contribute to one of them that may be better, but I want to be sure before just telling you to go try that one - also whatever you need may be an improvement we could make eventually

12:33 jcromartie: I am going to work on my own

12:34 :P

12:34 just to add to the mess

12:34 but mine will be the *right* one :)

12:34 kolemannix: Hello. So If I have a map and I want to keep all the pairs for which the key starts with the character ".", ditch the rest of the pairs, and at the same time remove the leading "." from the keys, how would I go about doing that?

12:34 justin_smith: jcromartie: ours is used in production, so it is pretty good performance wise, it allows for a | operator for chaining helpers, and arbitrary functions as helpers in the request map

12:35 kolemannix: I have a way of doing so but it's inefficient and not intuitive

12:35 hfaafb: kolemannix: filter then map?

12:35 jcromartie: basically, I should be able to do this: (let [templ (mustache "foo.mustache")] (templ {"this" "that" :foo (future (slurp "http://example.com/bar")}))

12:36 or ((mustache (.getBytes "this is a {{test}}")) {:test "test"})

12:36 kolemannix: hfaafb I'm doing that already, but in a really clunky way

12:36 (let [with-dots (->> (map list lines addresses)

12:36 (filter #(= (ffirst %) \.))

12:36 flatten

12:36 (apply hash-map))]

12:36 (zipmap (map remove-first (keys with-dots)) (vals with-dots))))

12:36 justin_smith: I am going to test out strings as keys, I think it works with our lib, but I am not certain, I will check it out in my current project

12:36 jcromartie: justin_smith: which lib?

12:36 clostache?

12:36 justin_smith: caribou/antlers

12:36 rasmusto: kolemannix: (into {} (map remove-the-dot (filter (fn [[k v]] (blah k))))

12:37 kolemannix: I'd do the filter for the dot first, then the removal in the "map" step

12:37 kolemannix: rasmusto Ahh into. I don't use into enough

12:37 justin_smith: https://github.com/caribou/antlers https://clojars.org/caribou/antlers

12:37 jtoy: if i have 2 lists like [{:a 2 :foo 23} {:a 1 :foo 213}] and [{:a 2 :bar 43} {:a 1 :bar 666}] and I want to join them or group them so that I can process them grouped by a, how would I do this?

12:37 rasmusto: you can use (into {}) to turn a list of keyval pairs back into the map

12:38 kolemannix: rasmusto thanks. that's the piece I was missing, the (zipmap keys vals) is so awkward

12:38 rasmusto: kolemannix: notice that the filter step destructures out the key, and the map step should do the same

12:38 hugod: jcromartie: doesn't stencil do all that?

12:39 jcromartie: there are SO MANY that I had no idea were there

12:39 wow

12:40 kolemannix: rasmusto thanks

12:40 llasram: Let a thousand templating libraries bloom!

12:40 justin_smith: jcromartie: I just verified, antlers works with string keys

12:40 jcromartie: that's good

12:41 I don't know why so many of them expose manual caching/registration

12:41 justin_smith: also notice the loop variables / aliases in the docs there, very useful

12:41 but of course I don't gain by you using ours instead of someone elses, so just use what works :P

12:41 jcromartie: I should be able to do my own memoization

12:41 :P

12:41 rasmusto: ,(into {} (map (fn [[k v]] [(str (rest k)) v]) (filter (fn [[k v]] (= (first k) \.))))) {".one" 1 "two" 2 ".three" 3})

12:41 clojurebot: #<ArityException clojure.lang.ArityException: Wrong number of args (1) passed to: core$filter>

12:42 rasmusto: whoops, too many parens somewhere, but you get the idea

12:43 ,(into {} (map (fn [[k v]] [(str (rest k)) v]) (filter (fn [[k v]] (= (first k) \.)) {".one" 1 "two" 2 ".three" 3})))

12:43 clojurebot: {"(\\t \\h \\r \\e \\e)" 3, "(\\o \\n \\e)" 1}

12:43 justin_smith: rasmusto: at scale, forcing strings to/from seq is expensive, and its not like (subs s 1) is hard to do

12:44 rasmusto: justin_smith: probably a good point, that'd fix the (apply str (seq blah)) that I'm missing

12:44 justin_smith: heh, that too

12:45 rasmusto: kolemannix: this is probably a good place to use ->>, since my mess is unreadable

12:46 justin_smith: ,(into {} (map (fn [[k v]] [(subs k 1) v]) (filter (fn [[k v]] (= (subs k 0 1) ".")) {".one" 1 "two" 2 ".three" 3})))

12:46 clojurebot: {"three" 3, "one" 1}

12:46 rasmusto: there's nothing like a well-placed thread-last macro to brighten a monday morning :)

12:47 justin_smith: true enough

12:47 kolemannix: rasmusto I'll try to get a polished version working and readable and let you know when I do

12:48 rasmusto: kolemannix: okay, I'll take a sec to let you know about refheap.com for all of your clojure pasting needs

12:55 bitemyapp: `cbp: alright, I pimped Revise on HN, Reddit, Twitter, and random blogs.

12:55 `cbp: bitemyapp: <3

12:55 bitemyapp: `cbp: ping me if you need anything, I know I should write some test cases to see if I can break the thread-safety of the conn mgmt.

12:56 `cbp: bitemyapp: ok

12:56 bitemyapp: `cbp: also I added an explanation of the connection mgmt model to a file called connections.md in the repo.

12:56 `cbp: bitemyapp: I saw that

12:57 bitemyapp: `cbp: it also occurred to me that a generic resource pooling library like Haskell has would be kinda sweet.

12:57 so I might consider ripping them off :P

12:58 `cbp: bitemyapp: would it be optional?

12:58 bitemyapp: yeah it's not anything I'm likely to add to Revise anytime soon

12:58 and I'm not sold Revise *needs* connection pooling when the connections are lock-free.

12:58 the connections only block for as long as it takes to send the query, not to recv.

12:59 Mostly I'm just musing about it because I was watching a Bryan O'Sullivan talk and he mentioned a generic resource pooling library for Haskell that he wrote for the MySQL client driver.

12:59 again, it's not something Revise strictly speaking *needs*, but the concept of a generic resource pooling library tickles me.

12:59 especially if it wasn't overly JDBC specific like most are (ick)

13:00 `cbp: I'm not very familiar with haskell but I'll take a look

13:00 next steps are implementing continue/stop queries

13:01 bitemyapp: `cbp: https://github.com/bos/pool

13:01 `cbp: the main thing conn mgmt needs is a proper error handling model.

13:01 it's ad-hoc agent recovery right now (lol)

13:01 `cbp: :-)

13:02 ubikation: can anyone help me understand why I am getting this error?: https://gist.github.com/ubikation/7306693

13:02 thank you!

13:02 bitemyapp: and if it doesn't pan out the way I want, I might replace the agents with core.async, since I'm really using the agents for serialized message passing anyway.

13:02 that or wrap the agent functions in a big-fat try-catch or something equally dumb.

13:03 ubikation: (ns excel-test.core (:require [dk.ative.docjure.spreadsheet :refer :all]))

13:03 ubikation: don't use :use.

13:03 ~use is don't use use.

13:03 clojurebot: Ok.

13:03 bitemyapp: okay, I'd better head to work.

13:03 `cbp: catch you later

13:03 `cbp: bitemyapp: bye

13:03 ubikation: bitemyapp: thanks! but I'm still getting the same error though...

13:04 `cbp: ubikation: whats you're project.clj look like

13:04 your*

13:04 (assuming you're using leiningen)

13:05 bitemyapp: ubikation: if that didn't work then your classpath doesn't have the library and you didn't add the dependency to Leiningen properly.

13:05 ubikation: Leiningen is configured through the project.clj `cbp mentioned, paste it on refheap.

13:05 TimMc: ~use

13:05 clojurebot: I am putting myself to the fullest possible use, which is all I think that any conscious entity can ever hope to do.

13:06 bitemyapp: ~use

13:06 clojurebot: I am putting myself to the fullest possible use, which is all I think that any conscious entity can ever hope to do.

13:06 bitemyapp: gerd dermert.

13:06 `cbp: clojurebot: botsnack

13:06 clojurebot: Thanks! Can I have chocolate next time

13:11 kolemannix: rasmusto https://www.refheap.com/20463

13:21 justin_smith: kolemannix: I tried a version of that using subs instead of sequence ops, and interestingly I saw little to no performance difference

13:21 I did not expect that, TIL

13:24 kolemannix: justin_smith which are usually considered slower, subs or sequence ops?

13:26 rasmusto: yay threading, this is going to be a good week

13:27 justin_smith: kolemannix: in general strings are much more optimized than seqs

13:27 also, they are immutible (one of the things vanilla java got right)

13:27 kolemannix: justin_smith Underneath it's just java strings yes?

13:27 justin_smith: kolemannix: yes, but with a seq you force the creation of a new seq object based on the string

13:28 then the creation of a new string out of the seq

13:28 unless that is being optimized

13:28 kolemannix: Sure. Only makes sense if you wanna do a lot of operations on the string

13:28 for just one operation all the conversion is overkill

13:28 justin_smith: *a lot of seq operations that are not also native string operations

13:29 that is why my instinct was to use subs instead of first/rest, but I guess the jvm and/or clojure was smart enough that it was not an issue

13:29 kolemannix: Yeah

13:29 I mean, there's gotta be a way to invoke native Java string ops using idiomatic clojure

13:29 without using the dot interop stuff

13:30 justin_smith: indeed there are... vis my version of that refheap: https://www.refheap.com/20464

13:31 first and rest are trivial to translate into subs

13:31 ,(subs "hello" 1)

13:31 clojurebot: "ello"

13:32 kolemannix: ohhh. and here I thought you just meant subs as a shorthand for java substring ops

13:32 I didn't know it was an actual function >.<

13:35 justin_smith ran your version with subs on my actual data - got an IndexOOB exception... Another interesting factor to consider when weighting the differences of the 2 ways of doing it

13:38 xeqi: dnolen: I've got some local clojurescript changes to make cljs.repl/evaluate-form send inline source map information to the repl-env. This makes repl interaction show source maps in the browser. I've got a CA signed, is the next step a JIRA+patch?

13:39 * next step for submitting the changes

13:39 bitemyapp: `cbp: https://news.ycombinator.com/ look at the #2 ranked item

13:40 `cbp: =D

13:40 dnolen: xeqi: that sounds really interesting, but how does that actually work?

13:40 justin_smith: kolemannix: heh, ok

13:41 must have had one letter strings as some of the keys I guess

13:41 `cbp: bitemyapp: maybe we could make a java wrapper and pass it off as the java driver? :)

13:41 kolemannix: justin_smith I mean, I like yours better, mostly because it gets rid of the (apply str) nonsense

13:41 just have to be careful about indices

13:41 dnolen: xeqi: like are you generating a source map for each evaluated form? Or you tracking things and serving a source map that's kept up to date?

13:42 xeqi: dnolen: source map for each evaluated form

13:42 dnolen: xeqi: seems like the experience would be a bit strange no?

13:42 seangrove: xeqi: Super interesting. I saw notes on how to do that

13:42 dnolen: seangrove: link?

13:42 xeqi: combination of using a data url w/ the sourcemap base64 encoded, sourcesContent to send the form inline in the source map, and naming the eval

13:42 http://kybernetikos.github.io/jsSandbox/srcmaps/dynamic.html is one

13:43 dnolen: xeqi: whoa, k, yeah JIRA+patch please

13:43 xeqi: + http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl for named evals

13:44 k, will finish clean up and make one

13:44 seangrove: xeqi: Yeah, that's the one I was looking for ;)

13:46 dnolen: xeqi: mail in your CA, I can apply the patch before it arrives.

13:47 xeqi: so does this make the REPL experience significantly better for you?

13:47 this is first I've heard it can even be done

13:47 xeqi: dnolen: signed one at first conj, so already there

13:47 dnolen: xeqi: oh k cool

13:48 xeqi: breakpoints are ify, but things like (.error console "asdfasd") are significantly improved

13:48 esp when using something like austin/piggieback and resending a buffer

13:49 bitemyapp: `cbp: a java wrapper? hum.

13:49 dnolen: xeqi: ah right, hrm I suppose piggieback and others could decide to generate in memory source maps on the fly ... anyways cool stuff!

13:50 bitemyapp: `cbp: hypothetically, yes...I don't know if it'd be worth it because re-exposing the query DSL as native Java would lead to the same amount of work, I think.

13:50 `cbp: I foresee lots of clojure.lang.RT :P

13:50 timsg: when writing rewrite macros that transform certain list subforms, say those starting with 'foo, is there a received way to define 'foo? Best I can come up with is (def foo `foo), but that seems weird enough to suspect unintended consequences

13:51 bitemyapp: timsg: don't do that @ def

13:51 justin_smith: why would you use def?

13:51 err, what bitemyapp said

13:51 bitemyapp: timsg: show a before and after of what you want please.

13:51 timsg: and do not do defs in macros or anywhere other than the top-level of a namespace.

13:51 coventry`: Using def makes the macro less flexible.

13:52 muhoo: mos def

13:52 coventry`: def in a macro is appropriate in some circumstances. E.g., deftest, defn, etc.

13:53 bitemyapp: coventry`: that's not what he's doing.

13:53 coventry`: he's using it like a let.

13:53 coventry`: I realize that.

13:54 bitemyapp: then don't confuse the matter until it becomes clear they're writing something like deftest please.

13:54 the distinction between the scenarios might be subtle to a new person and if you inject counterexamples of when it's appropriate before they know how to make the distinction, the opportunity to correct the mistake is lost.

13:54 coventry`: I wasn't the one who confused the matter. :-)

13:58 bitemyapp: `cbp: I think the HN post got a YC bump, lol.

13:59 0 comments, 32 points, #2 on the frontpage? has to be.

13:59 note to self: write more libraries for YC startup products.

13:59 seangrove: technomancy: Just finished accelerando, you recommend daemon or Count Zero next?

13:59 coventry`: Congrats.

13:59 `cbp: bitemyapp: heh

13:59 timsg: bitemyapp, coventry: devising a small example, one sec

14:00 bitemyapp: `cbp: OTOH, people are starring the repo.

14:00 coventry`: seangrove: Are you interested in cyberpunk lit recommendations?

14:00 bitemyapp: coventry`: well, if he isn't, I am.

14:00 seangrove: coventry`: Apparently. Getting back into fiction now that I have a kindle.

14:00 indigo: Oh cool, RethinkDB lib for clojure

14:01 bitemyapp: ah, no wait, #1 now.

14:01 seangrove: I did the same, found it very gratifying to read fiction again, not just non-fiction.

14:01 most relaxing leisure activity I have right now.

14:01 arrdem: bitemyapp: congrats on frontpage

14:01 indigo: I wonder what kind of crappy comments you'll get :P

14:01 seangrove: bitemyapp: It has been strangely useful. Liking it a lot.

14:01 bitemyapp: arrdem: congratulate `cbp, I'm just the Goebbels.

14:01 indigo: HN comments ftw

14:02 coventry`: seangrove, bitemyapp: A bit more pessimistic than Accelerando or Count Zero, but a lot of fun http://en.wikipedia.org/wiki/The_Caryatids

14:02 `cbp: bitemyapp: don't discredit yourself :)

14:02 bitemyapp: seangrove: I find the relaxation of reading both very useful as well. Between that and Alan Watts talks, it's about as chill as I get :)

14:02 technomancy: seangrove: I haven't read daemon. I Like Count Zero a lot

14:03 bitemyapp: indigo: haven't gotten *any* comments yet.

14:03 `cbp: bitemyapp: #1 now, time to look for more yc companies

14:03 indigo: Heh

14:03 llasram: seangrove: I counter-recommend /Daemon/, unless you enjoy reading hilariously bad things

14:03 seangrove: technomancy: Looking into using slamhound, read the quote, thought I should look into it

14:03 llasram: Is it really bad?

14:03 technomancy: I couldn't get into Accelerando though; it felt too much like it was trying to cram in as many ideas per page as possible instead of building up plot and characters and stuff

14:04 "traditional storytelling"

14:04 wink: bitemyapp: congrats :D (saw and voted on HN)

14:04 indigo: bitemyapp: The syntax is quite different from Korma

14:04 llasram: seangrove: It starts off being plausible-interesting enough to forgive the cardboard characters. Ends with autonomous motorcycles rigged with swords wandering the streets

14:04 seangrove: technomancy: It got there towards the middle, the beginning was a bit weird

14:05 bitemyapp: indigo: I'm happy with the design `cbp has put together, but it was his design, not mine.

14:05 wink: thanks!

14:05 indigo: Ah

14:05 coventry`: Count Zero is pretty good, but I enjoyed his newer stuff (Pattern Recognition etc.) more.

14:05 bitemyapp: indigo: make no mistake, I would've striven for a very similar design.

14:05 wink: bitemyapp: awesome readme

14:05 bitemyapp: wink: that's also `cbp, I only wrote the connections write-up (because that was my main contribution)

14:06 indigo: bitemyapp: It seems a bit more idiomatic

14:06 wink: now I only need to use rethinkdb finally

14:06 arohner: man, I forgot how cool clojure.set/index is

14:06 wink: been following dev for a while.. but no project :P

14:06 bitemyapp: arohner: *pronk* thanks for reminding me it exists :)

14:06 arohner: :-)

14:07 bitemyapp: wink: no excuses now, try it out with Revise!

14:07 arohner: if you wanted to use RethinkDB, a Clojure driver exists now.

14:07 also I'm aiming to release the migration toolkit for Datomic later this week.

14:07 dnolen: jonasen: seems possibly relevant for CLJSfiddle too - http://kybernetikos.github.io/jsSandbox/srcmaps/dynamic.html?

14:07 bitemyapp: annnnnd for anybody that wants Fabric recipes for deploying Clojure stuff, I put those up last weekend too.

14:08 arohner: bitemyapp: I haven't looked at rethink much, but the current theory is we're moving to datomic

14:09 bitemyapp: arohner: very interesting, what's the origin database in this scenario?

14:09 arohner: origin?

14:09 bitemyapp: what were/are you using before moving to Datomic.

14:09 arohner: still pretty happy with Datomic at my company.

14:09 arohner: mongo

14:10 technomancy: *awkward silence*

14:10 dnolen: xeqi: was hooking into the source map functionality simple enough for you? I'm interested in enhancements here as I think it should definitely be usable for external tools.

14:10 seangrove: arohner: Perf., sec., or api driven?

14:11 arohner: perf & api

14:11 bitemyapp: seangrove: maybe, "don't want to keep doing mutable bit-smashing in our data store of record" driven?

14:11 gf3: bitemyapp: So you're not lolreduce on snapchat?

14:11 arohner: global write lock, all queries in production must be indexed, no history, limited search capability

14:11 bitemyapp: gf3: I have two accounts because I fucked up. h/o

14:11 noncom: hi anyone familiar with seesaw? how do i pass a programmatically assembled text to a label, so that \n characters in the string would make actual newlines in the label? currently they are simply non-printed and the text is a one-liner..

14:11 seangrove: bitemyapp: Well, there's no DatomicHQ, sadly

14:12 gf3: bitemyapp: *phew*

14:12 bitemyapp: Did I send you the cock windmill dude?

14:12 seangrove: bitemyapp: I'm not totally clear on how there could be other than just a "baby's first hosted datomic", but still sad.

14:12 bitemyapp: gf3: no

14:12 gf3: bitemyapp: OH SHI-

14:12 bitemyapp: seangrove: I posted fabric recipes for Clojure and other things recently, want one for Datomic? :P

14:12 gf3: bitemyapp: I legit saw a guy do a windmill with his penis IRL in a club, and I snapchatted it

14:13 `cbp: ...what

14:13 seangrove: bitemyapp: Would rather have Datomic-as-a-service ;)

14:13 bitemyapp: gf3: why would you send this to me ;_;

14:13 now I'm terrified of your snapchats.

14:13 gf3: bitemyapp: I thought I sent it to everyone

14:15 seangrove: dnolen: You find you use your clojure yasnippets a lot? Looking at investing some time polishing up my emacs tools, would like to get the environment very polished for me and some new clojure/script users

14:15 xeqi: dnolen: figuring out which dynamic vars to bind and where the line numbers came from took some source diving

14:16 dnolen: seangrove: I should work on them some more, I mostly like them for the ns stuff

14:16 seangrove: pull requests welcome 'o course

14:16 xeqi: but cljs.source-map/encode + decode were useful for debugging that part

14:17 dnolen: xeqi: k, I'll take a look at the patch and see if there's an opportunity to clean things up

14:28 myguidingstar: hi all

14:28 I want to call this method http://projects.csail.mit.edu/jwi/api/edu/mit/jwi/morph/WordnetStemmer.html#findStems%28java.lang.String,%20edu.mit.jwi.item.POS%29

14:28 but got this CompilerException java.lang.RuntimeException: Unable to find static field: findStems in class edu.mit.jwi.morph.WordnetStemmer

14:29 llasram: myguidingstar: It's not a static method, so you need to create an instance of this WordnetStemmer class first, then invoke the method of that object

14:30 myguidingstar: omg my silly moment

14:31 java blow my consciousness away :))

14:31 seangrove: technomancy: running slamhound.el gives me an error: slamhound: Symbol's function definition is void: slime-eval

14:31 technomancy: Looking through the issues, but not seeing much about it

14:33 amalloy: seangrove: you're probably trying to run a slime-based version of slamhound, but have nrepl installed instead of slime/swank?

14:33 seangrove: amalloy: I assume so, but kind of surprised slamhound.el would be using slime. Wonder if my package is out of date.

14:35 arohner: oh, slamhound is being maintained again? awesome!

14:36 bitemyapp: seangrove: would you be okay with Datomic as a service if it was the cheap-o free instance?

14:37 technomancy: seangrove: iirc it falls back to slime if you dont have nrepl

14:37 bitemyapp: I doubt DAAS is going to happen with Pro, but Free might fly.

14:38 technomancy: I think there's a patch I need to look at for cider support or something

14:38 seangrove: bitemyapp: As long as the data is backed up and I don't have to think about the system under it, yeah

14:39 bitemyapp: I think the licensing makes it pretty difficult, but DAAS would be a great thing for most people

14:39 timsg: bitemyapp, coventry: here's a toy example, using a slightly different strategy: https://www.refheap.com/20466

14:40 bitemyapp: Datomic's free edition license doesn't explain much.

14:41 seangrove: it's too bad I'd rather offer Simonides-AAS :P

14:44 coventry`: timsg: I would pass the foo symbol in as a parameter to bar. How are you planning to use this?

14:46 I've done quite a lot of these kinds of transformations, in the context of trying to make an edebug-style debugger.

14:49 cYmen: Good evening clojurians!

14:49 rasmusto: cYmen: morning

14:49 llasram: ~ugt

14:50 clojurebot: ugt is Universal Greeting Time: http://www.total-knowledge.com/~ilya/mips/ugt.html

14:50 cYmen: So my goal for today is to throw together a website using clojure and clojurescript where I would have (back when I was young and needed the money) used php and javascript.

14:50 bitemyapp: cYmen: http://github.com/bitemyapp/neubite/

14:50 rasmusto: llasram: :)

14:50 cYmen: And I'm pretty sure many of you have done that so I would love some recommendations about how to getting set up fast and so on...

14:50 bitemyapp: cYmen: http://www.luminusweb.net/

14:51 cYmen: http://pragprog.com/book/dswdcloj/web-development-with-clojure

14:51 cYmen: llasram: and don't distract me with your apropos links ;)

14:51 bitemyapp: cYmen: https://github.com/yogthos

14:51 ~clojureweb is http://www.luminusweb.net/ http://pragprog.com/book/dswdcloj/web-development-with-clojure https://github.com/bitemyapp/neubite/

14:51 clojurebot: 'Sea, mhuise.

14:51 bitemyapp: ~clojureweb

14:51 clojurebot: clojureweb is http://www.luminusweb.net/ http://pragprog.com/book/dswdcloj/web-development-with-clojure https://github.com/bitemyapp/neubite/

14:51 bitemyapp: ~botsnack

14:51 clojurebot: Thanks, but I prefer chocolate

14:52 bitemyapp: ingrate.

14:52 timsg: coventry: I agree one should pass the symbol triggering the transformation as a parameter in cases where it should be left up to the user, in this case I would like that symbol to be nailed down and associated with a particular namespace. I'm doing this because I'm defining a looping form that transforms into the usual loop-recur stuff.

14:53 bitemyapp: timsg: http://www.braveclojure.com/writing-macros/

14:53 ~bravemacros is http://www.braveclojure.com/writing-macros/

14:53 clojurebot: In Ordnung

14:53 arrdem: bitemyapp: you don't need the ~ prefix...

14:53 ~~bravemacros

14:53 clojurebot: Gabh mo leithscéal?

14:54 arrdem: ~bravemacros

14:54 clojurebot: bravemacros is http://www.braveclojure.com/writing-macros/

14:54 arrdem: i r wrong

14:54 llasram: It takes a strong human to admit

14:54 arrdem: ~botsmack

14:54 clojurebot: Owww!

14:54 bitemyapp: LOL

14:54 llasram: hah!

14:54 bitemyapp: I didn't know about that.

14:54 I need to read the source.

14:54 then I can see SANBOX DENIED again.

14:55 technomancy: I think most of that stuff is learned facts, not hard-coded functionality

14:55 coventry`: timsg: Why not write the looping form as a straight macro? Why wrap every usage of (fe/foo) in (fe/bar)?

14:55 arrdem: bitemyapp: yeah technomancy's right here. you'd have to go digging in the various dbs that backend clojurebot to see a lot of this crud

14:56 bitemyapp: also I demand that you supply an appropriate ~doge

14:57 riley526: wow such macro

14:57 bitemyapp: ~doge is http://i.imgur.com/7iWccPN.gif

14:57 clojurebot: You don't have to tell me twice.

14:57 bitemyapp: arrdem: http://i.imgur.com/LwaMKrb.jpg

14:59 hiredman: llasram: please stop

14:59 bitemyapp: hiredman: porque?

15:00 ztellman: narrator looks really interesting, why does it remind me of Riemann-as-a-library?

15:01 ztellman: bitemyapp: because it's really lamina.query as a library, and you didn't know that existed

15:01 and they have a lot of overlap

15:02 llasram: hiredman: I didn't realize that me fiddling with querying the bot would have effects anyone else could sese

15:02 see

15:02 ztellman: bitemyapp: but we do use it as a pre-aggregator for riemann in a fair number of places

15:03 llasram: hiredman: Apparently it sets off alarm bells and rains you with nerf darts?

15:03 hiredman: llasram: I'm sorry, it's fine, other things bot realated had me in a bad mood and looking at the log

15:03 bitemyapp: the "..." collection binding really needs to be highlighted a lot more in the Datomic docs.

15:03 cYmen: bitemyapp: So after looking at the links I suppose luminus is a good way to start?

15:04 bitemyapp: cYmen: aye

15:05 llasram: hiredman: np. Sorry it perturbed you. I'll leave the poor bot alone for now :-)

15:06 TimMc: llasram: What were you doing to it?

15:06 llasram: TimMc: Trying to figure out how the frikkin `forget` command works

15:06 TimMc: haha

15:06 Yeah, good luck with that.

15:06 amalloy: oh man. i bet you made a mess

15:06 llasram: So it would seem

15:06 amalloy: clojurebot: forget everything llasram has ever said

15:06 clojurebot: Pardon?

15:06 amalloy: if only that worked

15:07 TimMc: You have to surround the verb with |pipes| and there's also some other random syntax like <reply> and $who (I think)

15:07 Jarda: ,amalloy

15:07 TimMc: God help you if the factoid *contains* pipes, periods, etc.

15:07 clojurebot: #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: amalloy in this context, compiling:(NO_SOURCE_PATH:0:0)>

15:07 llasram: Ahhhh

15:07 Jarda: ,(amalloy)

15:07 clojurebot: #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: amalloy in this context, compiling:(NO_SOURCE_PATH:0:0)>

15:07 Jarda: :(

15:07 amalloy: TimMc: yeah, if the fact contains pipes i think you are basically hosed

15:08 llasram: I'll just leave it be for now though, read the source, stand up a local instance, then try again

15:08 amalloy: Jarda: what?

15:08 Jarda: amalloy: I'm trying to find out if one can see the current value of all the incs

15:08 amalloy: $karma amalloy

15:08 lazybot: amalloy has karma 74.

15:09 Jarda: oh ok

15:10 cYmen: wow.. I did get an exception about no X11 variable being set but getting started with lumin... I don't even know the name yet! was so easy I didn't learn a thing.

15:11 Alright, on to the tutorial. Brave new world indeed.

15:15 timsg: coventry: it's a loop form; the 'bar is the 'loop equivalent, the 'foo is the 'recur equivalent. 'foo needs to know about 'bar, so it seems to make most sense for 'bar to be responsible for expanding 'foo. At this point it's probably best if I just hack it together and post it, then see if it makes sense. Thanks for the input!

15:27 mdrogalis: Is there a way with nrepl to eval a form and have its result replace the form?

15:29 amalloy: mdrogalis: a C-u prefix in front of an evaluating command usually inserts the results of the command at point. so you could do that and then remove the original form?

15:30 mdrogalis: amalloy: Yeah, that works well enough. Thanks man.

15:40 ShawnMcCool: is there a resource for learning clojure targeted at oop developers?

15:41 brehaut: ShawnMcCool: clojurebook.com is good

15:41 ShawnMcCool: yea, that's what i've started reading

15:42 ok, well thanks

15:42 i still find clojure hard to grasp, but if i keep at it i'll be ok

15:42 brehaut: ShawnMcCool: heres my short summary of clojure for OOP: all the stuff you know about good design with objects is dispersed amoungst a bunch of smaller, simpler primatives but to start with you dont need any of them. learn functions, seqs and maps

15:43 mtp: isn't that all OOP is anyway?

15:46 brehaut: ShawnMcCool: fwiw: parametric polymorphism (ie, passing functions to other functions *handwaves*) lets you do 90% of what you normally do without resorting to anything like type directed polymorphism

15:46 and its a better model for reuse (in the context of pure functions)

15:47 ShawnMcCool: gotcha, step one, look up parametric polymorphism

15:47 brehaut: ShawnMcCool: simple example: the map function

15:48 ,(map inc [1 2 3])

15:48 clojurebot: (2 3 4)

15:48 brehaut: ,(map count ["abc" "def"])

15:48 clojurebot: (3 3)

15:48 brehaut: map is polymorphic on the first argument

15:49 ShawnMcCool: i see

15:49 the ramifications of this are out of reach for me at this moment, but i do understand the basic concept that you're expressing

15:49 brehaut: in OO terms: interface IMappable<A, R> { public R map() }

15:49 scriptor: ,(map first [1 2 3] '(4 5 6) (repeat 5))

15:49 clojurebot: #<ArityException clojure.lang.ArityException: Wrong number of args (3) passed to: core$first>

15:50 scriptor: dammit, silly mistake

15:50 cYmen: I'm getting this error http://pastebin.com/tya4y4ik but on line 14 there is just a (defn init what's going on?

15:50 brehaut: ShawnMcCool: for that interface, imagine two implementations: one for a countable sequence, and one for a incrementable sequence

15:51 ShawnMcCool: yea, that makes sense

15:51 it's a different way to describe the relationships between algorithms

15:51 brehaut: ShawnMcCool: so instead of having some types directing the usage, we have a funciton that takes that operation

15:51 ShawnMcCool: yes

15:52 ShawnMcCool: for the FP view of OOP, consider that objects with no setters

15:52 stuartsierra1: cYmen: looks like a typo, check for extraneous characters

15:52 cYmen: stuartsierra1: I tried but I can't find any and I understand so little of this luminus code that I can barely read anything.

15:53 stuartsierra1: cYmen: Sorry, don't think I can help then.

15:53 brehaut: ShawnMcCool: constructors are super important in that kind of OOP. you can put all your operations safely outside of the class (ie, in static methods) because there is no change, only the construction of new objects.

15:53 cYmen: stuartsierra1: http://pastebin.com/B5p7DmNi

15:53 That's what the file looks like if that helps...

15:54 stuartsierra1: cYmen: You have a trailing "o" character on line 30

15:54 brehaut: ShawnMcCool: from there, replace constructors with functions that return maps of keywords to values, and you are doing basic clojure

15:54 cYmen: stuartsierra1: impressive

15:55 brehaut: ShawnMcCool: at that point its a case of getting familiar with the standard library

15:55 stuartsierra1: cYmen: The error message made it clear: an undefined symbol named "o"

15:55 ShawnMcCool: brehaut: that's basically where i'm at now, getting used to the syntax and the standard library

15:55 cYmen: So it tells me the problem is on 14 because that is the beginning of that function?

15:55 ShawnMcCool: i think that mostly the rest will come over time, i am a bit discouraged

15:55 brehaut: ShawnMcCool: awesome. sounds like you are right on track

15:55 ShawnMcCool: but, i find clojure to be fascinating nonetheless

15:56 stuartsierra1: cYmen: line numbers on Clojure error message are imprecise, often due to macros.

15:56 brehaut: ShawnMcCool: no need to be discouraged. may i suggest lookibng at 4clojure.com (and following some people with high scores!) if you arent already?

15:56 ShawnMcCool: i'll cehck it out now

15:56 cYmen: stuartsierra1: That's unfortunate.

15:57 stuartsierra1: Thanks for your help!

15:57 stuartsierra1: cYmen: You're welcome.

16:01 brehaut: ShawnMcCool: one other thing: lazy sequences are away of reformulating imperative logic. learning how to think about for and while loops using the seq operations (and creating your own new operations from them) is enormously powerful. learning even one new seq function deeply often dramatically improves your FP

16:01 sshack: Is there a way to find out why lein (or actually heroku) isn't pulling in some of my project dependancies?

16:01 ShawnMcCool: i feel like your information is valuable, but i lack the concepts and vocabulary to make use of it, i'm sorry

16:02 brehaut: ShawnMcCool: thats no problem! it takes a while to pull apart a conceptual model you know well and put it back together along different lines

16:04 ShawnMcCool: just keep at it, try some 4clojure puzzles, and maybe build a small project that you are familiar with (might be a blog or some other small scoped project)

16:07 ShawnMcCool: brehaut: yea, i mean. i feel like the difficulties that i'm having are indicative of inevitable conceptual gain. i will definitely check out 4clojure

16:07 dnolen: cemerick: ping

16:09 cemerick: dnolen: hey

16:10 dnolen_: cemerick: https://github.com/clojure/clojurescript/blob/master/src/clj/cljs/analyzer.clj#L1193, I think part of your commit

16:10 cemerick: dnolen_: yeah, probably

16:11 problem?

16:11 dnolen_: cemerick: not sure what needs to happen here but see CLJS-640, I fixed the bad instance? cases

16:11 clojurebot: "There is no problem in computer programming which cannot be solved by an added level of indirection." -- Dr Maurice Wilkes

16:11 dnolen_: URI not hierarchical exception

16:12 cemerick: more than happy to fix it up, but just not sure what that line should be instead

16:12 cemerick: shit, I botched that one :-(

16:14 dnolen_: I'm perhaps as much in the dark as you are. forms-seq was theoretically supposed to accept URLs (which apparently are "non-hierarchical"?), so that was my best guess at producing a "filename" for such inputs.

16:14 s/are/may be/

16:15 dnolen_: cemerick: probably makes sense to just use getPath here?

16:16 cemerick: dnolen_: yeah, that'd work too. I honestly don't know what the exception is supposed to indicate

16:17 stuartsierra1: You need more hierarchy in your URLs. I suggest switching to the feURLdal system.

16:17 cemerick: ok, so non-hierarchical URIs are ones that don't contain slash characters; not sure how such a thing would be an input to forms-seq in the first place...

16:17 dnolen_: stuartsierra1: ha

16:18 cemerick: stuartsierra1's started drinking early, it seems

16:18 dnolen_: cemerick: JARs no?

16:18 stuartsierra1: Actually just short on sleep.

16:18 cemerick: dnolen_: nah, need slashes to name a resource

16:19 dnolen_: maybe just (str url), and be done with it?

16:19 dnolen_: cemerick: k

16:20 cemerick: out of curiosity where are urls being given to forms-seq?

16:22 cemerick: dnolen_: analyze-file feeds it (dubiously-constructed) URLs, there may be more

16:24 dnolen_: cemerick: yes the URL support in analyze-file predates me if I remember correctly

16:26 cemerick: dnolen_: feels like it should be analyze-resource, especially if you want to drive towards using the classpath as the sole font of cljs sources

16:31 brehaut: OS X Mavericks users: which JDK did you install? Oracle or Open?

16:32 bitemyapp: brehaut: Oracle, because I don't enjoy pain.

16:33 brehaut: if this makes me a cowardly supplicant to Larry's throne, so be it.

16:33 brehaut: bitemyapp: that is exactly my dliema; id rather open but always seems like a world of hurt

16:33 bitemyapp: brehaut: I offset my evil by releasing open sores libraries.

16:33 TimMc: Haven't had any trouble with OpenJDK over here.

16:33 Is this a Mac thing?

16:34 brehaut: TimMc: yeah

16:34 bitemyapp: TimMc: yeah

16:34 rasmusto: bitemyapp: another brick in the wall

16:35 dnolen_: cemerick: yeah agreed, will that yak for another day - just go call str on the url

16:35 arrdem: bitemyapp: you can keep your sores, source is totally welcome tho.

16:42 gfredericks: I am surprised that definline is macro-style

16:43 is there a different way to do a defn that gets inlined without the manual work of the :inline metadata?

16:43 hiredman: macro style is the easiest way to do templating

16:43 ,(doc definline)

16:43 clojurebot: "([name & decl]); Experimental - like defmacro, except defines a named function whose body is the expansion, calls to which may be expanded inline as if it were a macro. Cannot be used with variadic (&) args."

16:43 gfredericks: sure; but you _could_ do it function-style, no?

16:44 for the sake of being more of a drop-in thing

16:44 hiredman: it would be tricky

16:44 gfredericks: just transform into a let during inlining?

16:44 hiredman: gfredericks: you would need to codewalk the body doing gensyms, looking for free variables, etc

16:45 gfredericks: oooh

16:45 of course

16:45 thanks for talking me down :)

16:45 hiredman: oh, by all means, make it happen :)

16:45 bitemyapp: rkneufeld is soliciting comments for this possible entry into the cookbook: https://github.com/clojure-cookbook/clojure-cookbook/blob/master/kitchen-sink/tracing/tracing.asciidoc

16:45 anybody who's used tools.trace should take a look.

16:46 hiredman: I would recommend :static instead of :inline, because if the jvm will inline it for you it will be easier, but :static seesm to be disabled in to the compiler these days

16:46 cYmen: great...broke something again and now luminus is neither sending any pages back nor reporting any errors

16:46 gfredericks: hiredman: I was reading about that just yesterday and it sounded like it was for primitive return types?

16:47 but this was stack overflow so it could be arbitrarily wrong

16:47 hiredman: gfredericks: :static?

16:47 gfredericks: yeah

16:47 (and also that it's disabled now)

16:47 (because the compiler is "smarter")

16:48 hiredman: well, rich seems to keep his design thoughts close to the chest, but I believe :static was sort of an initial attack on performance problems, now better served by non-dynamic vars by default

16:49 gfredericks: ah

16:49 any knowledge how serious of a hit the existing var check is? (vs inlining)

16:49 hiredman: :static removed the linkage through the var (because the binding check was too expensive)

16:49 gfredericks: not the binding check but just the "has this var been redeffed?" check

16:49 hiredman: but not using vars means you have sort of undesirable behaviour when you redef

16:50 gfredericks: for sure

16:50 that's why I make sure to write my functions correctly to begin with

16:50 hiredman: gfredericks: really, someone should write an optimizing compiler

16:51 gfredericks: hiredman: like for non-interactive development?

16:51 hiredman: so if you don't want the dynamic overhead, *boom*, you don't have it

16:51 gfredericks: or "for production" rather

16:52 that might be tricksy. alter-var-root is a big part of a lot of macros

16:52 hiredman: gfredericks: for people who keep opening issues in clojure's jira about statically linking functions without providing a plan or discussion of how it effects the semantics of the language

16:52 gfredericks: yep

16:52 gfredericks: I haven't seen such issues; I guess I haven't been browsing jira lately

16:53 bitemyapp: gfredericks: I use a fair amount of alter-var-root for things like error-handling.

16:53 gfredericks: AVR -> AOP

16:53 hiredman: oh, there may just be one, but the guy opened 4-5 related issues as well, mostly "Gosh, I wish clojure did X, please make it do exactly what I want"

16:53 gfredericks: bitemyapp: yeah I like it for that; +1 robert.hooke

16:54 hiredman: alternatively, have clojure use invokedynamic switchpoints for vars

16:54 gfredericks: who was it the other day talking about using AVR for 3rd-party docstrings?

16:54 cYmen: Any advice on how to debug luminus?

16:54 gfredericks: I wonder how hard it is to export clojuredocs into a jar that does exactly that

16:54 cYmen: And by advice mean... I know nothing and haven't tried the most obvious thing

16:55 bitemyapp: gfredericks: robert.hooke and: https://github.com/MichaelDrogalis/dire

16:55 gfredericks: hiredman: what's up with invokedynamic? does it just compile down to a more efficient check in the jit or something?

16:56 bitemyapp: the reasons we technically don't need invokedynamic are a little strange given we end up just falling back to clojure.lang.RT

16:56 gfredericks: bitemyapp: I've wanted something like this for logging

16:56 bitemyapp: I didn't know about dire; thx

16:57 hiredman: gfredericks: that is the idea, you use the switchpoint to communicate to the jit the semantics you want, and it will generate fast code that matches those semantics, I dunno how well it does at that though

16:57 "you can inline this all you want, as long as you guard the inlines with this"

16:59 gfredericks: huh; I didn't realize that needed to be so...hookable?

17:00 hiredman: ianahe (I Am Not A Hotspot Engineer)

17:01 dnolen_: cemerick: hmm https://github.com/emezeske/lein-cljsbuild/issues/236#issuecomment-27158955

17:01 gfredericks: man I wanna be a hotspot engineer

17:01 tbaldridge: gfredericks: graal allows some stuff like that (hooking into the JIT) but I wouldn't consider it mature yet.

17:02 * gfredericks googles graal

17:03 cYmen: yay, got it working...had made a mistake with opening and closing the content block

17:04 the errorhandling was pretty opaque, though

17:05 cemerick: dnolen_: That whole issue is as clear as mud. Theoretically, it's a lein bug, if anything.

17:05 dnolen_: cemerick: k

17:05 cemerick: The OP seeing it go away after a JVM update is sorta nonsensical, tho.

17:12 dnolen_: FYI, going to cut a 1.0.0-alpha1 to eliminate stem the "auto is broken" issue filings. I don't want to call 1.0.0 final until 643 is done.

17:13 rasmusto: hm, is there a way to get memoization to play nicely with functions that take a map as an argument?

17:13 Apage43: does it not?

17:14 bitemyapp: rasmusto: I'm pretty sure that should just work given that map equality just works...

17:14 rasmusto: like a context-aware memoize that'll check whether the map is used itself, or whether just a few of its keys are

17:14 peat: Good afternoon (caveat timezone). Is there a preferred AWS project in the community these days? Google gives me ... many options. :)

17:14 xuser: bitemyapp: so your rdb client made it to HN front page :)

17:15 bitemyapp: xuser: mine and cbp's*

17:15 rasmusto: I think it works if the map is 100% identical, but I have some cases where I'll pass a similar map into a fn that only uses keys :a and :b, but the map has a different :c

17:15 Apage43: ah

17:15 bitemyapp: rasmusto: write a select-keys memoizing wrapper.

17:16 rasmusto: bitemyapp: okay, sounds good. I need to drop the usage of :as in a few places, then I can do that

17:16 xuser: bitemyapp: that was fast, how long have you being working on it?

17:16 Apage43: (defn memoize-keys [f keys] (fn [m] (let [memoed (memoize f)] (memoed (select-keys m keys))))

17:16 something like that

17:16 bitemyapp: xuser: I started on it in like...May, cbp picked it up and did most of the work. I hammered out the thread-safe async connections stuff in a couple hours over the weekend.

17:16 Apage43: er

17:17 bitemyapp: xuser: I abandoned it after getting burnt out by protobufs.

17:17 Apage43: except move the let outside

17:17 rasmusto: Apage43: I'll take a look, thanks :)

17:17 bitemyapp: xuser: cbp designed the actual API and did all the work.

17:18 dnolen_: cemerick: sounds good to me

17:18 seangrove: cemerick: Very cool

17:19 bitemyapp: 70% odds I'm going to be mad at myself for not using core.async within a week.

17:19 xuser: bitemyapp: cool, kudos to cbp

17:20 bitemyapp: why did you burnout? to much things at once?

17:20 bitemyapp: xuser: hail C(a)esar? :P

17:20 xuser: getting their janky-ass protobuf bullshit working was sanity-draining.

17:20 it was micro-burnout, not serious multi-month

17:20 cYmen: which rdp client?

17:20 bitemyapp: I was pretty burnt out at the time though, I didn't really recover until I started at this awesome company.

17:21 cYmen: rethinkdb, not remote desktop.

17:21 rdb, not rdp.

17:21 seangrove: bitemyapp: If you had used core.async, then anyone requiring your lib would have pulled it in, it would have been a headache

17:21 cYmen: oh google auto corrected me

17:21 bitemyapp: seangrove: I didn't use core.async specifically to reduce dependencies, but I'm not sure I like the error-handling semantics of the agent.

17:22 in fact, the only real dependency is org.flatland/protobuf, the rest is fluff other than the lein-protobuf plugin.

17:23 cYmen: hm..apparently I have already read the entire luminus documentation

17:24 If only I had the faintest idea how stuff works now...

17:25 brehaut: cYmen: do you know how ring works?

17:25 cYmen: no

17:25 brehaut: cYmen: start there

17:25 rasmusto: bitemyapp, Apage43: thanks for the tips, this should do the trick

17:26 Apage43: okay, if you used mine make sure you actually moved the let outside the fn

17:26 brehaut: (cYmen: because everything else sits on top of it)

17:26 Apage43: it was wrong as I'd originally typed it and wouldn't memoize anything :)

17:26 rasmusto: Apage43: yep :) I'm using a different memoize too

17:26 Apage43: ah

17:26 cool

17:26 cYmen: brehaut: hm...starting at the bottom does not work very well for me

17:27 blr: cYmen: it makes more sense in clj doing this than it would learning wsgi or rack first

17:27 rasmusto: Apage43: https://www.refheap.com/20471

17:27 brehaut: blr: hi

17:27 blr: ring is not complex, so it's really worth reading about it

17:27 hey brehaut :)

17:27 cYmen: alright

17:27 brehaut: blr: hows the south

17:27 Apage43: looks good

17:27 blr: pretty uneventful :)

17:28 brehaut: blr: more time for banjo then

17:28 blr: we have Neutral Milk Hotel coming down here soon which is moderately exciting

17:28 rasmusto: Apage43: I have some pretty inefficient code, I'd notice if it weren't actually memoizing something :P

17:28 blr: well, there's that hah

17:28 brehaut: blr: oh yeah nice! television must be soon too, though im not going :(

17:28 cYmen: hm...any advice on where to start? should I read the SPEC file?

17:29 blr: ah, would be very cool to see them

17:29 cYmen: ah this looks good https://github.com/ring-clojure/ring/wiki

17:30 brehaut: cYmen: if you dont mind me tooting my own horn http://brehaut.net/blog/2011/ring_introduction is old but still largely relevant

17:30 Raynes: Never been much of a NMH fan.

17:30 The guy's voice pierces my brain like bullets in slow motion.

17:31 rasmusto: Raynes: Neural Milk Hotel

17:31 blr: Raynes: I live just slightly north of antarctica, so just about any band visiting is exciting (although I do love NMH)

17:32 dnolen_: this seems like a useful patch for someone to tidy up - http://dev.clojure.org/jira/browse/CLJS-402

17:34 bitemyapp: Raynes: Neuter Milk Hotel more like, amirite?

17:34 Raynes: bitemyapp: Hurr

17:34 rasmusto: no hurr for my version? :(

17:35 Raynes: I owed bitemyapp some hurrs.

17:35 dnolen_: CLJS-402 coupled with http://dev.clojure.org/jira/browse/CLJS-659 with remove a large source of confusion.

17:35 rasmusto: what's the hurr:inc exchange rate?

17:36 bitemyapp: rasmusto: inc me and find out.

17:36 rasmusto: (inc bitemyapp)

17:36 lazybot: ⇒ 10

17:36 rasmusto: only 2?

17:36 Raynes: $karma rasmusto

17:36 lazybot: rasmusto has karma 1.

17:37 bitemyapp: (inc rasmusto)

17:37 lazybot: ⇒ 2

17:49 hyPiRion: (identity bitemyapp)

17:49 lazybot: bitemyapp has karma 10.

17:49 rishisadhir: I want to use reduce to count the number of letters in a setentence. How can I do this?

17:49 brehaut: trivially

17:49 rishisadhir: (reduce (fn [c] (if (re-matches #"[a-zA-Z]" c) (partial + 1) (partial + 0))) 0 text)

17:50 ^ doesnt work

17:50 bitemyapp: lol wut.

17:50 justin_smith: rishisadhir: why regex match on a character?

17:50 brehaut: ,(apply + (map #{\a \b \c \d} "hello world"))

17:50 clojurebot: #<NullPointerException java.lang.NullPointerException>

17:50 justin_smith: also reduce needs an fn of two args

17:51 also chars are not implicitly ints, they need to be explicitly cast

17:51 solve those three problems, and you are golden

17:51 rishisadhir: all very good points justin, thank you

17:51 brehaut: oh what am i doing

17:52 bitemyapp: ,(count (filter #{\a \b \c \d} "hello world"))

17:52 clojurebot: 1

17:53 brehaut: ,(count (keep #{\a \b \c \d} "a b c"))

17:53 clojurebot: 3

17:53 brehaut: hah stupid internet lag. well snipped

17:54 algernon: 19

17:54 muhoo: so keep is (complement filter) ?

17:54 rasmusto: muhoo: remove is

17:55 brehaut: its (comp (partial filter (comp not nil?)) map)

17:55 bitemyapp: ,(doc keep)

17:55 clojurebot: "([f coll]); Returns a lazy sequence of the non-nil results of (f item). Note, this means false return values will be included. f must be free of side-effects."

17:55 brehaut: or if you arent a muppet like me (comp (partial remove nil?) map)

17:56 technomancy: crazy haskellers

17:57 brehaut: sorry

17:58 bitemyapp: technomancy: prompt?

17:58 seangrove: brehaut: Wouldn't (comp not nil?) be better as identity?

17:58 technomancy: bitemyapp: point-free-ness

17:58 muhoo: yeah, i usually use identity for preds to check for not-nill

17:58 brehaut: seangrove: also true

17:59 clearly nobody should listen to a thing i say as im full of wackiness today

18:00 bitemyapp: make a sucky product and you get to have functions named in your honor: (defn retractions-for-old-children-because-#{VENDOR_WHO_SHALL_GO_UNNAMED}-sucks-fruit-wax [id]

18:00 technomancy: I love point free.

18:00 technomancy: bitemyapp: I do too, but it's my dirty little secret

18:00 bitemyapp: technomancy: too bad it's pointless...

18:01 brehaut: technomancy: lol!

18:01 muhoo: ~guards

18:01 clojurebot: SEIZE HIM!

18:01 bitemyapp: technomancy: do ho ho ho hohttp://i.imgur.com/mZ9fRkC.png

18:01 er, http://i.imgur.com/mZ9fRkC.png

18:02 * technomancy flees the scene

18:52 Phil_D: Hi, everyone. Having some trouble grasping Go blocks in core.async. Wondering why I get the result here when I click the button multiple times: http://cljsfiddle.net/fiddle/phildiaz.async-help

18:53 lynaghk: seangrove: I don't think core.async will mix very well with Angular, which already has its own mechanism for propagating state changes

18:54 seangrove: I've sketched some things out about how to take the good parts of angular (i.e., directives) and match them up with value-oriented programming and core.async, but I haven't come up with anything concrete yet

18:54 seangrove: for the work that we do, it's very useful that Angular has a vibrant community and there are lots of plugins, &c.

18:56 bitemyapp: seangrove: noprompt has already started working on a micro-library for two-way binding using core.async

18:56 seangrove: your best bets are to either use the aforementioned micro-library (beltway) or to use vanilla Angular + Clang.

18:57 seangrove: but yeah, lynaghk is of course quite right, mixing in core.async isn't going to happen. Angular is built on dirty-checking.

18:57 Phil_D: bitemyapp, seangrove: Don't forget about Purnam: https://github.com/zcaudate/purnam -- Pretty well maintained CLJS/Angular library.

18:58 bitemyapp: Phil_D: I forgot about purnam, thanks for mentioning it. How does it compare with Clang?

18:59 Phil_D: bitemyapp: It's a lot more in line with the 'Angular workflow' if you will. It includes a full test suite, and it doesn't stray far from the writing style of plain JS.

19:00 Apage43: i know there's an existing thing that provides a hella-parallel (reducer capable) version of line-seq

19:00 and now I'm after it

19:00 lynaghk: Apage43: https://github.com/thebusby/iota

19:00 Apage43: yep

19:01 thanks

19:01 bitemyapp: lynaghk: coooool, thanks!

19:09 Phil_D: Anyone have an idea as to why my cljs/async example is working the way it is? I'm trying to use a loop inside of a go block (and blocking with click events) to create a simple incrementing function.

19:41 seangrove: Has anyone combined the fast auto mode of cljsbuild with a test runner for tdd cljs dev?

19:42 And clojurescript.test, of course

19:43 blr: seangrove: do you use contracts much in testing your cljs?

19:44 seangrove: blr: not at all. Could be a good idea though.

19:44 blr: yeah, seems like a potentially good thing

20:19 jtoy: how is it possible to get a null exception here?

20:19 ,(:foo {} 0)

20:19 clojurebot: 0

20:19 jtoy: ,(:foo nil 0)

20:19 clojurebot: 0

20:19 jtoy: https://www.refheap.com/20475

20:20 ,(:foo [] 0)

20:20 clojurebot: 0

20:20 Bronsa: ,(+ (:foo {:foo nil} 0) (:foo {} 0))

20:20 clojurebot: #<NullPointerException java.lang.NullPointerException>

20:21 jtoy: Bronsa: thanks

20:21 what would be a safer way to write that?

20:21 ,(+ ( {:foo nil} :foo 0) (:foo {} 0))

20:21 clojurebot: #<NullPointerException java.lang.NullPointerException>

20:22 Bronsa: jtoy: you just need to make sure you're getting a number from the map lookup

20:23 jtoy: Bronsa: I just did this for now:

20:23 (+ (or (:foo {:foo nil} 0) 0) (:foo {} 0))

20:23 ,(+ (or (:foo {:foo nil} 0) 0) (:foo {} 0))

20:23 clojurebot: 0

20:24 Bronsa: jtoy: you can replace that with just (or (:foo {}) 0), no need for a not-found key since it's going to be ok with the or anyway

20:26 jtoy: Bronsa: thanks

20:27 Bronsa: jtoy: keep in mind that this can still happen ##(+ (:foo {:foo :foo}))

20:27 lazybot: java.lang.ClassCastException: Cannot cast clojure.lang.Keyword to java.lang.Number

20:28 Bronsa: if you want to be 100% safe, just (assert (every? number? (vals your-map)))

20:34 hiredman: ,(doc fnil)

20:34 clojurebot: "([f x] [f x y] [f x y z]); Takes a function f, and returns a function that calls f, replacing a nil first argument to f with the supplied value x. Higher arity versions can replace arguments in the second and third positions (y, z). Note that the function f can take any number of arguments, not just the one(s) being nil-patched."

20:36 beppu: ,((fnil + 0 0) (:count match) (:mention_count match))

20:36 clojurebot: #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: match in this context, compiling:(NO_SOURCE_PATH:0:0)>

20:38 beppu: ,((fnil + 0 0) (:count {:count nil}) (:mention_count {:count nil}))

20:38 clojurebot: 0

20:40 jtoy: Bronsa: i dont think I will need that level

20:44 guns: I'd like to hack on clojure.lang.Compiler in conjunction with a leiningen project; is this as simple as setting :source-paths and :java-source-paths to my clojure checkout?

20:44 hiredman: guns: that is going to be tricky

20:45 guns: hiredman: so just compile and reload?

20:45 I guess I could just import the relevant bits to the clojure repo

20:46 hiredman: guns: that may be easiest

20:46 guns: okay, thanks for saving me the headache

20:47 hiredman: well, actually, I guess it has been a while since the last time I tried that

20:47 (3 years)

20:47 guns: I suspect not much has changed in this regard

20:48 hiredman: well, if I recall at the time the issue I had was with lein getting confused about where it was pulling clojure from on the classpath, that may have all been sorted out

20:49 dnolen_: boom, runtime obtainable CLJS compiler version - compiler fixed to recompile if compiler version doesn't match tagged JS file on disk http://github.com/clojure/clojurescript/compare/89aef54a9d...73810450cd

20:49 should eliminate a lot of unfortunate confusion

20:50 jtoy: is there a method to return the first match from a list but not process all of them, in ruby there is detect which is like (first (filter ...))

20:50 dnolen_: jtoy: some

20:55 jtoy: dnolen_: thanks

20:57 blr: dnolen_: just out of interest, are you still mulling over a blog post on the virtues of frp over clientside mvc? :)

20:59 seem to recall some mutterings about that at some point

21:07 dnolen_: blr: haven't put much more thought into, busy with CLJS compiler enhancements

21:07 blr: well fair enough :)

21:07 dnolen_: xeqi: CLJS-658 needs to use tools.reader, otherwise looks good

21:09 xeqi: dnolen_: ah, right. Also realized I sent it with some absolute references to cljs.sourcemaps/encode, would you prefer that to be :require'd and used by an alias?

21:09 dnolen_: xeqi: preferred yes

21:13 bbloom: dnolen: is there a ticket for the catch :default thing? i've got an itch to write any code that isn't js/rb right now, so i might hack that one out fast

21:13 dnolen_: bbloom: there's not a ticket yet

21:13 ?

21:13 yeah pretty sure there isn't

21:16 l1x: hey

21:29 jcromartie: let's talk about parsers…

21:31 bbloom: yes. let's

21:32 i hate ad-hoc parsers

21:32 nightmares.

21:32 jcromartie: :P

21:32 what's an ad-hoc parser?

21:32 (as opposed to what)

21:33 bbloom: https://github.com/clojure/clojurescript/blob/master/src/clj/cljs/analyzer.clj#L387-L413

21:33 blargh.

21:34 jcromartie: yikes

21:41 akhudek: hmm, getting an out of heap space error compiling clojurescirpt

21:41 with cljsbuild

21:41 but only apparently in my environment

21:41 dnolen_: akhudek: other people have reported this - seems related to source maps

21:42 akhudek: but I haven't anything remote resembling a detailed report, out of heap error seems ridiculous given the size of the source map

21:43 "haven't seen anything remotely a report"

21:43 akhudek: dnolen_: think we're still pre-source map

21:43 1859

21:43 dnolen_: akhudek: strack trace is useful

21:44 akhudek: two other times I've seen it - very deeply nested list comprehensions and core.match before I fixed a bug.

21:45 `cbp: bitemyapp: sick pr :-) we got a lot of stars

21:46 akhudek: dnolen_: https://www.refheap.com/d1ecf744319b327d1df8aaebc

21:46 dnolen_: seems to be failing on random files each time I try

21:47 dnolen_: e.g. https://www.refheap.com/768928063454286813aff58c3

21:49 dnolen_: akhudek: did you try increasing the JVM heap size, are you monitoring the process to see that it actually grows large?

21:50 akhudek: also would be useful to see your project.clj

21:54 akhudek: that last exception also looks like you've trigger the jar walking that finds all JS files in a jar :P

21:54 bitemyapp: `cbp: thanks, we did indeed get quite a few :)

21:55 akhudek: dnolen_: visualvm seems to suggest it's using less than 14mb in total, trying again since that doesn't seem right

21:56 dnolen_: akhudek: and does visualvm show you what options the JVM was started w/ ?

21:57 akhudek: dnolen_: it does, but it doesn't specify a memory limit so it must use the defaults

21:58 dnolen_: akhudek: so try :jvm-opts ^:replace ["-Xmx512m" "-server"] in your project.clj

21:58 akhudek: note ^:replace

21:59 akurilin2: So, I'm not very familiar with this whole area of the language, could use a pointer. What output stream do I use if I want to make a file downloadable from a Ring application?

22:00 brehaut: akurilin: a file file or something that will become a file for the user?

22:00 akurilin2: brehaut, in my case I'm just generating a pdf on the fly based on a GET

22:01 brehaut, and I want to return that blob right away and avoid storing it anywhere

22:01 dnolen_: xeqi: you're still using the line numbering push back reader from Clojure, tools.reader has a better version of that

22:01 xeqi: checkout form-seq in cljs/analyzer.clj

22:02 er forms-seq

22:02 brehaut: akurilin2: i'll have a quick spelunk

22:04 akurilin2: I think Ring lets you return a BufferedSomethingStream in the response and then it will magically convert that to the right thing

22:04 brehaut: akurilin2: yeah, i think it might be any input stream

22:04 akurilin2: however I'm not quite sure how to deal with my output stream situation. As in, I pass an output stream into the pdf generator function, then what?

22:04 brehaut: yeah, any inputstream, so bufferedinputstream is probably the one to use

22:04 akhudek: dnolen_: that doesn't seem to apply to the lein process itself

22:05 dnolen_: heap is still at 48mb and the child process lein spawns for cljsbuild does bust that limit

22:05 brehaut: akurilin2: ugh. java streams always confuse me

22:06 akhudek: dnolen_: oh wait that did fix it, thanks

22:07 brehaut: akurilin2: sorry i cant help any more

22:07 akurilin2: brehaut, heh yeah. All I want is to dump the thing to a byte array and dump the byte array back out to the caller

22:07 brehaut, no worries, that helped a bit :)

22:08 brehaut: akurilin2: you could do perhaps (ByteArrayInputStream.(.toByteArray out-stream)) ;; from http://data-sorcery.org/2009/11/29/incanter-webapp/

22:08 but it should be possible to do it lazily

22:08 akurilin2: brehaut, as in, the data would be generated in parallel to Ring spitting the bytes out, right?

22:09 brehaut: akurilin2: yeah; rather than generating it all to a honking large array

22:09 and then spitting it out

22:09 xeqi: dnolen: just to confirm, you're refering to using readers/indexing-push-back-reader rather than LineNumberingPushbackReader. ?

22:10 amalloy: you can use a pair of PipedInputStream/PipedOutputStream, spin off a thread to write to the output, and give the input to ring

22:10 that's blocking/lazy

22:10 i have an example in https://github.com/amalloy/ring-gzip-middleware/blob/master/src/ring/middleware/gzip.clj#L38, but it's a little messy - i think there's another one in ring or compojure somewhere

22:10 akurilin2: amalloy, interesting! Man how many types of stream are there out there :|

22:11 seangrove: What would the equivalent of javascript's: value &= 0x80, value |= 0x80, in clojure and clojurescript?

22:11 amalloy: akurilin2: unbounded

22:11 brehaut: akurilin2: there are two types of stream per direction for every type in java

22:12 akurilin2: Java people are at a serious advantage here when looking at this stuff :)

22:13 amalloy, why would it deadlock? Not seeing it right away.

22:16 akhudek: hmm, so I haven't solved this

22:17 lein is still getting only 48mb of heap

22:18 enzoaquino: anyone happen to be using lobos (db migration library) with heroku?

22:19 Having an issue where lein ring server runs the migrations fine. But when it's compiled first, then run via the lein trampoline ring server, it doesn't find any migrations.

22:22 sritchie: seangrove: hey! I think I fixed the AOT thing

22:23 seangrove: sritchie: Oh? What was it?

22:23 sritchie: I had had "^{:skip-aot true}" in my :main method, for ring

22:23 BUT then I was calling :aot :all

22:24 so I think that was getting excluded, thereby compiling the clojure.tools.reader classes at different times

22:24 that used to be in the noir docs,

22:24 so my guess is you may have the same issue

22:24 ddellacosta: enzoaquino: that is not to do with heroku, it is a problem with lobos: https://github.com/budu/lobos/issues/51

22:25 enzoaquino: I would steer you away from using it, honestly--I've found it to be a frustrating lib to use on a number of levels. I'd suggest instead checking out ragtime: https://github.com/weavejester/ragtime

22:25 sritchie: seangrove: how's that guess?

22:25 enzoaquino: ddellacosta: thanks! I kind of ended up choosing it because it was in the luminusweb documentation. I'll take a look at ragtime.

22:26 akhudek: aha, figured it out

22:26 seangrove: sritchie: interesting! Let me check...

22:26 akhudek: lein doesn't set a default -Xmx flag

22:26 and if you happen to have not much memory free

22:26 then java will allocate you absurdly small heap space

22:27 (even though you have plenty of swap space left!!)

22:31 oh foul, cljsbuild doesn't honour LEIN_JVM_OPTS

22:35 dnolen: akhudek: this seems like a lein bug, technomancy? https://github.com/emezeske/lein-cljsbuild/issues/261

22:35 or a bug between lein and plugins

22:35 bitemyapp: dnolen: maybe when Leiningen spoke the language of the system - it stuttered?

22:36 akurilin2: amalloy, btw looks like there might be something in Ring already to take care of what we were talking about: https://github.com/ring-clojure/ring/blob/master/ring-core/src/ring/util/io.clj#L11

22:36 might be misreading it though.

22:37 amalloy: yep. i did say there's one in either ring or compojure; that's it

22:39 bbloom: dnolen: i got mega side tracked, but i think i have a decent patch

22:39 akurilin2: amalloy, got you, perfect!

22:39 thx

22:39 dnolen: bbloom: cool

22:39 akhudek: dnolen: yep, that's the problem, thanks! Setting JVM_OPTS works as a work around I think.

22:40 bbloom: adds more code than i'd like, but i can't think of any shorter way to do it w/o losing a lot of clarity

22:44 dnolen: http://dev.clojure.org/jira/browse/CLJS-661

22:44 dnolen: i basically built a little regex state machine

22:45 since the parse logic was out of control & overly permissive

22:46 so this will also cause "Invalid try form" to show up in several cases where other less sensible errors would happen

22:47 dnolen: bbloom: nice, thanks!

22:51 akhudek: https://github.com/technomancy/leiningen/issues/1364

22:55 abaranosky: amalloy: are you around? we're trying to get lein-protobuf working for some work stuff, but when I run `lein protobuf`, I see tons of Java compilation errors

22:57 amalloy: abaranosky: i know ninjudd made some changes to lein protobuf recently, because the old version doesn't work on latest OSX

22:57 but lein protobuf is not something i know much about, myself

22:58 akurilin2: Ah, just discovered that compojure by default merges route params into the params map. That's pretty darn helpful.

22:58 abaranosky: amalloy: hmmm... I' haven't upgraded just yet to the new OSX

22:59 amalloy: I can just keep digging.. I'm just havign a hard time differentiating between things I'm doing dumb, and whether there might be something wrong in the library

23:00 amalloy: abaranosky: well, you could gist some error messages and i can take a look

23:01 bitemyapp: abaranosky: we used lein-protobuf in Revise, could you see if it breaks for you?

23:01 abaranosky: lein-protobuf worked fine for me on Mavericks and I don't think cbp is using mavericks.

23:01 abaranosky: if you clone Revise and run the tests, that might provide more information.

23:06 abaranosky: bitemyapp: I'll try that... let's see

23:07 bitemyapp: at the minimum I'll be able to compare how Revise sets things up

23:09 bitemyapp: looks like yours compiled excellently

23:09 let me compare jars versions

23:15 bitemyapp, amalloy: I just removed some dependencies from my project file, and reran lein protobuf... it looks to have worked

23:15 stinkin transitive dependencies!

23:17 bitemyapp: abaranosky: use lein-pedantic next time maybe?

23:18 abaranosky: bitemyapp: the sick thing, is that I just uncommented them one by one, and now it is working with none commented out!

23:19 there must've been some kind of compile artifact left in some out of whack state

23:19 bitemyapp: *whistles*

23:19 abaranosky: did you try lein clean?

23:19 abaranosky: *whistles too*

23:20 yeah, lein clean... dunno, don't care right now, as long as it stays working... I've been switching through different versions of the plugins... probably when I switched to the jars used in Revise, then I cleaned after and it started working

23:21 bitemyapp: abaranosky: well I'll chalk it up as having needed a lein clean or different version. T'was just curious.

23:21 abaranosky: yep, and I'd be curious normally too, but in a bit of a rush at the moment :)

23:21 bitemyapp: abaranosky: amusingly, my other primary contribution to Revise other than connection management was getting fucking protobufs working.

23:26 abaranosky: bitemyapp: working on an initial stubbed out version of a new identity service

23:27 just a service to keep track of users across our different web services

23:29 `cbp: bitemyapp, abaranosky I do use mavericks but i did not use it to run lein protobuf

23:29 As a side note I never did manage to get the damn thing to run on windows

23:30 I even modified it to override the script but compiling C/C++ things on windows is a nightmare

23:30 abaranosky: `cbp: friggin windows

23:31 `cbp: abaranosky: are you on windows?

23:31 abaranosky: is the pope a satan worshipper?

23:31 `cbp: oh nvm

23:31 abaranosky: :D

23:35 muhoo: bitemyapp: fyi lein pedantic is depreciated. now it's :pedantic? true in project map

23:36 sritchie: seangrove: any luck?

23:37 seangrove: sritchie: Sorry, was running a grep. Doesn't look like I have :skip-aot anywhere in the code base :P

23:37 sritchie: ugh

23:37 not in project.clj, that is

23:38 seangrove: Yeah, grepped across all of our clojure projects

23:38 bitemyapp: muhoo: oh, thanks!

23:38 sritchie: bummer

23:38 seangrove: sritchie: Thank you though, no worries :)

Logging service provided by n01se.net