#clojure log - Dec 30 2012

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

0:10 bbloom: does anybody else get a little high whenever some system you've made gracefully handles a new use case you hadn't considered?

0:16 ynniv: it's a good feeling

0:21 bbloom: i had a whole big function i was writing to handle the case, stopped to think, glanced at another piece of code, and then added a single keyword to a set somewhere and deleted the whole big function

0:21 poof worked

0:21 i giggled with glee.

0:29 technomancy: adjusted clojure-doc.org's Emacs tutorial to use nrepl.el instead of slime; any comments before I pull request? https://github.com/technomancy/cds/blob/no-slime/articles/tutorials/emacs.md

0:30 bbloom: technomancy: ok, so what's going on here? clojure-doc.org is dead, yes? and now who owns/operates clojure-doc.org? just you?

0:30 technomancy: bbloom: clojuredocs.org is ... hibernating

0:31 bbloom: technomancy: and written in ruby, FOR SHAME

0:31 technomancy: well

0:31 there's a Clojure REST API for it too

0:31 but no HTML UI

0:31 yes

0:31 yet

0:31 bbloom: heh, i don't care :-P

0:31 * technomancy glances around the channel for potential contributors

0:31 technomancy: anyway, clojure-doc.org is completely different

0:31 it's a collection of static tutorials

0:32 bbloom: but confusingly similar in name....

0:32 technomancy: the idea is hopefully they can merge once the clojure rewrite of clojuredocs.org is done

0:32 bbloom: is such a rewrite in progress?

0:32 clojurebot: Titim gan éirí ort.

0:33 technomancy: bbloom: no one has volunteered to do the HTML UI yet, but the API is done AFAIK

0:33 bbloom: ah ok cool

0:33 technomancy: bbloom: `lein repl` uses it

0:33 (cdoc reduce)

0:33 I think it's the same database behind the scenes

0:33 tomoj: Raynes: you fixed my class= problem just at the right time. but btw, you mispelled 'adjacent'

0:33 * bbloom runs (doc cdoc) first :-)

0:34 Raynes: tomoj: Oh, damn! Nice catch.

0:34 technomancy: bbloom: oh, looks like it got moved to (user/clojuredocs reduce)

0:34 Raynes: tomoj: Yeah, I just noticed the class= issue a moment ago.

0:34 tomoj: I'm making a few other changes and then I'll release 0.1.12.

0:34 bbloom: technomancy: both worked for me

0:34 Raynes: Should be just a few minutes.

0:34 tomoj: :D

0:34 bbloom: ok neat, didn't know this existed

0:34 technomancy: bbloom: it's a thing!

0:35 and you don't have to feel guilty about using rails

0:35 bbloom: heh

0:35 Raynes: tomoj: Other significant change is that I'm renaming select-and and select-or to and and or, since people should never be :refer :alling this library anyways.

0:35 bbloom: i don't feel guilty. for all the horrible evil things in rails, it did exactly what it's good for: clojuredoc.org existed at all

0:35 b/c it got built fast

0:35 b/c rails is easy

0:35 Raynes: (I already shadow clojure.core/remove, so I figured I might as well do this too)

0:35 technomancy: bbloom: well

0:35 not really

0:35 it was never OSSed

0:35 bbloom: but clojure is mature enough, it's time to not suck

0:36 technomancy: and if clojuredocs.org was never released, someone else would have written something

0:36 tomoj: Raynes: thanks!

0:36 I was miffed that I couldn't :require :as lz :rename {select-and and} to get lz/and

0:37 technomancy: if the existing site hadn't been created we probably would have something community driven and wouldn't be stuck with a single maintainer going MIA

0:37 tomoj: looks like there's a phantom descendant-of floating above the real one, dunno if you know

0:37 bbloom: technomancy: fair enough

0:37 tomoj: not that it would matter

0:37 Raynes: tomoj: Yeah, I've been trying to use laser to rewrite random enlive code that I see so that I can catch annoying little things like this

0:37 bbloom: technomancy: as long as it's getting fixed

0:38 technomancy: slowly but surely

0:38 marcelus: better documentation site in the works?

0:38 Raynes: tomoj: Grrr, fixed. Also fixed the ajacent typo.

0:39 TIL I can't spell adjacent.

0:39 technomancy: marcelus: clojure-doc.org has been around a while

0:40 tomoj: any nice way to select with a regex against attr values? could write attr-matches, but that seems too specific. maybe attr-pred, but seems like even that could maybe be broken down?

0:40 Raynes: tomoj: It also just occurred to me that I should probably make some other selectors be like descendant-of and take arbitrary arguments (I think it would make sense in child-of and adjacent-to), but I'll save that for the next version so that I can get the class= fix out for you.

0:41 tomoj: well, I'm fine using checkouts, fwiw

0:41 TimMc: gfredericks: Well, I'm enjoying it. It's pretty readable, and I think just the first couple chapters are worth reading on their own.

0:41 marcelus: So umm is there an unwritten rule that says we shall choose eerily similar names for things. :P

0:41 technomancy: speaking of HTML UIs, clojuredocs.org would be a great splash for introducing laser to the world

0:41 marcelus: see above; the long-term plan is to merge the two

0:41 marcelus: oh I read that. I'm just messing with ya. :P

0:41 abaranosky: anywhere I can read more about plans for clojuredocs.org?

0:42 Raynes: tomoj: You want a selector that is like attr=, but matches with a regex rather than just a plain string?

0:42 technomancy: abaranosky: talking to dakrone, antares, and uvtc is your best bet

0:42 Raynes: technomancy: You trying to get me to write a documentation site? ;)

0:42 abaranosky: it is pretty nice, but stuck on 1.3 still

0:42 tomoj: yeah, not in laser probably. but thinking maybe its building blocks could be useful in laser

0:42 Raynes: I was actually considering it when I have a bit of free time.

0:43 technomancy: Raynes: just a UI for an existing site =)

0:44 bbloom: marcelus: all of the good names are taken, thus all names are earily similar

0:44 Raynes: tomoj: Isn't it just (defn re-attr [attr re] (re-find re (get-in (zip/node loc) [:attrs attr]))

0:45 bbloom: hence why the unix people just gave up and invented words

0:45 Raynes: Er

0:45 tomoj: Isn't it just (defn re-attr [attr re] (fn [loc] (re-find re (get-in (zip/node loc) [:attrs attr])))

0:45 marcelus: So that's what it is!

0:46 tomoj: yeah, but what if I want to regex match against classes now?

0:46 I'll try saying what I mean in code sometime

0:46 Raynes: Classes is an attribute too. :p

0:46 tomoj: ah.. heh

0:46 Raynes: class= and id= are just convenience things, really. Especially id=.

0:47 tomoj: I like convenience :)

0:47 jlewis: i wrote a union-find implementation for clojure that i'd like to submit to the mailing list in a bit. but first i was wondering if any kind soul was interested in giving me some comments :)

0:47 https://github.com/jordanlewis/data.union-find

0:47 Raynes: I could make the existing attr= take either a regex OR a string.

0:47 tomoj: I wouldn't vote for that, but you're the dictator

0:48 Raynes: I'm not usually a fan of that sort of thing either.

