#clojure log - Dec 12 2013

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

0:08 brainproxy: dnolen: nice

0:09 nonuby: whats the latest solution to the leak in clojure web apps in servlet container (i.e. immutant/jboss), is it safe to use 1.6.0alpha2 if I not in my layers doing any thread local rebinding?

0:09 dnolen: updated gist, https://gist.github.com/swannodette/7915826, boilerplate around pure eliminated, and demonstrates how path information is communicated down the tree

0:35 bitemyapp: arrdem: mumble!

1:00 wei__: started using logback to direct clojure.tools.logging messages to a file, but my "spy" messages disappeared. where does clojure.tools.logging/spy output to?

1:34 hiredman: wei__: I would check your log level setting in logback, spy may use the trace log level

1:34 wei__: hiredman: good call

1:42 sj__: anyone experience parsing xml documents using data.xml?

1:43 i am relatively new to clojure ańd got stuck a littlebit

1:44 wei__: (inc hiredman)

1:44 hyPiRion: lazybot is dead

1:44 long live lazybot

1:44 wei__: :(

1:48 Jarda: sj__: it depends on what you need. I've used data.zip combined with data.xml to parse, works great!

1:49 sj__: check this answer (not the accepted but underneath) http://stackoverflow.com/a/9595315/270945

1:52 sj__: Jarda: hmm, thanks missed xml-zip, that looks good

1:56 SegFaultAX: hyPiRion: Aww, why's that?

1:57 hyPiRion: SegFaultAX: ask Raynes

1:57 he's responsible for that thing

1:58 arrdem: Raynes: BOT DOWN

1:58 SegFaultAX: Yay!

1:59 hyPiRion: (inc hiredman)

1:59 lazybot: ⇒ 30

1:59 hyPiRion: there we go

2:22 arrdem: (inc Raynes) ;; best bot hearder

2:22 lazybot: ⇒ 39

2:26 ddellacosta: bitemyapp, noprompt: I called you out here, but if you don't want me to list your name/link to you let me know: http://davedellacosta.com/cljs-dom-survey

2:27 noprompt: ddellacosta: don't mention my name. anywhere. ever. j/k :P

2:27 ddellacosta: hey, hey, i like the new digs!

2:28 ddellacosta: nice work!

2:28 ddellacosta: noprompt: haha...well, you never know if people, people can be picky.

2:28 noprompt: thanks!!

2:28 noprompt: your feedback definitely helped. :-)

2:28 noprompt: ddellacosta: it looks sharp! clean and easy to read.

2:28 ddellacosta: noprompt: excellent! Just what I was going for.

2:29 noprompt: ughh, i just spent a full hour trying to track down a bug through a maze of speghetti oo javascript.

2:29 ddellacosta: noprompt: ;-(

2:29 that sucks.

2:29 noprompt: and, did you track it down?

2:30 noprompt: ddellacosta: yeah. i can't imagine what this guy was thinking.

2:30 ddellacosta: noprompt: yeah, I know how that is...had many a moment like that myself.

2:30 and unfortunately, probably provoked many a moment like that in the past as well.

2:30 noprompt: literally. ObjA to ObjB to ObjC to ObjC's parent (ObjB)

2:30 ddellacosta: what

2:31 yikes.

2:31 noprompt: i've never liked OO code that mucks with this.parent

2:31 coupled with events and mutable state it's way to fragile.

2:32 ddellacosta: noprompt: if you are mucking with this.parent, doesn't it indicate that that shouldn't be inheriting from the parent in the first place? Not that I'm much good as an OO architect. Have never been able to feel grounded writing OO code.

2:32 noprompt: the funny part was the bug occured when i deleted a single line of code entirely somwhere else in the codebase.

2:32 ddellacosta: ahahaha...*sob*

2:32 * ddellacosta wipes a tear away

2:33 noprompt: ddellacosta: basically in this case the child class is listening for events on the parent class and then doing something.

2:33 ddellacosta: hmm.

2:33 wei__: trying to figure out how to deserialize a json to a map which originally had keyword values. anyone have a scheme to distinguish string values and keyword values in json?

2:34 ddellacosta: wei__: so, the JSON originally was a map once upon a time? do you have any flexibility in terms of converting to EDN vs. JSON?

2:34 noprompt: ddellacosta: my sentiment exactly. it seems to me if one were going to architect a system like that the parent should be responsible for sending messages to it's children.

2:35 ddellacosta: noprompt: yeah, I mean, I don't know the details so I can't comment, but that seems natural to me...

2:35 noprompt: ddellacosta: a little context; i'm rewriting a large messy js front end in cljs. :)

2:35 gws: wei__: https://github.com/clojure/data.json has a way for you to specify a :key-fn keyword that may be what you want?

2:35 ddellacosta: noprompt: well, at least you have something nice to look forward to. :-)

2:36 noprompt: ddellacosta: i showed the other devs today the work i'd been doing the past couple weeks and they looked so happy. (these are the backend guys)

2:36 ddellacosta: noprompt: excellent. Is it Clojure on the back-end too?

2:36 noprompt: ddellacosta: sadly no. it's python. :(

2:36 ddellacosta: noprompt: well, could be worse...haha. ;-)

2:37 noprompt: ddellacosta: that's certainly true. it's cool though cause they've set the api in the development branch to send me edn. :)

2:37 ddellacosta: noprompt: oh, that's super cool--sounds like they are pretty receptive to Clojure then.

2:39 noprompt: ddellacosta: not entirely, but they certainly agree with me raw javascript can be a rat's nest.

2:39 ddellacosta: gotcha.

2:39 noprompt: well, the indoctrination has to start somewhere.

2:40 noprompt: ddellacosta: it's funny though cause i've been able to take control over almost all of the front-end story simply with leiningen and clojurescript.

2:40 ddellacosta: noprompt: are you the only/main front-end dev?

2:40 noprompt: ddellacosta: lein-npm can fetch bower dependencies now >:)

2:41 ddellacosta: sadly, yes. and the front-end is the most complex part of it. :|

2:41 ddellacosta: noprompt: woah, that is cool...embarassingly, I've never heard of lein-npm until this moment... ;-p

2:41 oh, it's bodil's work, cool

2:42 noprompt: ddellacosta: it's pretty sweet but she hasn't pushed the new code to clojars so the README is lying a bit.

2:42 ddellacosta: noprompt: ah, okay

2:42 noprompt: ddellacosta: i just created my own version of it [noprompt/lein-npm "0.1.1"]

2:43 ddellacosta: noprompt: weeel then maybe I'll sneak a look at yours then

2:43 noprompt: ddellacosta: all i did was clone the repo as it is now, bump the version, and push to clojars.

2:44 ddellacosta: alright, I really gotta do some more work...be back. Thanks again noprompt !

2:45 noprompt: ddellacosta: you bet!

3:10 bitemyapp: noprompt: yeah, I hate it too.

3:11 noprompt: bitemyapp: dude, i just summed it up with that last tweet.

3:11 bitemyapp: in context, that's twitter gold.

3:11 haha

3:11 lol "Don't call your parents. They'll call you."

3:11 bitemyapp: noprompt: nice.

3:11 noprompt: hahahhaha

3:12 bitemyapp: no shit it's true. if i don't call my mom and dad after a week, they call me. really.

3:13 bitemyapp: noprompt: my parents call me once every month or two.

3:13 noprompt: bitemyapp: dude, i just spent hour trying to figure out this rediculous bug.

3:13 bitemyapp: noprompt: super related?

3:14 I was talking to a coworker today about how super and class-based views make Django code impossible to understand or modify.