0:48 marcelus: I wonder if clojurescript will end up making google closure itself more popular. Well at least after someone puts together nicer docs for clojurescript (Though Closure's docs could be a bit easier to navigate too.)

0:50 Even though I had to bang my head against a wall for a day or two trying to figure out what was going wrong with my ajax request I see alot of potential here for something really nice. Even for plain old websites that need some events

0:50 tomoj: I'm thinking like (comp (in-attr :href) (partial re-matches #"^/foo/.*"))

0:50 er. that doesn't seem quite right. nevermind for now :)

0:50 marcelus: a nice gateway to clojure proper if you will.

0:51 Raynes: tomoj: Yeah, I'm not sure there is much to generalize.

0:52 Simply because it's so easy to write a function that does what you need if laser doesn't have a selector for it. Like, if you wanted to convert an attribute to an integer and multiply it by 4 and see if it is equal to something (because you're nuts?) (defn be-crazy [n] (fn [loc] (= n (* 4 (Long. (get-in [:attrs :someattr])))))

0:53 That said, I can add re-attr. It's probably useful for people that aren't you.

0:53 Also, s/integer/long/

0:54 tomoj: I perhaps irrationally want fewer points

0:55 Raynes: tomoj: Points?

0:55 tomoj: like 'loc in your example

0:56 points as in point-free

0:56 Raynes: Oh.

0:56 Sounds pretty irrational. :p

0:56 bbloom: tomoj: #concatenative is that way --->

0:56 (virtually) ZERO POINTS

0:57 tomoj: maybe that's the way, I don't think it's what I want though

0:57 marcelus: what is laser?

0:57 tomoj: I want as much as possible to just read off the type http://conal.net/blog/posts/semantic-editor-combinators

0:57 I don't want to keep track of an invisible stack

0:57 but I probably don't understand factor yet

0:58 Raynes: tomoj: It sounds like you want a functor over attributes. :P

0:58 tomoj: yes

0:59 or at least I think so right now, need to play around

0:59 tufflax: I'm trying to use test-> in clojure 1.5.0-RC1, but it doesn't seem to work. Isn't there supposed to be a test->?

0:59 tomoj: marcelus: https://github.com/Raynes/laser/

0:59 Raynes: tomoj: I'm going to leave things as they are for now. If you come up with any ideas, let me know (issue, pull request, IRC).

1:00 tomoj: I've got to take off, but if you're really okay with using checkouts for tonight, I'll hold off on this release until I can consolidate adjacent-to and child-of with descendants-of.

1:00 tomoj: sure, no prob

1:00 Raynes: I'll have that done tomorrow though.

1:00 tomoj: I'd probably switch to a checkout soon anyway

1:01 Raynes: Thanks for pointing out the adjacent-to typo. If a certain guy named Alan had noticed it first, I'd never hear the end of it.

1:02 tomoj: Don't think I ever asked what you were doing with laser. TELL MEH

1:02 Before I go.

1:03 tomoj: uh, just screen scraping dominiondeck.com

1:03 Raynes: Nice. I only added 'select' like a day ago.

1:04 Also, you and I have to play together some time. I like Dominion.

1:04 * Raynes vanishes.

1:04 ClojureNewb: I'd like to perform function f over each item in a vector and pass an arg, like this;

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

1:04 (def m {:k "mydata"})

1:05 (do-stuff (second a) (do-stuff (first a) m)) etc...

1:05 Please help!

1:05 Raynes: (map #(f % m) a)

1:05 tomoj: would (do-stuff (do-stuff m (first a)) (second a)) work

1:05 Raynes: Or… I guess not.

1:06 I got all excited about map when I read the first message.

1:06 ClojureNewb: 'a' is a variable length vector

1:06 Raynes: Dream killer.

1:06 tomoj: that's (reduce do-stuff m a) I believe

1:06 * Raynes vanishes for real.

1:06 ClojureNewb: I'll think about reduce - I'll have to check it. Thanks!

1:06 tomoj: or (reduce (flip do-stuff) m a) if you had your original argument order, and if there was a flip...

1:07 technomancy: hokay

1:07 clojure-mode and clojure-test-mode 2.0 are out

1:07 the switch to nrepl is complete

1:08 tomoj: hmm.. I suppose us swank holdouts should take another look?

1:08 technomancy: tomoj: depends why you've been holding out I guess =)

1:08 there is still no inspector =(

1:09 tomoj: oh well. it's probably time

1:09 bbloom: what's the inspector do?

1:09 (besides, you know, inspect)

1:10 * technomancy hums Javert's theme

1:10 tomoj: it shows you all the java method signatures for a class/instance

1:10 technomancy: bbloom: hyperlinked jumping around a layout of a class's interfaces, constructors, and methods

1:10 tomoj: among other things

1:10 the hyperlinks always throw exceptions for me :(

1:10 technomancy: basically makes javadoc unnecessary

1:10 (unless you need argument names)

1:11 bbloom: technomancy: javadoc is always unecessary.

1:11 technomancy: I think clojure.reflect does a lot of what the inspector does

1:11 but the slime inspector is a much better interface for the functionality

1:11 marcelus: technomancy: is there any chance of getting the font-lock to work better for things like (foo/bar) so that it gets highlighted like in github?

1:11 bbloom: ah ok

1:12 technomancy: marcelus: "better"?

1:13 you mean coloring referred vars the same as built-ins?

1:13 marcelus: yes

1:14 technomancy: hmmm... I probably wouldn't add it myself, but I could take a pull request for it

1:14 too bad you just missed the release of 2.0.0

1:14 by like ten minutes

1:14 marcelus: its not a big deal but it would be nice to have just the same

1:14 lol

1:14 is it already available though package.el?

1:14 bbloom: marcelus: i actually quite like in the vim highlighting that builtins get highlighted differently than my own things

1:15 technomancy: yeah in marmalade

1:15 bbloom: I can see the appeal in differentiating between vars that come from the file vs vars that are refered

1:15 and TBH treating clojure.core as special rubs me the wrong way

1:15 beyond the obvious fact that it's auto-refered

1:15 *referred

1:15 tomoj: I don't like the specialness either

1:16 the only time I notice it is when something is a weird color for no good reason

1:16 bbloom: core being special is a good stop gap

1:16 it's better than all vars being highlighted regardless of refer status

1:16 * technomancy would love for something like nstools to make namespaces more egalitarian

1:16 marcelus: true

1:17 bbloom: that does make sense I never really thought of it like that

1:17 tomoj: like why is the "select" in 'lz/select green?

1:17 technomancy: it might be interesting to tie into nrepl so you could distinguish between vars that come from your project vs 3rd-party libs

1:17 tomoj: =\

1:17 it goes overboard with that by adding stuff for clojure.set, clojure.zip, etc

1:17 probably should have revisited that before cutting 2.0.0 OH WELL

1:18 tomoj: eh, I don't really care anyway :)

1:18 bbloom: 2.1.0 !!

1:18 (says the vim user

1:18 )

1:18 technomancy: off by 15 minutes

1:18 tomoj: glad to just see movement on those modes

1:18 technomancy: whoa; last clojure-mode release was 12 dec 2011

1:19 * technomancy heads off

1:21 marcelus: wonder why marmalade doesnt load up but melpa does

1:22 even after reevaluating the package-archives variable

1:22 nvm

1:23 had to re load the buffer

1:27 dcb: bbloom: this is directed at you because you mentioned using vim, but really this is for any vim user: what is the current state of vim with clojure? I'm using the VimClojure plugin as well as lein-tarsier, and its OK, but I feel like I could be missing something

1:28 bbloom: dcb: https://github.com/tpope/vim-foreplay

1:28 marcelus: yea org-mode and erc :P

1:28 bbloom: if i do any more advertising, tpope is gonna owe me royalties

1:28 tpope: if you do any less, I'll start charging you for foreplay.vim :D

1:29 dcb: bbloom: hah. Is this a replacement for VimClojure (not sure if you have experience with that)?

1:29 tpope: it replaces the dynamic portion

1:29 i.e., it does not provide basics like syntax highlighting or indenting

1:31 dcb: tpope: Awesome, I'm definitely going to check it out, I think it will fit right in beside the 10 other plugins I'm using that you authored :). Thanks for all of your awesome work!

1:31 tpope: cheers

1:52 tufflax: Is futures lazy? If I don't deref my future it seems it does not happen. But if I deref it my thread will wait for it, which is what I wanted to avoid in the first place.

1:52 What I'm trying to do is play a sound, but not have to wait for it. What should I do?

1:53 tomoj: try &(do (future (println "foo")) nil)

1:53 lazybot won't do future for some reason

1:54 tufflax: k

1:54 tomoj: that shows that it is not lazy in the sense I think you mean

1:55 are you running a program which calls future to play a sound and then exits?

1:55 tufflax: no

1:55 My program loops in a loop, waiting for user input

1:55 tomoj: I'd just stick a (do (println "called!") ...) around the thing that triggers the sound

2:00 it doesn't print if you don't deref?@

2:02 dcb: tomoj: I think futures are dissallowed by clojail. Raynes would know

2:02 tomoj: yeah, he's gone

2:02 supposedly :)

2:02 dcb: tomoj: hehe

2:03 tufflax: tomoj, yes it prints, but no sound ;( and what's even more strange, is that when I quit my main loop, my propram does not terminate if i have spawned a future

2:04 at least i find that strange :P

2:04 tomoj: I wonder if it has something to do with the repl env, have you tried with `lein run`?

2:04 ToxicFrog: So do I.

2:05 tomoj: `lein trampoline run` I guess

2:05 future-call uses the agent solo executor

2:05 tufflax: I'm using lein trampoline run

2:05 tomoj: so you probably need to call (shutdown-agents) after you quit your main loop

2:06 tufflax: @(future (-> in Player. .play)) plays a sound, but not @(future (do (println "called") (-> in Player. .play)))

2:07 isn't that wierd?

2:07 tomoj: ... yes

2:07 @(future (-> in Player. .play when)), no sound?

2:08 tufflax: what's when?

2:08 tomoj: (doc when)

2:08 clojurebot: "([test & body]); Evaluates test. If logical true, evaluates body in an implicit do."

2:08 tufflax: but, why would i put it there? :P

2:08 tomoj: that's an abuse of it

2:08 tufflax: ok ;p

2:08 tomoj: what you say doesn't make sense to me

2:08 that's another test

2:09 tufflax: with when it plays the sound

2:09 tomoj: the body is nil so it's like (do (-> in Player. .play) nil)

2:09 hmm

2:09 why?

2:10 clojurebot: why is the ram gone is <reply>I blame UTF-16. http://www.tumblr.com/tagged/but-why-is-the-ram-gone

2:25 tufflax: tomoj, hm I tried @(future (do (println "called") (-> in Player. .play))) and it does play a sound. Maybe I was mistaken before. But anyway, if I don't deref, it prints "called" but does not play a sound. If I put the print after the play, it does not print or play.

2:25 tomoj: try (future (-> in Player. .play println)), no deref

2:26 I dunno what Player or .play are

2:26 but I really dunno

2:27 I find it strange too :)

2:27 Raynes: tomoj, dcb: Futures are not allowed by clojail because I can't forcibly kill them like I can normal threads.

2:27 tufflax: does not work, the last one

2:28 tomoj: ah

2:28 Raynes: tomoj, dcb: Technically almost anything that is not allowed could be allowed if we were willing to write sandboxed implementations of them. It's just hard and tedious work.

2:28 tomoj: yeah

2:29 caha + cljs seems interesting

2:29 er, caja?

2:29 dcb: Raynes: interesting. I agree- probably not worth the time

2:35 Raynes: callen: Heh, I can pick you out of a group of people from a mile away now.

2:36 callen: http://www.reddit.com/r/Clojure/comments/158oyh/first_clojar_created_would_love_feedback/c7kgeik

2:42 bbloom: Raynes: lol, good catch

2:43 Raynes: tomoj: I think you're the first person besides me using laser. o/

2:43 bbloom: Raynes: he'll get to bitch about my library soon too, even tho it isn't strictly a templating library

2:43 tomoj: say you have <div class="group"><div class="group-0">foo</div> <div class="group-1">bar</div></div>

2:43 repeatedly

2:44 Raynes: bbloom: What library?

2:44 tomoj: er, not repeatedly

2:44 bbloom: the scene graph thing i'm working on

2:44 Raynes: What does that have to do with templating? O.o

2:45 bbloom: Raynes: i now have a partially working port of https://github.com/addyosmani/todomvc/blob/gh-pages/architecture-examples/angularjs/index.html

2:46 but it's a tree of maps rather than html

2:48 Raynes: bbloom: This is some sort of templating thing where you set an attribute and... uh... I don't follow. :p

2:48 tomoj: You had a question in there somewhere, right?

2:48 tomoj: I want to select the text content of select descendants (omitted above) of the #"^group-\d+$" classed nodes, but get the results grouped by the group-\d nodes

2:48 Raynes: There we go

2:48 :p

2:49 bbloom: Raynes: you can ignore the rest of the tutorial, this one page makes the point: http://docs.angularjs.org/tutorial/step_02

2:50 Raynes: Interesting.

2:50 We'll fight to the death.

2:50 tomoj: That's interesting.

2:51 thinking

2:53 tomoj: Does the div classed group contain anything other than those group-id nodes?

2:54 tomoj: https://www.refheap.com/paste/79ed442b28bb05fa0dcc04727

2:56 Raynes: tomoj: I can't think of a way that you could do this off the top of my head except matching the container above it and grouping its contents.

2:56 tomoj: https://www.refheap.com/paste/11d4e3950cb614b7361db7561

2:57 Raynes: Also, ugh, you had to copy half of class. Definitely gotta do something about the regex stuff.

2:57 :p

2:59 Right now, laser just selects each individual node that matches. It can't order them or anything, or group them. A selector can't do that. You could change the select function (which works independantly from the rest of laser) to work different and add some functionality, but I can't think of what I'd add.

2:59 tomoj: yeah, I tried to use fragment

2:59 yedi: is edn gaining any traction?

2:59 Raynes: What would you use fragment for?

3:01 tomoj: I experimentally tried doing this https://www.refheap.com/paste/fa91716fa5ce222e1096dbef5

3:01 but that doesn't work.. where do you get a seq of locs from to pass to fragment?

3:02 Raynes: tomoj: I was thinking (very crude example): (group-by (comp :class :attrs) (l/select (l/class= "group")))

3:03 tomoj: I think your fragment call doesn't do anything at all though.

3:03 tomoj: it should be identity, right?

3:03 but it's an error

3:04 oh, well

3:04 Raynes: Well, the transform has to be a function, but your function would just return the html you selected and it would replace it in the HTML and you'd get back the same html you passed in.

3:04 tomoj: of course, cus it's not a seq

3:05 Raynes: parse-fragment gets what you'd want to pass to fragment.

3:05 But I don't think you can do what you want with fragment.

3:05 tomoj: ah

3:06 a transform can't return something other than a hickory node?

3:06 Raynes: It can return a seq of hickory nodes or a node.

3:07 It transforms the html in place and doesn't pull it out.

3:07 Did you see the example I showed above?

3:07 How much trouble would it be to select the top-level node instead and group its content?

3:08 Or, wait.

3:08 Ugh, you had to ask questions at 2AM.

3:08 :p

3:09 I didn't understand your question completely.

3:10 Okay, I get it now.

3:11 tomoj: Okay, could you select the group-id nodes instead and then do your grouping?

3:11 Seems like that makes the most sense, because then you have access to the id.

3:11 But I guess that's a pain in the ass because of the the number of children.

3:14 tomoj: Looking at your sample HTML, if you selected the group-id divs, you could get the field-item divs like so: (-> (:content group-id-div) first :content first)

3:15 This is all admittedly painful, but I can't immediately think of a better solution.

3:15 I doubt you'd be any better off with enlive.

3:21 tomoj: Did you die?

3:22 tomoj: https://www.refheap.com/paste/a767ffc38094bdff3554e07e2

3:22 with enlive, there's a #'text somewhere that works, iirc

3:22 since it's not hickory

3:23 clojure.data.zip.xml/text

3:24 line 11 makes me think I'm doing it wrong

3:25 Raynes: tomoj: Oh, you mean how god awful it is to get something out of a node to pass to select?

3:25 Yeah, I realized about 30 minutes ago how nasty that would be.

3:26 I need to add a function for doing that.

3:26 Is that what you're talking about, tomoj?

3:27 tomoj: yeah

3:27 Raynes: Yeah, I'll make that better.

3:27 ibdknox: tomoj: are you making a dominion game?

3:28 tomoj: I've been working on it some

3:28 ibdknox: cool

3:28 Raynes: tomoj: So, you're saying that there is a way to do this in Enlive that doesn't suck?

3:28 tomoj: no

3:28 bbloom: tomoj: did you see carter-thaxton's ruby one? he had a pretty neat little green thread thing w/ a DSL and whatnot: https://github.com/carter-thaxton/ruby-dominion

3:28 Raynes: I wasn't sure what you meant by #'text

3:29 bbloom: tomoj: lib/cards.rb is neat

3:30 tomoj: yeah, I guess it's neat

3:30 https://www.refheap.com/paste/399c73d12a174759d65d3a923

3:30 558 lines for the base set (of course it's not complete)

3:30 Raynes: tomoj: I've got a list of stuff to do with laser tomorrow. Added making your code easier/smaller to that list.

3:31 There are several things I can improve there.

3:32 ibdknox: bbloom: that's surprisingly well thought out :)

3:32 bbloom: ibdknox: smart dude

3:33 Raynes: tomoj: So, what do you think of laser so far?

3:33 One thing I'll note is that I'm going to be fixing/improving a bunch of stuff tomorrow, whereas if this were enlive stuff, you'd probably have an issue and a pull request and about 6 months to two years before getting anything actually done. :p

3:34 tomoj: "My compromise is the following: Peddler.cost always returns 8. However, peddler.cost (where peddler is an instance of Peddler), will return a contextual cost. All cards have a context, which can be a Player or a Game instance."

3:34 that sounds like quite a struggle, maybe I just don't understand :)

3:34 ibdknox: combinations of cards in dominion can be pretty complicated

3:35 e.g. bridge substracts the value of all potentially buyable cards

3:35 coupled with something like a throne room

3:35 tomoj: yes

3:35 I just mean it sounds like he's struggling with OOP

3:35 ibdknox: ah

3:35 tomoj: instead of just separating facts about cards from facts about instances of cards

3:35 and using data

3:37 but I guess you have to struggle with OOP if you're in ruby, that doesn't mean the library is not neat

3:38 bbloom: tomoj: yeah, ruby's DSL approach *looks* like data, but it's really a big ol' mutable bag of oh shit

3:38 all those card attribute declarations are mutation objects at startup

3:38 the good design principal still applies: separate what from how

3:39 ibdknox: I don't think his solution is that far from what I would do in Clojure to be honest

3:39 bbloom: ibdknox: right, you'll just have 98% less unit tests and 200% more confidence :-)

3:40 ibdknox: haha

3:40 What are unit tests? ;)

3:43 ChongLi_: what's a good way to manage js libraries in a cljs project?

3:47 bbloom: man, i really wish i had a way to invert a block of clojure code for bi-directional bindings... i don't need it to work on everything, just the most common stuff people would use in a binding expression

3:48 it's so easy for concatenative languages: http://docs.factorcode.org/content/article-inverse,intro.html

3:49 tomoj: hah

3:50 so you write some concatenative stuff that renders the model into, say, hickory (?), then invert it, and you get something that takes hickory and returns an updated model?

3:51 bbloom: tomoj: i'm thinking i can write a macro that can invert common expressions used in bindings. generally, any expression you're gonna use is gonna be a pretty trivial -> pipeline

3:52 (-> foo :bar (f x))

3:52 the inverse of a keyword is assoc, or more generally get-in inverts to assoc-in

3:54 really only needs to work on a tiny subset of expressions, like some of the "filter" things on the left nav of http://docs.angularjs.org/api/

3:54 wingy: there is this templating lib for css .. anyone knows which one i am talking about?

3:54 bbloom: ie format-currency needs to have an inverse parse-currency

3:54 so that you can write (currency cost) and have it be two-way data bound reasonably

3:57 i'm gonna cheat for now and make it two separate things like this '{:bind foo, :convert [:bar (f x)]}

3:57 that should be good enough for now

4:10 dsantiago: Raynes, you still there?

4:11 callen: https://github.com/rathwell/clj-style

4:11 dsantiago: if it's about laser, I might be able to help. maybe.

4:12 dsantiago: callen: I have no idea, he asked if I was around a while ago while I was out.

4:13 callen: dsantiago: just checked my lastlog, you guys are playing IRC tag. He's it now.

4:13 dsantiago: Well, he'll never catch me.

4:13 callen: dsantiago: well laser is the main thing he's about lately.

4:19 yedi: is porting code from clojure to cljs nontrivial?

4:19 depends on the code right, etc. but generally speaking

4:22 tomoj: what do you mean by "generally speaking"? for some code, it's as trivial as `cp foo.clj foo.cljs`. for lots more code, it's not much harder than that. for some code, it's a whole lot harder

5:04 Raynes: dsantiago: Am now, are you? :p

5:04 dsantiago: Turns out yes.

5:04 Raynes: dsantiago: I just wanted to see if you had noticed https://www.refheap.com/paste/7927

5:05 There is already a year old issue on jsoup about it, so *shrug*

5:05 dsantiago: I hadn't, and there's nothing I can do about it.

5:05 Raynes: Nothing you can do about it, was just curious if it had ever annoyed you.

5:06 Not that big if a deal, really, just weirded me out earlier. I was like omgwtfjsoup

5:07 dsantiago: What is that supposed to parse to?

5:09 Raynes: dsantiago: Well, I was expecting that it wouldn't throw away the tags.

5:10 (not hickory, jsoup of course)

5:10 dsantiago: I ask because the HTML5 parsing rules sometimes fill in tags that are missing and correct misformating, so I wonder what HTML5 does with TR/TD tags that aren't in a TABLE.

5:12 Raynes: I don't think this behavior is actually a bug. It just isn't what I want in this case.

5:12 https://github.com/jhy/jsoup/issues/135 is the relevant issue. Not sure what jhy thinks of it. He never responded to it.

5:12 dsantiago: My HTML expert friend isn't on so I can't ask him.

5:13 Raynes: dsantiago: http://stackoverflow.com/questions/7985791/why-jsoup-cannot-select-td-element/7986084#7986084 question by the same guy

5:14 One answer says that it is indeed invalid HTML (which doesn't matter to neither he nor I), and he 'fixed' it by telling jsoup to (lol) use an xml parser.

5:15 dsantiago: Yeah.

5:17 Raynes: dsantiago: http://stackoverflow.com/questions/6722307/use-jsoup-to-parse-xml-prevent-jsoup-from-cleaning-link-tags

5:18 Would it be useful to be able to tell hickory what parser to use?

5:18 Probably not.

5:18 dsantiago: You already can.

5:19 If you get jsoup to parse you some HTML and give you a DOM tree, the as-hiccup/hickory functions should work on wahtever it gives you.

5:19 parse and parse-fragment are just conveniences.

5:19 Raynes: Ah, gotcha

5:21 dsantiago: Actually, it looks like the xml parser might actually do what I want. It just doesn't enforce valid html, but I'm not a browser so it kinda works.

5:21 I'll play with that tomorrow.

5:21 http://jsoup.org/news/release-1.6.2

5:21 dsantiago: Yeah, you're kinda gonna be unhappy either way.

5:22 There's all sorts of things that are valid HTML but not XML. If you want to parse any HTML into a useful data structure, you need a parser that can handle that. XML-type parsing won't be able to.

5:25 callen: dsantiago: do you use magit?

5:25 dsantiago: callen: I don't.

5:25 callen: dsantiago: your loss. >:)

5:26 dsantiago: any interest in web dev?

5:26 dsantiago: Pretty interestedi n that.

5:27 borkdude: the problem list on 4clojure.com isnt't fully available on github?

5:27 Raynes: borkdude: The problem list is in the database alone.

5:27 callen: dsantiago: http://www.luminusweb.net/ Also, I've been pondering a wiki for Clojure like EmacsWiki.

5:27 borkdude: Raynes I see

5:28 callen: dsantiago: I expected it to be a fairly popular idea, but surprisingly, it wasn't. I've found it very difficult to determine "best practice" in Clojure even though the documentation is readily available. I was musing to myself that a wiki might help. Especially a well-done one. Any thoughts there?

5:28 Raynes: borkdude: I saw your enlive question on stackoverflow. I rewrote your example with laser (for fun) and found a few things that I improved, so thanks for asking Enlive questions. :p

5:28 borkdude: I'm on Windows and don't have access to it, but I'll tweet you a link to the laser version tomorrow.

5:28 callen: Raynes: that's a really exceptional idea for improving laser.

5:29 Raynes: for smoothing out the rough edges.

5:29 borkdude: Raynes please share your laser version, yeah :)

5:29 callen: Raynes: could you post a before/after on refheap?

5:29 I'm quite curious.

5:29 Raynes: callen: Yeah, I was doing that all night.

5:29 callen: A before after of what? The laser version of his enlive thingy?

5:29 dsantiago: I don't really understand the interest I see in many parts in being able to go to a site or something that will tell you "the best practices" for various things.

5:29 callen: Raynes: yes please. on refheap.

5:30 dsantiago: I've seen a lot of questions here about things like swap!

5:30 Raynes: I don't have the old version, but I can probably reproduce it from memory. Will do callen. Tomorrow.

5:30 callen: dsantiago: AFAICT, most programmers have been burnt too many times by accidentally misusing things in ways the documentation doesn't really cover very well.

5:30 Raynes: don't perform any free labor on my account, I was just hoping to learn something. Don't bother.

5:31 Raynes: callen: I'd be interested in seeing it to and it's a simple example.

5:31 too*

5:31 callen: Raynes: also what the hell is ibdknox doing that requires 10 different programming languages? is he subcontracting work out?

5:31 Raynes: On Light Table?

5:31 ibdknox: hm?

5:31 clojurebot: benchmarking is https://github.com/hugoduncan/criterium

5:31 callen: I hadn't specified LT because I wasn't sure it was about LT.

5:31 Raynes: Unfortunately I do not have a direct line to ibdknox.

5:31 callen: I was just curious about what was twatted

5:31 Raynes: oh, it was an exchange between you two. n/m

5:32 ibdknox: what are we talking about?

5:32 callen: ibdknox: polygot tweet

5:32 Raynes: callen: That wasn't ibdknox, bro.

5:32 callen: oh fuck me

5:32 Raynes: That was cemerick

5:32 :p

5:32 callen: that was cemerick wasn---yes.

5:32 ibdknox: sorry, carry on.

5:32 ibdknox: huh, now I'm curious what he's doing

5:32 Raynes: Yeah, he wants a bunch of example usages of his PDF libraries written and then organized on Github.

5:32 ibdknox: ah

5:33 Raynes: It's simple stuff.

5:33 callen: Raynes: oh I love stuff like that.

5:33 Raynes: very cool

5:33 Raynes: You can see if he still needs it done.

5:33 He isn't paying for it, of course.

5:33 callen: Raynes: my labor is better allocated, I was merely curious.

5:34 I have 1,001 side projects, only a few of which proffer any path to putting pork on my plate.

5:34 Raynes: I have similar problems.

5:35 ejackson: i've yet to have a side project do that :)

5:35 callen: Raynes: товариш!

5:35 ejackson: i view them as pork, to be paid for by the rest of what i do

5:35 callen: ejackson: you have to seek it out. I'm exceedingly greedy.

5:37 ejackson: life's too short

5:38 callen: ejackson: that's precisely my point, life's too short to let other people control me through a job.

5:38 ejackson: thus, attempts at generating revenue on *my* terms.

5:38 ejackson: callen: oh yeah, 100% on that. I've not had a job in 2 years

5:39 march to my own bugle

5:39 but greed, for anything other than my own sparkling company, couldn't justify it

5:39 callen: ejackson: I've bootstrapped before, but it fell apart. I'm trying to make a go of it with the benefit of a great deal more experience.

5:40 ejackson: yeah, its a lot harder than i'd expected :)

5:40 ibdknox: it's a very difficult balancing act

5:40 ejackson: i was hoping to have more time to code, but actually I now have a lot of other malarcky interposing itself

5:41 bbloom: ejackson: yeah, running a company takes a fuckload of time

5:41 callen: time that has nothing to do with code, or in a lot of cases, even product.

5:41 ibdknox: on things that you don't realize actually *do* take time, no less

5:41 ejackson: i'm trying to run two ! a consulting company, and a different product company

5:41 callen: because you underestimate the difficulty of everything everybody does that isn't your own specialty

5:41 standard cognitive bias.

5:41 bbloom: ibdknox: WHO IS GOING TO ORDER THE COAT RACK!?

5:41 ibdknox: ejackson: consulting company with employees?

5:42 ejackson: ibdknox: no, one man band

5:42 ibdknox: bbloom: lol

5:42 bbloom: that shit adds up

5:42 ibdknox: it really does

5:42 callen: consulting vs. product is something I've been musing over. I tried asking patio11 in a recent thead, that didn't go anywhere.

5:42 ejackson: bbloom: yeah, it turns out somebody has to do all that

5:42 for me its all the gladhanding, and chasing potential clients, treating their staff gently etc etc

5:43 snowylike: what does a consultant do, if i may ask?

5:43 ejackson: prostitutes any skill he has to the highest bidder

5:43 callen: snowylike: produce value for businesses via knowledge, skill, experience, w/e

5:44 ejackson: usually its some tail skill that a company can't afford, or doesn't need, to have on hand all the time

5:44 callen: snowylike: usually consulting is economically useful because their time is economically leveraged in ways they couldn't generally access themselves.

5:44 ejackson: but need for some particular project

5:44 snowylike: so, like

5:44 ibdknox: truth: no one knows

5:44 ;)

5:44 ejackson: ibdknox: SSSH dammit !

5:44 snowylike: you can do something they can't, whatever that may be?

5:44 ibdknox: snowylike: more or less, yes

5:45 callen: if a consultant knows things that could make a business 10% more efficient, if that business has $250mm in yearly revenue vs. a bootstrapped startup, it's usually more directly economically beneficial to consult for the big business and extract value than attempt to bootstrap.

5:45 ejackson: yeah: so I build mathsy back-ends for people

5:45 callen: snowylike: something they need irregularly or can't afford full-time.

5:45 ejackson: oh I have something to discuss with you in private then, if exploring n-dimensional search spaces is of any interest.

5:45 snowylike: and how do you get into this consultant business?

5:45 callen: ejackson: it's a "solved" problem, but I haven't found anyone competent enough to do a post-mortem with.

5:46 snowylike: develop a portfolio, references, a valuable skill, start marketing yourself.

5:46 ibdknox: fine point: consultants often don't actually produce a final product - they lay out how you might do that yourself. They provide information and guidance.

5:46 callen: snowylike: you spend as much time selling yourself as working, ofttimes.

5:46 ejackson: more in the beginning

5:46 snowylike: in that case i don't think i'd be a good consultant

5:46 near non-existant marketing skills

5:46 ejackson: as the poet laureate said: pimpin' aint easy :p

5:47 ibdknox: srsly

5:50 thorwil: is it a bug or a feature that korma will return a vector of results even for a select with the primary key?

5:50 wingy: why do i keep getting: java.util.concurrent.ExecutionException: java.lang.NoClassDefFoundError: Could not initialize class myapp.server__init when requiring a file

5:53 bbloom: wingy: what is your file name and what is the symbol in the ns form at the top of that file?

5:53 ejackson: thorwil: probably a feature to ensure that the interface is consistent

5:54 thorwil: which then leads to me being consistent in taking first of the result :)

5:55 ejackson: yeah, the function always returns the same type: Vector.

5:55 irrespective of how many results you have. Dunno really, don't use korma myself, but that'd be my guess.

5:58 wingy: bbloom: that was the issue thx

6:09 Sgeo: You know what would be AWESOME (and difficult)

6:09 Making a macro that takes a macro and a body. The macro expands to body except using the given macro for function application

6:10 What I'm aiming for is something similar to making a new language in Racket by changing #%app

6:11 By doing that, we could have a pervasively-lazy sub-language, a pervasively-lifting ... thing for frp

6:11 etc. etc.

6:16 bbloom: Sgeo: you could try the cljs analyzer and walk it looking for :invoke forms

6:16 sounds like far more trouble than it's worth tho

6:16 Sgeo: Almost the flexibility of Racket would be really fun

6:17 Although Racket shows more than just #%app

6:17 There's also a form that wraps around entire modules, I think

6:17 But that's relatively easy

6:24 callen: xificurC: like black metal?

6:24 xificurC: callen: not really

6:24 im not a satanist either

6:25 fairly common questions because of my nickname

6:25 callen: xificurC: I wasn't going to ask about Satanism.

6:25 xificurC: I'm just really into black metal and was sorta hoping your name meant you'd be a fan. alas.

6:25 so does anyone here use ritz?

6:26 xificurC: callen: I'm not saying you'd think that, I was just saying it because people sometimes ask that too

6:26 whats your fav band, maybe I know it :)

6:26 callen: xificurC: I'm sorry to hear people you talk to are unimaginative as to the purpose of your name.

6:27 xificurC: lately? Burzum, Heretoir, An Autumn for Crippled Children, Svarti Loghin, Alcest, Drudkh, Pale Chalice

6:29 xificurC: callen: well yeah but I still think its an achievement from their side because some online friends I had came to me after one year saying "OH your nickname,I just got it!"

6:29 Raynes: callen: You listen to terrible music.

6:30 xificurC: callen: nope sorry, dont know any :( I think I only know some of the old metal bands that everyone knows :)

6:31 callen: Raynes: I don't have any curses worthy of this moment that bear uttering in this channel.

6:32 Raynes: may the great Satan of Black Metal himself forgive thee :)

6:32 AimHere: callen doesn't listen to any band that hasn't either murdered another musician or burned down 3 churches. That's how he knows that they're keeping it real

6:33 callen: AimHere: knows my soul.

6:34 Raynes: I'm fine with the church burning. I just don't typically link bands with names that sound like they're out of the Satanic bible.

6:34 borkdude: I used to listen to Cradle of Filth and Dimmu Borgir, but does that still count?

6:35 not a big fan anymore though

6:36 never was really, but I'm generally into different kinds of metal

6:36 callen: borkdude: no.

6:36 borkdude: those bands are pop culture caricatures

6:36 borkdude: callen yes, I expected that

6:36 callen: Raynes: there's nothing satanic about my music.

6:37 borkdude: that said, there are a few dimmu borgir songs I like.

6:37 Raynes: for that matter, black metal is far from the only genre I listen to.

6:37 I was listening to Punjabi folk music 5 minutes ago.

6:37 Raynes: Oh, well that makes it all better.

6:37 :p

6:37 Sgeo: I like Cradle of Filth's Castlevania cover

6:38 I think that's how I originally heard that song

6:38 Erm, I don't think the song itself is called Castlevania, but it's some soundtrack for Castlevania

6:38 callen: Sgeo: the songs from the game people tend to cover never really had official names. They were made up after the fact.

6:39 Sgeo: but it was probably the intro song.

6:39 that's the most famous one.

6:52 Raynes: callen: You like Castlevania games?

6:52 I played Lords of Shadow a recently. Really enjoyed it.

6:52 I need to play SotN

6:53 Sgeo: "For example, the #%app syntactic form can be overridden to change the semantics of function application."

6:53 I think this is a really good idea.

6:53 And is what I'd love to emulate

6:55 ibdknox: Raynes: SotN is one of my favorite games

6:55 Raynes: ibdknox: It's in the xbox live arcade. I'll buy it when I get a chance.

6:56 And by chance I mean "dollar to my name".

7:06 bbloom: if you guys haven't also played Shadow Complex, highly recommended for fans of the castlevania exploration style game

7:10 pmaes: I'd like to call a series of functions sequentially with a fixed delay between each call. Currently doing this without delay, so simply mapping function application over the arguments. What would be the most idiomatic way to do this?

7:11 bbloom: pmaes: what kind of delay?

7:11 like a thread blocking delay?

7:12 pmaes: bbloom: Yes, indeed

7:12 bbloom: pmaes: that sounds pretty UN-idiomatic to start with

7:13 why not create a java Timer object with a queue?

7:14 pmaes: bbloom: I'll look into that, thanks. Sorry, I'm new to both Clojure and the jvm ecosystem.

7:14 bbloom: pmaes: are you also new to concurrent programming?

7:14 (also, never apologize for being a beginner... everyone was a beginner at somepoint!)

7:15 pmaes: bbloom: Yes, this is also my first time exploring concurrency.

7:16 bbloom: pmaes: concurrency is complex and the learning curve is steep. you may want to avoid learning java, concurrency, and clojure all at the same time

7:18 borkdude: bbloom unless he's into concurrent learning ;)

7:18 AimHere: Yeah, he should throw in a brand new IDE while he's there

7:18 borkdude: emacs and paredit, writing down notes in org-mode

7:18 pmaes: Well, my emacs config is growing steadily :)

7:19 bbloom: borkdude: it's too bad that human brains appear to be single core, otherwise he could do some parallel learning too!

7:20 borkdude: bbloom your name reminds me of bloom filters btw

7:21 bbloom: borkdude: sadly, i'm not related to Burton Howard Bloom. woulda been cool to have a smarty pants algorithm inventing relative

7:23 pmaes: I have no background in CS (biochemist), is there a recommended source to read up on concurrent programming? Especially from a functional pov.

7:24 bbloom: pmaes: no background as in no *formal* background? or as in no real experience whatsoever?

7:26 pmaes: bbloom: No formal background, no proper fundamentals. I've been learning in a scattershot manner, to solve specific problems.

7:26 callen: pmaes: you're kinda fucked. you're a biochemist you say?

7:27 bbloom: haha he's not fucked

7:27 callen: pmaes: what you are, at the moment, is a middle-schooler asking how to be told how virus engineering works, specifically, but doesn't know any organic chem.

7:27 pmaes: you could probably kinda sorta fake it with some cargo cult, but you should be prepared to learn how to program, bottom-up, but with the emphasis on concurrency unless you're more competent than you imply.

7:28 bbloom: pmaes: http://www.amazon.com/Java-Concurrency-Practice-Brian-Goetz/dp/0321349601

7:28 callen: I knew you were going to link that book.

7:28 bbloom: that book is probably your best bang for buck to learn concurrent programming

7:28 pmaes: callen: The difference being that I'm very willing and prepared to learn it. I have no delusions about my progress.

7:28 callen: it is, but if they're as naive as they claim, that's going to hella rough.

7:29 pmaes: well if such a middle-schooler approached you, would you link them a book on virus engineering or something more foundational?

7:29 pmaes: callen: I get your point. Do you have any suggestions on a reading list?

7:29 callen: pmaes: you're an intelligent person, SICP alone might be sufficient to bridge you over to a book on concurrency like the Goetz book.

7:30 bbloom: pmaes: SICP is always a good choice. and it's free http://mitpress.mit.edu/sicp/full-text/book/book.html

7:30 will teach you scheme too

7:30 callen: bbloom: I said the same, but you bothered to link it :P

7:30 bbloom: which is a good start towards clojure

7:30 callen: i was agreeing with you...