3:14 he was as angry as myself about it :(

3:14 noprompt: bitemyapp: i'll recap. ObjA -> ObjB -> ObjC -> this.parent.on(event, f, this)

3:14 i'm using the -> here to represent flow.

3:15 bitemyapp: that's actually kind of funny because one of the django guys i work with was expressing the *exact* same pain.

3:18 rurumate: whoa, cascalog is really high level stuff

3:18 bitemyapp: rurumate: yep, it's awesome.

3:19 noprompt: bitemyapp: this idea of putting state (when you need it) behind a pub/sub on the client side is turning out to be a really clean way to manage app state.

3:19 rurumate: bitemyapp: but how to pass parameters/data to jobs, what I would normally do via JobConf?

3:21 noprompt: bitemyapp: it's like having a small evented document database.

3:21 seriously_random: how do I tell if difference in sorted sequence between each adjacent element is 1? e.g. [1 2 3] and not [1 2 4]

3:22 bitemyapp: rurumate: data would be on HDFS, no?

3:23 noprompt: hrm.

3:23 seriously_random: fold/reduce + reduced

3:23 hyPiRion: ,(every? #(= 1 (- %2 %)) (partition 2 1 [1 2 3])) ; seriously_random

3:23 clojurebot: #<ArityException clojure.lang.ArityException: Wrong number of args (1) passed to: sandbox/eval27/fn--28>

3:23 bitemyapp: hyPiRion: god dammit

3:23 noprompt: :|

3:23 lol

3:23 :)

3:23 bitemyapp: I knew a solution with partition was coming.

3:24 logic_prog: http://digitalocean.com/pricing <-- how is digital ocean managing to offer services cheaper than aws?

3:24 anyoe hosted clojure apps on digital ocean?

3:24 bitemyapp: logic_prog: AWS is massively over-priced.

3:24 noprompt: ,(partition 2 1 [1 2 3])

3:24 clojurebot: ((1 2) (2 3))

3:24 hyPiRion: ,(every? (fn [[a b]] (= 1 (- b a)) (partition 2 1 [1 2 3])) ; <- working ?

3:24 clojurebot: #<RuntimeException java.lang.RuntimeException: EOF while reading>

3:24 bitemyapp: logic_prog: I do.

3:24 hyPiRion: gahd

3:24 arrdem: ,(as-> [1 2 3] s (map (fn [x y] (<= y (inc x))) s (rest s)) (reduce and s))

3:24 clojurebot: #<CompilerException java.lang.RuntimeException: Can't take value of a macro: #'clojure.core/and, compiling:(NO_SOURCE_PATH:0:0)>

3:24 noprompt: ah that's what it was.

3:24 arrdem: FUUUUUU

3:24 hyPiRion: ,(every? (fn [[a b]] (= 1 (- b a))) (partition 2 1 [1 2 3]))

3:24 logic_prog: bitemyapp: do you have a blog post / documentation / something I can read?

3:24 clojurebot: true

3:24 bitemyapp: arrdem: NO SOUP FOR YOU

3:24 Apage43: (reduce (fn [p i] (if (= 1 (- i p)) i (reduced :nope))) [1 2 3 4 5 6])

3:24 hyPiRion: there we go.

3:24 Apage43: ,(reduce (fn [p i] (if (= 1 (- i p)) i (reduced :nope))) [1 2 3 4 5 6])

3:24 clojurebot: 6

3:24 Apage43: ,(reduce (fn [p i] (if (= 1 (- i p)) i (reduced :nope))) [1 2 3 4 5 6 8])

3:24 clojurebot: :nope

3:25 arrdem: goddamnit Apage43

3:25 bitemyapp: logic_prog: bitemyapp.com + gitub.com/bitemyapp/ - nothing specific to DigitalOcean, they're just a VPS provider.

3:25 * arrdem gives up and goes to bed

3:25 Apage43: <3

3:25 bitemyapp: Apage43 has defeated you all.

3:25 noprompt: ,(map #(apply -) (partition 2 1 [1 2 3]))

3:25 clojurebot: #<ArityException clojure.lang.ArityException: Wrong number of args (1) passed to: sandbox/eval204/fn--205>

3:25 arrdem: (inc Apage43)

3:25 lazybot: ⇒ 10

3:25 bitemyapp: (inc arrdem)

3:25 lazybot: ⇒ 12

3:25 noprompt: oh read the question wrong

3:25 * noprompt is an asshat

3:26 bitemyapp: ,(map (partial apply -) (partition 2 1 [1 2 3]))

3:26 clojurebot: (-1 -1)

3:26 bitemyapp: noprompt: yours could be a stepping-stone.

3:27 AWizzArd: ,(let [x [1 2 3 4 5 7]] (clojure.set/difference (set (range 1 (inc (last x)))) (set x)))

3:27 hyPiRion: ,(every? #(= % 1) (map #(apply - %) (partition 2 1 (rseq [1 2 3]))))

3:27 clojurebot: #<CompilerException java.lang.ClassNotFoundException: clojure.set, compiling:(NO_SOURCE_PATH:0:0)>

3:27 true

3:27 hyPiRion: but then we're moving into obscure territory

3:27 AWizzArd: ^^

3:29 Maybe a version with reducers...

3:29 Apage43: s/reduce/fold ^^

3:29 noprompt: bitemyapp: i picked up a bit of a buzz somehow after finding that bug.

3:30 honestly, beer, i don't know how it happened.

3:30 Apage43: actually no, can't just fold that

3:30 bleh =P

3:30 rurumate: '(pr-str {"1" 2 "2" 2})

3:30 ,(pr-str {"1" 2 "2" 2})

3:30 clojurebot: "{\"1\" 2, \"2\" 2}"

3:31 rurumate: how to prevent pr-str from printing commas? it's bloating my files..

3:31 seriously_random: hyPiRion, how about I check the difference between min and max value of [1 2 3] and see that frequencies max value is 1?

3:31 Apage43: maybe use https://github.com/clojure/data.fressian if you need something compact

3:32 hyPiRion: seriously_random: that's also a possibility

3:32 Apage43: I like frequencies as an anagram checker

3:33 ,(let [anagram? (fn [a b] (= (frequencies a) (frequencies b)))] (map anagram? ["fred" "meat" "what"] ["derp" "team" "thaw"]))

3:33 clojurebot: (false true true)

3:34 noprompt: ,(clojure.string/replace (pr-str {"1" 2 "2" 2}) #"," " ")

3:34 clojurebot: "{\"1\" 2 \"2\" 2}"

3:34 noprompt: :P

3:35 rurumate: ^^

3:39 gws: ,(let [c [1 2 3 4]] (every? #(= 1 %) (map #(- %2 %) c (drop 1 c))))

3:39 clojurebot: true

3:41 hyPiRion: I'm sometimes a bit angry that every? isn't variadic

3:44 Apage43: hyPiRion: would it concat its args?

3:44 hyPiRion: Apage43: no, just work like map

3:44 Apage43: ah

3:44 hyPiRion: e.g. (map + [1 2 3] [1 2 3]) => (2 4 6), (every? = [1 2 3] [1 2 3]) => true

3:46 bitemyapp: arrdem: http://www.youtube.com/watch?v=45lB-fyB87Y

3:53 ucb: g'day all

3:57 bitemyapp: ucb: hi!

3:58 ucb: bitemyapp: !!

4:02 atyz: Anyone know how I can add a key to a map that will match based on a regex?

4:04 arrdem: bitemyapp: so one thing I was pondering during my spindown ritual...

4:04 bitemyapp: your "duel" system needs to prevent ties

4:04 bitemyapp: it shouldn't be possible for two players to contest the state indefinitely.

4:06 bitemyapp: one solution is to have ressonance in the environment state, which feeds upon itself and becomes chaotic/unstable (but still deterministic) after some finite N ticks

4:06 bitemyapp: arrdem: mana/willpower?

4:07 arrdem: you can cast spells that affect more state, but drain your ability to cast spells faster, forcing you balance slow/steady vs. burst play?

4:07 you to*

4:07 arrdem: sure... but I'm saying that it should be impossible for two players both playing rationally along a slow and steady course to perfectly contest forever.

4:08 bitemyapp: arrdem: the only way to accomplish that would be to time their mana running out at exact intervals

4:09 arrdem: ordinarily they'd cast spells of varying cost and create gaps for the other person to attack or manipulate state uncontested.

4:11 arrdem: bitemyapp: right. what I'm proposing is that the state slowly becomes nonsteady. if A and B make moves a, ^a then the state is unchanged in the trivial model. but if the state devolves of it's own occord and introduces some neutral imballancing factor then it becomes impossible (or at least bloody hard) for humans to come up with a, ^a

4:12 bitemyapp: think of the battle field as an echo chamber that retains some energy slowly becomming resonant in conflict with both players

4:13 bitemyapp: arrdem: I like it. It could be like a travelling wave

4:13 arrdem: adding "energy" to the wave, almost like a motorcycle losing control, makes it more violent.

4:13 arrdem: could lead to some exciting duels where they sustain a fight until it completely explodes in one of their faces.

4:13 arrdem: you are really good at this :D

4:14 arrdem: bitemyapp: EXACTLY. this harmonic will eventually backfire on and crush someone while staying deterministic.

4:14 seriously_random: how do I write: (let [x] be (this) on_condition (condition) else let [x] be (other))

4:15 arrdem: (let [x (if (condition) this other)] .. )

4:43 rurumate: is there a standard way to pretty-print the :out field from a clojure.java.shell/sh call?

4:45 it looks like this: (clojure.java.shell/sh "ls") -> "etc\nlog\nproject.clj\nproject.clj~\nsrc\ntarget\n

4:50 hyPiRion: just call println

4:56 divyansr: what does #^ symbol mean in argument list of function ?

4:59 ucb: bitemyapp: oh! forgot to give you and update on trafficmigrationlols

4:59 bitemyapp: turns out that all the shittyness was due to graphite

5:00 rurumate: hyPiRion: thanks, that's exactly what I was looking for

5:06 daGrevis: does lein run automatically gets all dependencies specified in project.clj?

5:07 divyansr: what does #^ symbol means ?

5:14 scottj: divyansr: old syntax for ^

5:15 divyansr: Thanks ! In fact I was looking for compojure old commits and puzzled by #^ :)

5:21 makkalot: hi, i'm trying to write a macro in clojurescript : http://pastebin.com/Rd2Z5jE7 when i call it i see every time it returns nil to my called function , any ideas ?

5:26 nevermind i figure it out :P

5:26 clojurebot: It's greek to me.

5:27 rurumate: what's observable-fn?

5:27 makkalot: rurumate, it is my custom fn

5:28 rurumate: makkalot: where is it defined?

5:28 makkalot: in .cljs file in same ns

5:28 rurumate, macro is in clj

5:30 btw, is there a way to run clsjbuild test without compiling

5:30 rurumate: makkalot: oh, I see. macro doesn't care what it is, it just returns the symbol

5:31 makkalot: I think munged-symbol cannot be private

5:31 macros can only use public functions

5:31 makkalot: rurumate, actually it is ok

5:31 rurumate, works now, just had to change result of mungle to be str

5:32 because that variable was not exsitng

5:32 rurumate: cool

6:15 FragDoctor: Hi

6:16 ucb: say I want to include lib1 "0.0.1" and lib2 "0.0.1", how can I avoid repeating the "0.0.1" and instead provide a named constant?

6:16 I tried (def ver "0.0.1") before defproject but that didn't work :(

6:24 clgv: ucb: you can try to use ~ver inside the project map. but it might not work for the dependency vectory

6:24 *s

6:24 ucb: ah, gotcha

6:33 seriously_random: how does "predicate" function know about a-map, which isn't in its parameters?

6:33 oops, http://pastebin.com/PQn35sEf

6:41 ucb: seriously_random: key->predicate returns a function. This function is called by filter with each map. That's how a-map gets bound to each map.

6:47 pcn: Good morning

6:57 dav_: gen-class continues to baffle me. I have this very simple class which I'm able to instantiate, but cannot call any methods.. any ideas?

6:57 source is here: https://github.com/obadz/xlloop-clojure/blob/master/src/xlloop_clojure/funs.clj

6:58 (.myTest (xlloop.funs.)) => IllegalArgumentException No matching field found: myTest for class xlloop.funs clojure.lang.Reflector.getInstanceField (Reflector.java:271)

7:02 pcn: I'd like to have an async service that writes all output to a single file. Does anyone have any examples of something like this?

7:03 ohpauleez: pcn: You want an HTTP service, that writes all of its responses to a file (like a journal)?

7:04 pcn: Not http - the proto is simpler, but yes, something like that.

7:04 I want to read line-separated input, splitup the input, and write batches of some number - say 50 or 100 per line - to the output

7:04 s/number/quantity of inputs/

7:06 The input is straightoforward, and I'm passing it arund via go blocks. The part that I'm trying to understand is how to end up writing synchronously to an output file in batches. Order of the messages doesn't matter.

7:06 ohpauleez: ahh, you just need some sort of a script - the functions you'll need are `slurp`, `split`, `spit` with :append true

7:06 You don't want to do socket or file reads in go blocks

7:06 you should really do those in thread blocks

7:07 I was just optimizing a blog post the other day (adam bard's) that made some small mistakes

7:08 You read from the file synchronously though, and that's what is feeding "the machine"

7:08 so you'll end up being limited by that single part of your process

7:09 dav_: Does anyone have a minute to help me with my (above) gen-class problem ? :)

7:10 ohpauleez: dav: let me hit the scrollback, hang on

7:10 pcn: How efficient is spit? I expect to write a few hundred thousand lines, and I don't want the documented open, write, close behavior per-line

7:10 dav: ohpauleez: thanks

7:11 ohpauleez: pcn: I'm not sure, but personally, I only use spit and slurp for quick jobs. More often than not I need to use clojure.java.io readers and writers (for more control)

7:11 clgv: pcn: the you probably should open a fileoutput stream in a with-open

7:12 pcn: you'll find useful functions in clojure.java.io

7:13 ohpauleez: dav: You should try using the :methods arg in your :gen-class

7:14 something like (:gen-class :name xlloop.funs :methods [ … ])

7:15 and you can also set the method to be static there is you want (if you need that sort of thing)

7:17 dav: ohpauleez: worked with :methods, thanks.,

7:17 ohpauleez: np! Happy to helo

7:17 help

7:18 dav: ohpauleez: any idea why this guy (https://kotka.de/blog/2010/02/gen-class_how_it_works_and_how_to_use_it.html) is able to do it without :methods?

7:18 pcn: ohpauleez: so I can pass the message around go blocks, then at the end put it on an async channel, and have a thread the manages file writing (and rotating out files and linking bits to where I want them) !< from that channel, outside of a go block. Does that sound like it's obeying the appropraite rules?

7:18 ohpauleez: You need to add the :prefex piece if you want to do that

7:19 the default might be `-`, but I wouldn't count on it always being there

7:19 dav: ohpauleez: I see. thx.

7:20 ohpauleez: actually :prefix doesn't seem to work either.

7:20 ohpauleez: https://github.com/obadz/xlloop-clojure/blob/master/src/xlloop_clojure/funs.clj <= this doesn't work.

7:21 ohpauleez: pcn: Yeah, there are no hard and fast rules, but if you're dealing with something that has the potential to block (like certain kinds of IO), you should put the step directly response for the IO in a `thread` instead of a `go` block

7:22 so you don't end up using up one of the threads from the go-block thread pool

7:22 dav: ohpauleez: I think I get it. :methods is required anytime I'm creating new methods that aren't already in a superclass..

7:22 ohpauleez: I think?

7:23 ohpauleez: I can't confirm that… I have only used gen-class once or twice in my entire Clojure career :)

7:24 ahh yes, the blog post seems to make a point about "custom methods"

7:25 dav: ohpauleez: thanks. mystery solved. lots of mystery surrounding gen-class :(

7:26 ohpauleez: yes, it's a bit of a black art :)

7:32 pcn: I will cook up an example a little later this morning if you're still around

7:36 pcn: Thanks, I may idle

7:36 but I'll check my scrollback

8:32 seriously_random: check if HashSet one contains all the keywords in HashSet two?

8:33 ohpauleez: seriously_random: Take a look at clojure.set

8:33 there are some subset functions

8:34 and intersections (you can use the set of keys of both)

8:35 you can also use .containsAll and .entrySet and a length check

8:36 or (= (keys hs-one) (keys hs-two)) if you need the keys to be the same - really depends on what you're trying to express

8:36 clgv: seriously_random: since these are sets just compare if they are equal

8:37 ohpauleez: (for example, you don't need the length check in most cases)

8:37 amalloy: ohpauleez: it's a set, not a map

8:37 clgv: ,(= #{:a :b :c} #{:c :b :a})

8:37 clojurebot: true

8:37 clgv: ,(= #{:a :b :c} #{:c :b :a :d})

8:37 clojurebot: false

8:38 ohpauleez: ahh I missed that - yeah subset?, equality, or intersection - depending on the use case

8:38 mdrogalis: Five Word Tech Horror has to be my favorite hashtag on Twitter ever.

8:40 jkj_: hmmh. clojure bot pardons me in query

8:40 ,(:a #{:a :b :c})

8:40 clojurebot: :a

8:40 jkj_: ,(#{:a :b :c} :a)

8:40 clojurebot: :a

8:41 jkj_: ,(#{:a :b :c} #{:a :b :d})

8:42 clojurebot: nil

8:44 sw1nn: hi, anyone know much about deploying with leiningen to s3? I have it working, but lein deploy causes *many* WARNING: Error Response messages to be logged to console (307 temporary redirects by the look of things).

8:46 seriously_random: filter returns keywords, but they are not in a hashset, e.g. (:one, :two), how can I make it a set?

8:47 opqdonut: ,(doc set)

8:47 clojurebot: "([coll]); Returns a set of the distinct elements of coll."

8:47 gfredericks: does clojure-mode allow easily adding new keywords to the list of things that get indented macro-style?

8:49 amalloy: gfredericks: M-x customize-variable RET clojure-defun-indent

8:49 Bronsa: dnolen: you there?

9:00 sw1nn: just discovered the #leiningen channel, apologies for the noise.

9:01 mdrogalis: sw1nn: No worries. More than happy to help here if we know the answer.

9:03 sw1nn: mdrogalis: seems to me that 307 shouldn't be a warning, but I'm wondering if I've done something unusual in the set up that's causing this.

9:04 mdrogalis: sw1nn: Can I see your project file?

9:05 gfredericks: amalloy: coolthx

9:07 dnolen: Bronsa: hello

9:08 sw1nn: mdrogalis: https://gist.github.com/7928437

9:08 Bronsa: dnolen: hi, I was testing out t.analyzer.jvm and found out a typo in core.match https://github.com/clojure/core.match/blob/master/src/main/clojure/clojure/core/match.clj#L1363

9:08 dnolen: you have one too many nil in that call

9:09 dnolen: Bronsa: yep, thanks

9:09 Bronsa: dnolen: also, https://github.com/clojure/core.logic/blob/master/src/main/clojure/clojure/core/logic.clj#L73 you actually use pair in other namespaces, it only works now because you (declare pair) later in the source

9:10 dnolen: Bronsa: which other namespaces?

9:11 Bronsa: dnolen: https://github.com/clojure/core.logic/blob/master/src/main/clojure/clojure/core/logic/fd.clj#L40

9:12 mdrogalis: sw1nn: Hmm, I don't see anything out of the ordinary.

9:13 dnolen: Bronsa: thanks, made a ticket for that one.

9:13 sw1nn: mdrogalis: I just created the S3 bucket, wondering if maybe it's not replicated fully yet and that's why I'm seeing the redirects. Will try again tomorrow. thks.

9:15 pcn: I want to have an single thread that writes data to a file. Every second, i want to rotate that file out, open a new file, and resume writes, but to the new file, etc.

9:15 It doesn't seem like this is easy to support using with-open.

9:16 and spit seems to do an open, write, close which puts a lot of stress on the filesystem

9:16 mdrogalis: sw1nn: Mmmkay.

9:16 pcn: Is it OK to manage files with, say, a ref to the current open file, and in a while loop change the ref when the second boundary has been crossed?

9:20 ohcibi: it is okay to call def inside a function, right? otherwise (defn) could not be implemented? or is this something only the core should do?

9:20 Bronsa: ohcibi: defn is a macro, not a function

9:21 ohcibi: Bronsa: ah.. so if I want to create my own def (e.g. for a dsl) the idiomatic way is to write macros for it?

9:23 Bronsa: ohcibi: yeah

9:43 ohcibi: Bronsa: is defmacro also a macro?

9:44 Bronsa: yes

10:05 `cbp: b

10:14 ngw: hi *, I'm trying to use carica in one of my projects (https://github.com/sonian/carica) but apparently the repo is not present on clojars or any place so lein deps fails

10:15 how do I solve this?

10:16 nDuff: ngw: it's there on clojars

10:16 ngw: which version are you trying to pull?

10:16 ngw: https://clojars.org/sonian/carica

10:17 joegallo: ah, it looks like 1.0.4 was tagged but not pushed out

10:18 to clojars

10:18 ngw: nDuff weird: [sonian/carica "1.0.4"]

10:18 ha!

10:18 joegallo: leathekd: ^

10:20 jcromartie: I'm finding myself using Compojure's destructuring exceedingly rarely because I have functions that operate on the session and other things in the request

10:20 and it's just getting rather cluttered in the route destructuring

10:28 Pupeno_w: Doing (defn foo [& [bar baz]] ...) it's using pattern matching/destructuring to essentially define a function that receives between 0 and 2 attributes (more are just ignored), right?

10:28 coventry: Pupeno_w: Yes.

10:30 Pupeno_w: Neat.

10:38 wei__: trying to compare two maps across processes. could I compute an object hash or something of that sort?

10:41 `cbp: why not = ?

10:43 leathekd: joegallo: ngw: Sorry, yeah. The last update changed the readme but I failed to deploy it. Let me do that now.

10:47 joegallo: for shame, leathekd!

10:47 :)

10:48 * leathekd falls upon his sword

10:48 emaphis`: ouch.

10:52 CookedGryphon: does anyone know of a good ascii art graph renderer? vijual does exactly what I want but is ancient and doesn't work any more, plus it relies on swing which I can't use - I only want the ascii art bits

10:53 or am I going to have to bring vijal up to date

10:57 tolstoy: CookedGryphon: Maybe http://ditaa.sourceforge.net has something useful?

10:58 CookedGryphon: ah, overtone has a fork of vijual which seems to work

10:58 but isn't well advertised or documented

10:59 tolstoy: that's cool, but not quite what I want I don't think

10:59 I want to feed in [:a :b] [:b :c] [:a :d] and get a directed graph visualization in ascii art

11:00 tolstoy: I didn't think so. ;) Ditaa is more like OmniGraffle. ;)

11:00 leathekd: ngw: All set. 1.0.4 is now on Clojars.

11:00 clgv: CookedGryphon: if you drop the ASCII requirement you can use rhizome

11:02 CookedGryphon: clgv: that's nice, but I don't have swing

11:02 coventry: CookedGryphon: Sounds like an interesting application. What's it for?

11:02 CookedGryphon: otherwise I would probably have tried that first

11:03 I have a complex publish/subscribe model for my android app which coordinates lots of ui/system events and want to visualize it to help newcomers understand

11:03 but being on android all the graphviz stuff won't work

11:03 so it would be nice to just have it in the repl

11:04 clgv: CookedGryphon: pure java graph layouting then?

11:04 CookedGryphon: yep, with textual output

11:05 clgv: no android UI?

11:05 CookedGryphon: clgv: could do, but don't really want to do it on the device, it's a dev tool

11:05 so want to bring it up in the repl really

11:06 clgv: oh ok

11:17 coventry: Wow, sounds really cool.

11:17 CookedGryphon: yeah, i'm quite pleased with how it's coming along actually

11:17 loads of complex interactions that just melt into simple parts with core async and this model

11:18 so far anyway :P

11:57 jtoy: can a library know what the path of that java was started from? so if im at /home/jtoy and i do lein repl and include a library, can the library kow the path /home/jtoy and if so, how can Iget it?

11:59 TimMc: That's the current working directory, yeah?

11:59 jtoy: TimMc: yes, but im not sure if the jvm hides it or if jars know

12:00 justin_smith: jtoy: (System/getenv "PWD")

12:01 it's the same way any process tracks the working directory, and you can change your working directory by mutating it with setenv

12:01 jtoy: grea,t thanks

12:01 justin_smith: though java tools don't care about PWD they care about the classpath

12:01 but you can use PWD in creating File objects etc.

12:03 jtoy: justin_smith: I just wantto set the log directory for my app

12:03 hiredman: /win 27

12:03 jtoy: thats a lot of windows

12:03 hiredman: yep

12:10 jtoy: is there a simple way I can catch all exceptions in a program so hat I can log them?

12:11 justin_smith: (defn -main [] (try ... (catch Throwable t ...)))

12:11 that is a bit excessive though

12:11 there are throwables that you should not try to handle

12:11 mdrogalis: jtoy: You need to make a decision about what level of abstraction you're going to deal with errors and what you're doing to do about it.

12:11 One big net is a recipe for a bad program.

12:12 jtoy: I just want to log them, canI just rethrow them?

12:12 justin_smith: true, I take my silly suggestion back

12:12 stuartsierra: jtoy: Thread/setDefaultUncaughtExceptionHandler will catch exceptions on threads that have no other try/catch in place.

12:12 mdrogalis: Yeah, of course. But to do that you need to catch them.

12:12 stuartsierra: Huh, I never knew that was a thing.

12:12 jtoy: stuartsierra: great, thanks!

12:12 stuartsierra: Note that this doesn't apply to exceptions thrown in Futures, which get stored until you deref the future.

12:14 Also note that ExecutorService.submit returns a Future, so any exception in one of those tasks will be stored in the Future.

12:15 apgwoz: hello.

12:15 woah. this room has grown a ton since i last visited.

12:19 mcblumperson: ascii

12:27 justin_smith: to elaborate what stuartsierra said, I think agents behave similarly (though agents may even be a subcategory of future for all I know)

12:30 TimMc: Ah, so I should deref all my futures... in another future... that can log the errors...

12:31 justin_smith: "We are all interested in the future, for that is where you and I are going to spend the rest of our lives."

12:32 that classic quote seems quite apropos here

12:32 hiredman: TimMc: at that point you may be better off just not making any errors

12:33 technomancy: "Of all the dimensions I could spend my life being inexorably forced to travel forward through, I guess time isn't the worst."

12:33 hyPiRion: would be worse if it were the x-axis of the world

12:35 teslanick: It wouldn't be so bad if we could travel through time at will. If we were moving through time *and* the X-axis, well, that would be bad.

12:35 hyPiRion: oh yeah, you're right

12:36 justin_smith: I would settle for immutibility

12:36 so much better than immortality imho

12:37 teslanick: Isn't the "many worlds" hypothesis of time effectively immutability?

12:37 technomancy: consciousness is an agent

12:38 which is too bad; it'd be really nice to have access to dosync

12:38 danneu: Does anyone use a minimal Backbone.js-like abstraction with ClojureScript?

12:38 teslanick: That would have made college so much easier: stop the world and do homework.

12:38 hyPiRion: today I learned AI can't use dosync

12:41 apgwoz: does anyone have experience integrating clojure into a heavily guiced java code base?

12:42 i'm interested in hearing horror / success stories

12:45 dnolen: k thinking about React life cycle hooks for om via reify - https://github.com/swannodette/om/issues/1

12:47 justin_smith: apgwoz: I haven't done so, but it should suffice to implement the right interfaces on a clojure defrecord or deftype. But hold out for someone who actually has tried it, I am just speculating.

12:47 hiredman: apgwoz: the search team where I work was fiddling with writing elasticsearch plugins (which I guess rely on guice for deps?) in clojure, there were issues at one time with being able to annotate constructors created by clojure with the correct annotations

12:47 S3thc0n: If I have no else to execute, but also only one expression (no do necessary) as then, should 'if' or 'when' be preferred?

12:48 justin_smith: S3thc0n: when for side effects

12:48 or for values

12:48 S3thc0n: Why is that?

12:48 justin_smith: (or (get-value thing) default-value)

12:48 (when in-outer-space (use-jetpack)

12:48 )

12:48 hiredman: apgwoz: that got fixed, and then after that I think they've been able to, but I haven't been directly involved so I am not sure what the extent of their success was

12:49 justin_smith: S3thc0n: either works, but or is more clearly about values, when is more clearly about what side effects to create

12:50 S3thc0n: justin_smith: You meant if instead of or?

12:50 justin_smith: no

12:50 if if you have two branches

12:50 or if you have one and care about values

12:50 when if you have one branch and care about side effects

12:51 ,(or nil true (println :huh))

12:51 clojurebot: true

12:51 apgwoz: hiredman: thanks!

12:52 S3thc0n: I see.

12:52 justin_smith: Thank you.

12:52 justin_smith: S3thc0n: np - though of course with or you end up inverting the first condition compared to when

12:53 'and' works similarly

12:53 ,(and true :OK)

12:53 clojurebot: :OK

12:54 apgwoz: justin_smith: yeah. I'm still investigating, but I think as long as I use an injector with modules that I'm not providing, it should be OK.

12:54 justin_smith: but we'll see. :)

12:54 S3thc0n: Interesting. That is a bit I will have to remember

12:57 But I did not quite get why I should use or instead of when?

12:58 justin_smith: for the same reason you wouldn't use if

12:58 ,(if true :yeah)

12:58 clojurebot: :yeah

12:58 justin_smith: it works, but may not be as clear

12:59 similarly, when works for a single branch, but may not be as clear if all you care about is the value

12:59 'and' works also, but is not as clear if you care about side effects

13:00 (I should have suggested 'and' in the first place, I thought of or because that is how most of my single branch conditionals work - providing a default if nothing is specified)

13:00 S3thc0n: I see. So if I don't even have anything to do I'll just use or.

13:00 justin_smith: yeah, or for values, when for side effects

13:01 S3thc0n: ok.

13:01 Thanks a lot!

13:19 In the 4clojure problems, 'conj' is used very often, even though the order of the items matters. Is that bad style, or is it acceptable to let the next one looking at your code figure out what conj will do?

13:21 bbloom: S3thc0n: conj doesn't have anything to do with order. conj is just a polymorphic add-to-collection operator

13:22 ,(conj #{2 4 6} 1 2 3 4 5 6 7 8)

13:22 clojurebot: #{1 2 3 4 5 ...}

13:22 TimMc: Usually when you're using conj, you know what kind of collection you're adding onto.

13:22 S3thc0n: bbloom: That is why I am asking. In 4clojure, the order of the resulting collection matters when it is used.

13:23 llasram: And if the function needs a particular type for the algorithm to be correct, that's no different than requiring you pass in that collection type vs a database connection or whatever

13:23 bbloom: S3thc0n: only if it's a sequential data structure

13:23 ,(map sequential? [#{1 2} [1 2] {1 2}])

13:23 clojurebot: (false true false)

13:24 bbloom: bitemyapp: i can't hold a grudge. you're re-followed :-P

13:25 pyrtsa: Naming problem: I keep wanting to use a helper function that converts any non-nil value x into [x] and nil into [], i.e. #(if (nil? %) [] [%]). In Haskell, I'd use maybeToList, but what's a suitable name for it in Clojure?

13:26 bbloom: pyrtsa: i think i've seen that called seqify or vecify

13:26 oh no, nevermind.

13:26 that's like 5 -> [5] and [5] -> [5] is vecify

13:27 jtoy: can I put a breakpoin in clojure code so that when I run the function from the repl, it will stop there and I can continue running the commands by hand to test ?

13:27 bbloom: pyrtsa: don't you just want into [] ?

13:27 ,(into [] nil)

13:27 clojurebot: []

13:27 bbloom: ,(into [] 5)

13:27 clojurebot: #<ExceptionInfo clojure.lang.ExceptionInfo: Don't know how to create ISeq from: java.lang.Long {:instance 5}>

13:27 pyrtsa: No I don't. :)

13:27 bbloom: er nevermind

13:27 once again, i should think before i type anything

13:27 ignore me :-P

13:27 pyrtsa: :)

13:28 S3thc0n: bbloom: Usually they are sequentials. WHat bothers me that it is expected for the reader to consider the data type.

13:28 ,(= '(3 4 5) (conj '(3 4) 5) (conj [3 4] 5))

13:28 clojurebot: false

13:29 S3thc0n: I fully understand if you use it for a map or so, but 4clojure definitely uses it on sequences in cases where order matters.

13:29 hyPiRion: pyrtsa: I'd just call it maybe-vector and get on with life :p

13:29 bbloom: S3thc0n: 4clojure has intentionally contrived problems to illustrate things

13:29 S3thc0n: Of course one will know it, but there's nothing wrong with making it more explicit?

13:29 hyPiRion: considering ##(vector 5) gives you a similar function

13:29 lazybot: ⇒ [5]

13:30 S3thc0n: bbloom: It is all over the place, nto only when teaching conj / cons

13:30 bbloom: S3thc0n: i'm still not understanding the problem...

13:30 S3thc0n: conj means "add to collection"

13:31 jtoy: this is a pretty cool breakpoint: https://coderwall.com/p/xayyvq

13:31 pyrtsa: hyPiRion: Maybe. :)

13:32 S3thc0n: Yes. There's nothing wrong with conj itself. But I wanted to know if it isn't bad style to rely on conj to append to a particular end of a sequence and let the reader figure out which one it is.

13:34 bbloom: S3thc0n: i don't think it's bad style

13:35 it's usually pretty clear if the thing being conj-ed on to needs to be of a particular type or if the function works generically on any composite

13:35 alew: Well you should only be relying on an order in a vector I would think

13:37 coventry: Super-correct style would probably be only to use conj if you don't care about where it puts the addition to the collection. But it's pretty minor.

13:37 S3thc0n: So it is preferred to explicitly convert the given sequence to the datastructure and then use conj implicitly instead of just takig the given and then adding to the correct position?

13:37 Caus then you will always have to know the type, which is kidn of inconvenient.

13:38 mdrogalis: He has a good point.

13:38 This wouldn't make any sense if you didn't know it was prepending.

13:38 alew: What does it mean to be in a specific position in a map or set for example

13:38 mdrogalis: ,(reduce conj (list) (range 1 5))

13:38 clojurebot: (4 3 2 1)

13:40 S3thc0n: alew: Nothing, but I'm talking about sequences.

13:41 alew: conj acts on collections not sequences no?

13:41 S3thc0n: alew: Aren't sequences collections?

13:41 hyPiRion: ,(conj (seq (range 10)) -1)

13:41 clojurebot: (-1 0 1 2 3 ...)

13:42 alew: you can access any collection as a sequence

13:43 justin_smith: S3thc0n: I use conj on the data if the same function creates or coerces the data

13:43 alew: a sequence is a view at a collection, but not a collection itself I believe

13:43 lists implement sequences pretty directly though

13:44 amalloy: alew: of course a sequence is a collection

13:44 justin_smith: alew: that is true

13:44 amalloy: it holds elements, you can add elements to it, what else is there?

13:44 alew: a seq is just an interface against some collection, is it really a collection itself?

13:44 justin_smith: linked-list style first/rest is kind of the lowest common denominator api for collections - if it is ordered pretty much anything can provide you that style

13:44 amalloy: &(coll? (range 1))

13:44 lazybot: ⇒ true

13:44 amalloy: &(coll? (seq [1 2 3]))

13:44 lazybot: ⇒ true

13:45 amalloy: you cannot provide any seq that is not a coll

13:45 justin_smith: ,(seq "hello")

13:45 clojurebot: (\h \e \l \l \o)

13:46 alew: I'm guessing a seq created from range is a list underneath

13:46 justin_smith: ,(coll? "hello")

13:46 clojurebot: false

13:46 justin_smith: dunno if that is what you meant

13:46 amalloy: alew: you are guessing some crazy things

13:47 it's a sequence constructed of cons cells, which is rather like a list, but all it promises to be is a seq

13:47 if you can provide some x such that (seq? x) is true and (coll? x) is false i shall be very excited

13:48 (since that is definitionally impossible - every seq is a collection)

13:48 S3thc0n: I would argue that everything implementing an interface kind of has to be that thing in some sense.

13:48 justin_smith: S3thc0n: the instance? predicate agrees with you

13:49 amalloy: yeah, it's basically impossible to disagree with S3thc0n's assertion

13:51 alew: Yeah

13:51 S3thc0n: So I would propose to use cons and a function that appends on the end when order matters, instead of just relying on data types. It doesn't cost anyhting and only makes it clearer.

13:52 alew: Does clojure actually use cons cells underneath btw?

13:52 amalloy: sometimes

13:52 justin_smith: S3thc0n: well the point of conj is it is guaranteed to be the cheapest way to add to a collection, time/space wise

13:53 S3thc0n: Exactly. But order is not guaranteed. It might change depending on implementation (although that is not sure).

13:53 amalloy: justin_smith: i have an entertaining edge case for you

13:53 alew: In that respect, it doesn't really make sense to use conj as a way to ensure order from arbitrary collection input

13:53 justin_smith: amalloy: cool, do tell!

13:54 amalloy: &(let [x (lazy-seq (do (Thread/sleep 5000) [1]))] (time (first (conj x 0))))

13:54 lazybot: ⇒ "Elapsed time: 5017.044583 msecs" 0

13:54 amalloy: &(let [x (lazy-seq (do (Thread/sleep 5000) [1]))] (time (first (cons 0 x))))

13:54 lazybot: ⇒ "Elapsed time: 11.118449 msecs" 0

13:54 alew: That's funny

13:55 justin_smith: like a magic trick

13:55 but that is indeed why we have laziness, neato

13:55 amalloy: well, the trick is that LazySeq's conj implementation forces the first element of the sequence

13:55 whereas cons just builds a Cons

13:56 alew: is it only the first element?

13:56 hyPiRion: unless it is chunked

13:56 amalloy: well, it calls seq

13:56 S3thc0n: I think i will look at coljure.core and see how conj is used there.

13:57 justin_smith: S3thc0n: good call, reading code is often the right answer :)

13:57 amalloy: and you can build collections which do arbitrary amounts of work to implement seq, so "only the first element" isn't really a provable thing

13:57 TimMc: Beware, clojure.core is full of dirty tricks and bootstrapping.

13:57 It's a good read, but there's some very unidiomatic stuff. :-)

13:58 justin_smith: S3thc0n: if using emacs, M-x rgrep is a cool way to investigate usages throughout a codebase

13:58 TimMc: (Usually because it is still building the things Clojure idioms rely on.)

13:58 amalloy: eg, (conj (lazy-seq (vec (range 1e7))) -1) only forces the first element of the underlying seq, but building that seq can't happen until you make a 10M element vector

13:58 alew: it's probably bad practice anyway to rely on lazy seq evaluation for side effects

13:59 seangrove: bbloom: I think you'll like this - we're building in a bit of functionality to show emails in the browser

13:59 Luckily, we don't have to worry about it looking good/formatting it at all, nor attachments, etc.

14:02 TimMc: For now. Just wait.

14:03 In 6 months you'll be working on a full MTA.

14:03 bbloom: seangrove: remind me who "we" is again?

14:03 coventry: Every mail reader expands until it can be used as a general-purpose programming language.

14:04 seangrove: bbloom: Zenbox, but working on a new product

14:04 jcromartie: I'm about to just (def ^:dynamic *db*) here, is that so wrong?

14:04 bbloom: seangrove: oh right, the gmail plugin in cljs :-)

14:05 seangrove: TimMc: It's an idea I flirt with form time to time for a side project eventually - an open source extensible email client in cljs

14:06 justin_smith: coventry: lol, I was just looking for the original quote

14:06 jcromartie: depends, should threads see the db binding, and are they launched inside the lexical context of the binding?

14:07 TimMc: coventry: Claws Mail is definitely working on that, although it relies on being able to shell out for the most advanced predicates and actions.

14:07 seangrove: jcromartie: I'm not a big fan of it, but if it's just something quick-n-dirty, it's not the end of the world

14:08 S3thc0n_: As much as I have seen (not too much) the function description explicitly states that it is conjoined (no order guarantee) or it is used on a sequence which was created very near to the use.

14:08 coventry: TimMc: Sounds like a glorious yak shaving vehicle.

14:09 alew: (class (range 1))

14:09 ,(class (range 1))

14:09 seangrove: jcromartie: Also, I believe bitemyapp said something like "I'd burn my house down before doing dynamic db bindings again"

14:09 clojurebot: clojure.lang.LazySeq

14:09 seangrove: Could have been for something else though

14:10 jcromartie: seangrove: I'm leaning towards "just pass an arg"

14:10 it's really not that bad, once you get used to it, and it's the very definition of SIMPLE

14:10 but I have my doubts

14:10 that's the story of my Clojure experience, nothing but self doubt :(

14:10 seangrove: jcromartie: Yeah, I think that's a good approach

14:11 justin_smith: jcromartie: that sting is just your pride fucking with you, you're learning, that's positive

14:12 jcromartie: hm, that's an interesting way of looking at it, actually!

14:12 justin_smith: it is my philosophy of learning

14:13 alew: What's the difference between a LazySeq and a ChunkedCons?

14:13 jcromartie: alew: this sounds like a start to a good troll :)

14:14 alew: I'm wondering because

14:14 ,(class (seq (range 1)))

14:14 clojurebot: clojure.lang.ChunkedCons

14:14 alew: ,(class (sequence (range 1)))

14:14 clojurebot: clojure.lang.LazySeq

14:15 justin_smith: alew: chunking is a performance optimization, it realizes some number of results beyond what is needed for the current call

14:15 alew: Is it still a LazySeq though?

14:16 coventry: alew: http://blog.fogus.me/2010/01/22/de-chunkifying-sequences-in-clojure/

14:16 justin_smith: ,(instance? clojure.lang.ChunkedCons (seq (range 1)))

14:16 clojurebot: true

14:16 justin_smith: ,(instance? clojure.lang.LazySeq (seq (range 1)))

14:16 clojurebot: false

14:17 coventry: If you're looking at clojure.core.clj, jvm/clojure/lang/ChunkedCons.java are only a short hop away.

14:18 *and friends are only a short hop away

14:25 alew: speaking of friend

14:25 has anyone had a good experience with the friend authentication library?

14:26 jonasen: Bronsa: Is tools.analyzer.jvm better to infer java types than Compiler.java (i.e. less type hints are needed)?

14:30 Bronsa: jonasen: yes

14:31 jonasen: Bronsa: Is there an easy way to see which types Compiler.java can't find? (I'm thinking some kind of :infer-type-hints "linter")

14:32 Bronsa: jonasen: not that I can think of right now

14:32 jonasen: Bronsa: ok

14:33 Bronsa: jonasen: btw will probably release a 0.0.1-alpha1 version of t.a & t.a.j later this week so that eastwood can depend on a non-SNAPSHOT version

14:33 algal: I got to a good place with friend but it took longer to get there than I'd have liked.

14:37 alew: algal: Do you think it's because of documentation or just the inherent complexity of the interface?

14:38 conventry: Thanks for the link btw

14:38 algal: alew: Documentation is definitely a problem. I am not sure what I think of the interface.

14:38 S3thc0n_: I have now seen a whole lot of examples where people just rely on conj to do the right thing...

14:39 algal: alew: The main docs now are the README, which needs editing.

14:40 S3thc0n: But in core it is made sure that it is always the same. So there should be no real issues as long as noone fiddles around with core. But it still is semantically incorrect and complicates thing unnecessary

14:40 algal: alew: it presents too many concepts for basic use cases.

14:41 alew: I started with friend, ditched it for http-basic-authentication, then went back to friend.

14:41 alew: algal: Yeah, I think he just wrote everything he had on mind without really thinking of the minimal surface area to cover

14:42 algal: alew: yes. friend would be 3x as useful if someone spent 3 hours editing the README.

14:42 justin_smith: well there is that thing they call pull requests on github

14:42 algal: justin_smith: I know! It's on my todo list.

14:43 alew: I still need to get a working conceptual model of friend before I'm confident in making docs for it :P

14:43 algal: alew: I bet that whole model could fit in one well-considered diagram.

14:44 alew: Probably, it seems well designed

14:44 justin_smith: alew: three awesome ways to figure out how to use an underdocumented library: write unit tests that pass given the current implementation, write comments that accurately describe the non-trivial parts of how the functions interact (given the facts you know from the tests), write a readme that the author considers accurate

14:45 the nice thing is these can be stepping stones to help others in the future

14:46 bitemyapp: Bronsa: I didn't know eastwood used ta/taj

14:46 Bronsa: neat.

14:47 algal: alew: one complicating factor is that authentication + routing + ring is a bit non-obvious, imho.

14:48 alew: at least, I first stumbled into the error of wrapping routing handlers in auth. others do as well.

14:49 Bronsa: bitemyapp: it was mostly an Andy Fingerhut effort to port it, it helped me a lot finding & fixing bugs

14:50 bitemyapp: now t.a and t.a.j have been succesfully run in all contrib libraries but core.typed/jvm.tools.analyzer because of namespace collisions and data.fressian/test.generative beacause of http://dev.clojure.org/jira/browse/TANAL-24

14:51 justin_smith: algal: alew I am trying to figure out friend myself, so I can integrate it into caribou with my plugin API (said api is still in development)

14:51 technomancy: bbloom: congrats on breaking 10M =D

14:52 algal: justin_smith: caribou looks very impressive, btw!

14:52 justin_smith: thanks, I am only one of the devs, and not the primary one

14:52 but I trust that the parts that you like best are the ones I am responsible for :)

14:53 the parts you don't like are all patchwork's fault

14:59 bbloom: technomancy: w00t! thanks

14:59 technomancy: it's really unbelievable

15:01 technomancy: http://www.youtube.com/watch?v=R6dnBA8BSR8&feature=youtu.be :-)

15:02 technomancy: haha wow

15:03 biggbear: bbloom: are you the kid teaching?

15:03 bbloom: that's just the most recent cool thing to grace my inbox

15:03 technomancy: there's so much news/press/excitement, it's just too cool

15:03 like absurdly excited little girls: http://www.youtube.com/watch?v=e_t3-3vPp-g

15:04 biggbear: http://code.org

15:04 algal: "They used to call it magic. Today we call it information" :)

15:05 seangrove: bbloom: Looks like you need to work on loading times :)

15:06 bbloom: seangrove: lol i think she was just too excited & mis-tapped the safari icon :-P

15:07 algal: bbloom: has Papert's Mindstorms etc. influenced the instruction design? or not so much?

15:07 hyPiRion: how do you even get that sort of domain? Crazy lucky.

15:08 That's what the only thing I wonder about. I have weird priorities.

15:08 algal: I've been visiting public elementary schools in SF and it's sad how unimaginative they are about use of computers.

15:08 bbloom: algal: technomancy & others were discussing mindstorms in here a few days ago. i just wrote javascript/ruby/etc, leave the education design up to the professionals :-)

15:09 `cbp: you can hack mindstorms with clojure? or is that not related?

15:10 bbloom: but i can say that the feedback has been exceptionally positive for the pacing & presentation of our tutorials in particular. some of our learning partners, especially those teaching javascript or freeform ones with out goals, have much lower success rates

15:10 algal: `cbp: Lego mindstorms != Papert mindstorms.

15:10 bbloom: `cbp: not lego

15:10 technomancy: it's definitely indirectly influenced by mindstorms

15:10 logo -> scratch -> blockly -> code.org

15:10 algal: bbloom: Very cool.

15:10 `cbp: oh, I got excited for a bit

15:15 algal: bbloom: btw, I really liked your presentation on concatenative clojure. saw it online. very eye-opening.

15:15 bbloom: algal: thanks! glad you liked it

15:19 bitemyapp: ~APL

15:19 clojurebot: APL is a comonad

15:19 bitemyapp: ~concatenative is a comonad

15:19 clojurebot: 'Sea, mhuise.

15:21 algal: bitemyapp: Has someone really configured "~" to call its argument a comonad?

15:21 ~algal

15:21 clojurebot: No entiendo

15:23 pjstadig: algal: "~" is just how you get clojurebot's attention

15:23 danneu: Does anyone implement the ol *current-user* concept in a different way than to use a dynamic var?

15:23 TimMc: You're a comonad.

15:23 bbloom: bitemyapp: no, it really isn't stop that

15:24 bitemyapp: even if it was a comonad, it's not a useful thing to consider

15:24 jcromartie: survey: mustache (clostache etc.) vs hiccup?

15:24 TimMc: Is a comonad like a coburrito?

15:24 jcromartie: or a cronut?

15:24 bitemyapp: TimMc: kinda.

15:24 algal: it's like a co writing desk.

15:24 TimMc: jcromartie: Hiccup is unsafe by default, so there's that.

15:25 danneu: hiccup for sure

15:25 TimMc: (Mustache HTML-encodes data unless you ask for an exception.)

15:26 Someone made a safe version of Hiccup, although I can't remember who.

15:26 seangrove: Big fan of hiccup

15:26 coventry: TimMc, algal: http://trevorjim.com/the-monadic-morass/

15:27 teslanick: Googling turned up nothing -- why is hiccup unsafe?

15:27 bitemyapp: coventry: monads aren't a turing tarpit, lol.

15:27 rovar: how can I get tests to work via fireplace?

15:27 bitemyapp: coventry: monads aren't some limited language researchy thing, they're used to build reusable software components.

15:27 rovar: I'm trying to work through the intro to fireplace and I'm stuck there..

15:27 bitemyapp: a regrettable article written from ignorance.

15:28 TimMc: teslanick: If the data you're dumping into hiccup is "<blink>", hiccup will happily include that in your HTML.

15:28 xeqi: teslanick: you have to manually escape strings

15:28 jcromartie: I like the *idea* of mustache, and yeah I don't like the unsafe-by-default hiccup

15:28 xeqi: TimMc: https://github.com/ato/clojars-web/blob/master/src/clojars/web/safe_hiccup.clj is the additions we use in clojars to make escape by default

15:28 TimMc: I don't undersatnd why people keep writing HTML templating or generation libs that fuck this up.

15:29 teslanick: Ah, the XSS problem.

15:29 xeqi: though it does escape more then it needs to, we just don't use those parts

15:29 bitemyapp: TimMc: Selmer gets it right by default.

15:29 TimMc: I'm glad to hear that.

15:30 So does Enlive, and, I think, Laser.

15:30 bitemyapp: Hrm. I should ask Raynes.

15:30 jcromartie: I don't really like any of the Clojure mustache libs, and I have failed at several attempts at writing my own due to the insanity of parsing Mustache with the set-delimiter directive

15:30 Raynes: bitemyapp: https://www.youtube.com/watch?v=WkNGf_NPM78

15:30 Hi.

15:30 bitemyapp: TimMc: Selmer is the only *fast* and nice to use templating library that gets it right :)

15:30 Raynes: hi!

15:30 jcromartie: maybe I'll try selmer too :)

15:30 right now this app uses clostache AND hiccup

15:30 bitemyapp: jcromartie: highly recommend it.

15:30 Raynes: So what are you asking me about?

15:30 Escaping?

15:31 bitemyapp: Raynes: yeah, how does Laser do it?

15:31 xeqi: I thought everyone was using cljs+react now :p

15:31 TimMc: Raynes: Laser, does it fuck up escaping?

15:31 danneu: hiccup is a unique opportunity to do something you just can't/don't do in other languages/stacks.

15:31 bitemyapp: danneu: er, no.

15:31 jcromartie: true

15:31 Raynes: Laser escapes strings by default. You can wrap strings in an Unescape type if you want them to not be escaped.

15:31 bitemyapp: danneu: that was already a thing in Common Lisp with CL-WHO

15:31 danneu: oh come on

15:31 TimMc: Raynes: Good, good.

15:31 Raynes: That's what my hickory fork allows for.

15:31 danneu: captain technical

15:31 TimMc: danneu: Yes, and I like the general shape of Hiccup for some tasks, but this one flaw is pretty serious.

15:31 bitemyapp: TimMc: so, sounds like Laser works on roughly the same basis as Selmer. Escape by default, mark for unescaped on a case-by-case basis.

15:32 danneu: pardon me for being a grumpy old Lisper, just saying.

15:32 alew: justin_msith: you mentioned caribou. I've been thinking of switching to it from composure and making use of the model stuff

15:32 bitemyapp: compojure*

15:32 justin_smith: alew: I won't try to convince you not to :)

15:33 pcn: Does anyone know of libraries that make interacting with the filesystem easier? I'd like to have access to stat, link, unlink, and some other stuff.

15:33 Raynes: bitemyapp and I are secretly the same person.

15:33 bitemyapp: pcn: fs

15:33 danneu: pcn: Raynes has this fs lib.

15:33 Raynes: Our real name is Jason and we have multiple personality disorder, clearly.

15:33 justin_smith: alew: be sure to check out the docs, they are pretty extensive. If you have questions that are caribou specific we hang out on #caribou

15:33 bitemyapp: Raynes: no we don't

15:33 pcn: thanks

15:34 bitemyapp: Raynes: ssshhh don't tells thems

15:34 Raynes: <3

15:34 danneu: TimMc: is the issue that you have to opt-in to escaping user input instead of opting in to unescape it?

15:34 TimMc: Exactly.

15:35 Raynes: pcn: danneu is correct, I do has this fs lib. It may have things you want in there.

15:35 arrdem: Raynes: http://i.imgur.com/qYNFUyF.gif

15:35 TimMc: And users will always get this wrong in at least one location, and then Samy comes in the night and crashes your site.

15:35 Raynes: pcn: There is also conch if you'd like to just shell out. That works too.

15:35 I got whachu need, brah. Take your pick.

15:36 bitemyapp: pcn: the entire Clojure community is actually just Raynes and technomancy. There are no other creators of libraries.

15:36 TimMc: And ztellman. I think ztellman is a separate person.

15:36 jcromartie: ztellman is an AI

15:36 bitemyapp: TimMc: yeah but he's in another dimension.

15:36 jcromartie: but legally a person

15:37 bitemyapp: jcromartie: glasses-wearing AI

15:37 Raynes: My new profile pictures: http://fc00.deviantart.net/fs70/i/2011/288/7/6/deal_with_it___rainbow_style__by_j_brony-d4cwgad.png

15:37 TimMc: I don't think I even need to click on that.

15:37 danneu: TimMc: since there are solutions for it, it doesn't seem like it should have much clout in one's decision

15:37 arrdem: TimMc: the URL does say it all

15:37 bitemyapp: Raynes: <3

15:38 danneu: besides, cowboy coders don't care

15:38 ztellman: bitemyapp: you figure my designers would have gotten my eyes right, but alas

15:38 TimMc: danneu: Unless I'm mistaken, xeqi didn't monkeypatch hiccup, it's an outright fork.

15:39 That means it's not even hiccup, it's a less-maintained thing that used to be hiccup.

15:40 danneu: it's just a redef of the html5 macro

15:41 i do like that form-to redef though that bakes in the anti-forgery-token input

15:41 *yoink*

15:42 TimMc: Ah, OK.

15:44 danneu: oh yeah, there's even hiccupy syntax for css https://github.com/noprompt/garden

15:44 Raynes: noprompt is a bro.

15:44 <3

15:45 danneu: i used to think flask/sinatra/express were minimal. but now i use that weavejester/noprompt stack

15:48 bitemyapp: Raynes: yes he is.

15:49 Raynes: a MENSCH as they say.

15:49 mdrogalis: Raynes: Someone saw that I added 'fs' to a project and asked about when I "added this raynes stuff in"

15:49 You're basically a library now.

15:50 Raynes: lol

15:50 bitemyapp: but a library with hopes and dreams.

15:51 mdrogalis: A library that throws a nio class cast exception on Java 6. Bad Raynes

15:52 Raynes: mdrogalis: Pretty sure that was fixed in a more recent version.

15:52 But the plan was to deprecate Java 6 support in the next major version.

15:52 mdrogalis: Raynes: Ah, it wasn't my problem, and I could care less about Java 6 support. So good.

15:53 Raynes: It's just that the nio stuff is pretty nice. It's hard to ignore when Java releases are moving so fast these days :p

15:53 mdrogalis: Yeah, no fault there for sure.

16:01 sveri: hi, how can i refer from one leiningen project to another leiningen cljs-build?

16:04 bitemyapp: technomancy: the answer to the shopping cart thing is that Amazon does a set union when they need to resolve a conflict

16:05 which explains that one time I had an item in my shopping cart I couldn't seem to delete.

16:05 technomancy: bitemyapp: when in doubt, go with the answer that makes the company more $$$

16:06 bitemyapp: technomancy: yeah I found it a cute, but sensible solution.

16:07 dnolen: sveri: what do you mean?

16:09 sveri: dnolen: i have to projects, both are clojurescript projects and i want to include one project into the other during development and build time, just like i would use one clojure lib in another clojure library

16:09 *two

16:10 dnolen: sveri: oh, might be possible, but I don't know myself.

16:10 sveri: dnolen: ok, thank you :-)

16:16 OscarZ: if i have a recursive function, a kind of tree traversal thingy that may make two recursive calls to itself in some cases, is it possible make the two calls run in parallel if there are cores available?

16:17 justin_smith: OscarZ: sounds like reducers http://clojure.com/blog/2012/05/08/reducers-a-library-and-model-for-collection-processing.html

16:19 OscarZ: thanks

16:19 justin_smith: OscarZ: or you could express it as go blocks that send their results to a shared input channel

16:19 technomancy: sveri: you mean :dependencies?

16:19 OscarZ: might be too advanced stuff for me at this point :)

16:19 patchwork: Getting intermittent errors about "too many arguments to def"

16:19 I run it one time, no errors

16:20 next, error

16:20 What is that about?

16:21 justin_smith: sounds like an evil macro!

16:21 are you using defonce with a docstring?

16:22 patchwork: Not me!

16:23 amalloy: patchwork: using def with a docstring pre-1.3?

16:24 gfredericks: amalloy: that wouldn't be intermittent

16:25 amalloy: gfredericks: intermittent is so vague. maybe he's running lein test, in a project which runs tests on all clojure version in a nondeterministic order

16:25 patchwork: amalloy: That is the error. So it seems it is intermittently pulling in pre 1.3, then on next boot post 1.3?

16:25 amalloy: Typing > lein run each time

16:25 justin_smith: sounds like a job for lein pedantic / exclusions

16:25 patchwork: No multiple versions

16:26 So: lein run — too many arguments to def

16:26 Next: lein run — *boots fine*

16:26 technomancy: yeah definitely drop a pedantic in there

16:26 gfredericks: (if (zero? (rand-int 2)) (eval '(def foo bar baz bang bapiew)))

16:27 justin_smith: lol

16:27 technomancy: bapiew? were you raised by wolves?

16:27 the correct metasyntactic variable is "quux"

16:28 justin_smith: my goto metasyntactic is ☃

16:29 technomancy: kids these days

16:29 TimMc: quux quuux quuuux

16:29 justin_smith: 😼

16:29 gfredericks: clojurebot: bapiew is wolfspeak for quux

16:29 clojurebot: Roger.

16:30 TimMc: That's a nice little time bomb of surreality.

16:30 gfredericks: that's a good summary of most of my interaction with clojurebot

16:30 coventry: patchwork: I would try putting a clojure.tools.test/trace-var on (def) at the entry point of lein run. Don't know whether that works, though.

16:30 technomancy: that's clojurebot's whole purpose for existence

16:31 gfredericks: ~that

16:31 clojurebot: that is dumb

16:31 gfredericks: ~this

16:31 clojurebot: this is not a bug

16:31 gfredericks: ~what

16:31 clojurebot: what is cells

16:31 justin_smith: ~wat

16:31 clojurebot: It's greek to me.

16:31 technomancy: ~why

16:31 clojurebot: technomancy: because you can't handle the truth!

16:31 justin_smith: ~greek

16:31 clojurebot: Excuse me?

16:31 gfredericks: ~technomancy

16:31 clojurebot: technomancy is <jweiss> oh man this sucks, why didn't anyone warn me about protocols

16:32 technomancy: ~how

16:32 clojurebot: with style and grace

16:32 gfredericks: ~wherefore

16:32 clojurebot: excusez-moi

16:32 justin_smith: ~when

16:32 clojurebot: I don't understand.

16:32 technomancy: hard to argue with that one

16:32 pjstadig: ~suddenly

16:32 clojurebot: BOT FIGHT!!!!!111

16:32 pjstadig: bah

16:32 gfredericks: ~lazybot

16:32 clojurebot: lazybot is echo ~lazybot

16:32 gfredericks: ~sexpbot

16:32 clojurebot: sexpbot is not a clojurebot

16:32 justin_smith: ~~

16:32 clojurebot: Cool story bro.

16:32 technomancy: ~when is for side effects

16:32 clojurebot: In Ordnung

16:33 pjstadig: technomancy: haha!

16:33 keep the dream alive, my friend

16:33 sveri: technomancy: basically, yes, but i mean clojurescript dependencies

16:33 technomancy: sveri: sure. what's the problem though?

16:34 justin_smith: ~whither

16:34 clojurebot: It's greek to me.

16:34 technomancy: ~whence

16:34 clojurebot: Excuse me?

16:34 sveri: technomancy: i wonder if its possible, and if, do i do it just like i add a clojure dependency

16:34 technomancy: ~tias

16:34 clojurebot: Try it and see! You'll get results faster than asking someone in #clojure to evaluate it for you, and you'll get that warm, fuzzy feeling of self-reliance.

16:34 pjstadig: ~dont

16:34 clojurebot: No entiendo

16:35 justin_smith: ~whither is let bindings or function args are best, then vars, finally dynamic vars

16:35 clojurebot: Ok.

16:35 justin_smith: "to what place or state"

16:36 technomancy: clojurebot: whether tis better to suffer the slings and arrows of outrageous monads

16:36 clojurebot: Titim gan éirí ort.

16:36 technomancy: get it? arrows? eeeeeeh.

16:36 * technomancy elbows clojurebot

16:36 sveri: technomancy: was that hint for me?

16:36 justin_smith: lol

16:36 technomancy: sveri: right-o

16:37 justin_smith: Generalized Abstract Nonsense is the best source of humor material

16:37 sveri: :D it took me a while to get it :D thank you, i try it

16:37 technomancy: oh no cartesian closed comic is offline D=

16:39 gfredericks: it is?

16:39 jweiss: hah, technomancy's definition is from met complaining about protocols. something about reloading the definition of a protocol causing class mismatches :)

16:40 *me

16:42 justin_smith: yup, that is what sucks about protocols

16:42 macros have similar issues

16:42 redefining them does not redefine the things that already used them

16:43 gfredericks: macro-driven development is a hard life

16:50 bitemyapp: I would rather like it if Mac OS X would stop breaking my applications when I unlock my computer.

16:51 justin_smith: that sounds really weird

16:55 bitemyapp: justin_smith: it's pretty weird.

16:55 I end up having to kill and restart a bunch of stuff.

16:57 justin_smith: what are the symptoms?

16:59 bitemyapp: justin_smith: they shove up to the top of the screen, taking all the horizontal width, and about 1/4 of the vertical span

16:59 they are responsive in some sense, but the rendering of the window is frozen and I have to cmd-q and restart to make them work again

17:01 justin_smith: Why can't anybody do displays right. I bet it has to do with the code for recognizing and using monitors as they are plugged in.

17:01 jcromartie: yeah I really don't get it. particularly on Linux

17:01 graphics cards are scary beasts

17:02 justin_smith: jcromartie: now that I grok xrandr I would not enjoy having to use systems that do not provide that utility

17:02 technomancy: intel cards <3

17:02 just works

17:02 justin_smith: a single command line to use / ignore / rotate an external display, eminantly shell-scriptable

17:02 technomancy: how frequently do you use multiple monitors?

17:03 technomancy: every day?

17:03 I don't do rotation though

17:03 jcromartie: I'd love to use the output on my thinkpad, which has Nvidia/Intel setup

17:03 I have to run the Nvidia card to get output

17:03 but I have to run Intel to get more than 40 minutes of battery life :|

17:06 bitemyapp: justin_smith: xrandr has been pretty good to me on my Thinkpad.

17:06 technomancy: so nix. How do I install/search packages?

17:06 justin_smith: technomancy: I don't do rotation either on a regular basis, I was using it as an example that more advanced functionality was also there in the command. One of these days I want to try the zoom/pan multi-monitor setup, where one monitor is the entire "display" scaled down, and the other is a zoomed in region following the mouse

17:06 bitemyapp: technomancy: the documentation hasn't been kind to me.

17:08 technomancy: bitemyapp: `nix-env -qa emacs`

17:08 ^ to search

17:08 `nix-env -i emacs-24.3` <- to install

17:09 bitemyapp: error: getting information about `/Users/callen/.nix-defexpr': No such file or directory

17:09 technomancy: I tried figuring out what it wanted me to do to finish bootstrapping the env but it referenced files I couldn't find.

17:10 nix is written in C++? Brave.

17:10 technomancy: bitemyapp: yeah there's some crazy NIH going on there

17:11 I wish they had gone the https://www.gnu.org/software/guix/ route from the start

17:11 (haven't tried guix yet; it looks more pleasant but probably a bit less polished)

17:14 I really should try it

17:18 bitemyapp: technomancy: I don't want to use Guile :(

17:19 coventry: Funny, I've just been playing with nix today too.

17:33 pcn: This has go to to be well known. How am I getting "IOException Stream closed java.io.BufferedWriter.ensureOpen (BufferedWriter.java:98)" using with-open and a for loop to write data to th efile.

17:35 stuartsierra: pcn: `for` is lazy

17:36 pcn: Ah, yeah, I just get that while works for that. Hmm..

17:37 technomancy: bitemyapp: you'd prefer a weird one-off language?

17:45 bitemyapp: technomancy: you know what I prefer *_*

17:46 technomancy: bitemyapp: there's a disturbing amount of perl in nix =\

17:47 #fivewordtechhorrors or whatever

17:48 bitemyapp: not surprised.

17:55 pcn: So what's an idiomatic way to deliver a list to an open file, not using spit?

17:55 Can while bind?

17:57 coventry: >pcn: You can use (for [bindings :while (test)] body) for that.

17:59 Oh, didn't see your first message. To send to a file, use doseq instead of for.

18:00 pcn: Ah, I was going to ask about un-lazifying it. I'll try doseq.

18:11 So https://gist.github.com/pcn/7937204

18:12 cark: anybody here having a bit of experience running a cljs repl on node-webkit ?

18:13 i got the repl working, but the document element being referenced is the iframe for the repl rpc, i have no clue on how to acccess the top-level repl

18:13 i mean top level document

18:15 justin_smith: cark: sounds like a xss security thing

18:15 cark: everything is local

18:15 but yes, i think it's forbidden for an ifram to access anything else

18:16 justin_smith: yeah, just because this is all the same host, does not mean xss security measures can'

18:16 t affect it

18:16 cark: oh, node-webkit is loading it's data from file, so yes must be xss problem

18:16 justin_smith: damn fat fingers hitting too many keys at once

18:17 cark: so i guess i should serve the files and access these via http at least for developement

18:17 that sounds right, thanks !

18:18 justin_smith: np

18:21 TimMc: S11001001: Are you at the meetup?

18:22 S11001001: TimMc: I'll be leaving for it soon

18:22 TimMc: OK, I think the times on the meetup site are wrong.

18:23 I got here at 6:00, but Eric's not here yet.

18:23 It seems to still be on, though.

18:23 S11001001: 6 isn't the right time :)

18:23 TimMc: hrmph :-)

18:23 S11001001: 6:30's the meet/greet, 7's the "official" start

18:24 here we go

18:39 pcn: TimMc: what town are you guys in?

18:42 TimMc: pcn: Cambridge/Boston, MA

18:42 (By the way, the meetup was in fact supposed to start at 6:00 PM.)

18:44 amalloy: good news! if you're living on a sensible coast, it's not 6PM yet

18:48 pcn: So you're still at work :)

18:51 slpsys: " "

18:58 Raynes: amalloy: I don't understand the east coast.

18:59 I picture it as kind of a swamp. All of it.

18:59 amalloy: pcn: happily unemployed!

18:59 Raynes: :p

19:00 But the beach is still there.

19:00 pcn: amalloy: can't find any problem with it if you're happy!

19:02 TimMc: Raynes: This is correct.

19:02 amalloy: checkmate, east coast

19:20 * pcn concedes

19:20 bitemyapp: oh my god I just spent like 5 hours jumping between helping 4 different people

19:20 I want to curl up in a ball now.

19:20 * pcn puts on the hip waders.

19:20 * pcn wades out to the subway in the swamp

19:21 * Raynes holds bitemyapp

19:21 Raynes: s'okay buddy

19:22 bitemyapp: Raynes: I like helping people but if I don't get some music and code in my life I will shrivel up and die.

19:22 rovar: is it possible to use a chan as a key in a map?

19:22 bitemyapp: rovar: don't.

19:22 rovar: ok

19:22 bitemyapp: rovar: don't pretend channels are reified "things"

19:23 rovar: they might be in some cases, but often aren't.

19:23 rovar: rgr that

19:23 bitemyapp: the current state of reification is a value-oriented convenience but don't take it beyond that.

19:24 bbloom: rovar: it's perfectly possible

19:24 bitemyapp: rovar: why'd you want to do that anyway? curious idea.

19:24 rovar: making a multi-user websocket server

19:24 bitemyapp: I could see it making sense for a chan to be a value, but not a key.

19:24 bbloom: i also don't think it's as bad a plan as bitemyapp suggests

19:24 amalloy: really? i'd expect channels to have identity equality

19:24 bitemyapp: amalloy: they do

19:24 bbloom: amalloy: they do

19:24 amalloy: seems perfectly sensible to use them as keys in a map

19:24 bbloom: agreed

19:24 * bitemyapp scrunches faces

19:25 bitemyapp: s/faces/face/g

19:25 bbloom: especially with (alts! (keys ..

19:25 amalloy: i think it's totally plausible that you're just running around the room scrunching everyone's faces

19:25 rovar: its either I use the channel to associate all of the rest of the metadata.. or I generate a unique string that represents that connection, and hand that back to the client

19:25 technomancy: amalloy: he didn't sp.ecify what he was helping 4 different people with

19:25 rovar: the first approach is just much simpler, but not as fault tolerant.

19:26 bitemyapp: technomancy: clojure and datomic

19:27 the clompire spreads here.

19:30 emp-jure?

19:31 technomancy: please set LEIN_IRONIC_CLO to continue

19:41 bitemyapp: bbloom: I see you re-followed me on the twattles. What inspired that?

19:42 bbloom: bitemyapp: i only really unfollowed you for a gag & then you showed up on my "interactoins" page, so i clicked the follow button :-P

19:43 bitemyapp: bbloom: <3

19:44 Raynes: bitemyapp is good peoples.

19:44 noprompt: #1983

19:44 Raynes: noprompt: Hi!

19:44 noprompt: Raynes: :-)

19:45 bitemyapp: my internet tanked last night. there was comcast blackout. :(

19:45 mysamdog: Both dommy and dommina do not appear to work for me

19:45 I mean, append! and stuff works, but listen! doesn't

19:46 bitemyapp: noprompt: is it back up?

19:46 Raynes: that is a lie.

19:46 kendallbuchanan: I have a question about the robert-hooke library: I'm wondering if a particular use-case I have is taking it too far. Anyone used it before?

19:46 noprompt: bitemyapp: yeah, but i'm at work for the next hour or so atm.

19:47 bitemyapp: Raynes: http://www.youtube.com/watch?v=omSeE9Ku9lM

19:47 rovar: so how might I force an evaluation of chan to put it in a map to test?

19:47 bitemyapp: noprompt: sure, just trying to schedule.

19:47 rovar: { (chan

19:47 Raynes: bitemyapp: I think I just died https://www.youtube.com/watch?v=jlSF0dtDRD8

19:47 rovar: meh

19:47 { (chan) "channel 1" (chan) "channel 2" }

19:48 results in a duplicate key: (chan)

19:48 bitemyapp: rovar: only way to access that if you define it that way is (keys ...)

19:48 Raynes: listening to the cotton story, it's hilarious.

19:48 noprompt: bitemyapp: yah, i'm stoked. i'm super rusty and basically back at the n00b level but this'll be good.

19:48 bbloom: ,{(gensym) 1 (gensym) 2}

19:48 clojurebot: #<IllegalArgumentException java.lang.IllegalArgumentException: Duplicate key: (gensym)>

19:48 bitemyapp: noprompt: it's fine.

19:48 bbloom: heh, well would you look at that?

19:48 seems like a bug to me

19:49 rovar: bitemyapp, yea, I was just testing to see if it would work

19:49 that approach obviously didn't :)

19:50 arrdem: <3 anamanaguchi

19:50 noprompt: lol

19:50 arrdem: it's allabout virt.

19:51 bitemyapp: rovar: let

19:51 arrdem: noprompt: will investigate

19:51 bbloom: technomancy: http://cardenas.house.gov/media-center/press-releases/c-rdenas-416d65726963612043616e20436f646520

19:51 arrdem: once I finish my anual AW YEAH TSO phase

19:52 swarthy: sandbar or friend?

19:52 bitemyapp: bbloom: good to see our congressmen are still figuring out ways to destroy the middle class >:D

19:52 technomancy: bbloom: thought it was a uuid at first

19:52 rovar: that worked..

19:52 bitemyapp: rovar: good.

19:53 bbloom: bitemyapp: that's the most cynical point of view, it's frankly idiotic

19:53 bitemyapp: bbloom: you're assigning a value judgment that isn't there.

19:53 bbloom: commoditization of knowledge and labor is the natural order with a society organized the ways ours is. It's a good thing.

19:54 bbloom: however, due to forces unrelated to software, it contributes to the weakening of the middle class. Hopefully a smarter labor force will outweigh the negatives.

19:54 noprompt: arrdem: virt fx1, fx2, fx3 <3

19:54 bbloom: technomancy: i'm concerned that the act will fail b/c nobody will want to type in that hexadecimal string all the time :-P

19:55 bitemyapp: bbloom: why would people type it in?

19:55 manually, that is.

19:55 bbloom: bitemyapp: your sense of humor is broken

19:56 arrdem: bbloom: there is an open issue somewhere..

19:56 bitemyapp: bbloom: well, I know that, but do you?

19:57 Apage43: whats with the trailing space tho

19:58 noprompt: :-(

19:58 bbloom: Apage43: it's an intentional bug to teach children about the perils of append-only code bases such as our laws

19:58 i hope.

19:59 oh wow: https://pay.reddit.com/r/programming/comments/1sqnj7/416d65726963612043616e20436f646520/ce0b9vy

19:59 technomancy: I'll see your Japan Air and raise you a Meow: http://www.youtube.com/watch?v=vc3JWo2iiGc#t=167

19:59 oops; http://www.youtube.com/watch?v=vc3JWo2iiGc

20:00 coventry: No way a congressman wrote a reddit post that cool without assistance.

20:01 Bronsa: bbloom: re: {(gensym) 1 (gensym) 2} -- that's throwing at read-time, I don't see a way to "fix" that

20:01 bbloom: Bronsa: you could not count unquoted lists as duplicate keys

20:02 Bronsa: bbloom: what about {[(gensym)] 1 [(gensym)] 2} then?

20:02 amalloy: bbloom: but it's not a legal map. how would you work with it?

20:02 (get m (first (keys m))) ;; what can this possible return?

20:02 hiredman: arraymap used to not check duplicates so you could do things like that, but everyone complained

20:02 Bronsa: amalloy: it'd be legal at runtime, it's not at read-time

20:03 bbloom: just goes to show how silly little things like a duplicate check can be hard :-P

20:03 noprompt: i'm glad i don't follow politics.

20:03 amalloy: Bronsa: i know, and the compiler has to work with it at read time

20:03 Bronsa: I guess the compiler could use create instead of createWithChecking or whatever they're called

20:03 bitemyapp: noprompt: good idea.

20:03 Bronsa: amalloy: the compiler really doesn't care AFAIKT, it's only an artifact of the reader

20:05 Apage43: bbloom: oh. huh.

20:05 hiredman: anyway, I think enforcing valid datastructures at read and at runtime is for the best

20:07 bitemyapp: hiredman: true Lispers shove everything to runtime and write a bunch of error handling code.

20:07 coventry: Could the reader transform map literals into hash-map calls?

20:08 I guess that would get messy for ^{} metadata annotations.

20:09 arrdem: aaaand we've reinvented reader macros..

20:10 coventry: Not at all.

20:10 Bronsa: ,'`{1 1}

20:10 clojurebot: (clojure.core/apply clojure.core/hash-map (clojure.core/seq (clojure.core/concat (clojure.core/list 1) (clojure.core/list 1))))

20:13 coventry: Yes, but that still fails on '`{G__# 1 G__# 2}. If the literal were transformed to (hash-map G__# 1 G__# 2), it would give sensible results, at least in this case, and duplicate keys would still fail at runtime.

20:14 Bronsa: coventry once you hit the reader, it's already too late.

20:14 coventry you'd have to use a parser as opposed to a reader if you wanted that to work

20:18 mysamdog: Okay, so I have this code:

20:18 (ns soar.site

20:18 (:require [domina :as dom]

20:18 [domina.events :as ev]))

20:18 (defn test []

20:18 (dom/append! (dom/by-id "content") "<p>Test Successful</p>"))

20:18

20:18 (defn ^:export init []

20:18 arrdem: mysamdog: PASTE PASTE PASTE

20:18 mysamdog: (if (and js/document

20:18 (.-getElementById js/document))

20:18 (ev/listen! (dom/by-id "Home") :click test)))

20:18 technomancy: ~gourds

20:18 * arrdem facepalms

20:18 clojurebot: SQUEEZE HIM!

20:19 mysamdog: sorry, probably should have put that on refheap

20:19 swarthy: mysamdog: try http://refheap.com instead

20:19 beat me

20:19 mysamdog: I figured it was short enough to just paste it, but then the formatting got screwed up

20:19 arrdem: unless it's a one-liner never paste

20:19 mysamdog: Good to know.

20:20 arrdem: *in channel

20:20 mysamdog: Anyway, So I'm trying to make that code append <p>Test Successful</p> to a div with id "content" when the button with id "Home" is clicked

20:21 coventry: Bronsa: What breaks if you change the (RT/map (to-array the-map))) line in tools.reader/read-map to something like (list* 'hash-map the-map)? You'd need to extend read-meta to detect such a list and try to convert it to a map at that point.

20:21 mysamdog: The part that appends the <p> works when I call it from the console, but not when the button is clicked.

20:22 bitemyapp: noprompt: so that I know when to head home, when are we hacking?

20:22 mysamdog: Here's my html: https://www.refheap.com/21703

20:22 I had the exact same problem when I used Dommy

20:22 bitemyapp: mysamdog: Selmer user?

20:23 noprompt: bitemyapp: i'm gonna work for probably another 30mins here and then head back home. i should be down to hack by no later than 7pm.

20:23 Bronsa: coventry I understand what you're saying, but then what you're doing is no longer reading, it's parsing & transforming

20:23 bitemyapp: noprompt: okie-dokie. I'll give some thought as to how we pair digitally.

20:23 coventry: Bronsa: and it's important to maintain that distinction for the sake of simplicity?

20:23 mysamdog: Yeah, I use Selmer

20:24 One sec, I'll put the code that generates the html on refheap

20:24 bitemyapp: NOOOOOOOOOOOOOO

20:24 technomancy: why is floobits on MELPA?!

20:24 those fucking madmen

20:24 noprompt: bitemyapp: i expect you'll be driving for the majority of the session. mostly i plan to ask questions. beside you don't wanna see me squirm w/o my evil-mode keybindings. :-)

20:24 bitemyapp: don't they know what they're asking me to doooooooooo

20:24 noprompt: all the same.

20:25 I was thinking voice/skype + floobits or something.

20:25 mysamdog: Oh wait. I uploaded that. I meant to give you the one that the browser sees, after selmer parses it

20:25 One sec

20:25 bitemyapp: noprompt: if we use floobits you use your native environ.

20:25 and I use mine.

20:25 noprompt: wow

20:25 bitemyapp: that's uh, the point.

20:25 coventry: Oooh. Floobits looks incredibly useful. Thanks.

20:25 noprompt: that sounds pretty cool.

20:25 bitemyapp: noprompt: https://floobits.com/ technomancy reminded me it existed last night after dinner.

20:25 Bronsa: coventry AFAIK a lisp reader is just a special-case of a parser, whose special-ness is that it "outputs" the data it reads-in into its internal representation, if you take that away.. it's no longer a reader

20:25 bitemyapp: good timing on his part.

20:26 mysamdog: https://www.refheap.com/21704

20:26 bitemyapp: technomancy: see, this MELPA installation, this is why I end up vendoring everything.

20:26 arrdem: bitemyapp: vendoring?

20:27 bitemyapp: arrdem: the reason I have 400,000 LOC in my .emacs.d

20:27 arrdem: I vendor 90% of the code I use.

20:27 because I have zero patience for things breaking.

20:28 floobits-summon and floobits-join-workspace <--- cool.

20:28 noprompt: so yah, get a floobits account.

20:28 then we'll rock.

20:28 coventry: Bronsa: OK. I'm curious about why you want a reader as opposed to a parser, though.

20:28 * noprompt ♫ you go back, jack, do it again ♫

20:28 technomancy: bitemyapp: node.js, man

20:29 bitemyapp: noprompt: free plan has zero private workspaces, but this works fine, it's open source work anyway.

20:29 Bronsa: coventry: I don't. It's the Lisp Way™ though.

20:29 bitemyapp: This is wicked if it ends up working

20:30 arrdem: noprompt: do like.

20:30 noprompt: arrdem: such a killer song.

20:30 coventry: Maybe I'll submit a patch to LispReader.java, then.

20:30 mysamdog: So, uh, any thoughts on what's wrong with my code?

20:30 bitemyapp: we live in the future!

20:30 Bronsa: coventry I doubt it'll ever make through

20:31 bitemyapp: mysamdog: I see HTML, not code. What's breaking and what's the code?

20:31 mysamdog: include more context in your refheap, it helps people to help you faster.

20:31 coventry: Bronsa: Because of the reader/parser distinction?

20:31 arrdem: bitemyapp: pair editing over shared VTTY has been a thing for over a decade...

20:31 bitemyapp: arrdem: floobits isn't VTTY

20:31 arrdem: did you look at it?

20:31 technomancy: yeah the whole point of floobits is just that you can pair with vim users

20:32 bitemyapp: arrdem: each person works in their native environment.

20:32 arrdem: bitemyapp: yes I saw how floobits works, and it's awesome. I'm just making the point that remote pair work isn't new.

20:32 coventry: Can you share a repl/interactive python buffer in floobits?

20:32 technomancy: emacs:emacs floobits doesn't make a lot of sense

20:32 bitemyapp: arrdem: that's not the part that makes it the future, it's the cross-client part.

20:32 technomancy: what's the name of the emacs native one?

20:32 technomancy: bitemyapp: rudel

20:32 well

20:33 it's not emacs-native

20:33 mysamdog: Here's the .cljs file: https://www.refheap.com/21705

20:33 bitemyapp: technomancy: but it was made for emacs.

20:33 technomancy: bitemyapp: but the only other implementation is gobby, which is a pretty lame editor

20:33 no

20:33 bitemyapp: oh, wow.

20:33 mysamdog: And I'll go get the last 500 lines of the .js file I get

20:33 technomancy: gobby implemented the protocol first

20:33 bitemyapp: technomancy: weird.

20:33 Bronsa: https://floobits.com/code_roulette/ so sad.

20:34 noprompt: bitemyapp: so are we using this thing or not?

20:34 mysamdog: Here's the last 500 lines of my js: https://www.refheap.com/21706

20:34 technomancy: I'd rather be using rudel than floobits, but it's not supported by vim

20:35 noprompt: technomancy: if it supports emacs that's good, i just use the evil-keybindings.

20:35 technomancy: noprompt: if you're willing to do that just use tmux =)

20:35 much easier to share shells/repls that way

20:36 noprompt: technomancy: so am i to understand floobits won't be a good solution here?

20:36 bitemyapp: noprompt: if I can figure it out, yes.

20:37 technomancy: I don't use evil mode, he does.

20:37 technomancy: right, but you can toggle that with a single binding

20:37 noprompt: technomancy: which i have w/ key-chord

20:38 technomancy: different strokes for different folks; use whatever works for you

20:38 bitemyapp: I don't have a key combo for it. I could add one.

20:38 technomancy: I mostly just want to test floobits. We've discussed how I want to hammer out processes for remote working at my company.

20:38 vim and sublime text are popular with my coworkers.

20:38 noprompt: the haskell mode indention has to be tweaked for evil-mode.

20:38 bitemyapp: noprompt: lol fuck that then

20:38 using my editor. I like my smart ident.

20:39 noprompt: bitemyapp: nah all you have to do is turn it off.

20:39 (setq evil-auto-indent nil)

20:39 bitemyapp: I'll set it in my haskell-config JIC then

20:41 noprompt: bitemyapp: other than that i'm pretty happy w/ the basic rollout. i won't demand any of my other fancy stuff.

20:41 technomancy: btw, how do i get recentf files to show up when i use switch-buffer?

20:41 technomancy: i'm being lazy.

20:42 technomancy: noprompt: ido-use-virtual-buffers

20:42 unfortunately uniquify doesn't work on the recentf buffers =(

20:43 but pretty handy apart from that

20:43 bitemyapp: Raynes: I'm telling people to use Tentacles so that they complain at you.

20:46 Bronsa: https://floobits.com/active/

20:47 noprompt: there's some code I need to push on my other computer, but this seems to at least exist.

20:48 pcn: Is there a time function that'l convert time into seconds + millis?

20:48 technomancy: juxt!

20:49 Bronsa: bitemyapp: hopped in :)

20:49 technomancy: ,((juxt / mod) (System/currentTimeInMillis) 1000)

20:49 clojurebot: #<CompilerException java.lang.NoSuchFieldException: currentTimeInMillis, compiling:(NO_SOURCE_PATH:0:0)>

20:49 technomancy: yeah yeah whatever clojurebot

20:49 llasram: ,((juxt quot mod) (System/currentTimeMillis) 1000)

20:49 noprompt: technomancy: thanks!

20:49 clojurebot: [1386899366 255]

20:50 llasram: Probably `quot` too :-)

20:50 technomancy: ~juxt

20:50 clojurebot: juxt is a little hard to grok but it's the best thing ever

20:50 llasram: ~quot

20:50 clojurebot: Gabh mo leithscéal?

20:50 pmap: do you guys think it's possible to do a real-time display of a changing 2d pixel array with seesaw?

20:50 llasram: gee, thanks clojurebot

20:51 pmap: Hard real-time, or just like 60 frames a second?

20:51 pmap: it wouldn't even have to be 60 frames per second

20:51 llasram: Then definitely

20:52 pmap: you think you could do it with no java interop?

20:53 llasram: Err. I don't know. I saw you wrote "seesaw" but just then immediate thought "Java2D"

20:53 pmap: yeah

20:53 I know it's definitely possible with java

20:54 do you think it'd be much effort doing that through java interop?

20:55 pcn: llasram: thanks I'll try that

20:57 coventry: Hmm, not a ringing endorsement for rudel: http://stackoverflow.com/questions/2375473/emacs-collaborative-buffers-open-in-the-wrong-mode#comment12957400_2375473

20:57 llasram: pmap: I personally don't think direct interop is that big a deal. But also haven't used seeswa much, -- it might provide a better experience, depending on your problem

20:58 I wonder how hard it would be to some sort of cider-eclim integration, so you could get interop autocompletion for classes and methods via eclim

21:02 noprompt: bitemyapp: alright, i'm gonna bounce home here in a bit.

21:10 coventry: There's no trick for destructuring a ::namespace-qualified kw out of a map like with :keys, is there?

21:10 amalloy: coventry: just the general map destructuring, no :keys shortcut

21:11 coventry: amalloy: Thanks.

21:17 pmap: llasram: I do it when it's necessary, but I'd always rather do things in pure clojure.

21:18 coventry: pmap: Clojure is on the JVM partly because java does some things well, and it's idiomatic to utilize it for those things.

21:19 pmap: well I have to go walk for 10 minutes in the snow to get to my school's computer lab right now

21:19 I'll be back

21:19 coventry: Enjoy!

21:20 pmap: piping the X11 output from their 64 core hasn't been working for me

21:20 over ssh

21:20 ivan: try NX?

21:20 pmap: so I gotta use one of their sun machines

21:20 never heard of nx

21:21 no time to try new things though

21:21 tomorrow's the last day of the semester :S

21:22 though I'll want to try things like that once I'm back home 4 hours away

21:22 see you all in a bit...

21:25 pcn: what exactly is ,(...) ? I can't find documentation on it

21:28 rovar: i'm having a hard time serving a js file via ring/compojure

21:28 jcromartie: pcn: it's nothing… where do you see it?

21:28 rovar: I've set a handler : (resources "/js" {:root "js"})

21:28 llasram: pcn: It's just how you tell clojurebot bot to eval code

21:28 ,:fun!

21:28 clojurebot: :fun!

21:28 rovar: the file is compiled and present, but the server is returning a 404 upon request

21:29 jcromartie: pcn: oh, the comma :)

21:29 rovar: ,(repeatedly 5 (rand-int))

21:29 clojurebot: #<ArityException clojure.lang.ArityException: Wrong number of args (0) passed to: core/rand-int>

21:29 rovar: ,(repeatedly 5 (rand-int 10))

21:29 clojurebot: #<ClassCastException java.lang.ClassCastException: java.lang.Integer cannot be cast to clojure.lang.IFn>

21:29 jcromartie: rovar: where is your JS file located in the filesystem?

21:29 rovar: jcromartie, target/resources/js/

21:30 jcromartie: rovar: just put it in resources/js/

21:30 rovar: I'm just re-using an existing webchat example

21:30 jcromartie: and the URL should be /js/whatever.js

21:30 rovar: what are the rules for where ring looks for said files?

21:30 jcromartie: since you're specifying a certain base URL and a base resource bath

21:30 it's loaded from the classpath

21:31 rovar: the url is /js/whatever.js

21:31 jcromartie: via Java's resource loading

21:31 rovar: there is an edn file in resources/

21:31 a frodo config

21:31 I don't really want to go serving that, do I?

21:32 jcromartie: no, that's why compojure's `resources' defaults to serving the files in resources/public

21:32 but you've overridden that with {:root "js"

21:32 rovar: so putting it in resources/js/ fixed it

21:32 is that a recent change?

21:33 I'm just curious as to why everything seems to compile to target/...

21:33 jcromartie: no

21:33 that's where compiled output goes

21:33 and resources are inside the produced jar

21:34 your source and resource paths all get copied into the final jar

21:34 rovar: right.. and there's a resources dir.. and a js dir in that.. why wouldn't compojure/ring look there for static files to serve?

21:34 jcromartie: ...

21:34 rovar: inside of target/ i mean

21:34 jcromartie: when you run "lein run" or "lein ring server" it does not use the output in target/

21:35 target/whatever.jar is just the output of "lein jar" or AOT compilation form "lein compile"

21:35 from*

21:35 how are you running your app?

21:36 rovar: lein dev

21:36 jcromartie: the short answer to "why" is: because target/ is not on the classpath

21:36 what's lein dev? sorry, never used it

21:38 rovar: it's just an alias for running a few things in order, pdo. cljsbuild auto, frodo

21:38 (as far as I understand lein)

21:39 jcromartie: OK

21:40 so I don't know about those specific plugins, but I don't think they run from any compiled output in target/

21:40 maybe?

21:41 but either way, for interactive purposes ("lein run", "lein repl", "lein ring server" etc.) the classpath includes ./resources/ ./src/ ./test/ etc.

21:41 not target/

21:41 rovar: jcromartie, good to know

21:42 ok.. I have a question about channels and go blocks...

21:43 I have a go-loop.. and from within that loop I call a multimethod

21:43 and in that multimethod I call >!

21:43 and it asserts saying that >! is not used in (go ...) block

21:43 but the function is being called from a function that is clearly in the go block..

21:44 llasram: rovar: You can only use >! etc *lexically* within a `go` block

21:44 jcromartie: rovar: because it needs to literally be inside the go block

21:45 rovar: but.. I.. err..

21:45 jcromartie: the `go' macro actually recompiles all of the code inside of it into a crazy state machine :)

21:45 yeah

21:46 rovar: wow.. it would have been nice to know that before I made this beautiful multimethod for my wire protocol

21:46 I guess I could change it to pattern matching, but I will be wearing a sad face..

21:50 how can I include a " in a string in clojure?

21:51 dsrx: \"

21:51 bitemyapp: noprompt: home now.

21:51 dsrx: , "hello \"world\""

21:51 clojurebot: "hello \"world\""

21:51 noprompt: bitemyapp: yeah just got here.

21:51 dsrx: ,(println "hello \"world\"")

21:51 clojurebot: hello "world"\n

21:51 dsrx: ,(print "hello \"world\"")

21:51 clojurebot: hello "world"

21:51 dsrx: there we go.

21:52 rovar: any clever way to wrap a string in quotes?

21:52 ,(str "\"" "blah" "\"")

21:52 clojurebot: "\"blah\""

21:53 coventry: ,(str \" "blah" \")

21:53 clojurebot: "\"blah\""

21:53 jcromartie: (defn wrap-quotes [x] (apply str (take 3 (flatten (cycle ["\u0022" x])))))

21:53 you wanted clever?

21:53 rovar: ,(read "\"blah\"")

21:53 clojurebot: #<ClassCastException java.lang.ClassCastException: java.lang.String cannot be cast to java.io.PushbackReader>

21:54 rovar: jcromartie, I deserved that.

21:54 ,(read-string "\"blah\"")

21:54 clojurebot: "blah"

21:54 rovar: ,(read-string "{:mykey \"blah\""})

21:54 clojurebot: #<RuntimeException java.lang.RuntimeException: Unmatched delimiter: }>

21:54 dsrx: jcromartie: not point-free style, not "clever" enough

21:54 rovar: ,(read-string "{:mykey \"blah\"}")

21:54 clojurebot: {:mykey "blah"}

21:55 coventry: rovar: Is that the reason you want to do the wrapping?

21:55 ,(pr-str {:mykey "blah})

21:55 clojurebot: #<RuntimeException java.lang.RuntimeException: EOF while reading string>

21:56 coventry: ,(pr-str {:mykey "blah"})

21:56 clojurebot: "{:mykey \"blah\"}"

21:56 rovar: coventry, yes, I'm sending messages in from a browser and they're interpreted as strings, i want to read them in as edn

21:56 bitemyapp: noprompt: about to order food

22:00 coventry: rovar: pr-str may be what you want, then.

22:02 gfredericks: reiddraper: I just realized defspec is incompatible with clojure.test :each fixtures, isn't it?

22:04 reiddraper: gfredericks: I'm not familiar with that, but totally possible

22:06 gfredericks: reiddraper: I want to clear the database before each run of a test; now that I'm using defspec that's problematic

22:07 seangrove: coventry: Would be curious to hear how rudel works out

22:08 coventry: Sounds like technomancy has used it in anger.

22:08 Its marmalade package install is broken, so I have punted on it for now.

22:13 seangrove: I tried floobits out between a vim and emacs session, and it was ok-ish

22:13 Seems like it's a pretty difficult problem to tackle well

22:22 coventry: Yeah, it needs a shared shell/repl facility to really be useful, for starters.

22:22 bitemyapp, noprompt: are you guys going to use floobits?

22:24 justin_smith: I tried pair programming in google wave once

22:25 even started worked on a multi-cursor mode for emacs that took in external commands (did not get far with that project)

22:32 arrdem: floobits' python component bombs for me... filing bug report.

22:35 bitemyapp: coventry: hangouts first.

22:35 coventry: I might install floobits while I'm eating.

22:35 coventry: Makes sense.

22:39 ldk: fwiw, pair programming really doesnt' require two cursors, just one shared one is ideal

22:39 Taking turns driving is where the benefits of pairing come from

22:40 You can pair effectively with ssh + screen/tmux + any editor

22:41 technomancy: yeah, two cursors is actually a disadvantage for pairing

22:44 rovar: ,(defn wrap-quotes #{ apply str (-> ["\u0022" %] cycle flatten (partial take 3) (partial apply str) })

22:44 clojurebot: #<RuntimeException java.lang.RuntimeException: Unmatched delimiter: }>

22:45 rovar: ,(defn wrap-quotes #{ -> ["\u0022" %] cycle flatten (partial take 3) (partial apply str) })

22:45 clojurebot: #<IllegalArgumentException java.lang.IllegalArgumentException: Parameter declaration #{["\"" %] (partial apply str) cycle -> (partial take 3) ...} should be a vector>

22:46 rovar: ,(defn wrap-quotes #{ (-> ["\u0022" %] cycle flatten (partial take 3) str) })

22:46 clojurebot: #<IllegalArgumentException java.lang.IllegalArgumentException: Parameter declaration #{(-> ["\"" %] cycle flatten (partial take 3) ...)} should be a vector>

22:47 rovar: ,(def wrap-quotes #{ (-> ["\u0022" %] cycle flatten (partial take 3) str) })

22:47 clojurebot: #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: % in this context, compiling:(NO_SOURCE_PATH:0:0)>

22:47 rovar: ,(def wrap-quotes #{ (-> ["\u0022" %1] cycle flatten (partial take 3) str) })

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

22:47 coventry: rovar: You want def, not defn.

22:47 rovar: ,(defn wrap-quotes [x] #{ (-> ["\u0022" x] cycle flatten (partial take 3) str) })

22:47 clojurebot: #'sandbox/wrap-quotes

22:47 arrdem: coventry: he got that

22:47 rovar: ,(wrap-quotes "testing")

22:47 clojurebot: #{"clojure.core$partial$fn__4198@54d7ac"}

22:47 * arrdem slow claps

22:48 rovar: not quite :P

22:48 arrdem: rovar: what are you doing with that set?

22:49 ,(defn wrap-quotes [x] (-> ["\u0022" x] cycle flatten (partial take 3) str set))

22:49 clojurebot: #'sandbox/wrap-quotes

22:49 arrdem: ,(wrap-quotes "testing")

22:49 clojurebot: #{\@ \a \b \c \$ ...}

22:49 * arrdem facepalms

22:49 rovar: I just want to wrap a string in quotes

22:49 the hard way

22:49 arrdem: ,(defn wrap-quotes [x] (format "\"%s\"" x))

22:49 clojurebot: #'sandbox/wrap-quotes

22:50 arrdem: ,(wrap-quotes "testing")

22:50 clojurebot: "\"testing\""

22:50 rovar: this was actually in response to jcromartie's response where he was chided for not providing a point free solution

22:50 so I decided to take a whack at a point free solution

22:50 arrdem: point-free?

22:51 xpe: ,````````x

22:51 clojurebot: #<StackOverflowError java.lang.StackOverflowError>

22:51 rovar: basically coding by not passing variables, only composing functions.

22:53 arrdem: ,(def wrap-quotes (comp (partial interpose " ") (partial apply str) (partial format "\"%s\"")))

22:53 clojurebot: #'sandbox/wrap-quotes

22:54 arrdem: ,(wrap-quotes "testing")

22:54 clojurebot: (\" " " \t " " \e ...)

22:54 * arrdem will stop using clojurebot as a repl now

22:58 justin_smith: you can /msg him for that :)

22:59 arrdem: or I could just M-x jack-in on ~/scratch.clj :P

23:06 rovar: alc

23:06 arg

23:06 I have a (match [] .. et up

23:06 set up

23:07 but I keep getting "No matching clause ..."

23:07 even when I have the correct values

23:07 regardless, I have an :else clause that it also seems to be ignoring..

23:17 is there a better way to fetch the same key from a hash-map of hash-maps?

23:17 arrdem: ,(doc get-in)

23:17 clojurebot: "([m ks] [m ks not-found]); Returns the value in a nested associative structure, where ks is a sequence of keys. Returns nil if the key is not present, or the not-found value if supplied."

23:17 rovar: (map :name (vals mymap))

23:18 arrdem: rovar: no that's fine

23:18 rovar: (map (comp second :name) ..) alternatively...

23:22 rovar: I want all of the :name's though..

23:22 not just the first one

23:22 i swear there was a function for that..

23:22 oh well.

23:23 justin_smith: arrdem: I think that's backwards

23:23 arrdem: ,(doc comp)

23:23 clojurebot: "([] [f] [f g] [f g h] [f1 f2 f3 & fs]); Takes a set of functions and returns a fn that is the composition of those fns. The returned fn takes a variable number of args, applies the rightmost of fns to the args, the next fn (right-to-left) to the result, etc."

23:23 arrdem: justin_smith: yerp.

23:23 rovar: I knew what he meant

23:24 so I still can't figure out this match thing

23:24 maybe it's an old version

23:29 oh.. i had a paren mismatch, but the entire match case was still somehow syntactically correct..

23:29 err..

23:29 just not semantically..

23:30 justin_smith: clojure has lots of multi-arity fns that do that

23:33 brand0: I'm glad that guy's blackmail thread was deleted

23:34 if he's *for* underground markets, as he says, then why not leave it at "I hacked ___" here's the proof, don't use this market

23:34 why go after people sticking their necks out and running these markets?

23:34 arrdem: brand0: wrong channel?

23:34 brand0: big time

23:34 lol

23:34 arrdem: brand0: I mean nice to see you but that's #atx2600 or #aha :P

23:38 rovar: is there a way I could get around this go block restriction for channels?

23:38 I mean, I'd really like to clean up this code with functions..

23:39 I mean I guess I could eval a function string, but that seems harsh..

23:40 justin_smith: wait, you can't call functions inside go blocks? that's absurd

23:40 of course you can

23:40 tbaldridge: yeah you can call functions inside of gos

23:40 rovar: you can.. but not functions that call >! or <!

23:41 so I have, for instance, a function called broadcast which I call in the case of many different messages

23:41 which does what you might expect..

23:41 tbaldridge: rovar: use pub instead?

23:42 or perhaps mux, both are used to broadcast msgs

23:42 rovar: hmm

23:44 i'm actually using the chord wrapper around http-kit websockets

23:44 so it presents the core.async api, but I am not sure if it provides the pub/sub yet..

23:45 tbaldridge: well you can always use pipe + pub/sub

23:46 rovar: not familiar...

23:46 tbaldridge: chord hands you a channel like thing right? A "output" channel.

23:47 rovar: both input and output, yea

23:47 inside of its with-channel macro

23:47 tbaldridge: So on one end you should be able to take the chord channel and sub it into a pub.

23:48 Or on the other end create a pub that uses the chord channel as the input channel

23:48 rovar: I'm not seeing any docs for pubsub.. other than a gist..

23:48 I like the pubsub model, largely because I'll have several hierarchies of broadcast..

23:49 tbaldridge: http://clojure.github.io/core.async/#clojure.core.async/pub

23:51 rovar: also must be called in a go block?

23:51 tbaldridge: nope

23:52 <! >! alt! and alts! are the only things that have to be in go blocks

23:53 rovar: neat..

23:53 tbaldridge, thanks for your help. Now the conundrum.. have to be at work in 8 hours, need sleep.. want to try..

23:53 tbaldridge: lol, I hear that

23:56 bbloom: tbaldridge: i haven't been paying attention, seems like there are some more channel utils worth studying :-)

23:56 tbaldridge: yeah, we've added a ton of new stuff in the past 2 months or so

23:57 bbloom: it's fun to see how close they are to my asyncx implementations :-) but i only really did the < variants

23:57 rovar: are there examples anywhere? i'm having a hard time grokking the big picture of pubs and also the mult/tap bits

23:58 tbaldridge: this might help, I have a few examples here: https://github.com/halgari/clojure-conj-2013-core.async-examples/blob/master/src/clojure_conj_talk/core.clj

23:59 rovar: a..

Logging service provided by n01se.net