7:31 callen: bbloom: well if you have an otherwise educated and intelligent but totally naive individual, SICP is pretty choice.

7:31 and he already wants to learn Clojure apparently, so it was a good match.

7:31 if they're completely out of the water I just link them Zed Shaw's work.

7:31 * callen goes back to reading HP:MOR

7:31 callen: bbloom: it really is a pity you're not related to the bloom filters guy. We could use that to propagandize Clojure :P

7:32 bbloom: pmaes: SICP also has a chapter on concurrency, which might help you enough

7:32 callen: pmaes: resist the temptation to read ahead.

7:32 bbloom: pmaes: i envy you, i wish i could read SICP again for the first time. it blew my mind :-)

7:32 callen: pmaes: programming is more like martial arts than mathematics.

7:32 in terms of how it's learned, anyway.

7:33 I'm just #haskell would disagree, but w/e

7:33 sure*

7:33 bbloom: pmaes: does all that help?

7:52 pmaes: bbloom: Most certainly. Thank you very much. callen as well. I'm starting SICP now and will leave the jvm-specific information for later.

7:53 callen: pmaes: capital.

7:59 milos_cohagen: man, i find this langauge rough.. from http://clojure.org/Namespaces.. "Vars can be interned in a namespace, using def or any of its variants, in which case they have a simple symbol for a name and a reference to their containing namespace, and the namespace maps that symbol to the same var."

8:00 callen: milos_cohagen: that's not literature for noobcakes.

8:00 milos_cohagen: for the purposes of pedagogy, lets say that a var is just a reference or a pointer or a box around some value.

8:01 milos_cohagen: a namespace contains a collection of vars.

8:01 milos_cohagen: roger

8:01 callen: milos_cohagen: also, buy a book. I recommend Clojure Programming.

8:03 milos_cohagen: reading 'joy' now, i'm making more of a point that the description in the docs is hard to parse for me, ur avg programmer

8:04 specifically, "..they have simple symbol for a name and

8:04 +a reference to their containing namespace"

8:05 bbloom: milos_cohagen: i agree with you, a lot of the core docs are pretty terse

8:05 plus they have a lot of odd conjunctions, etc

8:05 they also are intended to be read by people who already know all the jargon

8:05 which makes them extra tough

8:05 milos_cohagen: so, what does, "symbol for a name" mean?

8:06 yeah thx bbloom

8:06 bbloom: there are three things that look similar until you squint just right

8:06 symbols are things like 'foo

8:06 they are names that can refer to some other value somewhere

8:06 then there are vars, which are things like #'foo

8:07 milos_cohagen: yep yep

8:07 bbloom: they are sorta like symbols, but they refer to "globals" function definitions, things like that

8:07 then there are keywords that look like :foo

8:07 they are sorta like symbols, but they always refer to themselves

8:07 vars have names

8:07 those names are symbols

8:07 ,#'inc

8:07 clojurebot: #'clojure.core/inc

8:07 bbloom: that's a var

8:07 ,(class #'inc)

8:07 clojurebot: clojure.lang.Var

8:08 bbloom: ,'inc

8:08 clojurebot: inc

8:08 bbloom: ,(class 'inc)

8:08 clojurebot: clojure.lang.Symbol

8:08 bbloom: that's a symbol

8:08 symbols and vars live in namespaces

8:08 ,`inc

8:08 clojurebot: clojure.core/inc

8:08 bbloom: ,(class `inc)

8:08 clojurebot: clojure.lang.Symbol

8:08 bbloom: keywords, however, don't

8:08 ,:inc

8:08 clojurebot: :inc

8:08 bbloom: ,':inc

8:08 clojurebot: :inc

8:08 bbloom: ,`:inc

8:08 clojurebot: :inc

8:09 bbloom: ,(class :inc)

8:09 clojurebot: clojure.lang.Keyword

8:09 bbloom: that doc string is telling you this:

8:09 ,(class (:name (meta #'inc)))

8:09 clojurebot: clojure.lang.Symbol

8:09 bbloom: get it?

8:10 milos_cohagen: forgive my silence while i take it all in.. tyvm

8:12 tufflax: The important point is that symbols are like identifiers in other languages, but in clojure symbols are themselves values. So you can do (def foo 'foo) and then (eval foo) will yield foo, and (eval (eval foo)) too, and so on. (def foo 'foo) stores the symbol foo in the var that has the name of the symbol foo in the current namespace.

8:13 ...I think, correct me if I'm wrong :P

8:14 bbloom: tufflax: nope, you're on point

8:28 firesofmay: Hi, I have small question. I want to append a string using a regex match. I need to get all the files inside a directory and subdirectory of patterm *.m I tried using conch library for this, but find doesn't seem to work recursively. Any pointers?

8:35 tufflax: bbloom, btw symbols doesn't necessarily lives in namespaces, do they? I mean, 'foo is just a value like 1, right?

8:36 bbloom: tufflax: symbols *may* live in namespaces, vars *always* live in namespaces

8:37 tufflax: firesofmay, I don't know what you mean by "I want to append a string using a regex match." But you can perhaps just use java Files and and make a recursive function yourself with list() and isDirectory(), or something :P

8:38 or listFiles()

8:39 bbloom: dammit. how did it get to 530 am. gooood night

8:39 milos_cohagen: bbloom and tufflax, thx a lot, i'm reading and playing in the repl with all u said

8:40 firesofmay: tufflax, okay will check that out.

8:44 tufflax: milos_cohagen, you can create symbols out of strings with (symbol "foo") and get the string back with (name 'foo). But they are perhaps most useful for macros. They docs are a little bit short when it comes to macros though :p

8:47 milos_cohagen: yeah i'm in my pre-macro stage of learning, thx much for the help

8:49 tufflax: :)

8:52 Sgeo: Possibly a good way to learn macros is by reading about Common Lisp macros, although there are some subtle differences

8:58 milos_cohagen: i'm about 1/2 way through sicp, little schemer, and starting 'joy' just now. i'm a long time java programmer who got my eyes opened up when i started learning javascript a couple years ago

8:58 tufflax: my stepping stone was python :P

8:59 Ralt: hm, people

8:59 milos_cohagen: ha yeah once you taste a functional language

8:59 Ralt: in lisp, if I want to use a let'd variable in the same let, I have to use let*

8:59 is there something similar in clojure?

9:00 AimHere: ,(let [a 1 b a] b)

9:00 clojurebot: 1

9:00 Ralt: alright, cool :)

9:01 tufflax: Now it's hard to get motivated to learn something new. But I'm learning Haskell too become a better clojure programmer, not because I think I will use it .P

9:01 to*

9:03 milos_cohagen: my motivation level in learning programming has gone up and down a cycle or two in my life

9:04 tufflax: I've always been motivated to learn but with clojure it's hard to imagine there is something better out there :P

9:06 milos_cohagen: i kick myself now at age 35 that i spent some years on auto-pilot cranking out java code by day, but not learning at same time

9:06 tufflax: hehe

9:07 milos_cohagen: i'm re-invigorated now that fp got a hold of me

9:08 tufflax: yeah, it's fun

9:08 I love macros too :p they are so nice when you need them

9:11 milos_cohagen, maybe you are more experienced than I am and know this stuff already, but this video really helped me become a better programmer and appreciate clojure http://www.infoq.com/presentations/Simple-Made-Easy

9:11 pisketti: milos_cohagen: Well said, sir. I have felt the same :)

9:11 Ralt: ok... how the hell do I define clojure.contrib.math as dependency?

9:15 tufflax: Ralt, I may be mistaken. But using clojure.contrib is the old way of doing things I think. I usually look for libs on github. Like maybe you want these https://github.com/clojure/math.numeric-tower https://github.com/clojure/math.combinatorics

9:15 Ralt: I just want Math/round :(

9:16 tufflax: it's in that numeric-tower :p

9:16 do you use lein?

9:16 Ralt: yeah

9:16 tufflax: yeah, so then it's easy to get it :P

9:16 Ralt: ah alright, found it

9:16 thanks

9:19 pisketti: Ralt: For future reference http://dev.clojure.org/display/design/Where+Did+Clojure.Contrib+Go

9:20 Ralt: thanks :)

9:20 I just saw plenty of old contents, so couldn't get anything right

9:21 callen: milos_cohagen: it's never too late.

9:21 milos_cohagen: don't ever let negativity creep into your brain at a time when you are trying to improve yourself. Reward your ego for seeking self-improvement. Most people spend their whole lives never trying any harder they have to in order to keep a paycheck.

9:21 milos_cohagen: eat some chocolate, drink some nice coffee, write some code. :)

9:22 milos_cohagen: my mother is in her 50s, I'm still trying to get her to take up coding period, let alone getting better at it.

9:23 bbloom: you know, my point about the docs being terse and insufficient might be alleviated by something like a wiki...carthago delenda est...

9:23 pisketti: callen: good points. I'd also add that it's important to surround yourself with enthusiastic ppl. Eg. a user group.

9:23 Ralt: clojure's being mean with me

9:23 callen: Ralt: it can be a stern mistress.

9:24 Ralt: not near as bondage-and-discipline as Haskell though! :D

9:24 p_l: callen: Haskell however gives you harsh time till you switch the roles ;)

9:24 callen: p_l: yeah, sure, then you have a space leak when you scare it too bad.

9:25 a space leak allll over the bed.

9:25 pisketti: It's my hypothesis that people don't actively seek self-improvement, because to do so would mean confronting all the previously misused time.

9:25 as a result, I exhort people vigorously to put the negative thoughts aside.

9:26 p_l: callen: it's called "brain damage" (and sometimes "natural optimist") ;)

9:26 pisketti: callen: My hypothesis is that not being exposed to new things and passionate practioners leads to sticking to your comfort zone and eventually apathy.

9:26 Ralt: okay -- pushed my code somewhere. With these deps https://github.com/Ralt/web-account-clojure/blob/master/project.clj and lein deps run, loading this file in nrepl throws me "FileNotFoundException could not locate math..." https://github.com/Ralt/web-account-clojure/blob/master/src/my_website/models/account.clj

9:26 p_l: (n.b. - research actually found that "naturally optimist" people have a difference in frontal lobe that stops them from being able to perceive nearly half of the negative ideas)

9:27 callen: pisketti: being exposed to passionate individuals definitely helps. There's a lot of factors involved in anything this complicated.

9:27 I, for one, rather adore this IRC channel.

9:27 pisketti: :D

9:27 callen: except Raynes.

9:28 p_l: callen: it also helps to actually go down and hit bottom once. Teaches you a bit of a different outlook at life

9:28 callen: anybody glancing at this terminal have an opinion on a ClojureWiki?

9:28 abaranosk: callen I second that about Raynes

9:28 callen: I really love EmacsWiki and think it would fantastic for Clojure.

9:28 abaranosk: callen: I've never heard of it

9:28 callen: abaranosk: you'll add me to that list soon.

9:29 abaranosk: my second favorite wiki of all time: http://emacswiki.org/

9:29 pisketti: callen & call: the science of motivation is interesting

9:29 abaranosk: so just a freeform anything goes, Clojrue wiki? What does it add that community lacks currently?

9:29 callen: pisketti: LW?

9:30 abaranosk: a wiki.

9:30 abaranosk: hey where'd the 'y' in my name go?

9:30 pisketti: sorry, callen & p_l that was :)

9:30 LW?

9:30 callen: abaranosk: I'm considering some semi-novel models for structuring and editing.

9:30 pisketti: testing to see if you were into a sub-community I lurk.

9:30 pisketti: apparently not :|

9:30 abaranosk: callen: in general, I love wikis!

9:31 callen: pisketti: Elizer Yudkowsky's cohort, LessWrong, all that. They analyze things like motivation.

9:31 abaranosk: what do you think suffices in its absence at the moment?

9:31 abaranosk: I like the ClojureWerkz stuff but it's not the same.

9:31 pisketti: callen: I'm only familiar with the popularised stuff like the Drive by Dan Pink :)

9:32 callen: pisketti: oh, I follow a bunch of weirdo itinerants obsessed with cryonics, bayesian reasoning, and the singularity.

9:32 pisketti: motivation is a testable hypothesis for them.

9:32 point being, you can experiment to figure out what works to motivate people.

9:33 abaranosk: anyway there's a lot of collected wisdom with regards to idioms, 'good practice', and the rest to Clojure that currently isn't being collected or documented. Is there a website or community where this is happening that I'm not aware of?

9:33 pisketti: Any key takeaways?

9:33 abaranosk: callen: I don't think anything has really captured the hearts and minds of thec ommunity

9:33 pisketti: callen: Say for a team member/coach

9:34 AimHere: Clojure's wisdom is distributed evenly across the entire internets

9:34 callen: pisketti: people are highly irrational, social pressure and expectations influence people strongly, work ethic can become a habit. People are generally more motivated by intangibles and well-wishing than economic motivators.

9:34 pisketti: here's a hint

9:34 pisketti: That I agree with

9:35 financial incentives just plainly do not work

9:35 callen: pisketti: part of the reason the YC crew focuses so much of their investment decisions on how well the founders get along with each other, and how they know each other is that they know a founder is more likely to hang with it when times are rough if they have a friendship with the other founder(s)

9:35 AimHere: Well there is a minimum threshold of financial comfort that you need, beyond THAT, the financial incentives stop working

9:36 callen: pisketti: if you can give a reason to care about the outcomes you want them to care about in a social context, you're a lot better off.

9:36 pisketti: AimHere: that is true

9:36 callen: AimHere: last study I saw put the number for people living in the US at about $70-90k

9:36 after that, the hedonic treadmill took over.

9:36 pisketti: callen: makes sense

9:36 callen: sadly, I don't have good numbers on cost of living for that.

9:36 AimHere: Heh, the hedonic treadmill?

9:37 callen: AimHere: your happiness tends to level off to its neutral/resting state regardless of external jolts.

9:37 AimHere: if you're a miserable person, 6 months after winning the lottery you'll still be miserable.

9:37 pisketti: callen: what is sad is that firms are still lead with outdated knowledge

9:37 AimHere: Right, though I was just wondering how the term 'treadmill' fit in there.

9:37 callen: there are some hypotheses on making permanent adjustments to your "resting state"

9:38 pisketti: callen: like the fact that engaged and happy ppl are way more productive

9:38 callen: pisketti: my concerns are somewhat smaller in scope, I'm a startup kid. I just have to motivate a small team of people, not convince a bunch of chairmen of the board.

9:38 AimHere: because it refers to the fact that if you up the "goodies" in your life, the treadmill just catches up with you

9:38 AimHere: Hang on, if the scientists all believe that happiness generally maxes out at $90k per year, isn't that an argument for a maximum wage! 100% tax at $100K

9:39 Won't make people more miserable

9:39 callen: AimHere: no because there's utility to income beyond that that grows the economy.

9:39 pisketti: I'm mostly concerned about my team as well but at the same time I'm trying to inject these ideas to upper management 8)

9:39 abaranosk: callen: I'm not a huge beleiver that people can be motivated

9:40 callen: pisketti: I sometimes have to cope with the alien psychology of investors/VCs who come from a more corporate background. I try to ignore their ideas on HR and focus on the business stuff.

9:40 abaranosk: but if I had to fin d away, I'd look for things that those people are already motivated by, and then frame what we're doing currently in terms that match what already motivates them

9:40 pisketti: I feel for you :)

9:40 callen: abaranosk: directly? me neither. indirectly? maybe. You have to create legitimate reasons for people to care, not just try to manipulate them.

9:40 AimHere: callen, who cares about economic growth? You maximise happiness by evening out the incomes, and nobody'll care if the economy shrinks ;)

9:41 callen: AimHere: well believe it or not, $90-100k per annum incomes don't happen without economic leverage and that economic leverage doesn't happen without new growth.

9:41 abaranosk: callen where are you working currently? I see you're also in the Bay Area

9:41 callen: few people are literally directly performing that kind of value of work, it's leverage that comes from providing value to a business model that multiples the utility across X customers.

9:42 AimHere: Well the growth will come because the people making significantly lower than $70k will have more money to spend

9:42 callen: abaranosk: at a startup

9:42 abaranosk: that's almost everyone here though :)

9:42 callen: abaranosk: I live and work in Mountain View at the moment for a nutrition/food startup.

9:43 with that much information and Google, you can track me down in 5 minutes.

9:43 pisketti: abaranosk: apparantly you need to be in a startup if you want to be writing clojure for a living

9:43 abaranosk: Runa's old office was in Mountain View. I lived there for a few months

9:43 callen: abaranosk: we're in the same building as YourMechanic

9:43 pisketti: except that I'm in a big corporation writing Clojure for a living ;)

9:43 abaranosk: callen: do you guys use Clojure

9:44 callen: pisketti: I don't write Clojure for a living, I write Python. My side projects are in Clojure.

9:44 abaranosk: no, I tend to be conservative when it comes to technological decisions made in a business context.

9:44 abaranosk: how do you like Python?

9:44 callen: abaranosk: used it for years, like it fine because I can project my version of FP onto it. Clojure has replaced it for side projects for quite awhile now though.

9:44 pisketti: callen: My (rather limited) experience is that Clojure is definitely mature enough by now

9:45 callen: myself and dustingetz are the only people I know of that have even taken monads seriously in the context of Python.

9:45 pisketti: it's not even really about maturity.

9:45 pisketti: callen: what then?

9:45 callen: pisketti: conservativism in this context means that I can estimate deliverables and product deadlines much more readily with something like Python than Clojure.

9:45 for now.

9:45 pisketti: I cannot take unnecessary risks, startups are risky enough. There is no fallback for a startup. Product has to be shipped ASAP, week in, week out.

9:46 pisketti: hmm, apparently you have a team of senior python hackers?

9:46 callen: pisketti: yes, a team doing dev-ops, backend, API, database, search, automation. A team of 1. me.

9:46 pisketti: I think one of the key benefits of using Clojure is the speed. The ability to ship sooner.

9:46 abaranosk: Man there are so many Korma issues. Hard to decide what to handle first.

9:47 pisketti: callen: it obv depends a lot on the context

9:47 callen: pisketti: maybe, maybe not. I take *knowing* something very seriously. I'm not willing to guess. I wanted more experience in Clojure before I subjected a business to my technological whims.

9:47 pisketti: the domain, the ppl etc

9:47 abaranosk: Clojure isn't about raw speed though, more about simplicity over time

9:47 pisketti: correct

9:48 callen: Clojure tends to have a most profound advantage once your problems reach a certain level of complexity.

9:48 abaranosk: callen: I think that is a very good point (knowing) At some point though, you need experience in the field to complete the full knowing

9:48 callen: up to that point, it's likely a wash and most of any difference will be up to programmer proficiency.

9:48 pisketti: abaranosk: I find FP specifically helpful there

9:48 callen: abaranosk: that's what the side projects are for. I'm building an end-to-end product in Clojure and ClojureScript.

9:49 so that I *know*

9:49 abaranosk: what are you using for the project?

9:49 callen: I don't know what you're asking, I'm sorry.

9:50 abaranosk: do any of you all have any preference for any of the outstanding Korma issues?

9:50 callen: abaranosk: are you asking what libraries I'm using?

9:50 abaranosk: callen: Sorry, I meant which libraries are you using?

9:50 hehe

9:51 callen: migratus, korma, ring, compojure, hiccup

9:51 soon, luminus. I've been tinkering with that with yogthos.

9:52 abaranosk: when I started this project at work that needed SQL, I looked for schema a migration library, but they all seemed overkill

9:52 callen: abaranosk: migratus is pretty lightweight. You just write *.sql files.

9:52 abaranosk: we ended up using some code taken out of the clojars website github repo

9:52 callen: it migrates each file individually in timestamp order.

9:53 abaranosk: Maybe I should take a look at migratus

9:53 callen: abaranosk: especially since I just got done harassing pjstadig into fixing it.

9:53 so that work has already been done. cheers.

9:54 abaranosk: callen: so you are also up at an ungodly hour then? You're not in China or something?

9:54 callen: abaranosk: just needed a few changes for lein2

9:54 abaranosk: no, I don't have time to travel. I'm simply up at an ungodly hour. My circadian rhythm is 25-26 hours long and when vacation time hits, I start slip slip slipping into the future.

9:55 abaranosk: same thing happens to me actually

9:55 ChongLi: hi, anyone here with clojurescript/gclosure experience?

9:55 I'm trying to use piggieback to start a browser repl

9:56 and I keep getting this error

9:56 Uncaught Error: Undefined nameToPath for goog.async.Deferred

9:56 it seems to be a missing dependency in the closure library

9:56 I don't know why it would be missing though

9:57 callen: ChongLi: https://groups.google.com/forum/#!msg/clojure/6FvdB9yFOzI/tBpPaZWok34J

9:58 abaranosk: you got my first ghub issues vote.

9:58 second vote.

10:09 abaranosk: callen: I don't see it..... link?

10:10 callen: abaranosk: look at the github issues or the recent comments on github issues.

10:11 abaranosk: example here: https://github.com/korma/Korma/issues/101

10:14 abaranosk: callen thanks. I'll think about this deeper when I'm less tired. In gneral, connection pooling seems to be a issue that is effecting a lot of different people/issues. I want to make sure the final solution makes sense all around

10:17 callen: abaranosk: no solution is final, but you might be able to make connection pooling a non-problem long enough to create breathing room to address other things without having to come back to it regularly.

10:20 abaranosk: callen: yep, I'm considering the angles. I need a little more time to digest

10:43 Seba51: Is there an alternative to lein-auottest for leiningen 2?

10:46 Raynes: I wrote a prerequisite library planning to write an alternative to it, but never got around to it.

10:46 Seba51: So it needs to be ported to Leiningen 2.

10:46 Sgeo: Well. I found a monads library worse than clojure.algo.monads.

10:47 Didn't think it possible.

10:51 Raynes: Sgeo: Hah

10:52 Sgeo: It's similar to clojure.algo.monads except there's no monadfn and no other way to define a function that works with monads unless it itself does with-monad

10:52 abaranosk: Monads are those thing you use to make simple problems fancy problems, right?

10:52 Seba51: Which test frameworks are used in the community. I used clojure.test and midje in my first experiences.

10:53 abaranosk: there are a couple other niche ones I think as well

10:53 expectations for one

10:53 Raynes: abaranosk: Is this the username you plan to use from now on on IRC?

10:54 abaranosk: also, speclj

10:54 Sgeo: do-> in Enlive is sort of a macro that represents a concept that would work as a monad

10:54 abaranosk: Raynes: no, Linkinus went crazy

10:54 Seba51: ä#

10:54 daughter was typing

10:54 Raynes: abaranosk: What do you want to use?

10:54 abaranosk: (in other words I haven't been bothered to figure out how to change my name yet)

10:54 Sgeo: /nick newname

10:54 abaranosk: alex_baranosky

10:55 Raynes: underscores are for wimps.

10:55 abaranosk: I stand as accused!

10:55 Raynes: How about alexbaranosky?

10:55 Or baranosky

10:55 Surely there isn't anyone else on freenode named baranosky

10:56 abaranosk: Raynes: you are caring a confusingly lrge amount about this :)

10:56 baranosky: Nope, there isn't.

10:56 abaranosk: maybe I'm just too tired to understand

10:56 Raynes: I'm giving you an account on my ZNC instance.

10:56 :p

10:56 I'm picking you an IRC nick.

10:57 yogthos: Raynes: hey, so I saw we made a doodoo in our checkin for 0.3.0 making some unit tests right now :)

10:57 Raynes: we should hook up travis for next time too

10:57 Raynes: yogthos: Thank you. I'd rather be named baranosky than write lib-noir tests.

10:57 yogthos: Raynes: :) no prob

10:58 Raynes: yogthos: Don't bother pushing to a branch for the tests. Just push 'em to master and I'll hook up travis when theyr'e done.

10:58 abaranosk: Raynes: aha it all makes sense now

10:58 then alexbaranosky ???

10:58 lazybot: abaranosk: How could that be wrong?

10:58 Raynes: Sure. Winner.

10:59 yogthos: Raynes: ok I'll stick some in soon :)

11:00 Raynes: abaranosk: This will just take a moment and won't hurt a bit.

11:00 Blast!

11:00 He probably went to bed.

11:00 I decided to not go to bed.

11:00 Because I can't sleep.

11:00 I'll take a nap later.

11:00 The baranoskynater

11:01 abaranosky: Have you registered alexbaranosky yet?

11:02 He isn't very good at IRC.

11:02 alexbaranosky: tada

11:03 ChongLi: gah, now you're the same colour as Raynes

11:03 Raynes: alexbaranosky: Have you registered it yet?

11:03 alexbaranosky: Raynes what do I have to do to register it?

11:03 Raynes: alexbaranosky: Type the following: /msg nickserv register mypass myemailaddress

11:04 Don't over think the password. The day someone tries to steal your nickname is the day I do jumping jacks on Mars.

11:04 AimHere: I may have to see that.

11:05 Raynes: You'd need a really good telescope.

11:05 alexbaranosky: Raynes: done

11:05 Raynes: Excellent

11:05 ChongLi: nah, I'd just watch it on the live video feed from the rover

11:05 AimHere: You'd need a really good Space Program. I think I'll get what I need before you

11:05 Raynes: Okay. Now this is the hard part.

11:05 alexbaranosky: Raynes: never say never with the Mars jumping jacks thing

11:05 Raynes: alexbaranosky: Going to private message you with instructions.

11:05 alexbaranosky: anything can happen

11:06 cool

11:30 andrewmcveigh: Anyone know if it's possible to write an "OR" query with sql korma's map syntax? Something like (select foo (where {:id [or 1 2]})) - can't seem to find how to do it.

11:34 alexbaranosky: (select foo (where (or {:id 1} {:id 2})))

11:35 Raynes: alexbaranosky: Success!

11:35 alexbaranosky: andrewmcveigh: when in doubt, check the tests: https://github.com/korma/Korma/blob/master/test/korma/test/core.clj#L138

11:35 Raynes: high five

11:36 andrewmcveigh: alexbaranosky: ah, OK thanks.

11:37 alexbaranosky: man I love Indian food.

11:38 andrewmcveigh: alexbaranosky: the docstring for "where" sort of suggests you can use it in the same way as "like", etc.

11:40 hyPiRion: ~factorial

11:40 clojurebot: factorial is not something you need alphanumeric characters for: https://gist.github.com/3036120

11:41 alexbaranosky: andrewmcveigh yeah, you can use it like those too

11:41 hyPiRion: Oh sweet, clojurebot's back

11:42 alexbaranosky: andrewmcveigh (select foo (where {:id [or 1 2]}))) ;; does this work?

11:44 andrewmcveigh: alexbaranosky: no, doesn't work here...

11:45 it's expanding to: SELECT "foo".* FROM "foo" WHERE (("foo"."id" OR ?)) :: [1]

11:46 alexbaranosky: wonder if that's a bug... there's no unit test for this, so it could be one

11:47 dbushenko: alexbaranosky, when do you plan to push beta12 to clojars?

11:47 Raynes: alexbaranosky: Also, worth noting that znc doesn't log IRC conversations anywhere that I know of, so feel free to visit any number of cyber sex channels without me ever being the wiser.

11:47 alexbaranosky: for now use the syntax I gave first then, we need a bug report, and me fixing it :)

11:47 dbushenko: I've just started leading the proejct and am getting up to speed still, but certainly within a week

11:48 dbushenko: great!

11:48 alexbaranosky: Raynes: good to know :)

11:48 dbushenko: btw, thanks for maintaining korma!

11:48 alexbaranosky: dbushenko sure thing. Just don't be too hard on my while I get a little more up to speed.

11:49 dbushenko: sorry :-)

11:49 alexbaranosky: I was joking mostly

11:49 andrewmcveigh: alexbaranosky: OK, the other syntax doesn't really work for me, but I'll work around. You want me to create a github issue?

11:51 alexbaranosky: andrewmcveigh: issue would be great. Were yo saying it doesn't work for your use case... or that it also doesn't work?

11:52 andrewmcveigh: alexbaranosky: for my use case. I really could do with passing a map in, as I'm not writing the query manually.

11:54 alexbaranosky: andrewmcveigh: understood. I'm going to look into this now. Most of these aren't covered in the unit tests, so there may be some bugs hiding: [=, like, and, or, >, <, >=, <=, in, not-in, not, not=]

11:58 andrewmcveigh: alexbaranosky: Cool, haven't noticed other probs with the predicates, but probably haven't used them all. BTW, is there a non-horrible way to add a predicate? I needed 'ilike for postgres's case insensitive like, but had to resort to 'alter-var-root ... :-O

11:59 alexbaranosky: andrewmcveigh: no there is not, but maybe we should explore making the preds extensible

11:59 andrewmcveigh: I was just looking through the list of predicates, 'and' seemed weird

12:00 I am not sure what it would really mean to say (where {:id [and foo bar]})

12:01 andrewmcveigh: alexbaranosky: Yeah, I'm not sure how that would be of any use...

12:02 alexbaranosky: I'm adding unit tests for these now.

12:03 andrewmcveigh: great :), do you still want the issue writing?

12:04 Raynes: alexbaranosky is so cute, maintaining his korma.

12:05 He should post about his maintainership to hacker news and get some korma karma.

12:05 My life is complete now that I've used those two words together in a sentence.

12:05 hyPiRion: Raynes: All these years

12:05 waiting for the perfect moment,.

12:06 dbushenko: :-D

12:23 Raynes: Anybody else debug an issue for 30 minutes and realize the stupid reason for it and immediately vocalize some weird "ABLUGHABLUGADUUUUUUH" sound?

12:24 ChongLi: Raynes: the sound doctor zoidberg makes when he flutters his tentacles?

12:25 Raynes: Sometimes.

12:26 hyPiRion: I tend to do that if I realize that when I'm dealing with spaghetti code going outside the project I'm working in and into APIs I'm using

12:27 /s/when//

12:44 Ralt: is there the 1+ function in clojure?

12:45 alexbaranosky: `inc`

12:45 Ralt: in CL, (+ 1 2) can be done with (1+ 2)

12:45 alexbaranosky: `inc`

12:45 ChongLi: ,(inc 2)

12:45 clojurebot: 3

12:45 Ralt: k. Thanks.

12:46 ChongLi: Ralt: http://hyperpolyglot.org/lisp

12:46 for a nice chart comparing everything

12:47 Ralt: ha. thanks :)

12:48 symbols are case sensitive?!

12:48 damn. I better read that chart.

12:48 ChongLi: there are a lot of little differences

12:48 besides common function names

12:49 hyPiRion: ,(let [+* +, + println] (+ 1 2))

12:49 clojurebot: 1 2

12:49 hyPiRion: ^lisp1

12:49 technomancy: aaaaah don't read hyperpolyglot

12:50 it's really unhelpful and superficial

12:50 ChongLi: technomancy: why not?

12:50 is it indicative of an incorrect approach?

12:50 (that of trying to directly translate idioms from one language to another)

12:51 technomancy: yeah, it's coming from a CL perspective and trying to find matches where they aren't actually intended for the same thing

12:52 plus a lot of things are just straight up incorrect, like the clojure definition of atom

12:52 Ralt: it's more knowing the differences so that I don't do stuff in clojure that I'd do in CL. Like, assuming case-insensitivity of symbols

12:53 technomancy: it also claims clojure doesn't support arrays?

12:53 alexbaranosky: misinformation I tell you!

12:53 Raynes: Kastupid

12:53 ChongLi: that is weird

12:53 technomancy: plus it tells you to use structs

12:54 ChongLi: clojure has make-array

12:54 hyPiRion: and into-array

12:54 ChongLi: jeez, why would they say it doesn't?

12:54 uvtc: It *is* nice though to see a concise summary of "here's how $this-lang differs from $that-lang". Way back when, I wrote up some of those myself at ruby-lang.org.

12:55 technomancy: it also seems to be confused about docstrings

12:55 I could go on but I think you get the point

12:56 uvtc: hey, do you know if there's any progress on a Clojure HTML UI for the clojuredocs.org API?

12:56 dcb: So I think I'm missing something obvious here, but: How do I start an nrepl server in a lein 2 project, and where/how should I specify what port it uses? If it makes a difference I'm trying to get vim-foreplay to connect to the server

12:56 technomancy: someone was saying they wanted to help out with that

12:56 ChongLi: it also says you can't define an exception in clojure

12:56 technomancy: dcb: :repl-options {:port 4005}

12:56 uvtc: technomancy: no, but we could ask dakrone .

12:56 ChongLi: can't you just subclass Exception

12:56 ?

12:57 tpope: dcb: if you run "lein repl" foreplay will find it automatically

12:57 clojurebot: Huh?

12:57 alexbaranosky: I think you need to AOT compile a gen-class?

12:57 technomancy: ChongLi: yeah, but it's a bad idea. better to use ex-info

12:57 alexbaranosky: what he said

12:57 Raynes: And for those who missed it, he said to use ex-info

12:57 technomancy: the point is, the differences between the languages can't be meaningfully expressed in a table; it needs prose

12:58 ChongLi: technomancy: I think you could say that about almost anything

12:58 people love to create tables which misrepresent things

12:58 tpope: w3schools anyone?

12:58 dcb: technomancy, tpope: OK, thanks

12:59 uvtc: technomancy: Ah, yes, I saw that in the irc logs at some point. Last I heard the project is https://github.com/dakrone/eisago , but not sure I understand yet exactly how that fits together.

13:00 ChongLi: I doubt it's intentional misrepresenting. It's tough for an author to be expert in *all* of them. :) And the people who *are* experts in all of them aren't always the ones motivated to write up the tables. :)

13:01 seangrove: Anyone using shoreleave in here? Having a very difficult time getting it to work with keywords-as-topics

13:03 ChongLi: uvtc: sure, but my point was that tables are often used in a rhetorical fashion

13:04 uvtc: this sort of thing: http://www.timothysykes.com/wp-content/uploads/2010/01/iPad-vs-Rock.jpg

13:04 uvtc: ChongLi: hehe. :)

13:26 bpr: anyone have any useful tips for debugging namespace load errors? Errors such as: "NoClassDefFoundError Could not initialize class"

13:32 raek: bpr: do you have a paste of the whole error?

13:33 bpr: https://www.refheap.com/paste/7940

13:34 https://www.refheap.com/paste/7941

13:34 ^ the namespace declaration of the ns i'm trying to load

13:34 raek: hrm, this is not the "usual" "ClassNotFoundException" or "Could not locate foo/bar__init.class" errors...

13:35 bpr: do you use ahead of time compilation?

13:35 is your classes/ directory empty?

13:36 bpr: no aot comp

13:36 no, my classes directory isn't empty

13:36 raek: bpr: do you use "lein run" without any arguments?

13:37 bpr: that paste is from a repl session

13:37 i did (require 'server.core)

13:37 raek: and do you have a :main entry in the project.clj without ^{:skip-aot true}

13:38 bpr: here's the output of a lein run: https://www.refheap.com/paste/7942

13:38 yes

13:38 raek: if you have a :main entry without ^{:skip-aot true} before the symbol, then you are using AOT

13:38 sadly

13:38 bpr: project.clj: https://www.refheap.com/paste/7943

13:38 oh ok

13:39 raek: replace ":main server.start" with ":main ^{:skip-aot true} server.start"

13:39 and remove everything in classes/

13:39 and restart your clojure instance

13:40 you got the error because aot-compiled files were shadowing your new modified code

13:40 bpr: ah

13:40 thanks

13:40 raek: aot just messes everything up...

13:40 bpr: it's weird b/c i did a lein clean at one point earlier while trying to debug this

13:41 lein run seems to work now

13:41 thanks

13:41 raek: you might need to look into this again if you want to make a uberjar, though...

13:42 bpr: ok

13:43 Ralt: hmmm

13:45 it looks like emacs/nrepl doesn't pick up the new deps installed with lein

13:45 is there something to do?

13:45 or it's just that I don't know how to have multiple :use

13:45 and google doesn't provide any good pointer.

13:46 raek: Ralt: have you restarted the nrepl instance?

13:46 Ralt: nope

13:46 do I have to?

13:46 raek: yes

13:47 ppppaul: what does the #() reader macro do?

13:47 raek: at least I think so. this is the case for "lein repl" and the old swank way

13:47 Ralt: kk

13:47 ppppaul: oh, nvm

13:47 raek: ppppaul: is is a shorthand for (fn [...] (...))

13:47 ppppaul: forgot it was anon fn shortcut

13:48 Ralt: well, restarting doesn't change, guess my problem lies elsewhere :-)

13:48 raek: if you didn't get an error when you started the repl, then the dependency parts in the project.clj files were correct

13:48 (and clojure should be started with access to those deps)

13:49 Ralt: if I want to use :use several times, I do like this? (ns ... (:use some.dep) (:use other.dep))

13:49 k, good to know

13:49 raek: yes, but you shoulnd't use :use, use :require

13:49 Ralt: oh well, guess so

13:49 it's just that all the noir tutorials use form-to

13:49 so I guess they :use hiccup.core

13:50 raek: ah

13:50 Ralt: at least I hope so

13:50 raek: anyway, prefer :require for new code :)

13:50 Ralt: no, it's hiccup.form

13:51 yeah I guess

13:51 raek: that's the problem with use... you cannot tell where a symbol comes from

13:51 Ralt: well it's nice for some cases

13:51 but yeah, I get the point

13:51 raek: I think short prefixes work well enough

13:52 (:require [hiccup.core :as h]) for example

13:52 Ralt: true

13:52 I'll go with that

13:52 thanks for the advice

13:52 raek: also, that you give to require and use does not have to correspond to the dependency name

13:53 Ralt: I'll just use :use with :only I guess

13:54 borkdude: require also supports :refer

13:54 so use is pretty much obsolete now

13:54 Ralt: :refer?

13:54 gfredericks: Ralt: does the same thing as use/only

13:55 Ralt: oh, handy

13:55 borkdude: hmm, clojuredocs should be updated to 1.4/1.5

13:56 raek: and it should not have a big link to clojure.contrib.* on the front page... :)

13:58 gfredericks: and it should let you search for things by name

13:58 Ralt: any example of using require with refer?

13:59 gfredericks: (:require [foo.bar :refer [things in foo dot bar]])

13:59 Ralt: thanks

13:59 gfredericks: you can mix that with :as as well

13:59 super-nice

14:00 borkdude: (require '[clojure.set :refer [union]])

14:00 gfredericks: I guess for and and are hard so search for because they're common words as well

14:05 ppppaul: how do i duck punch functions in clojure?

14:05 borkdude: duck punch?

14:06 ppppaul: wrap a fn

14:06 but with the same name

14:06 borkdude: (def + +)?

14:06 ppppaul: hmm

14:06 hyPiRion: wrap a fn?

14:07 borkdude: (def + (fn [& args] (apply + args)))

14:07 ppppaul: i have a (find-id) fn in my ns. i want to overwrite it, but use the old find-id fn inside the overwritten fn

14:07 AimHere: ,(let [+ -] (+ 4 3))

14:07 clojurebot: 1

14:08 borkdude: (def find-id (fn [x y z] (find-id x y z)))

14:08 ppppaul: interesting

14:08 that wont throw a warning?

14:08 borkdude: ppppaul of course not, vars are mutable as hell

14:08 hyPiRion: ,(let [+ (fn [a b] (if (odd? a) (+ a b) (- a b)))] (+ 1 2) (+ 2 2))

14:08 clojurebot: 0

14:08 hyPiRion: ,(let [+ (fn [a b] (if (odd? a) (+ a b) (- a b)))] [(+ 1 2) (+ 2 2)])

14:08 clojurebot: [3 0]

14:08 ppppaul: maybe i was doing it wrong... i was using (defn

14:09 hyPiRion: yeah, with defn, you get recursion

14:09 borkdude: ppppaul hyPiRion you can avoid the recursion by using fully qualified name

14:09 AimHere: As long as the functions are in different namespaces

14:10 borkdude: AimHere right

14:10 ppppaul a safer approach is maybe to use binding

14:10 (defn my-find-id [] bla), (binding [find-id my-find-id] (some expr))

14:11 gfredericks: ^:dynamic

14:11 borkdude: ppppaul yes, find-id has to be declared dynamic then

14:12 ppppaul: hmm

14:12 it's not dynamic and it's from someone else's lib

14:13 hyPiRion: just fully qualify it, and require from your own ns

14:14 bpr: borkdude, ppppaul: wouldn't technomancy's robbert hooke library be useful?

14:14 borkdude: bpr don't know it

14:15 ppppaul: woah, this is getting too complicated for what i need... going to just call it by a different name

14:15 bpr: https://github.com/technomancy/robert-hooke

14:16 borkdude: ppppaul that's an even better idea, use a different name

14:16 =)

14:16 bpr looks nice

14:16 ppppaul: robert hooke is badass

14:44 devn: oh cemerick -- you've found a way to keep my sunday busy: https://gist.github.com/3e615a4d42b88ccefdb4

14:51 cemerick: oh...whoa. were you actively editing this when i mentioned it?

14:53 cemerick: nevermind. i think something is weird with github's "last updated at" thingy. it's saying last updated "just now", but no new revisions as far as i can tell

15:14 technomancy: is clojurescript-mode still useful now that we have piggieback? https://github.com/technomancy/clojure-mode/pull/118

15:16 borkdude: computable numbers are enumerable.. why, can someone explain it to me?

15:16 because turing machines themselves are enumerable?

15:18 hyPiRion: Because that's the definition?

15:18 A set of computable numbers: There is an algorithm that enumerates its members.

15:19 borkdude: hyPiRion computable in the sense of: there is an algorithm that can compute the digits of the number to an arbitrary precision

15:19 hyPiRion like 1/3, Pi, e, etc

15:20 hyPiRion: Well, yeah, theoretically

15:21 It's more in the lines of "repeating this algorithm forever yields π"

15:22 It's a property of the algorithm, not the turing machine.

15:22 borkdude: hyPiRion I want to have n digits of Pi, the digits are computable

15:26 tomoj: Raynes: #'zip seems useful, but it also seems kind of silly in my case - maybe it would make more sense to have a select-locs or something?

15:26 or just make select always return locs... :/

15:27 actually, that probably wouldn't even work

15:35 yeah that seems to not work

15:37 cemerick: devn: heh, that's pretty old at this point :-)

15:38 tomoj: I've been pondering something like that the past couple days

15:40 a seq done like that could be traversed backwards with the reverse index, then you can layer on IIndexed

16:19 heh, I can backward slurp the repl prompt :/

16:40 acron: hi

16:41 https://www.refheap.com/paste/7948

16:41 Would some one mind taking a look at this?>

16:42 I'm having a problem in which if a string with count < 4 is passed in,, an exception is thrown

16:42 It appears the "else" is resolved, even in the condition returns false

16:44 tomoj: (< 4 (count s)) is `4 < s.length`

16:44 I think you mean (< (count s) 4)

16:44 btw, there is subs in clojure.core for .substring

16:45 acron: tomoj: gah, thanks - it is the count call messing it up

16:46 ahhh, so subs == .substring ?

16:46 tomoj: yeah

16:46 I think you could also just write (defn is-op-str? [s] (.endsWith s "_op"))

16:47 chouser: including index out-of-bounds exceptions

16:47 tomoj: for which there is no non-interop equivalent

16:47 I'd think clojure.string would have starts-with? and ends-with?, but oh well

16:48 hyPiRion: tomoj: You got them from interop though, it's not really worth it wrapping them up

16:48 tomoj: unless you're porting clj to cljs :)

16:48 plus, same argument applies to subs :P

16:48 acron: what would be the call via interop? i've not done any yet

16:49 hyPiRion: ,(.startsWith "123" "12")

16:49 clojurebot: true

16:49 hyPiRion: ,(.startsWith "12143" "14")

16:49 clojurebot: false

16:49 acron: awesome.

16:49 tomoj: (.endsWith s "_op") above is 'interop', endsWith is a java method on String

16:50 hyPiRion: in addition, clojure.string could have {starts,ends}-with? work on CharSequence, like its {upper,lower}-case

16:51 acron: tomoj: afaik, clojure.string currently doesn't have starts-with or ends-with

16:51 tomoj: indeed, that's why I'm complaining (when I should just be writing a patch..)

16:51 acron: is '.' short-hand for interop? Isn't it like (java.String.endsWith ...) ?

16:51 hyPiRion: tomoj: In fact, it could work on anything

16:51 That would be even better

16:51 tomoj: I dunno

16:51 hyPiRion: (starts-with [1 2 3 4] [1 2])

16:51 tomoj: whoa, that is not what I thought you meant

16:52 acron: that's an awesome idea

16:52 tomoj: thought you meant (starts-with? [1 2 3 4] "[1 2")

16:52 I don't want either of those though

16:52 hyPiRion: Don't think it translates well to fast java interop

16:52 tomoj: oh, I see, cus strings 'are' seqs

16:52 er, they are seqable

16:53 hyPiRion: yeah

16:53 tomoj: yeah, I'd like clojure.string/starts-with? which is fast for strings

16:54 if you had a protocol for take, you could make a general starts-with? fast for ITake maybe, but that's crazy

16:55 hyPiRion: there's much crazy in Clojure already :p

16:57 chouser: doesn't sound crazy to me

16:58 tomoj: well, what should ITake's return value be, a seq?

16:58 it seems like it'd be cumbersome to implement all of IMap, IFilter, ITake, IDrop everywhere, like I was thinking

16:59 chouser: oh, perhaps I misunderstood

16:59 hyPiRion: ,(ancestors clojure.lang.IPersistentVector)

16:59 clojurebot: #{clojure.lang.ILookup clojure.lang.Reversible clojure.lang.Associative clojure.lang.Seqable clojure.lang.IPersistentCollection ...}

16:59 tomoj: above I just meant (defprotocol ITake (-take [x])) where (= "f" (-take "foo" 1))

17:00 and (= '(1 2) (-take '(1 2 3) 2)), (= [1 2] (-take [1 2 3] 2))

17:01 (apply a gricean maxim to get more information than is literally contained in those equalities..)

17:03 say you have a cljs macro which does some weird global processing of the env, say it finds all implementations of a specific protocol and generates code based on that. in foo.weird, you call this weird macro at the top-level. now you may get different results for (:require foo.weird foo.bar) from (:require foo.bar foo.weird). what can we infer from this?

17:03 you shouldn't write a weird macro like that? you shouldn't call it at the top-level?

17:03 you can do that and tell people to be careful, without being burned at the stake?

17:04 one can also assume that the macro is idempotent, so that you can call it again in a new top-level to ensure you picked up all the protocol impls not seen before, and if there aren't any, it will generate no code

17:09 I feel like I want a hook that gets called every time a ns is required, even if it had already been required

17:10 which.. makes me uneasy

17:12 acron: tomoj, thanks again for your help

17:13 all working now

17:15 tomoj: the goal would be to be able to say things like "find everything which implements IKVReduce and doesn't have an explicit IReduce impl. extend IReduce to those types with this impl that calls reduce-kv" (assuming you own IKVReduce, for politeness)

17:16 with access to the env it should work even for (reify IKVReduce (-kv-reduce [coll f init] ...)), assuming that the ns which does that has already been analyzed

17:18 hmm.. that seems pretty damn weird though. probably couldn't work in clj either even if we had an analyzer like cljs's and the env was passed to macros

17:39 bbloom: what did you mean by "separate what from how"?

17:40 bbloom: tomoj: i mean that when you design with data, you build up some data structure that describes your problem and then you write an algorithm to solve that problem

17:40 it's a good idea to figure out which bits are essential to the problem and which bits are incidental because of the way you choose to solve it

17:41 tomoj: so specifically, it worries me a bit to jump straight to cards.dtm instead of cards.clj, since datomic seems "how"

17:41 bbloom: tomoj: don't jump straight to cards.dtm

17:42 tomoj: the trick is continuous refactoring

17:42 but when refactoring, you should figure out where to put your data

17:44 tomoj: what i like to do is to start with trivial functions from the bottoms up that i know i'm gonna need. in your case, that would be stuff like "move this card from player 1 to player 2's hand"

17:45 ibdknox: in this case I'm not sure I see the value in it being in datomic

17:45 bbloom: oh, yeah, i dunno why datomic is involved here haha

17:45 the entire game state is probably pretty small and could be in a single tree of maps, spit to file & you're good :-)

17:45 ibdknox: I actually would argue that adds a fairly high amount of incidental complexity

17:45 ppppaul: i want to add ns defs for all exposed vars from (use ns) in my ns... how can i do this?

17:45 bbloom: ibdknox: absolutely

17:45 tomoj: it certainly adds overhead

17:47 ibdknox: ppppaul: I don't follow

17:48 ppppaul: my shot in the dark would be something like potemkin: https://github.com/ztellman/potemkin

17:48 ppppaul: my ns is getting a var (find-id) from some other ns. i want to be able to do my-ns/find-id

17:48 tomoj: I want to be able to run queries like, say, "find all games in which a player bought exactly two joats, and get their score for each turn of that game"

17:48 bbloom: ppppaul: i asked about this too, here's some discussion http://clojure-log.n01se.net/date/2012-12-25.html#16:31

17:49 tomoj: i think you do that *later*

17:49 tomoj: runtime data structures and query data structures are likely to be different

17:49 so embrace that

17:49 ibdknox: card defs don't belong in datomic

17:50 game state could be stored there if you wanted

17:50 bbloom: although some card metadata can be in datomic if you wanted to query by it

17:50 tomoj: I do, but that is admittedly a minor convenience

17:50 ibdknox: but I agree with bbloom do that later

17:50 bbloom: isolate components! write the runtime data structure

17:51 and you can maintain a data structure of every step and the state at each step

17:51 ibdknox: ppppaul: import-fn in potemkin will do that I think

17:51 bbloom: and then when you want to query it, write a function that walks the data structure and flattens it into a datomic insert

17:51 much much simpler!

17:53 ibdknox: we should settle on a datalog impl

17:53 ppppaul: ibdknox, thank you so much

17:53 ibdknox: then you could get the querying without the complexity of datomic

17:53 for things that aren't really database-y

17:53 tomoj: well, you can use datomic's datalog without using a database

17:53 but you still have the dep

17:53 ibdknox: ppppaul: no problem dude

17:54 tomoj: and I'm not hopeful they'll break out the datalog and release it

17:54 ppppaul: why do you care about the dep?

17:55 tomoj: I feel my preferred representation for game state is a seq of datoms, but maybe I've just been staring at .dtm files for too long

17:55 well, it pulls in a whole lot you don't need just for datalog. and logging and apache httpclient come to mind

17:55 e.g. pedantic complains if you ask for the latest datomic and latest clj-http

17:56 bbloom: tomoj: preferred for what task?

17:56 ibdknox: so you can use the datalog stuff without some crossprocess nonsense?

17:56 bbloom: you need different representations for different purposes

17:57 ibdknox: i.e. without spinning up a database instance

17:57 bbloom: tomoj: did you watch http://www.infoq.com/presentations/Thinking-in-Data ? do like they did with their poker game!

17:58 tomoj: ibdknox: yeah, the query logic is 'client'-side. no transactor needed. and you don't even need an in-memory database, since the datalog bit works on regular clojure data structures as well

17:58 bbloom: after the game is over, you can flatten facts about the game into datoms and query to your heart's content

17:58 hiredman: ~ping

17:58 clojurebot: PONG!

17:58 hyPiRion: ~gourds

17:58 clojurebot: SQUEEZE HIM!

17:59 tomoj: thanks for the thoughts (bbloom: and the video)

17:59 bbloom: tomoj: the poker example is really good, it's actually extremely similar to dominion in terms of design approach

18:05 the Thinking In Data talk was particularly interesting to watch *after* i had already internalized all the same stuff he's saying. i found myself nodding my head like he was preaching gospel

18:18 tomoj: hmm, consider outpost. if the game is an atom which we swap with state updates, we have to leave some history around in the state that says 'this turn is happening because of outpost' to know not to give them another turn if they play another outpost

18:19 ppppaul: ibdknox, have you used potemkin?

18:19 tomoj: I guess it's not really a problem to make the game state include the entire history

18:20 ibdknox: ppppaul: I have not. It's used throughout ztellman's stuff though

18:20 bbloom: tomoj: or you can store a flag on the current state

18:20 and you have your choice of history representation

18:21 ppppaul: crap. i'm running into a problem with it

18:21 bbloom: you can trivially have a :previous-state key, and that's basically a linked list

18:21 that would give you O(N) access to prior states where N is number of states back in time to travel

18:22 which is probably good enough

18:22 tomoj: and I'd think N shouldn't ever be more than 1, though I will not be surprised when I am wrong

18:22 bbloom: so, if you're wrong, you change it :-P

18:22 think about the types of operations you need to perform

18:22 design a data structure for that

18:23 then, figure out which bits are "essential" and which bits are just cached values for convenience & performance of later algorithms

18:23 the ultimate essence of the game is just a list of actions taken. you can serialize games as a vector of action maps

18:24 but at runtime, you might want [:outpost-played true] in your map for convenience

18:24 if each game state has an :action key which is the most recent action, you can trivially produce the game history by reduction

18:25 you create a 'history function which returns a sequence of game states in reverse cronological order

18:25 then you (reduce (fn [actions state] (conj log (:action state))) [] (history state))

18:26 and then you have a nice little vector of actions, spit to a file, poof you're done

18:26 love it.

18:26 ogrim: Anyone compiled Clojure CLR for .NET 4.5?

18:26 bbloom: the history function is just a lazy-seq recursive walk down into :previous-state keys

18:28 tomoj: does that make sense?

18:30 tomoj: yeah

18:31 bbloom: so this is what i mean by what vs how: you need to work at it from both angels

18:31 in this case, the "what" is the sequence of actions

18:31 the how is the structure you're using at runtime to power the particular functions you need to make the next game state from a given action

18:32 you gotta come at the problem from both sides :-)

18:32 tomoj: "find all turns (in any game) in which a player could have played an outpost to get an extra turn, but didn't". we could write a query function that builds up a game state map from all the recorded datoms up to a point, then one which applies the datomic-less game logic to that. worries me some performance-wise, but I'll ignore that concern for now

18:33 bbloom: tomoj: that's one strategy

18:33 amalloy: bbloom: uh, isn't that reduce just (map :action (history state))?

18:34 bbloom: amalloy: lol duuuh that's what i get for writing code in my irc window

18:34 * bbloom looks at his feet

18:34 tomoj: another that occurred to me would be to record as datoms all the available choices a player had

18:34 bbloom: tomoj: classic time vs space tradeoff

18:35 if it's taking too much time, figure out a way to trade time for space :-)

18:35 tomoj: but when someone gets a 20-card hand and plays chapel.. :)

18:35 bbloom: start with the essence of the problem, trade off space and time later :-)

18:35 tomoj: yeah, again thanks

18:35 bbloom: my pleasure

18:35 explaining this stuff helps me think about it too

18:40 tomoj: s/chapel/cellar/

18:43 bbloom: tomoj: it's ok, i haven't played dominion in years, so i have no idea which cards are which :-)

18:44 Raynes: I like Dominion, but it really gets tedious when you have more than 1 expansion.

18:44 tomoj: cellar with 20 other cards in hand is 2^20 choices

18:44 Raynes: I'm not a huge fan of games that take longer to set up and clean up than they do to play.

18:44 bbloom: and there's always that one guy who has played so many times that he knows exactly what strategy to use for any permutation of cards, such that his turns are longer than everyone else's combined times 10

18:44 Raynes: Risk is an exception to that rule, I guess.

18:45 bbloom: Raynes: may i suggest http://www.gilwood.org/riskopoly.htm

18:46 warning: allocate an entire evening to riskopoly if your friends are the types of negotiate really strange treaties before the UN (simple majority to enact new rules)

18:46 good luck programming that game....

18:46 * Raynes twitches

18:46 tomoj: Raynes: that's what isotropic is for

18:46 in my play group everyone was like "waah I don't want to play online, we're in the same room, that's stupid, let's just play IRL". I convinced them and we haven't touched our real cards again since

18:48 Raynes: tomoj: So, I realized my implementation of descendant-of was entirely broken and rewrote it earlier. It was pretty funny. It only worked by accident with my specific test cases.

18:48 tomoj: huh, seems to have worked ok for me so far too

18:48 oh, I already have that commit

18:49 Raynes: Yeah, if you're using the version I wrote last night, it's only working by accident.

18:49 tomoj: oh, the version that "actually works" doesn't?

18:49 Raynes: No, the version I wrote *last night*. I wrote a new version 4 hours ago.

18:50 tomoj: ah :)

18:50 there is a phantom node now too

18:50 Raynes: This new version should work fine. it's unfortunately larger and has the strangest reduce I've ever written, but it should work.

18:50 tomoj: phantom #'node

18:50 Raynes: I fixed that.

18:51 Probably didn't push.

18:51 Just pushed.

18:51 tomoj: oh, yes, I see it :)

18:51 Raynes: You can be confident that if laser ever got as big as Enlive, at least 200-300 lines of it would be phantom functions.

18:51 tomoj: I weakly suggest (defn select1 [zip & selectors] (first (apply select zip selectors)))

18:52 kind of seems silly now that I say it out loud

18:52 Raynes: I can't imagine why you'd want that. :o

18:53 Since it's just (first (select …))

18:53 tomoj: yeah, hence "silly"

18:53 Raynes: You rarely say silly things though.

18:53 tomoj: it was by analogy to xml1->

18:55 Raynes: I'm going to try to generalize the code in descendant-of later, since the code for arbitary args in each of these combinators should be very similar.

18:55 But for now… cheeseburger.

18:55 * Raynes vanishes

18:57 * tomoj imagines "cheeseburger" is your teleportation spell

18:58 bbloom: lol

19:15 pcsanwald: hi everyone, I'm paul. I'm new to #clojure and haven't used irc for a very very long time

19:15 tpope: hi paul

19:16 pcsanwald: someone at the nyc clojure meetup mentioned #clojure, so I figured I'd drop in. sorry for the AA style introduction :)

19:17 ppppaul: i'm also paul

19:17 seangrove: pcsanwald: No one can get better at fp unless they admit to a belief in a higher bbloom

19:17 ppppaul: any other pauls?

19:17 tpope: hi also paul

19:17 pcsanwald: excellent. solid name.

19:18 amalloy: i guess ohpauleeze doesn't hang out in here anymore

19:19 bbloom: seangrove: hey man, i'm just a bishop, hickey's the pope

19:19 hell, i'm not even a bishop

19:19 seangrove: bbloom: How's the CPS transformer coming along?

19:19 bbloom: seangrove: it's not

19:20 ppppaul: fp puts the fun in functional

19:20 bbloom: seangrove: it's a pretty low priority task on my list

19:20 seangrove: Heh, no worries

19:20 Just curious

19:20 bbloom: seangrove: and it's *hard* so i need somebody to help me with it. im hoping dnolen and i can hack on it when i get to NYC

19:20 bpr: bbloom: i'd say hickey's closer to the buddah lol... the pope comes with too much cerimony :-p

19:21 bbloom: seangrove: my other projects are coming along splendidly, however :-)

19:21 seangrove: Heh, let me know if you come down to SF sometime, wouldn't mind hacking on something with you

19:21 tomoj: ditto

19:21 bbloom: seangrove: yeah absolutely. i'm usually in SF a few times a year

19:22 seangrove: Good stuff

19:22 bbloom: i need a good way to keep track of which people are in which cities so i know who to ping when i visit

19:25 chouser: bbloom: https://maps.google.com/maps/ms?ie=UTF8&oe=UTF8&msa=0&msid=112691912540601337884.00045972a1deb8de0d96b

19:26 bbloom: chouser: awesome.

19:27 i don't have an address in NY yet, i should just put a pin on liberty island

19:27 chouser: There's a remote possibility that clojure users exist that are not on that map.

19:28 bbloom: understatement of the year

19:28 i'm laying claim to the reservoir in central park

19:28 pcsanwald: bbloom you are moving to nyc?

19:28 bbloom: yup

19:28 wink: hehe, no one from the Munich Clojure UG on that map

19:30 chouser: bbloom: are you moving there just for the Clojure users group?

19:30 pcsanwald: nice, welcome. get ready for every single NYer you meet to tell you how awesome their neighborhood is

19:30 seancorfield: did i miss a link to a clojure users' map?

19:31 chouser: seancorfield: The last link pasted. It's a very old map -- I'm surprised people have continued to add to it.

19:31 bbloom: chouser: i'm in seattle now and i'm originally from NY, my family is all there. starting my next company there

19:32 chouser: Created on Oct 17, 2008

19:32 bbloom: but the clojure community is a nice bonus

19:38 ferd: hey... just added myself. First one in Argentina :-\

19:39 * ferd feels lonely

19:41 chouser: I don't see you. Did you click save?

19:41 seancorfield: chouser: i guess it was posted before i (re)joined the channel

19:41 ferd: chouser: yes

19:41 chouser: seancorfield: https://maps.google.com/maps/ms?ie=UTF8&oe=UTF8&msa=0&msid=112691912540601337884.00045972a1deb8de0d96b

19:45 ferd: chouser: I don't see it from another browser session :-\ not sure what else I need to do

19:46 bbloom: i think there's some eventually consistency involved

19:46 my understanding from talking to a gmaps engineer is that bike trail edits are updated within 20 minutes, so i'd imagine comparable turnarounds

19:47 i think all the geo-indexing happens on the spiritual equivalent of a gigantic cron job

19:48 chouser: oh, I think there are two pages of markers

19:48 bbloom: oh, boo

19:48 chouser: scroll the left panel all the way to the bottom, click next, get a completely different set of markers

19:48 bbloom: that sucks

19:49 chouser: And look, there's someone in Buenos Aires!

19:49 bbloom: google maps supports marker clustering: https://developers.google.com/maps/articles/toomanymarkers

19:49 they should use it here :-)

19:50 ferd: hey!

19:50 bbloom: good example of this in action: http://mappedinny.com/

19:52 tomoj: I parsed that domain as something about belly buttons

19:52 ivan: wow, that page 1/2 thing is horrible

19:55 after switching a couple times, all the markers are gone, heh

19:56 seancorfield: hmm, finally got java.jdbc passing all its tests again... maybe i should quit while i'm ahead?

19:58 part of the big refactor to add an API where you pass in the db spec instead of using *db* - and then rewriting all the old API in terms of the new one

19:59 chouser: seancorfield: excellent. That's an important improvement.

19:59 ferd: I'm trying 'cemerick/friend with http-basic authentication. Works fine... however, when client sends no credentials, it's responding with a redirect (HTTP 302) ... I want it to fail (HTTP 401). Ideas?

19:59 seancorfield: for example (execute! db-spec [sql-string param1 param2] :transaction? true)

20:01 and simpler (query db-spec [sql-string param1 param2]) to just return a result set fully realized

20:04 ferd: ...hmm looks like the redirection logic is not part of the http-basic "workflow"... it's "hardcoded" within the authentication* function. I'm afraid I won't be able to achieve this without touching friends/authenticate*

20:07 cemerick: I'd appreciate you ideas. And thanks a lot for your work. Good stuff

20:07 tpope: ferd: :workflows [(workflows/http-basic)]

20:07 ferd: yes, that's what I'm doing

20:08 tpope: hmm, it's giving me a 401 just fine

20:08 ferd: what if you don't pass any creds ?

20:08 tpope: 401

20:08 ferd: hmm... I get 302 redirecting to /login

20:09 tpope: ferd: just walked through by hand and ended up at https://github.com/cemerick/friend/blob/master/src/cemerick/friend/workflows.clj#L7-11

20:15 ferd: I don't know what code path it's taking... but it's redirecting me back to /login

20:24 tpope: cannot get around it :-(. Thanks anyway. I'll continue tomorrow

20:25 tpope: ferd: my guess is you have some other call friend/authenticate you're forgetting about

20:26 ferd: tpope: nope :-( ... I re-started my nrepl session in case I had another handler in place that I wasn't seeing... but no luck

20:30 when I say I don't pass credentials, I mean I pass nothing at all .. that is, no "Authentication:" HTTP header going on the request (using curl here, I simply don't pass the --user parameter to it)

20:31 tpope: (let [response (app (request :get "/"))] (is (= (:status response) 401))))

20:31 that's from my test suite

20:31 no auth headers there

20:32 just double checked with curl

20:33 ferd: well... good to know it works for somebody... I'll get back at it tomorrow with a fresh view

20:33 version of friend ? "0.1.2" ?

20:33 tpope: 0.1.2

20:33 ferd: thanks. leaving for the day

20:43 Deece: Is anyone proficient with vim-foreplay? I'm trying to connect to my repl server but it seems to fail.

20:44 tpope: I've played with it

20:44 chouser: heh

20:44 Rich_Morin: :)

20:44 tpope: define "seems to fail"

20:46 Deece: Sorry. After entering localhost and the port via the interactive :Connect, I get "nREPL: execution expired" after it blocks for a while, and I see a java.net.SocketException show up in the REPL i've got running in another window.

20:47 tpope: oh boy

20:48 Deece: To start with, it looks like I'm not even running lein2 - was using an old arch package. i'll try that ;o

20:48 tpope: I hope that's it

20:48 because walking you through debugging this is going to be super tedious

20:50 Deece: that was indeed it. phew, thanks.

20:50 tpope: what was the old version of lein?

20:51 if I can reproduce it locally then maybe future Deeces can be spared this problem

20:51 Deece: ^

20:51 Deece: 1.7-1-1 - https://aur.archlinux.org/packages/lein/

20:55 tpope: indeed, I can reproduce it

21:06 bosie: what would be a good way to transform a list to a map containing the occurences as values

21:07 i only have a convoluted way by filtering the list and applying count on it

21:08 ibdknox: ,(doc frequencies)

21:08 clojurebot: "([coll]); Returns a map from distinct items in coll to the number of times they appear."

21:08 ibdknox: bosie: ^

21:08 bosie: ibdknox: thats cheating

21:08 ;)

21:09 ibdknox: reduce and update-in would be the best manual solution I can think of

21:09 bosie: ok, have to look at those, as i didn't use that at all. thanks

21:10 amalloy: reduce, update-in, and fnil

21:10 ibdknox: ,(doc fnil)

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

21:10 tpope: Deece: whoa, looks like lein 1.7 doesn't use nrepl at all

21:10 ibdknox: tpope: that was new in 2.0

21:10 amalloy: or a shorter solution is (apply merge-with + (for [x coll] {x 1}))

21:11 ibdknox: haha nice

21:11 seancorfield: that is nice, amalloy !

21:11 amalloy: not my own invention, i'm afraid. that's stolen from someone's 4clojure solution ages ago

21:12 bosie: wouldn't that run in n^2 ?

21:12 hmm or not, since its all lazy... hm

21:13 amalloy: even if it weren't lazy i can't imagine it taking n^2

21:13 maybe 2n, but of course that's just n

21:13 bosie: amalloy: oh, the (for...) runs once?

21:13 amalloy: uhh...?

21:14 bosie: i am not quite sure how clojure evaluates the whole term?

21:15 it goes to th for part, looks at the first item of coll, creates {x 1}, passes it into merge-with and applies + on it. goes to the second item of coll and so forth?

21:15 tpope: ibdknox: good to know. but annoying to guard against :/

21:16 seancorfield: bosie: are you asking about how the laziness works? or about order of eval in general?

21:16 bosie: seancorfield: both i guess

21:17 seancorfield: without laziness, (for ..) would produce a sequence, then apply would use that as the arglist for merge-with

21:17 with laziness, yes, it's more complicated :)

21:17 i can't remember exactly how apply interacts with laziness like that

21:17 ibdknox: seancorfield: what size shirt do you wear? :)

21:18 seancorfield: generally 2XL ibdknox

21:18 i have my LT T sitting right next to me atm...

21:18 it hasn't made it out of the office, into the bedroom

21:18 ibdknox: ah, you got one through the KS already?

21:19 seancorfield: yup! very nice, thanx!

21:19 amalloy: seancorfield: it works fine with laziness. merge-with takes its arglist as a seq named 'ms, or something like that. if that seq is lazy, no big deal

21:19 seancorfield: amalloy: yeah, i know "it works fine" but i

21:20 i'm not 100% clear on how apply actually causes a lazy seq to be realized as an arglist

21:20 bosie: amalloy: could you elaborate what "no big deal" means with lazy eval?

21:20 seancorfield: does it depend on the definition of the function being applied?

21:20 bosie: amalloy: is my above description correct?

21:21 amalloy: seancorfield: IFn (or maybe RestFn?) includes an (.applyTo this args) method, which takes a sequence. (fn [& args] ...) turns into an implementation of that interface that just accepts the arglist and does whatever with it

21:24 seancorfield: amalloy: 'k... i added println to the fn used for merging and the for seq, and all the for seq was realized first, then the adds were done for the duped items... but i may not have used a long enough seq to really see any interleaving

21:25 ok, with a large enough seq (> 32 items) the for and the add start to interleave

21:26 bosie: seancorfield: mind sharing the code?

21:26 seancorfield: bosie: https://www.refheap.com/paste/7959

21:26 shows the code and the output and the result

21:29 outta here for the night...

21:29 bosie: seanaway: thx

21:30 although i see no + ;)

21:30 nvm

21:31 why would i see no + here https://www.refheap.com/paste/7960 ?

21:32 oh

21:32 nvm

22:08 seangrove: Raynes: <3 refheap

22:08 I'm having trouble with a function calling back to itself via setTimeout in cljs: https://www.refheap.com/paste/7961

22:09 It runs fine the first time, but it's not able to call itself back

22:09 tufflax: tomoj, I figured out the future thing :p

22:09 seangrove: It seels like _wait-for-selector is being expanded to the full namespace, so I'm getting "WARNING: Use of undeclared Var zenbox.client.gmail.sidebar/_wait-for-selector"

22:10 Here's the javascript I'm porting to cljs: https://www.refheap.com/paste/2eea95111c2269931432ce044

22:11 tomoj: seangrove: hmm.. try it without the initial underscore?

22:11 say, use wait-for-selector*

22:11 tufflax: tomoj, it was stupid really: I used a with-open to open `in` and then spawned a future, but closed the stream immediately :p

22:12 seangrove: tomoj: Same problem

22:12 tomoj: oh

22:12 I didn't notice the other use

22:13 let doesn't work that way

22:13 you could use letfn probably

22:13 seangrove: Ok, let me look at letfn

22:13 Was wondering if let bindings could refer to themselves

22:13 tomoj: easier way incoming

22:14 something like this should work: https://www.refheap.com/paste/ef8b1948825cb8f7bbe430ec9

22:14 Raynes: seangrove: <3

22:15 seangrove: tomoj: The javascript on that one does look better, yes

22:16 And yes, it works, thanks :)

22:19 tomoj: I guess 'wait is not a good name

22:20 aaelony: somehow I'm getting stuck dealing with a clojure collection with nestings where I want to output keys as xml tags and values as xml content (no xml attributes). is clojure.walk/postwalk the way to go? Unsure how to configure it with a case statement that determines the type at each node… https://www.refheap.com/paste/7963

22:21 I don't want the :tag, :attrs, and :content in clojure.xml

22:21 Deece: I've almost got everything working nicely with vim-foreplay, except that my leiningen (2.0.0) isn't writing the target/repl-port file when i start up the repl. Anyone know what to do?

22:22 aaelony: or maybe i do...

22:25 or rather, the way hiccup does it

22:30 tufflax: aaelony, where are you stuck?

22:31 aaelony: basically, on two levels. First the nestings. if a node is terminal (a number or a string) then that's fine, but if it isn't it needs to handle based on type

22:32 secondly, i'm unsure whether i need hiccup, clojure.xml, clojure.walk, or even just seq

22:32 (seq {:foo 1 :bar 2}) almost does what i want

22:33 but needs "something" for (seq {:foo 1 :bar 2 :baz {:a 1 :b 2}})

22:34 tufflax: Hm, your "what I want" in the paste can be done with postwalk I think

22:35 aaelony: i think postwalk will be most elegant, but I am trying to understand it better

22:36 then a simple change to (walk/postwalk #(do (println "visiting:" %) %) x) would do it

22:37 tufflax: i'll study http://clojuredocs.org/clojure_core/1.2.0/clojure.walk/postwalk a bit more...

22:53 tufflax: postwalk works pretty well for the descent (open tags) and terminal nodes, but I am unsure how to close out the tags on the way back up.

23:03 tufflax: aaelony, https://www.refheap.com/paste/7965 maybe something like that?

23:04 aaelony: tufflax: yes that is it

23:04 perhaps postwalk-replace would work too but I am unsure how it works

23:05 tufflax: I tried with postwalk but it was a mess :p

23:06 aaelony: will study your solution, thanks. I'll add postwalk to the list of things to figure out :)

23:06 tufflax: :)

23:06 just ask if you don't understand :p

23:07 aaelony: I also have vectors in there but I should be able to tweak further from what you have :)

23:07 thanks tufflax :)

23:07 tufflax: what do you want to happen to the vectors?

23:08 aaelony

23:09 aaelony: {:a [ {:line "blah"} {:line "blah2"}] }should become <a><line>blah</line><line>blah2</line></a>

23:09 i think i can wrangle that further though from there

23:10 sometimes the xml needs to preserver order, so vectors...

23:10 preserve

23:10 tufflax: aaelony, that's what my code does, with the vectors

23:10 <a><line>blah</line><line>blah2</line></a> is the output :P

23:11 aaelony: nice

23:11 why (str (str btw?

23:11 anyways, thx again.. will tinker with it

23:12 tufflax: aaelony, for clarity, if you indent correcly it looks nicer, but the indentation in my paste was not correct

23:12 aaelony: i see

23:13 dcb: Is there anything like flip http://hackage.haskell.org/packages/archive/base/latest/doc/html/Prelude.html#v:flip in clojure? I am trying to needing it because I want to use threading, but the arg order is not consistent

23:15 tufflax: dcb I don't think so, but of course it's very easy to make one :p

23:16 dcb: tufflax: Indeed, thanks

23:18 would it be considered bad or non-idiomatic to make a single arg anonymous function in the threading sequence to get around the ordering issue?

23:19 tufflax: dcb hm, I don't know, example?

23:19 dcb: as in: (-> some-string (s/split-lines) #(map some-func %))

23:20 actually that doesn't really make sense because ->> would work with split-lines

23:20 but imagine if split-lines had to take some-string as the first arg

23:20 tufflax: yeah, also, #() functions don't work so well with the threading macros

23:20 tomoj: it would need to be (-> some-string (s/split-lines) (#(map some-func %)))

23:21 dcb: tufflax, tomoj: ah. ok. I'll just keep it simple then

23:21 tomoj: I just don't use threading when it doesn't work. I dunno that it's that bad to do (-> ... (#(foo %)))

23:21 dcb: tomoj: yah. just kind of ugly

23:21 tomoj: maybe you should check out the new threading macros in 1.5, maybe one will help

23:22 tufflax: dcb I would not consider it to be idiomatic, if there the list of functions is long, and only 1 needs #() i would do it

23:22 tomoj: (1.5.0-RC1 to be precise)

23:22 tufflax: er, non-idiomatic

23:23 dcb: OK, thanks

23:23 tufflax: why did test-> become cond->? :P I think test-> was a better name :p

23:23 (because it did, right?)

23:23 s/because//

23:24 Raynes: dcb: flip wont do what you want anyways.

23:24 dcb: (-> x (flip a y)) = (flip x a y)

23:24 It works with raw lists, not functions.

23:25 tufflax: Raynes, hm, flip would be called (flip map) for example...

23:25 Raynes: Ah, right, I suppose. I was conflating it with partial as well.

23:25 But still, meh.

23:26 If you need to do argument flipping and such just for threading, I'd just not use threading.

23:26 dcb: Raynes: no, your right. It makes sense to do in haskell because of the currying

23:26 and threading is not currying. hmmm....

23:27 Raynes: I squeal in glee when I see flip in a point free Haskell expression.

23:28 * tufflax does not understand, but is learning Haskell

23:28 dcb: Raynes: haha, it can be really nice in certain circumstances

23:30 tomoj: ;; (-> x ((flip f)))

23:31 well that would be silly :)

23:31 * tufflax scratches his head

23:32 dcb: ,(-> :a (partial flip {:a :b}))

23:32 clojurebot: #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: flip in this context, compiling:(NO_SOURCE_PATH:0)>

23:32 dcb: hah oh yah

23:32 tomoj: it would be (-> x ((flip (fn [y x] ...)) y)) I guess

23:32 (which is still silly, as already noted)

23:33 dcb: quite

23:43 muhoo: is the :repl profile supposed to automatically activate whenever running a repl?

23:51 having a :repl profile at all in my profiles.clj causes lein trampoline repl to fail completely: Could not locate clojure/tools/nrepl/server__init.class or clojure/tools/nrepl/server.clj on classpath

23:51 auugh, wait, i need to build lein from master, and that was failing for a different reason. :-/

23:56 ok, fine. same failure with lein built from master.

23:56 can't find nrepl. have no idea why.

Logging service provided by n01se.net