#clojure log - Apr 12 2012

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

0:52 technomancy: quil! http://p.hagelb.org/quilin-villain.png

0:54 wkmanire: technomancy: Nice

0:55 i_s: i'm trying to build a list recursively and i'm having some issues. can someone take a look? https://gist.github.com/950c2fcd2b5ef5c66024 (see line 81 for the problem)

0:57 technomancy: i_s: you're using `for` for side-effects; you should use doseq.

0:58 i_s: technomancy: you mean the print statements?

0:58 technomancy: i_s: oh, I see; those are just for debugging

0:58 i_s: yeah

0:59 technomancy: that's a pretty convoluted recursion; are you sure it can't be expressed in a single reduce?

1:03 i_s: hmm, i'll think about it. was worried about blowing the stack, so i tried this seq

1:22 hm, i can't think of a good way to do that technomancy

1:54 tmciver: technomancy: is there a method to add paths to the classpaths used by 'lein repl' that are outside the project directory?

2:09 emezeske: Woo, lein-cljsbuild 0.1.7 released: https://github.com/emezeske/lein-cljsbuild/blob/0.1.7/doc/RELEASE-NOTES.md

2:09 Maybe, just maybe, I didn't break anything this time

2:15 wei_: I have a proxy with an onMessage handler, that listens for messages on a channel. how would I send a message, then sleep until I received the message? (this is for a load test btw)

2:38 katratxo: emezeske: i tried the simple sample example project, but the main.js is not present after starting the server

2:39 emezeske: i followed the instructions in the README

2:39 emezeske: katratxo: Oh, it looks like those instructions are wrong. How'd that happen?

2:40 katratxo: You just need to run 'lein cljsbuild once'

2:40 katratxo: emezeske: ok, testing

2:42 emezeske: katratxo: Thanks for catching that! I pushed a doc fix to master.

2:43 katratxo: emezeske: now i get the expected alert :)

2:43 emezeske: thanks

2:44 emezeske: katratxo: Cool beans.

2:56 Iceland_jack: Is there any way of getting a list of Java methods?

2:57 so for (“methods” "HI") you might get charAt, concat, format, substring, etc.

2:58 xumingmingv: a have simillar question: is there a function to list all the methods of a namespace?

2:58 e.g. (methods 'clojure.lang)

2:58 hiredman: namespaces don't have methods

2:58 there is no namespace called clojure.lang

2:59 xumingmingv: oh, sorry, i mean the methods declared in a namespace

2:59 Iceland_jack: xumingmingv: maybe look at: (map ns-map (all-ns))

2:59 hiredman: methods are things classes have

2:59 xumingmingv: oh, sorry again, i mean functions lol

3:00 Iceland_jack: (all-ns) lists existing namespaces

3:00 ,(doc ns-map)

3:00 clojurebot: "([ns]); Returns a map of all the mappings for the namespace."

3:06 xumingmingv: Iceland_jack thanks

3:07 Iceland_jack: No problem xumingmingv

3:09 I found the answer to my question if anyone was wondering the same

3:09 http://stackoverflow.com/questions/5821286/how-can-i-get-the-methods-of-a-java-class-from-clojure

3:13 muhoo: Iceland_jack: this is how i usually do it: https://refheap.com/paste/2026

3:13 actually, or this: https://refheap.com/paste/2027

3:14 Iceland_jack: ah

3:14 thanks muhoo

3:15 it would be nice to have that provided by (doc …), similar to Python's dir()

3:15 muhoo: that's exactly what i was going for :-)

3:15 and spoiled by

3:15 Iceland_jack: heh

3:35 clizzin: anyone know what the equivalent of ruby's capistrano is for clojure? or just generally, what is the story for deploying clojure web applications?

3:45 amalloy: muhoo: it's rather simpler to write as (map :name (remove (comp :private :flags) (:members ...)))

3:45 emezeske: clizzin: There's "pallet", which I think can be used similarly

3:46 clizzin: emezeske: i've looked at pallet, but it looks more like a tool for provisioning nodes and installing dependencies. i can't find a clear examples for actually deploying a web app. do you know where i might find one?

3:49 emezeske: clizzin: It's hard to point at a specific example without knowing more about how you, specifically, want to deploy your app

3:49 clizzin: I mean, you can deploy by just sticking the app on the server and doing a "lein run"

3:50 clizzin: Or you might need to fire up some EC2 instances and configure databases, etc

3:50 clizzin: emezeske: sure. i come from a rails web background, so the way i usually do this is by running "cap deploy," which SSH's into the production server, git pulls down the latest revision from origin, installs dependencies, compiles assets, and then restarts the server

3:51 emezeske: from what i know of clojure, it sounds like the equivalent would be to SSH into the production server, git pull the latest revision from origin, build an uberwar, copy the uberwar into place, and then restart the server.

3:52 emezeske: or i could build the uberwar locally, rsync it into place on the production instance, and then restart the server

3:52 does that clarify things a bit?

3:52 i'm also open to hearing about better ways to deploy

3:52 ibdknox: deploying a webapp is just a matter of calling lein trampoline run with nginx as a reverse proxy :)

3:53 no war needed

3:53 emezeske: Yeah, ibdknox' way is definitely the simplest

3:53 If you want to automate the setup of that, I still think pallet is the right thing

3:53 Check this out: http://palletops.com/doc/how-tos/using-pallet-with-existing-servers/

3:54 You could extend that example to run the commands you need to copy things and configure them, etc

3:56 clizzin: ibdknox: what is lein trampoline?

3:56 ibdknox: it tells lein to shutdown and then start your process

3:57 just saves you a little memory by cleaning up the extra JVM

3:57 not important per se

3:57 but might as well

3:59 clizzin: if you use Noir lein trampoline run prod is all you need

4:00 clizzin: ibdknox: what server is it actually running in that case? is jetty embedded or something?

4:00 ibdknox: yep

4:00 embedded jetty

4:00 anyways, gotta run.

4:00 clizzin: ibdknox: ahh cool

4:01 ibdknox: cool, thanks for the tip

4:01 ibdknox: but fwiw, I run numerous websites that way

4:01 never had any issues

4:01 clizzin: emezeske: thanks as well

4:09 emezeske: clizzin: NP, good luck with that!

4:11 muhoo: amalloy: i do not think that kibit will be able to replace you anytime soon :-)

4:12 amalloy: the day the language itself does better static analysis than i do, i'ma switch languages

4:27 * muhoo goes through all his code replacing #(filter (not...)) with #(remove ...)

4:29 muhoo: sorry (filter #(not ...)) with (remove #(...))

4:35 amalloy: you can replace most of your #(not ...) with (complement ...) too

4:54 clgv: cemerick : ping

4:54 cemerick: wow, that was fast

4:55 clgv: pong

4:55 clgv: cemerick: thunderbird is open here ;)

4:56 cemerick: the completion idea was meant like the behavior that you get when using rlwrap with clojure.

4:57 cemerick: I can't say I've ever used rlwrap

4:58 clgv: cemerick: it behaves similar to the current CTRL+UP-ARROW that goes back to the previous history entry except that it takes the content before the cursor and searches the previous hirstory entries for the last that starts with the same content

4:58 cemerick: In any case, I think I grok what you'd like to have happen, but: what should be done when paredit is being used? Just lop off the content to the right of the cursor for search purposes?

4:58 clgv: you mean paredit in REPL view?

4:59 cemerick: yeah

5:00 clgv: the amtch could be a regular expression "LEFT-PART.*RIGHT-PART" - I dont know if that makes much sense. otherwise I would restrict it to "unrestricted edit mode"

5:01 cemerick: heh, yeah, we could do that

5:02 amalloy: we're talking about C-r from readline?

5:02 or M-p from emacs, i guess

5:03 clgv: amalloy: a feature request for CCW REPL view that allows searching repl history

5:03 amalloy: that's one reason i don't use paredit in my repl

5:03 clgv: right, i can tell. i'm just confirming what the feature you want added is

5:03 cemerick: as you can all tell, not something I've ever thought to want :-)

5:05 clgv: cemerick: I am working with incanter on datasets that are loaded from files and its pretty handy to be able to search repl history for the command that loaded the datasets in the last sessions

5:06 cemerick: sure

5:08 clgv: cemerick: by the way, is the repl history limited? I don't see any option for that

5:10 cemerick: clgv: yeah, 1000 entries

5:11 clgv: cemerick: shall I make a ticket requesting an option for that?

5:17 cemerick: clgv: what, configurable history? Sure.

5:19 lpetit: cemerick, amalloy, clgv: paredit shouldn't be a problem if we just try to match what is on the left of the cursor. Seems simple and good enough for me, he ?

5:20 clgv: lpetit: +1. but you could also use the above reg exp trying to match both sides in paredit mode if that makes sense

5:21 amalloy: i don't see any point in matching the right side. with paredit mode on, anything that matches the left and the middle will also match the right

5:22 cemerick: clgv: and this is supposed to work in bash with Ctrl+PageUp?

5:22 clgv: cemerick: in bash it works when you uncomment the corresponding line in /etc/inputrc

5:23 cemerick: heh, ok

5:23 clgv: cemerick: it's one of my first changes to a fresh linux ;)

5:23 cemerick: I just `history | grep xxx` at that point :-)

5:24 clgv: I often just type "ssh" + CTRL+PAGE-UP + ENTER ;)

5:24 cemerick: The fewer customizations I make to my env, the less irritated I am when things aren't *just* right. :-)

5:24 lpetit: If often find myself, while in a middle of typing, wanting to just drop it and start fresh from the previous history entry.Wouldn't this addition force me to first delete all the contents of the input area ?

5:25 amalloy: clgv: it works in bash out of the box

5:25 bound to C-r, not C-pgup

5:26 cemerick: lpetit: shouldn't; as it is, you can go back in history, and then go forward until you're back at your original input

5:26 clgv: amalloy: didnt know about C-r - bu it seems different

5:26 amalloy: C-r ssh RET

5:26 lpetit: cemerick: i was talking "after" having added what clgv suggests

5:27 amalloy: or tbh if you're just using it for something as primitive as "repeat previous ssh command", you should just do !ssh RET

5:27 cemerick: amalloy: C-r gives me an odd (reverse-i-search) prompt.

5:28 clgv: amalloy: wow, something new again. I guess I am a bash noob ;)

5:28 amalloy: indeed, cemerick

5:28 cemerick: !foo is in every shell, I think ;-)

5:28 amalloy: C-r <thing to search for> RET [...further editing if you want...] RET

5:28 you can hit C-r again instead of RET to continue searching back

5:29 cemerick: C-r "git pu" RET ===> "git: 'pu' is not a git command"

5:30 amalloy: i guess it's...possible bash on osx has a broken version of C-r? but i don't think it does. that interaction works fine for me

5:30 assuming you're not actually typing those quotes

5:31 clgv: imo any time i have to use an arrow key or something in the PGDN area i realize i'm misusing bash :P

5:31 cemerick: amalloy: all the better to grief you with :-D

5:31 amalloy: hm?

5:31 cemerick: But, no. Not sure why it's borked here.

5:32 amalloy: clgv: a related bash tip: !?push -- repeat most recent command that included push

5:33 clgv: amalloy: the backsearch via PAGE-UP (it is PAGE-UP only - no CTRL) is similar to ARROW-UP has no overhead like C-r

5:33 amalloy: overhead?

5:33 clgv: amalloy: awesome

5:34 amalloy: the overhead for PGUP is taking your hands off home row, just like for ARROW-UP. that's why i prefer C-r and C-p, respectively

5:34 clgv: amalloy: the command line ui "(reverse-i-search)`': ..."

5:35 amalloy: btw cemerick: just SSH'd to an osx machine, it still works for me. i wonder what dark rituals you've performed to break it

5:36 cemerick: amalloy: you've probably ssh'd to that OS X machine before, found it broken, and tweaked it out without remembering. :-P

5:36 amalloy: haha, no. it's just a coworker's machine that i happen to have an account on

5:37 ANYWAY, i guess all this bash discussion isn't that important now that everyone knows what clgv wants in ccw, so i can shut up about it

5:37 and go to bed. night folks

5:37 cemerick: My .profile has one alias and three env vars in it. I wouldn't know how to break bash. ;-)

5:38 clgv: amalloy: the additional information about ! and !? is appreciated :)

5:39 andyfingerhut: My .profile has lines that I can recall putting in there in 1990 :-)

5:43 wei_: functionally what's the difference between these two functions? one uses "let" and the other "def" https://gist.github.com/2365902

5:44 Iceland_jack: don't use def

5:46 andyfingerhut: wei_: Is the first one missing ( after doall?

5:46 Not sure if that is typo, or part of the problem.

5:48 wei_: typo, thanks. just amended it.

5:54 andyfingerhut: I'm not sure why there would be a difference in behavior between those two, but use of def inside a function like that is at least bad style, and often not what you want.

5:54 It is defining symbols globally, not locally. let keeps the symbol scope local to the body of the let.

5:56 My only guess at why the behavior might be different is if somehow one of those is postponing evaluation of some API call due to lazy evaluation, and the other is not.

5:56 Have you Googled for the exception message?

6:02 sandbags: hi. been a while since i poked around with Lisp so I just bought the 2nd ed. Prag's programming clojure

6:03 last time i bought Paul Graham's Lisp book and noodled my way through most of that

6:03 always liked it but was put off by the environments and cruft, looking forward to trying clojure

6:04 i'm coming from mainly Ruby in the past 6 years or so, and most recently Obj-C

6:05 ngw: sandbags: you'll have lots of fun then

6:06 sandbags: i'm hoping the book is good, i nearly went for the O'Reilly one but i missed the 50% off sale

6:06 i buy a lot of prag books

6:06 the Erlang one was pretty good

6:07 i really enjoyed Erlang but couldn't see myself ending up using it

6:07 but it definitely gave me a taste for functional stuff

6:08 andyfingerhut: I'm curious what you were put off by that you call environments and cruft? I'm not saying there isn't anything to be put off by -- just curious what you disliked.

6:09 sandbags: andyfingerhut: it was a few years ago but all the decent (i.e. i could imagine i'd build end-user software) environments seemed really expensive

6:09 Lispworks, for example, is way more than i could justify at this point

6:09 so i was cobbling stuff together with emacs & slime and I hate emacs

6:10 ngw: I personally prefer the O'Reilly one

6:10 andyfingerhut: Commercial Common Lisp dev environments definitely aren't cheap, at least once you get past the free trial versions, e.g. you want to ship something commercial based on it.

6:10 sandbags: and by cruft i'm largely referring, i think (as I say it was a while ago), to the syntax cruft in the language

6:10 looks like Clojure goes some way to addressing that

6:11 i'm not really making a cogent argument, just trying to dredge up what i remember :)

6:11 ngw: oh well :)

6:11 andyfingerhut: You'll definitely find a lot of Emacs users among Clojure programmers, but there are other editors fairly commonly used.

6:11 sandbags: i just can't get on with Emacs.... Vim i clicked with in 2 minutes

6:11 i've tried emacs 3 times already but... it just won't go :)

6:12 andyfingerhut: I'm weird enough to use VI key bindings inside of Emacs :-)

6:12 sandbags: heh

6:12 ngw: sandbags: http://writequit.org/blog/?p=386 this was very helpful to me

6:12 sandbags: oh, nice, thanks

6:18 rodnaph: sandbags: this looks better, but i've never gotten it to work: https://github.com/vim-scripts/slimv.vim

6:18 andyfingerhut: sandbags: I'd recommend reading the book first, but if you get into hacking and trying to figure out and remind yourself what functions there are and what they do, you might find the cheatsheet useful: http://jafingerhut.github.com/cheatsheet-clj-1.3/clojure-1.3-cheatsheets.html

6:19 sandbags: ta

6:19 andyfingerhut: Several flavors there -- my personal favorite is the one you get from clicking the upper leftmost link.

6:19 sandbags: i tend to get 2/3rd of the way through a book then go off-road :)

6:19 andyfingerhut: That one will probably be available at clojure.org/cheatsheet some day

6:20 sandbags: cool, thanks

6:20 i guess the only thing that makes me sad about Clojure is that (I guess) I'm not going to be writing Cocoa apps with it

6:20 but, realistically, i think that about every language that is not Obj-C :)

6:21 rodnaph: i'm sure someone will write a clojure -> obj-c compiler pretty soon.

6:22 Iceland_jack: lol, don't hold your breath

6:24 sandbags: i think a clojure->objc compiler would be a pretty horrible solution

6:25 clgv: sandbags: I think rodnaph meant a Clojure implementation in obj-c similar to the one for .Net

6:27 sandbags: i'd love to see it happen but think that would be quite a challenge

6:27 rodnaph: yup. haven't thought about it too much, but i don't see any reasons obj-c couldn't be a clojure host.

6:28 clgv: does obj-c have a vm underneath it?

6:28 sandbags: no

6:28 i was goign to say

6:28 i may be missing something, but the challenge of porting Clojure to .Net

6:28 would not be the same thing at all, you'd have to invent your own VM on top of the Objective-C runtime

6:28 it's doable, this is essentially what MacRuby does

6:28 clojurebot: You don't have to tell me twice.

6:29 sandbags: using LLVM

6:29 clgv: yeah, no vm makes it hard, I guess

6:29 sandbags: harder still since OSX is deprecating libauto

6:29 so no free GC

6:29 although the code, IIRC, is open so I guess it could be maintained and used

6:30 the MacRuby guy seems to have some plan to port ruby to use ARC type semantics

6:30 (ARC is compile-time automatic retain/release if you're not familiar with it)

6:32 but if anyone wanted to scale that mountain, it'd make me happy :)

6:34 andyfingerhut: Nathan Sorenson has developed a Clojure->Scheme compiler, which can then with Gambit be compiled to C. He said he confirmed that Clojure's core library runs on the iPad simulator. https://mail.google.com/mail/?shva=1#label/clojure/136130a4b12bc21d

6:35 Not sure if I used a good link there. Intended to be to the email thread on the clojure Google group.

6:35 maio: doesn't work

6:36 wei_: andyfingerhut: thanks for your help on https://gist.github.com/2365902. I found the error

6:37 it was just a typo :)

6:38 andyfingerhut: Just Google search on: clojure scheme gambit

6:38 Top 5 links all look relevant.

6:40 That phrase tickles my funny bone: "yak shaving"

6:41 Explanation: In Nathan's email announcement, he refers to a lot of yak shaving that still needs to be done to make his work more useful.

6:57 hoeck: http://www.infoq.com/interviews/hickey-clojure-reader

7:14 sandbags: hoeck: interesting, i didn't follow 98% of it but interesting none the less

7:15 * sandbags enjoys being out of his depth again

7:16 hoeck: sandbags: haven't seen it in action (the extensible reader), but I imagine you can do funny stuff with it in IDEs

7:48 ngw: does someone have any idea what this is about? https://gist.github.com/0cc62ad7996b9c5177e1

7:49 Raynes: It's about 4 lines long and a real pain in the ass.

7:49 ngw: This is Noir validation stuff?

7:49 ngw: Raynes: yep

7:50 I honestly can't understand the error

7:50 I guess something that should be bound is unbound

7:50 go figure what, seems basic to me...

7:51 samaaron: ngw: it's hard to know without knowing what vali is all about

7:51 Raynes: ngw: This stateful stuff works because, inside of request, noir binds and keeps track of an atom/ref of the data it needs to keep track of for the duration of the request.

7:51 samaaron: I know what it is. Go doctor or something.

7:51 :p

7:51 samaaron: Raynes: bully for you

7:51 ngw: oh, I see

7:51 Raynes: ngw: The problem here is that you're calling valid? outside of a request, so noir hasn't bound the var. When the vali/* stuff tries to access it, it isn't bound.

7:52 ngw: ok, now it's clear Raynes, thanks

7:52 definitely not how I would validate stuff...

7:52 samaaron: ngw: does the documentation make it clear that you need to call valid? within a request?

7:52 Raynes: ngw: This makes testing a little more difficult. If you really need to run this in the repl, you can likely use binding to mock the var up. You'll have to see which var it is (it'll be named with asterisks).

7:53 ngw: well, I was looking inside the blog example samaaron, and validation is inside the model

7:54 I didn't think that the request was available in there too

7:55 Raynes: This sort of function has to be called from inside a defpage or from something that it calls.

7:55 samaaron: Raynes: if you're so awesome at fixing issues - perhaps you can figure out why REPL-y doesn't like Overtone atm

7:55 clgv: ngw: there is noir.util.test/with-noir that sets all bindings

7:55 Raynes: For example, if you have a defpage that calls function foo and it calls bar and it calls valid?, the var will be bound. It just has to originat from defpage.

7:55 samaaron: REPLy is a big dark box of evil and fire. Only trptcolin can put it out.

7:56 samaaron: nice to hear your vote of confidence

7:56 Raynes: I've been pretty ticked off at it too lately.

7:56 But my problem isn't REPLy itself.

7:56 ngw: yes, I got it Raynes

7:56 Raynes: It's jline, which is even more evil.

7:57 samaaron: oh ok

7:57 ngw: but check from line 88 on: https://github.com/ibdknox/Noir-blog/blob/master/src/noir_blog/models/post.clj

7:57 samaaron: so would you have any idea why REPL-y might interfere with Overtone's boot process?

7:57 Could it be blocking the main thread or something?

7:57 ngw: it seems validation is at the data level: at least this is my interpretation of what a model is

7:57 Raynes: I've never really looked at how REPLy works. Or Overtone for that matter.

7:58 samaaron: Raynes: but you seem to know everything... ;-)

7:58 Raynes: I know your dress size.

7:58 samaaron: crazy scenes

7:58 Raynes: ngw: Where would you put validation?

7:59 ngw: at the data level :)

7:59 meaning that the request is not needed

8:00 but I'm not an expert by any means, very noob with clojure as you can see

8:00 Raynes: Well, you can certainly do that if you want, just not with noir.validation.

8:00 clgv: ngw: have you tried calling your valid? with 'noir.util.test/with-noir yet?

8:00 Raynes: I expect that noir.validation does things the way it does at least partially to isolate state.

8:07 groovemonkey: is there a reference that explains the different REPL errors?

8:09 I'm getting an 'IllegalStateException Attempting to call unbound fn' error. Not sure where to look for an explanation

8:17 mccraig: cemerick: just getting started with friend… the authenticate function takes the ring-handler as the second arg, whereas most (all?) handlers take the ring-handler as the first arg… is there a reason for this ?

8:18 clgv: groovemonkey: what did you do?

8:20 cemerick: mccraig: That was mostly to make it usable with partial, though I think that might have been not worth it at this point.

8:26 mccraig: cemerick: ah, i see. i've had similar problems too. perhaps there should instead be a variant of partial which can fix args at the front of the list ?

8:27 cemerick: mccraig: heh, well, that's #(afn % known-arg) :-)

8:35 gfredericks: ,(-> 8 (/ 0) (try (catch Throwable t "threading is fun")))

8:35 clojurebot: gfredericks: Huh?

8:36 gfredericks: &(-> 8 (/ 0) (try (catch Throwable t "threading is fun")))

8:36 lazybot: java.lang.SecurityException: You tripped the alarm! catch is bad!

8:36 gfredericks: fine

8:41 mccraig: cemerick: i meant fix args at the end of the list.. more like : (defn rpartial [f & fixed] (fn [& args] (apply f (concat args fixed))))

8:41 cemerick: mccraig: oh; well, bummer about something like that is that you can't stack rpartials.

8:46 mccraig: cemerick: what does 'stack' mean in that context ?

8:48 cemerick: mccraig: nm, I misread your defn

9:25 Raynes: cemerick: You're pink.

9:26 cemerick: Huh, ok.

9:26 Raynes: cemerick: I felt it important to note the color of your nickname in my IRC client.

9:27 fdaoud: cemerick: and you think *I'm* insane?

9:28 progo: Raynes, so are you :p

9:28 cemerick: fdaoud: I'll bet Raynes will only write one book. ;-)

9:28 fdaoud: cemerick: :-D

9:29 TEttinger: fdaoud is pink in my client.

9:29 fdaoud: TEttinger: there is no pink in my client, because, you know, you can customize those colors.

9:30 Raynes: To adjust the pink would be to reject the pink. This is not the way of the Clojurian.

9:30 TEttinger: fdaoud, I have a really wide variety of colors in mine (Floe on windows)

9:33 Raynes: cemerick: http://code.google.com/p/clementine-player/issues/detail?id=219

9:34 cemerick: Raynes: I couldn't quite remember where the last pink reference came from, but I knew it was lingering back there somewhere.

9:35 fdaoud: Every time I think I have a good ballpark figure for the number of insane people on the intrawebz, that number goes up by another order.

9:37 Raynes: fdaoud: Did you see the Clojure pull request where the guy renamed it to Lava?

9:37 fdaoud: Of course, I'm not judging, since I'm part of that number. Like being stuck in traffic at a non-rush-hour part of the day and wondering "what are all these people doing here? Uh, then again, what am *I* doing here?"

9:38 Raynes: You need better problems.

9:38 fdaoud: Raynes: yeah I saw that! heh

9:39 me? better problems?

9:40 I have two toddler-aged daughters who have dedicated every second of their existence to driving me crazy enough that I want to go jump off the roof. I don't need better problems.

9:40 Raynes: Your problems are boring. Traffic.

9:41 Now that's a decent problem.

10:00 dgrnbrg: Where can I see an example usage of the extensible reader in 1.4?

10:02 trptcolin: is this behavior surprising to others, or just me? https://refheap.com/paste/2034

10:04 specifically, the fact that an agent dispatch within a *different* agent's action seems to be delayed until the calling agent's action completes

10:11 sattvik: trptcolin: Interesting.

10:11 antares_: trptcolin: I use agents very rarely but it makes sense to me. I think agents interact with STM the same way?

10:12 trptcolin: it is basically to avoid unexpected race conditions, I think

10:12 trptcolin: antares_: for a single agent dispatching to itself, totally makes sense

10:19 cemerick: trptcolin: all sends are held within an agent action until it completes; as antares_ said, same semantics as sends within a transaction.

10:20 trptcolin: yeah. kind of wondering why, though. agent sends don't retry, right? holding off on sends to the same agent makes sense, so only 1 action runs per agent at a time, cool.

10:20 also couldn't find any docs on it

10:22 cemerick: an agent's queue can stack up plenty of sends. i.e. you can send multiple actions to an agent within the same transaction or other agent action.

10:23 trptcolin: the problem i'm trying to solve (tm) is: https://github.com/overtone/overtone/issues/85

10:24 cemerick: The rationale is to simplify the semantics of the reference through time. All of the effects of an agent action (changing the agent's value and all of its sends) occur at the same point in time.

10:27 trptcolin: so each native dep is loaded via an agent send?

10:27 trptcolin: right

10:27 cemerick: why?

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

10:28 * trptcolin shrugs

10:29 * cemerick reading https://github.com/overtone/overtone/blob/master/src/overtone/libs/deps.clj

10:29 trptcolin: well, i mean, it's so the "main" thread can Thread/sleep until they're all done

10:30 seems like a reasonable thing to do. maybe eventing would be better, but it still seems like it ought to work.

10:30 (of course given what i now know i understand why it doesn't)

10:32 cemerick: so, various parts of overtone register callbacks for when the various bits come online, but none of those end up actually being sent because the thing that triggers the loading of all of the deps is later on in the (use 'overtone.live) call?

10:32 (that's probably wrong, but mostly rhetorical anyway)

10:33 trptcolin: so does overtone never work, or sometimes work?

10:33 trptcolin: never w/ nrepl, as far as i can tell

10:34 always w/ reply --standalone

10:34 cemerick: trptcolin: that's true for technomancy's report as well?

10:35 trptcolin: the native deps/ java 7 thing (#86)? not sure on that one.

10:36 cemerick: no, his comment on #85

10:38 trptcolin: as far as i've heard so far, the timeout always happens this way w/ lein2 repl (after we got the Long/MAX_VALUE timeout in the repl task)

10:38 alexyakushev: Is there a way to connect to an external nREPL using Counterclockwise? I'm feeling very stupid right now:)

10:38 cemerick: alexyakushev: Window -> Connect to REPL

10:39 You need 0.7.0, I think.

10:41 trptcolin: cemerick: i'll do some more thinking/looking into this after work today, need to get back

10:42 cemerick: trptcolin: Sure. If it really comes down to it, we can stop using agents for sessions. :-(

10:43 alexyakushev: Chas Emerick: Thanks a lot, the old version of CCW was the issue

11:10 Licenser: (filter #(= "dhcp") ("" ""))

11:11 ,(filter #(= "dhcp") ("" ""))

11:11 &(filter #(= "dhcp") ("" ""))

11:11 lazybot: java.lang.ClassCastException: java.lang.String cannot be cast to clojure.lang.IFn

11:11 clojurebot: #<ExecutionException java.util.concurrent.ExecutionException: java.lang.NoClassDefFoundError: Could not initialize class clojure.lang.RT>

11:12 hroarke: Licenser: Your list of IPs should either be quoted '() or a vector [].

11:13 Licenser: hroarke you're right :) I was just pasting the prn'ed output

11:13 but I found my bug it's a missing %

11:14 samaaron: Raynes: howdy pardner

11:15 Raynes: samaaron: Hi there Dr. Aaron.

11:15 samaaron: Raynes: so this refheap thing...

11:15 I *think* I want to use it..

11:16 I'm looking at the elisp thing you wrote - which has an ominous readme

11:16 Raynes: Hahaha

11:16 samaaron: is it in a workable state?

11:16 Raynes: Should be fine for use.

11:16 samaaron: I must admit, my elisp-reading skills need a lot of work

11:16 Raynes: muhoo uses it, IIRC.

11:17 samaaron: so what's the defcustom thing do?

11:17 Licenser: Raynes you've a emacs plugin for refheap?

11:17 Raynes: The original issue was a problem with connection closing on the server, but that has long since been fixed.

11:17 samaaron: how do i plug in my usename/token?

11:17 Raynes: samaaron: Allows you to customize the variable via Emac's pretty customization UI.

11:18 Emacs's? Whatever.

11:18 samaaron: Should be... M-x customize-group RET refheap? Something like that.

11:19 samaaron: Raynes: is there anyway to do that in my elisp?

11:19 I never use the pretty customisation thingy

11:19 Licenser: Raynes can you share a link to your emacs thing? ^^

11:20 samaaron: Licenser: https://github.com/Raynes/refheap.el/blob/master/refheap.el

11:20 Licenser: thanks :)

11:20 samaaron: np

11:20 Raynes: Well, doing that will produce elisp. That said, you should be able to do (custom-set-variables '(refheap-token "") '(refheap-user ""))

11:21 samaaron: oh ok - and fill in the empty strings with my golden details?

11:21 Raynes: Yessir

11:21 That emacs thing is on marmalade too, so accessible via ELPA. I *think* it's up-to-date enough.

11:21 I haven't used this in quite a while since I switched to Vim.

11:21 samaaron: oh, can some friendly people upvote this link: http://news.ycombinator.com/item?id=3832499

11:22 Raynes: DONE

11:22 samaaron: i think overtone can help increase awareness of Clojure in general

11:23 Raynes: Who doesn't like music, right?

11:24 Licenser: Raynes sweet :D

11:24 samaaron: Licenser: did you get the refheap thing working?

11:25 Licenser: yea just put it in my .emacs.d folder and laoded it in the .emacs

11:26 samaaron: i'm struggling to log into refheap

11:26 Raynes: custom-set-variables not working?

11:27 Licenser: Raynes how can I bribe you to support dtrace scripts?

11:27 samaaron: no, i'm having issue logging in with a browser atm

11:27 Licenser: samaaron oh I just did it w/o the login part

11:28 Raynes: samaaron: What's going wrong?

11:28 Licenser: First step is to write a lexer for pygments.

11:28 Licenser: oi

11:28 Raynes: Second step is to send me a pull request adding it to the language list.

11:28 :P

11:29 samaaron: Raynes: I think I must have registered a while back - but have no idea what password I used

11:29 and their password reset thing is broken

11:29 Raynes: Well that sucks.

11:30 samaaron: indeed

11:30 * TimMc is laughing on the inside

11:30 TimMc: *poker face*

11:30 samaaron: I can't even create a new account

11:30 Raynes: samaaron: It works for me.

11:30 What browser is this?

11:30 samaaron: safari

11:31 Raynes: I'm using Chrome.

11:31 Safari is for people who write musical code.

11:31 samaaron: i get the same issue with Chrome

11:31 Raynes: Your computer is broken.

11:31 llasram: Refheap's login has also never worked for me, but I consider that my own fault for using Conkeror

11:31 samaaron: clearly

11:32 i'm actually on https://browserid.org/signup

11:32 TimMc: Raynes: I gave up on using BrowserID. It doesn't work with the Firefox password manager (despite being made by Mozilla).

11:32 Raynes: llasram: Yeah, technomancy pointed that out.

11:32 Licenser: Raynes acutaylly you support D already

11:32 TimMc: It's not worth it to look it up in my password manager every time.

11:32 llasram: Licenser: Are you sure that isn't Digital Mars D?

11:32 Raynes: It is.

11:33 Licenser: no I'm not but it does not seem to be that off :P I don't get errors in example code

11:33 Raynes: TimMc: Shame.

11:33 samaaron: Raynes: try registering with a fake email - see if you get past the "Verify Email" button...

11:33 Raynes: TimMc: I don't use password managers for that exact reason. I just use 'password' for all my passwords and I get by fine.

11:34 samaaron: Raynes: that's WEEEEEEAK. I use P455w0rd

11:35 Raynes: samaaron: Yup.

11:35 * nsxt_ waits for hunter2 joke to drop

11:36 Raynes: If someone wanted to send me a patch to add github authentication, I'd accept said patch.

11:38 fdaoud: samaaron: love the comments in that ycombinator link.

11:38 samaaron: fdaoud: haha.

11:38 why can't people comment on the CONTENT?

11:39 Raynes: samaaron: "better video, 4 minutes, no crappy foreplay, just some guy live-coding with overtone"

11:39 Seems like that's about the content.

11:40 fdaoud: samaaron: same reason there's always this one guy who reviews an amazon book saying that the book arrived fast and in good condition.

11:40 samaaron: haha

11:40 crappy foreplay???? wft?

11:40 twf?

11:40 ftw?

11:40 WTF?

11:41 Bronsa: lol

11:41 fdaoud: no such thing.

11:41 samaaron: haha

11:44 Raynes: samaaron: That was an excellent talk. I think I stayed awake during it, even.

11:53 samaaron: Raynes: what did you think of the crappy foreplay?

11:54 hhutch: Raynes: darn but that refheap.el is handy

11:55 gfredericks: look I don't know what is being discussed here but now I have this image in my head of Raynes falling asleep during foreplay and I need someone to blame for it.

11:56 samaaron: gfredericks: hahaha

11:56 Bronsa: lol

12:17 is there a better way to achieve this than (take-while not-empty (iterate rest (range 10))) ?

12:18 S11001001: ! (doc tails)

12:19 &(doc tails)

12:19 lazybot: java.lang.RuntimeException: Unable to resolve var: tails in this context

12:19 S11001001: uh, maybe

12:19 goodieboy: could someone tell me what i'm doing wrong with this? I'm expecting this to match: (re-find #"(?m)a.*b" "a\nasdfasdf\n\nb")

12:19 ,(re-find #"(?m)a.*b" "a\nasdfasdf\n\nb")

12:19 clojurebot: nil

12:19 S11001001: goodieboy: you're looking for s, not m

12:19 goodieboy: ,(re-find #"(?s)a.*b" "a\nasdfasdf\n\nb")

12:19 S11001001: m changes how ^ and $ work

12:19 clojurebot: "a\nasdfasdf\n\nb"

12:20 goodieboy: S11001001: Woohoo! Thanks :)

12:23 amalloy: Bronsa: well, seq rather than not-empty, at least

12:23 S11001001: goodieboy: interesting aside: in posix extended regexp, s is called p, for "posixline". I'm not sure s is less ambiguous

12:24 goodieboy: S11001001: interesting, good to know

12:27 Bronsa: right amalloy

12:37 jondot1: hi all. what should i do if i need a to use a project that is not on clojars yet (it has an older version), but i can clone and build from github?

12:38 its not my project so i can't push a new build

12:38 technomancy: samaaron: feel free to yoink those sketches as quil samples btw

12:38 samaaron: were you able to run the jar with "java -jar [...]"L

12:39 it would be cool if there were some kind of visual chooser you could include in a collection of sketches like this so people can just double-click on the uberjars and have them work

12:41 samaaron: technomancy: ah, that works fine

12:41 I just tried to double click it

12:41 so instead I just unzipped the jar and ran the sketches manually

12:41 they're lovely :-)

12:41 technomancy: thanks =)

12:42 samaaron: btw, did you know about set-state! and state

12:42 juhu_chapa: hi clojurians, what is the clojure way to use a properties file? maybe defining a global var a then loading and binding the properties or just passing the properties to the method?

12:42 technomancy: most of them are from 2½ years ago

12:42 samaaron: :-)

12:42 technomancy: samaaron: I was just thinking something nicer could be done wrt state

12:42 samaaron: technomancy: I'm all up for ideas

12:42 technomancy: like if the update function just took an argument like a reducer function

12:42 samaaron: I just thought that adding per-sketch state was very useful

12:43 technomancy: or it seems like having the frame-count as a function argument would be useful too

12:43 man, it sucks that fn literals don't have :arglists metadata, or you could do this automagically without breaking backwards-compat

12:44 samaaron: so whatever was returned by #'draw was passed to it as an arg?

12:44 technomancy: yeah

12:44 samaaron: yeah, i thought about that - I just thought it was adding a lot of boiler plate

12:44 I wish we could support both

12:44 technomancy: maybe you could have an :update function as an alternative to draw that took state as an argument

12:44 amalloy: jondot1: you have two reasonable options

12:44 samaaron: hmm, interesting

12:45 technomancy: state and possibly frame-count

12:45 samaaron: yeah, precisely

12:45 frame-count is super useful

12:45 technomancy: would help make sketches more functional

12:45 achin: weavejester: Have you had a chance to take a look at my web.xml PR?

12:45 amalloy: you can tell lein to have your project depend on the git repo. i don't know the details of this, and i think technomancy frowns on it, so it's sorta an option you should try to avoid

12:45 samaaron: i also would prefer it if things like the x and y coords were passed to mouse handlers

12:46 technomancy: oh yeah, absolutely

12:46 btw; is there an equivalent to defonce for defsketch?

12:46 samaaron: but for version 1.0 i just wanted things to be as similar to processing as possible

12:46 technomancy: so C-c C-k doesn't open up a new window?

12:46 weavejester: achin: Didn't I already merge that? Hang on...

12:46 samaaron: technomancy: no, there's not - but that's an excellent idea

12:46 amalloy: or you can build it from git and release it to clojars yourself under a different groupid. eg, instead of overtone/overtone (if samaaron were so rude as to not update his version on clojars) you could use org.clojars.jondot/overtone

12:47 achin: weavejester: Thanks.

12:47 amalloy: then lein can pull it down like any other dependency

12:47 * technomancy notices he's supposed to be frowning at someone; acts accordingly

12:47 jondot1: amalloy: i see. isn't the second option considered rude?

12:47 amalloy: meh. it wouldn't hurt you to ask them to update their version first

12:47 but i don't think it's terribly rude to push your own version, is it? anyone?

12:47 samaaron: amalloy: what are you suggesting?

12:48 weavejester: achin: Okay, it's merged. Sorry about that, I thought I had already done it.

12:48 technomancy: jondot1: have you tried checkout dependencies?

12:48 samaaron: I'm not the one that ate a pint of bacon...

12:48 amalloy: samaaron: i just dragged you in as an example

12:48 jondot1: amalloy: i see. is it possible that i built the jar and check it into source control?

12:48 amalloy: i shared! i didn't eat it *all*

12:48 Raynes: Rude...?

12:48 Why would it be rude?

12:48 amalloy: jondot1: i will strangle you

12:48 if you do that

12:48 Raynes: jondot1: I'll cut you.

12:48 jondot1: yep.

12:48 amalloy: (i totally would have eaten it all)

12:48 achin: weavejester: No worries. Thanks. Do you think you're going to cut a 0.6.4 anytime soon?

12:48 samaaron: cor, there's some brutality in here

12:49 jondot1: I woudl neither strangle nor cut you. I'd just politely suggest that there was a better option

12:49 Raynes: The only resolution for people who check jars into source control is seppuku.

12:50 weavejester: achin: I can. Have you used the web.xml behavior from a fork or something? i.e. is it tested?

12:50 amalloy: for example, jondot1, there are at least five different groupids for org.clojure/data.xml on clojars, because it took so long for clojure/core to release a jar to maven

12:50 samaaron: amalloy: you'd have no competition from me. I never understood why people eat other animals flesh. In pint glasses or not.

12:50 TimMc: But but but... the Twelce Factor app tells me to vendor things in!

12:50 *Twelve

12:50 Raynes: Because they rewrote it 6 times and couldn't figure out how to make it build on 80 different JVM/OS combinations.

12:50 jondot1: ok.. and now for another option. im thinking about running a pure java image analysis or shelling out to image magick. imagemagick is around 3 times faster. is there a point to keep the pure java code?

12:51 achin: weavejester: Yeah, I've been using the version that I had before I ripped out server-uberwar and changed :webxml->:web-xml in production for a few months.

12:51 Raynes: jondot1: I'd just shell out.

12:51 samaaron: Raynes: ah man, again, that's not such a nice thing to say. You should celebrate life - not describe hideous suicidal methods

12:51 weavejester: achin: Okay, I'll push out 0.6.4 in a few minutes then

12:51 Raynes: samaaron: Apparently this was at one time acceptable behavior.

12:51 * gfredericks thinks "shout out":people::"shell out":ninja-turtles

12:52 achin: weavejester: Great. Thank you!

12:52 samaaron: Raynes: many awful things were once acceptable. i.e. slavary

12:53 Raynes: You mean to tell me I'm supposed to give up my slave!?!?

12:53 amalloy: i have a master/slave relationship with my databases. what we do behind closed doors is not samaaron's business

12:53 samaaron: Free him/her immediately!

12:53 technomancy: why you gotta be hatin' on a man's hobbies? http://wondermark.com/152/

12:53 samaaron: amalloy: don't bring up your databases again - we've been through that before

12:54 Raynes: Hahaha

12:54 weavejester: achin: Done

12:54 samaaron: technomancy: haha

12:54 RickInGA: it is difficult coming in the middle of a conversation... samarron says somethings used to be acceptable, but aren't any more, and I wonder how he knows I am working in C# today

12:55 samaaron: RickInGA: :-)

12:56 RickInGA: as long as you dont' start talking about strangling, cutting, killing or selling yourself to slavery, then I'm cool

12:56 achin: weavejester: Thanks. Pulling it now.

12:56 jondot1: is there any mapping between clojure 1.2.0 and 1.2.0 contrib to clojure 1.3.0 (and merged contrib functionality) ?

12:56 gfredericks: are you asking where contrib went?

12:56 achin: jondot1: http://dev.clojure.org/display/design/Where+Did+Clojure.Contrib+Go is what I use.

12:56 weavejester: Sometime I've got to make lein-ring reload the checkouts folder as well.

12:57 jondot1: great, thanks

12:57 weavejester: Or add something to the options to customize it.

12:57 RickInGA: samaaron: on an unrleated subject, I am using your live config, but I don't have any of the features when I am editing a cljs file in emacs. did I break something?

12:58 samaaron: RickInGA: no, I just haven't added cljs support yet. For now you can force it into clojure mode with M-x clojure-mode

12:58 RickInGA: samaaron awesome, Thanks!

12:58 technomancy: cemerick: so did you follow https://github.com/overtone/overtone/issues/85? what does this mean for reply/nrepl?

13:00 fdaoud: juhu_chapa: did you get an answer to your question?

13:00 cemerick: technomancy: it probably means it needs to stop using agents for REPL sessions.

13:00 samaaron: cemerick: agreed

13:00 cemerick: which is ironic, since that's the path I took ~2 years ago. :-P

13:01 samaaron: I had composing agents issues about ~1.5 years ago

13:01 juhu_chapa: not yet, but i think the def var and binding later is the right choice

13:01 samaaron: it was super frustrating to debug

13:02 technomancy: cemerick: so that sounds like a fairly involved change

13:02 cemerick: technomancy: not particularly. Doesn't change semantics a whit.

13:02 * hiredman recalls talking about implementing repl sessions directly on top of executors and being asked "so you are reimplementing agents?"

13:02 cemerick: I mean, except for not causing the current PITA.

13:03 hiredman: Yeah. Back to the nREPL 0.0.x-series approach.

13:05 gfredericks: (defroutes test-server (GET "/foo" [] "bar")) (test-server {:uri "/foo"}) => nil

13:05 ^ what am I misunderstanding about compojure?

13:05 technomancy: cemerick: but probably not something that should block preview3 any more

13:05 weavejester: gfredericks: You haven't specified a :request-method

13:05 cemerick: technomancy: no

13:06 gfredericks: weavejester: haha quite; thanks!

13:06 weavejester: gfredericks: ring-mock is a good library for creating Ring requests, btw

13:06 gfredericks: weavejester: I'm just doing some sanity checks

13:07 technomancy: at least the overtone issue has a workaround with just requiring it twice

13:07 samaaron: technomancy: and I expect most overtone users aren't using lein repl anyway

13:08 cemerick: well, they'll be able to in short order

13:08 samaaron: indeed :-)

13:08 having it work in lein is super important

13:09 technomancy: cemerick: will this require changes in reply or just nrepl?

13:09 cemerick: just nrepl

13:09 technomancy: cool; so it'll be easy for people to bump without upgrading lein once the fix is out

13:10 cemerick: though reply has a separate issue as well: https://github.com/trptcolin/reply/issues/49#issuecomment-5083824

13:10 yeah, overtone + nREPL 0.2.0-betaX will do it

13:10 sattvik: About the overtone thing… It also seems to cause my VimClojure to hang, though it's not using any agents as far as I can tell.

13:11 cemerick: technomancy: I've come to enjoy this long prerelease thing quite a lot ;-)

13:12 technomancy: cemerick: it's great; I love it =)

13:12 samaaron: sattvik: did you write VimClojure?

13:12 oh i misread it's for I'm

13:13 sattvik: samaaron: No, that's Meikel Brandmeyer.

13:13 samaaron: sattvik: could you send an email to the overtone mailing list? There's a bunch of people on there that use Vim that are probably better positioned to help you out

13:14 sattvik: samaaron: OK, I'll probably do that. It works fine with slimv and clojure-swank, but I am used to using VimClojure.

13:14 samaaron: so what's the current solution for cljs in emacs?

13:15 technomancy: there's a clojurescript-mode; don't know much about it

13:16 samaaron: i currently use clojure-mode for both

13:16 technomancy: I think it just has some inferior-lisp setup for a cljs repl

13:16 oh, it uses script/repl; gross

13:16 samaaron: oh ok

13:17 technomancy: are you referring to this: https://github.com/carllerche/.emacs.d/blob/master/extra-packages/clojure-mode/clojurescript-mode.el

13:17 cemerick: it can't really use anything more sophisticated because of how browser-repl works.

13:17 technomancy: samaaron: that looks like a copy; the canonical version lives in the clojure-mode repo

13:17 samaaron: oh ok

13:17 technomancy: probably needs to be updated to work with lein-cljsbuild

13:21 lynaghk: -clojurebot-: Thanks for the intro. ANN: cljs-chosen, a ClojureScript wrapper for everyone's favorite <select> library.

13:21 Bronsa: what's the reason of doing Util.ret1(something, something = null) ?

13:21 samaaron: lynaghk what's a <select> library?

13:21 does it choose things for me?

13:21 Raynes: lynaghk: Cool. I use chosen in refheap. Speaking of that, go write refheap's js in clojurescript for me.

13:21 Bronsa: i see this done a lot of times in the clojure codebase

13:22 lynaghk: samaaron: it makes giant <select> tags not suck in the brower by adding things like in-line search field and clickable tags for multiselects

13:22 As for the cljs-wrapper, it handles everything for you using atoms, so you can listen for changes and update the options in the selector using cljs data structures instead of having to muck with html.

13:22 Raynes: samaaron: The language dropdown on refheap is chosen.

13:22 samaaron: what is my favourite select library?

13:23 oh ok, so <select> is a cljs lib, and chosen adds useful helpers?

13:23 or is <select> some js thing?

13:23 Raynes: samaaron: It's a html tag.

13:23 lynaghk: Raynes: refheap is pretty cool, but I don't have bandwidth for community-rewrites at the moment. I'm looking to finish up some big CLJS projects that can be open sourced and demo the possibilties for the platform.

13:23 Raynes: Have you ever done anything *besides* music?

13:24 lynaghk: samaaron: <select> is the html tag that makes drop down menus.

13:24 samaaron: Raynes: nope

13:24 Raynes: lynaghk: I would hope that you would realize I was joking.

13:24 technomancy: is that for hypertext? that markup thingy language?

13:24 lynaghk: Raynes: a bottle of whiskey in the mail can turn jokes like that INTO REALITY

13:24 samaaron: lynaghk oh, I knew that - you just described it as "for everyone's favourite <select> library"

13:25 true_droid: hi! I'm curious, is ClojureScript different in many fundamental ways from Clojure? For instance, afaik this trick isn't available in Clojure https://gist.github.com/2346460 . Is it just a design decision or a technical limitation?

13:25 samaaron: so i thought you meant an existing lib

13:25 lynaghk: samaaron: I don't appreciate you adding extra 'u's to my language. I saw what you did there, okay.

13:25 = P

13:25 samaaron: lynaghk *your* language? Ahem!

13:25 scriptor: brits...

13:26 samaaron: I'm English, I live in England and I speak English

13:26 lynaghk: samaaron: americans have been around the longest, everyone knows that.

13:26 scriptor: *Englandish, you mean

13:26 amalloy: true_droid: some of both

13:26 samaaron: lynaghk oh, yeah I forgot - since I spent so long today studying at a university OLDER THAN AMERICA!

13:26 technomancy: I've heard of Englandish before; isn't that what they speak on the BBC?

13:26 amalloy: it's technically impossible to do that without decreasing performance of the whole language by a factor of like five (made-up guess, but it's large). so a design decision was made not to allow it

13:27 scriptor: clojurescript can't have true tco either, right?

13:27 lynaghk: Raynes: how come you didn't write refheap using CLJS?

13:27 scriptor: without trampolining and such

13:27 mefesto: what is the proper way to round bigdec? i'm doing the following which must be the looong way :)

13:27 ,(with-precision 10 (-> (/ 1M 3) (.setScale 3 RoundingMode/HALF_UP)))

13:27 clojurebot: #<CompilerException java.lang.RuntimeException: No such namespace: RoundingMode, compiling:(NO_SOURCE_PATH:0)>

13:27 mefesto: doh

13:27 ,(with-precision 10 (-> (/ 1M 3) (.setScale 3 java.math.RoundingMode/HALF_UP)))

13:27 clojurebot: 0.333M

13:27 cduffy: scriptor: ...neither does Clojure on the JVM (without loop/recur), so that's not exactly a difference.

13:27 Raynes: lynaghk: Because 1) there isn't enough js for cljs to really help with anything 2) I've not yet developed the hatred towards js that everyone else has 3) I didn't want another compilation step.

13:28 scriptor: cduffy: right, hence "either" :)

13:28 cduffy: ahh.

13:28 amalloy: scriptor: i imagine some js implementations would have it

13:28 * cduffy missed the word.

13:28 lynaghk: Raynes: give #2 some time, maybe add some more features to refheap...

13:28 Raynes: Oh, I'm sure.

13:28 But #2 is directly related to #1.

13:28 I don't need much js to add features to refheap.

13:28 Bronsa: true_droid: technical limitation

13:29 Raynes: At least, not the features I've planned to add.

13:29 samaaron: Raynes: like github authoriSation?

13:29 amalloy: you should add a bear that dances around the page when you hit Paste

13:29 Raynes: samaaron: Someone else can do that. :p

13:29 browserid isn't broken for me.

13:30 amalloy: Didn't we plan to add a secret button that would play video game music?

13:30 amalloy: i do recall that

13:30 true_droid: amalloy: thanks

13:48 technomancy: and it's out. ladies and gentlemen, leiningen 2.0.0-preview3: https://groups.google.com/group/clojure/browse_thread/thread/91079a531ee1f1c8

13:48 * RickInGA cheers

13:53 ibdknox: it's a real-time web week lol

14:01 sattvik: dnolen: Any ideas on how to coordinate selecting proposals for GSoC?

14:03 samaaron: Raynes: awesome, I now have refheap working from my emacs with authentication. Thanks so much :-)

14:13 Raynes: samaaron: I'm just happy it works. I don't know elisp. Most of that was copied from various libraries.

14:26 llasram: technomancy: And there was much (belated) rejoicing!

14:26 samaaron: Raynes: well, it was a good job :-)

14:26 Raynes: <3

14:32 dnolen: sattvik: yes details forthcoming in the next couple of days.

14:32 Raynes: Maaaaaaaan, why is brehaut never here when I need to spew now playing information to him? :(

14:34 sattvik: dnolen: Sounds good. I am really looking forward to seeing what GSoC will produce for Clojure.

14:39 sandbags: user=> (clojure.repl/source applyTo) -> "Source not found"

14:39 does that mean applyTo is a built-in of some kind?

14:39 or am i doing it wrong?

14:39 aperiodic: samaaron: i tried the quil 1.0.0 release with my kinect thing yesterday, to no avail

14:39 sandbags: (i was looking at the source of apply using c.r/source)

14:40 technomancy: sandbags: source only works on Clojure functions; applyTo is a Java method I believe

14:40 sandbags: ahhh

14:40 thanks

14:40 technomancy: np

14:40 S11001001: sandbags: it is also easier to browse with M-. if you are using slime

14:40 sandbags: S11001001: thanks for the tip, but i'm not

14:40 technomancy: are there any fans of Leiningen shell wrappers who would be offended if they were replaced with a more general post-install mechanism?

14:41 sandbags: technomancy: leiningen yours?

14:41 technomancy: sandbags: indeed

14:41 sandbags: technomancy: cool beans, using it now

14:44 technomancy: excellent

15:03 sandbags: not far into this clojure book and the questions are piling up already... but i will spare you all my newbness and hope they get answered as I go along :)

15:06 fdaoud: sandbags: which book are you reading?

15:06 sandbags: fdaoud: the new ed of the prag's book

15:07 so far i kind of wish i'd bought the O'Reilly book

15:07 but i missed the half-price deal and balked at paying full-price

15:07 i guess this one will hit it's stride

15:08 but the O'Reilly one seemed a better introduction out of the gate

15:08 cemerick: sandbags: not too late, eh? ;-)

15:08 sandbags: cemerick: too late for what?

15:09 AimHere: Too late to turn back now, and learn PHP before it's too late

15:10 cemerick: sandbags: sorry, I was being cheeky. If you're really just trying to get moving, the first chapter is free; maybe it'll get you up to speed enough to be comfortable with PC? http://cdn.oreilly.com/oreilly/booksamplers/9781449394707_sampler.pdf

15:10 sandbags: cemerick: yes i have the first chapter

15:10 cemerick: that's how i know it was a better introduction :)

15:10 headius: speaking of PHP...I found this entertaining: http://me.veekun.com/blog/2012/04/09/php-a-fractal-of-bad-design/

15:10 sandbags: headius: that is some scary shit in there

15:10 * cduffy is a big fan of The Joy Of Clojure -- actually, he remembers the exact heading of the chapter that would answer the question he has right now, but his copy isn't present.

15:11 sandbags: i found it hard to read

15:11 headius: I couldn't believe it doesn't provide stack traces of any kind

15:11 I only got about halfway through, but jesus, PHP isn't even a programming language as far as I can tell

15:11 S11001001: headius: it sort of does, you just have to write your own catcher and trace printer for every project :)

15:13 headius: as a language implementer I can certainly appreciate the reduced complexity of no stack traces by default, but yeah :)

15:13 Wild_Cat: headius: good to see this paper is going around every community... We've been alternately laughing and crying about it in #python-offtopic for a few days now :D

15:13 headius: jruby doesn't get its pretty stack traces without a lot of fiddling

15:13 * cduffy has a bunch of PHP programmers at the desks to the right of him; they've been... quiet... for the last few days.

15:14 mrb_bk: dnolen: high five man, wish i could go to that conf

15:21 dnolen: mrb_bk: thx. StrangeLoop is way fun.

15:21 mrb_bk: Emerging Languages looks extra hot

15:22 mrb_bk: dnolen: damn i know

15:22 scriptor: ooh, cool, the cfp is still open

15:22 wait, is this the emerging languages camp?

15:23 fdaoud: sandbags: I'm waiting for both (paper) books to arrive..

15:23 mrb_bk: learn ALL OF THE LANGAUGES

15:24 dnolen: scriptor: i believe Emerging Langs CFP is now closed. but CFP for StrangeLoop open till mid May I think.

15:24 sandbags: fdaoud: cool, the prags book has an uneven style so far

15:24 but the content is good

15:24 but i'm taking it on trust they're going to explain a heap of shit

15:25 ibdknox: dnolen: now I have to figure out what I'm going to talk about :p

15:25 sandbags: because they don't stop to explain much as they go

15:25 scriptor: dnolen: really? Their last thing on their blog is that the cfp is open

15:25 dnolen: scriptor: I could be wrong!

15:25 scriptor: but I've seen confs not updating this stuff before

15:26 eh, the submission page is open, don't have anything to lose

15:26 dnolen: ibdknox: haha, I'm sure Alex will be up for more than one Clojure related talk. Mine is all nerdy internals stuff.

15:26 ibdknox: I have a couple ideas

15:27 one that I think might be a lot of fun is titled "Behind the mirror" - I spent hundreds of hours behind a one way mirror watching people solve problems and code. Some neat lessons there

15:27 I'd love to do a bret victor-ish talk about the possibilities with clojure/clojurescript too

15:27 scriptor: ibdknox: whereat will you talk?

15:27 ibdknox: As many places as I can this year

15:28 hopefully strangeloop

15:28 lynaghk: ibdknox: I would love to hear a "Behind the mirror" talk.

15:28 ibdknox: definitely oredev in sweden

15:28 scriptor: ah, nice

15:28 dnolen: ibdknox: you should, especially since Bret Victor will be there!

15:28 ibdknox: I know :)

15:30 light table would be another potential thing to talk about

15:31 sandbags: technomancy: is there a way to get tab-completion of symbols in leiningen repl?

15:33 autodidakto: sandbags: ohmyzsh has a plugin for it

15:33 oh wait, lol nm

15:33 I thought you mean "of commands in bash"

15:33 llasram: sandbags: the terminal repl for lein 2.x has tab-completion

15:33 autodidakto: note to self: don't start answering questions within 5 minutes of waking up

15:34 sandbags: ah, homebrew gave me 1.7.1

15:34 llasram: Ah, homebrew

15:34 Actually, lein2 isn't stable yet

15:35 sandbags: i can live without, just lazy

15:35 llasram: There was just a new preview release, and I've had no problems with it, but there are apparently still a few issues to shake out

15:35 sandbags: You can have both at the same time for individual deving

15:35 I doubt homebrew buys you anything over the "self install"

15:35 which consists of putting the 'lein' shell script in your path, and running it

15:37 autodidakto: llasram: that's pretty much it. it copies it to your PATH and runs it for you

15:38 llasram: Oh, what homebrew does? Er, nice?

15:38 I try to pretend proprietary operating systems don't exist *la la la*

15:39 autodidakto: llasram: don't blame homebrew. blame technomancy for much an awesome script/program

15:40 llasram: usually though, homebrew leverages thousands of unix loving mac guys to give you the perfectlly tweaked make/config file ready to build

15:41 well, apt-get for mac is a better way to put it

15:43 llasram: Well, maybe `emerge` for Mac OS X? Doesn't it typically pull in source and compile it?

15:43 Or maybe... whatever the *BSDs use

15:43 Anyway

15:44 At my current office we spend waaaay too much time arguing about packaging :-)

15:46 alfborge: Are there any good blogs or articles about testing in clojure? Currently I'm using deftest, testing and is, but my tests are too fragile...

15:47 As in I'm using many is-statements in one deftest, and if one of these causes and error then they all seem to fail.

15:48 S11001001: alfborge: further failures/errors would probably be cascades

15:49 alfborge: and the best way is to look at various libraries' tests and see how they do it

15:51 alfborge: one thing you'll see that way is that no one uses inline tests; everyone puts tests in separate files, usually in a parallel module hierarchy, as is encouraged by leiningen

15:51 scriptor: ah, emerginglang's cfp *is* closed for this year

15:51 emezeske: alfborge: That seems fishy to me; when one of my (is ...) fails, it doesn't cause any others to fail

15:51 alfborge: emezeske: The test isn't failing, it's throwing an error.

15:52 emezeske: alfborge: Oh, that would be hard to help with without seeing the code.

15:53 alfborge: Not a problem, I'm able to fix the error (despite clojure and the testing macros every attempt to confound me)

15:53 I'm just annoyed that an error causes all other tests to stop running.

15:54 Which is a sure sign that I'm "doing something wrong"

15:54 S11001001: so split up your deftests

15:54 if you need common setup, use fixtures

15:54 emezeske: So it's actually the testing library that raises the error?

15:54 hcumberdale: Hi guys ;)

15:55 alfborge: emezeske: Nah, the current error was just me being stupid and shadowing a function with my let. :)

15:55 hcumberdale: Does anybody know how efficient clojure is when macros are used a lot?

15:55 Or do macros cause memory holes?

15:55 S11001001: hcumberdale: macros slow down the compiler, not the execution speed of the running code

15:55 alfborge: hcumberdale: macros are evaluated to code at compile-time

15:55 progo: no matter since the macros are gone by runtime

15:56 hcumberdale: yeah but the runtime needs to allocate memory for it?!

15:56 alfborge: the runtime doesn't know about macros

15:56 hcumberdale: And the macros stay in memory after execution!?

15:56 S11001001: the macro *definitions* stay loaded, not the *uses*

15:56 hcumberdale: *confused*

15:56 alfborge: hcumberdale: the macros are replaced with actual code during compilation

15:56 joegallo: technomancy: is checksum-deps no longer a thing?

15:56 alfborge: hcumberdale: so the runtime only sees regular code

15:57 hcumberdale: think of it as code generation at compile time

15:57 emezeske: hcumberdale: Are you familiar with C programming?

15:57 hcumberdale: alfborge, how should this be possible? with the dynamic they offer? Does the compiler check where the macro is used and then "x times" the f(n) is generated?

15:58 yes emezeske

15:58 But I thought lisp macros are different from c macros?!

15:58 emezeske: hcumberdale: Well, the thing is, they are both evaluated at compile time

15:59 hcumberdale: So if you have #ifdef 0 ... #endif, that happens at compile time, right?

15:59 S11001001: hcumberdale: they are, but "different" doesn't mean "there are no similarities whatsoever"

15:59 hcumberdale: ^^ crazy yes.

15:59 emezeske: hcumberdale: So picture clojure macros as similar to #ifdef and friends, except vastly more powerful. ^_^

15:59 hcumberdale: and (macro x) (macro y) => two instances that are generated at compile time ;)

16:02 alfborge: hcumberdale: when you compile code with a macro in it, the compiler executes the macros and replaces them with the resulting code, so yes to your question to me

16:03 jkrueger: i had a rather interesting issue with tools.logging today. I AOT compile code, which makes calls to logging functions from tools.logging. Those functions turn out to be marcos, which in turn emit calls to a library internal protocol into my code, which seems seems to break it. could anybody here tell me whether there is a known issue with protocols and AOT compiled code, when a protcol is not compiled but code using it is ?

16:04 hcumberdale: jkrueger, i'm using slf4j and logback to capture all the logging output (including the clojure logging output) and filtering it if needed

16:05 I recommend this if other java libs are used that write dirty logging output to SYS_OUT

16:06 or to SYS_ERR. Most java libs write errors to SYS_OUT ;(

16:06 jkrueger: i'm less curious about workarounds, than to understand why my code breaks

16:07 llasram: jkrueger: How is your AOTed code getting loaded when it breaks?

16:08 jkrueger: tools.logging does a reify at some point on a protocol called LoggingFactory, which appears to make my code depend on the the protocol's interface. when the name space is required, which contains the logging calls, a class not foind excpetion is thrown

16:08 naming the protocol from tools.logging

16:08 technomancy: joegallo: checksum-deps isn't needed in lein2

16:09 cduffy: How expensive is proxy? I'm currently calling it within function that's called in a loop (to allow a local ref to be closed over), but pondering if doing something different would be better.

16:09 llasram: jkrueger: Ah, gotcha. So the .class file contains hard references to the LoggingFactory interface, and the JVM is attempting to resolve those interfaces prior to executing the initializer code loading the tools.logging interface

16:09 joegallo: technomancy: ah, okay. also, i have lein tar in my dev profile's dependencies (new version). but it says it's not a task. :(

16:09 jkrueger: that's what it looks like

16:10 _312matt: sorry for this really really stupid questions

16:10 (def hello (fn [] "Hello world"))

16:10 jkrueger: i wonder if this dependency could be removed if the logging interface in tools.logging used functions instead of macros

16:10 _312matt: how do i execute that and get it's return value

16:10 when i execute it and try to do (prn hello)

16:10 it goes

16:10 mefesto: _312matt: (println (hello))

16:11 _312matt: mafesto: it prints #<user$helloA user$helloA@755c62bc>

16:11 llasram: s,tools.logging interface,tools.logging namespace,

16:11 Hmm

16:11 I *thought* though that references to a class weren't enough to force class resolution and initalization

16:11 Is your code making logging calls in what ends up in static initializers?

16:11 technomancy: sandbags: yeah, give lein2 a try if you are using the command-line repl; the one that comes with lein1 is not very good

16:11 mefesto: you need parens around hello

16:11 raek: cduffy: proxy uses "reflection-ish" parts of java and methods are looked up via a clojure map from strings to functions

16:11 _312matt: THX! mafesto

16:11 sorry for the stupid question, so bored today so i thought i would mess with clojure, i assure you i am not retarded

16:11 sandbags: technomancy: will do, thx

16:11 technomancy: just be prepared to fall back to lein1 for some projects; not everyone is onboard with the full awesomeness yet

16:11 raek: cduffy: reify on an interface generates a new jvm class that implements the methods directly

16:12 sandbags: technomancy: this is clojure day 1, i suspect i will not be straying into interesting areas of awesomeness any time soon :)

16:12 jkrueger: llasram: it's used in a multimethod dispatch at one point to emit a warning

16:12 otherwise no unusal places

16:14 mefesto: so does lein2 use nailgun?

16:14 technomancy: mefesto: no, it uses nrepl

16:16 llasram: jkrueger: Sorry, I don't have any other ideas. It seems like the sort of problem people would have run into before if it's a pervasive issue...

16:17 I know that I've AOTed code referencing Protocols without issue

16:19 sw1nn: Any zipper experts around?

16:19 I was looking at this question on SO - http://stackoverflow.com/questions/10127023/filter-a-map-with-complex-nested-structure

16:19 mefesto: on first run lein2 launches an nrepl server?

16:20 sw1nn: There's an answer already, but I was trying a zipper based solution without much luck

16:20 technomancy: mefesto: oh, no that is not implemented. hopefully jark will allow that to work though.

16:20 sw1nn: I don't follow the make-node param to (zipper branch? children make-node root)

16:21 Where can I find examples of zipper usage?

16:21 http://clojuredocs.org/clojure_core/clojure.zip/zipper isn't helping me

16:21 * mefesto downloads lein preview3 :)

16:23 kephale: sw1nn: you probably dont want to use the function "zipper" directly, but instead seq-zip, vector-zip, or xml-zip

16:26 sw1nn: kephale: problem is that doesn't seem to work for maps

16:28 because (seq my-map) returns a sequence of [key val] which doesn't recurse presumably?

16:29 mefesto: if the latest version of lein-swank is 1.4.4 why doesn't that show up in: lein2 search lein-swank ?

16:30 technomancy: mefesto: probably your search indices are stale

16:30 rm -rf ~/.lein/indices/http___clojars.org_repo_/

16:32 autodidakto: technomancy: that's what she said

16:32 jkrueger: llasram: i think i may have verified my working theory. i only use the "info" macro from logging at the moment. if i replace it with a function the dependency on the protocol interface disappears

16:32 mefesto: if i wanted to run a project in production using lein2 is there any special env vars or other configuration stuff i should know?

16:33 im guessing it'd be something like: lein2 with-profile prod run

16:33 autodidakto: mefesto: did you read the Upgrading page on the leiningen githubs?

16:34 mefesto: autodidakto: nope, i'll check that out. thanks

16:34 kephale: sw1nn: well you can write a recursive seq-ing function

16:34 autodidakto: mefesto: you mean, as opposed to lein1? in either case, check out the sample.project.clj

16:34 kephale: , (require '[clojure.zip :as zip])

16:34 autodidakto: it's on the githubs, or you can type "lein help sample"

16:34 clojurebot: nil

16:35 kephale: , (zip/down (zip/seq-zip ((fn recseq [s] (if (or (vector? s) (map? s) (seq? s)) (map recseq (first s)) s)) {:a {:b 3}})))

16:35 clojurebot: [:a {:l [], :pnodes [(:a (:b 3))], :ppath nil, :r ((:b 3))}]

16:35 llasram: jkrueger: I'm confused as to how that happens though. AFAICT, the code emitted by the macros never mentions the protocol interface directly

16:35 jkrueger: i think the special case here may be that the protocol is implemented in a reify

16:35 and that is emitted into my code

16:35 not sure though

16:36 llasram: jkrueger: I don't think that should matter? The code I'm looking at calls impl/get-logger on a dynamic var. The reified protocol gets bound to the var, but that shouldn't be resolved at macro-expansion time

16:37 sw1nn: kephale: hmm, thanks I'm gonna have to study that a bit!

16:38 Bronsa: ?

16:40 technomancy: mefesto: yeah, "with-profile prod" is the way to go for something like that

16:41 jkrueger: llasram: i agree. it shouldn't. but i can definitely reproduce this behavior by switching from macro to function and back

16:42 llasram: jkrueger: Very very strange. If tools.logging isn't doing anything especially unusual, then that may be a Clojure compiler bug

16:44 dnolen: looks like we're getting very close on PersistentHashMaps for CLJS.

16:44 rplevy: does anyone have a util library with condp-let in it?

16:46 lpetit: dnolen: you're doing my day, everyday :)

16:48 pandeiro: have the recent optimizations on CLJS made it into an official release?

16:48 dnolen: lpetit: ha not me, other people :)

16:48 pandeiro: not yet.

16:50 hcumberdale: technomancy what is the advantage of lein2?

16:51 technomancy: oh man... where to start? =)

16:51 llasram: hcumberdale: Even though most people thought there was only room for another 17% more awesome in tool, he and the other contributors have squeezed in about 117% more

16:52 technomancy: hcumberdale: http://technomancy.us/158 is a good overview

16:52 though it doesn't really mention the fact that the repl has been totally rewritten to use jline2 and have full tab completion

16:52 pandeiro: technomancy: like in slime?

16:52 hcumberdale: yeah!

16:53 technomancy: pandeiro: pretty much

16:53 afoolsuchasi: hey, bit new to clojure. trying to get a basic noir project up on beanstalk. tried to follow documentation on noir page and lein beanstalk page. ran "lein beanstalk deploy development" but got error INFO: I/O exception (java.net.SocketException). First guess is wrong port or something but does anyone have a link to a sample project that I could try to run to help diagnose? thx.

16:53 technomancy: I think it's actually the same codebase driving the completion

16:53 pandeiro: that is terrific

16:53 would that mean that it works with cljs?

16:53 technomancy: hm; I don't think so

16:53 cljs doesn't have reified namespaces, does it?

16:54 pandeiro: paging dr nolen

16:54 i assume not

16:54 technomancy: there's technically no reason the new repl couldn't be ported to lein1 except that it would be less reason for people to upgrade, so I'm not going to do it =)

16:54 dnolen: technomancy: if the files have been analyzed tools can look inside of the cljs.compiler/namespaces atom for the same info.

16:55 hjs: hey, anybody using clojurescriptone here? is there any better combination of libraries for web dev?

16:55 llasram: Profiles are definitely the big draw for me. The :user profile alone is incredibly helpful, and it being provided by a general mechanism is just great for everyone

16:55 hcumberdale: super-awesome

16:57 technomancy: dnolen: yeah, I'm sure it's doable; it's just that a different approach would be needed from the library the new lein repl uses

16:58 has anyone tried cljs with swank-js?

16:58 AWizzArd: hcumberdale: one interesting example is to have different profiles with different optional JVM parameters, such as “-Dcompile.time.flag=x”. Your code can include macros which lookup those properties and expand to nil in cases where you don’t want to include customer-specific code into some .jars. Very useful for some projects.

16:59 hcumberdale: Is the emacs clojure repl better than the one from vimclojure

17:00 It really frustrates me! Start nailgun, open vim, \sR ESC ^ww v \eb \p ^ww ... begin to work here

17:00 AWizzArd: hcumberdale: depends on who you ask. Ask this question an emacs user (like me), or a vim user (:

17:01 hcumberdale: I like vim cause it seems so simple and I never understood this str+?! things in emacs

17:01 >> http://mrozekma.com/editor-learning-curve.png

17:02 antares_: I am trying to refer to a function that's part of a protocol from a different function in the same deftype definition. it only works if I extract a helper function like so (see info, error and so on): https://gist.github.com/46f0563836ff51e9b13e. Is this how it supposed to be? or what I am trying to do should be possible?

17:02 emezeske: hjs: I'm using clojurescript, but did not base my project on clojurescript one

17:03 technomancy: profiles are definitely the biggest new feature in lein2; I'm very pleased with how they turned out

17:03 emezeske: hjs: A good start is just to use a combination of ibdknox' libraries (noir, crate, fetch, etc)

17:04 AWizzArd: technomancy: yes, this finally allows me to use Leiningen for every project, also in my company. We needed parameterized compilation, which is now provided.

17:08 ibdknox: bwahaha

17:08 time to write a blog post

17:10 emezeske: ibdknox: Uh oh, am I feeding people misinformation?

17:10 mefesto: lein2 repl is nice. is there any emacs / nrepl integration?

17:10 ibdknox: emezeske: oh no, that was completely unrelated

17:10 emezeske: ibdknox: oh haha

17:10 ibdknox: I just got something very, very cool to work

17:10 emezeske: awesome!

17:10 ibdknox: And I think that's enough to finally talk about this thing I've been playing around with :)

17:11 hjs: ibdknox: i'd like to know too :)

17:11 emezeske: looks very good, thanks

17:11 dnolen: ibdknox: bring it on!

17:11 ibdknox: hjs: cljs-template is the quickest way to get going

17:12 dnolen: should get the post + video out tonight or tomorrow :)

17:12 hjs: ibdknox: thanks, i'll play with it. any thoughts on clojurescriptone?

17:13 technomancy: mefesto: no nrepl.el yet; it's a long way off from being competitive with slime

17:13 ibdknox: hjs: awesome example with fantastic documentation, not a great starting point for a new project though. So it depends on what you want to do :)

17:15 hjs: ibdknox: why it's not a good starting point for new project?

17:15 ibdknox: hjs: too much going on that's unrelated to what you're probably doing

17:16 hjs: ibdknox: i have little to worry about the front-end, but need to help testing and provide some basic functions for the front-end developer, so i think clojurescriptone might be a good choice

17:16 ibdknox: I know some do use it as a starting point, but it's kind of in this weird limbo of including what are essentailly libs in its source and such

17:16 hjs: ibdknox: i see

17:17 ibdknox: either way, there's nothing wrong with starting from it

17:17 whatever works :)

17:18 as a clean, simple starting point for something new, cljs-template is probably the right place to look

17:18 hjs: ibdknox: yeah, i'll give it a shot :) and then probably cleanup libs for my specific need.

17:22 tmciver: I'm seeing some unexpected behavior when trying to call a method of a proxied object when creating an instance using (.newInstance my-proxy-class). Does anyone have any advice to get around this problem? https://refheap.com/paste/2063

17:23 amalloy: tmciver: don't do that

17:23 hiredman: tmciver: don't do that

17:23 tmciver: the class generated by the proxy macro is not for you

17:24 amalloy: and even if it were, (.newInstance foo) wouldn't work if the proxy body closed over any locals

17:25 tmciver: hiredman, amalloy: I wouldn't normally do that but a JavaFX application requires you to pass the java.lang.Class and I assume it's instantiating one of these internally.

17:25 muhoo: i vaguely remember there being a way to get lein to symlink jars into lib instead of copying them, but i don't rememebr what it was

17:25 kjellski: ls -lh

17:25 arch, sorry guys

17:25 amalloy: you probably can't do that with proxy, tmciver. code that uses reflection is pretty fragile/finicky, so you probably have to write some glue in java or with gen-class

17:26 antares_: tada! lein2-preview3 is live on travis-ci.org. (cc cemerick)

17:26 technomancy: antares_: nice!

17:26 tmciver: amalloy: yeah, that's what I thought. I just wanted to make sure.

17:26 and it looks like deftype won't work either becasue it only accepts Object, correct?

17:27 amalloy: if you only need to implement interfaces (not extend a class), you can use deftype. but i remember javafx causing problems for hordes of clojure devs, so that's probably not true

17:27 tmciver: amalloy: OK, thanks for the help.

17:29 mmarczyk: dnolen: ping?

17:29 dnolen: mmarczyk: hello

17:29 mmarczyk: hi

17:30 fighting git atm, but almost done with it

17:30 dnolen: mmarczyk: excellent!

17:30 mmarczyk: about the #_-commented-out-code

17:30 do you want the old map-emitting code in the compiler removed?

17:31 I originally left it in on the off chance there are some uncaught bugs, so there's a natural quick fix

17:31 of course, there are no uncaught bugs

17:31 (right?)

17:31 but anyway.

17:33 I expect it'll be going back in eventually too, since I imagine ObjMaps at least may be more efficient in certain small map scenarios

17:35 dnolen: mmarczyk: yes replace the map emitting code. We can figure out later whether to emit ObjMaps or ArrayMap or whatever for small maps.

17:36 mmarczyk: ok

17:37 about proto perf vs. direct impl via Object

17:37 the difference is rather striking in Rhino

17:37 thanks for the hint

17:37 dnolen: mmarczyk: mark the current maps as deprecated.

17:37 mmarczyk: ok, will do

17:37 dnolen: mmarczyk: np.

17:37 mmarczyk: does gclosure shave any of that off?

17:38 dnolen: mmarczyk: no gclosure optimizations are very specific. remove deep property access and unwrapping needless functions are the biggest wins.

17:38 mmarczyk: ok, got it

17:44 dnolen: all-in-one patch posted to JIRA

17:55 hjs: the latest swank-clojure seems broken? my lein version is 1.7.1

17:57 dnolen: mmarczyk: Thanks. I think I'll need to look more closely at the patch. Doing some quick perf tests I think the hit on small maps vs. ObjMap is too just big to merge this in just yet.

17:58 amalloy: hjs: and what is your swank-clojure version? 1.4.2 is pretty stable afaik, and if you're complaining that a snapshot is broken i wouldn't really be too surprised

17:58 kjellski: technomancy, can you give me a hint on this? Its an installation error from starter-kit in emacs… https://gist.github.com/2371270

17:58 hjs: amalloy: 1.4.4, i got this error message "java.io.FileNotFoundException: Could not locate swank/swank__init.class or swank/swank.clj on classpath: (NO_SOURCE_FILE:1)", but second run made it works, no idea

17:59 mmarczyk: dnolen: sure

17:59 amalloy: i dunno, hop into #leiningen and give technomancy a ring

17:59 hjs: amalloy: ok

17:59 dnolen: mmarczyk: that said, update perf on V8 is pretty sick.

17:59 mmarczyk: :-)

18:00 amalloy: kjellski: those look like warnings, not errors. i don't know a lot about elisp culture, but code with a million warnings seems surprisingly acceptable

18:00 kjellski: amalloy, *lol* okay… is there a way to check wether it finished completels?

18:01 technomancy: kjellski: yeah, that's expected

18:01 amalloy: uhhh, you could open up emacs and hit M-x clojure-mode -- that should work iff the compile succeeded? not really my area of expertise

18:01 technomancy: it's dumb; the elisp compiler whines about silly things sometimes

18:01 kjellski: technomancy, thanks =) ...

18:01 technomancy: so nobody pays attention to the warnings

18:02 mmarczyk: dnolen: as a quick fix, I could add thresholding using ObjMap / HashMap; or maybe ObjMap + a port of ArrayMap (which would take slightly longer)

18:02 amalloy: technomancy: referring to a free variable sounds bad. is it okay because of the pervasive dynamic scope? like, i can refer to this variable that's not lexically scoped because emacs has no lexical scope?

18:03 zerokarmaleft: technomancy: is there a way to turn off elisp compiler warnings? does elisp have multiple warning levels?

18:03 dnolen: mmarczyk: I think we're at the point where some tests on jsperf.com would be useful like we did for various PersistentVector uses cases.

18:04 mmarczyk: specifically we care about access / update perf on small / big maps - we want to be able to assess that easily.

18:04 technomancy: amalloy: in that gist it's a case of setqing something before it's required because the lib that contains that defvar isn't strictly required. but some of the warnings are bona fide stupid, like "ooooh, looks like you required cl.el; that won't do."

18:05 zerokarmaleft: I don't know; I haven't looked into it

18:05 mmarczyk: dnolen: right, I'll look into it

18:05 dnolen: mmarczyk: exciting stuff - thanks for taking this on!

18:06 mmarczyk: not at all, it's a fantastic experience

18:08 and cljs "just works" in a way which is absolutely amazing

18:08 dnolen: mmarczyk: it's pretty mind blowing.

18:08 mmarczyk: it is

18:09 dnolen: mmarczyk: and JS engines are getting so finely tuned. The perf of persistent data structure on modern JS engines is shocking.

18:09 mmarczyk: right

18:10 well, I've got an unusually busy weekend ahead of me (incl. Friday), but I'll definitely be squeezing in some cljs time

18:10 I'll look into jsperf.com, thresholding etc.

18:11 dnolen: mmarczyk: no problem, I'll try to take a look as well.

18:11 mmarczyk: great, thanks

18:11 dnolen: mmarczyk: it may be as simple as using ObjMap up until we hit 32 keys or we get complex keys.

18:12 mmarczyk: I've been reading the transient map impl in Clojure too and I'll definitely be experimenting with adding an equivalent to the cljs port

18:13 dnolen: mmarczyk: cool!

18:28 Licenser: In cljs r1011 I keep getting odd situatiosn where it claims "Cannot read property 'cljs$lang$maxFixedArity' of null" on the line: "cljs.core.apply.call(null, cljs.core._STAR_main_cli_fn_STAR_, cljs.core.drop.call(null, 2, cljs.nodejs.process.argv));"

18:28 any idea?

18:30 dnolen: Licenser: did you not have that problem before?

18:31 Licenser: I've seen the error message before -when I use a wrong function name for example - but in this place never and that is generated code

18:31 kjellski: I've installed starter-kit now, then I browse to a leon project… and do the clojure-jack-in… I've already https://gist.github.com/2046593 in my .emacs file… and it still tells me lein is not a recognized command...

18:32 Licenser: it looks like apply was not declared which is odd

18:33 hiredman: do you have reason to believe set-exec-path-from-shell-PATH works?

18:33 have you checked you path in emacs and seen that it contains the right directories?

18:33 (getenv "PATH")

18:34 dnolen: Licenser: what I mean is did your code work before r1011

18:35 kjellski: hiredman, I've now just linked the ~/bin/lein to /bin… so this is gone, now slime-clj is an unrecognized symbol…

18:35 technomancy: you'll want to get rid of slime-clj

18:35 hiredman: slime-clj means you are mixing bits

18:36 Licenser: yes but I also had changes since then - when I saw this the first time make clean and make fixed it

18:36 hiredman: slime-clj is part of a fork of swank-clojure that is named ritz

18:36 technomancy: clojurebot: slime-clj

18:36 clojurebot: I don't understand.

18:36 Licenser: dnolen what confuses meis that the like looks like boilerplate code, it does not find cljs.core.apply

18:37 and the call seems to be the entry call for node.js

18:37 kjellski: actually this is really frustrating… I'm now trying to get an acceptable emacs setup for 2 evenings… why is it so hard?

18:37 technomancy: clojurebot: slime-clj is deprecated.

18:37 clojurebot: c'est bon!

18:38 dnolen: Licenser: I'm not that familiar with the Node.js stuff in CLJS. It would be helpful if you did a git bisect to figure which commit broke your code.

18:38 Licenser: my main problem is that the line isn't techincally 'my' code o.o

18:38 and the error pops on and off when I cahnge stuff in different places

18:39 dnolen: Licenser: i suspect that cljs.core._STAR_main_cli_fn_STAR_ is null sometimes.

18:40 kjellski: You know, when there would exist clojurebox anymore, I would've already installed windows in a vm to get rid of this… is it easier for others?

18:40 Licenser: this time it works again - after changeing a string constant o.O

18:40 technomancy: kjellski: in general it's not bad if you follow the official docs

18:40 dnolen: Licenser: if you can enumerate the steps to repro - then open a ticket in JIRA.

18:41 technomancy: though the macosecks path stuff is frustrating no matter what

18:41 kjellski: technomancy, for clojure, google is not able to find an really easy way to get you started locally… any reasons?

18:42 technomancy: google indexes a lot of things; good and bad.

18:42 it's a known bug.

18:42 Licenser: dnolen I'll try to track it down further

18:42 technomancy: unfortunately I haven't been able to find the URL for the bug report form for Google Search =)

18:42 kjellski: technomancy, soooo? ^^ tell me how to find the good.

18:42 technomancy: https://github.com/technomancy/swank-clojure is probably your best bet

18:43 or dev.clojure.org's Getting Started with Emacs, though the comments on there are misleading and I haven't been able to fix them

18:58 kjellski: technomancy, thanks for the hints… and I'm extremely sure that you have already done extremely much to make things easier… but for me, this is unacceptable as a staring point to get into a development environment. I'll leave this for someone with more time and get back to lein repl… which is none but works.

18:59 technomancy: yeah, learning Emacs at the same time as learning Clojure is not going to work very well.

19:00 kjellski: technomancy, could you point me to somewhere I could file this in a matter of a community problem? I tried clooj, I tried counterclockwise, I tried Emacs, Aquamacs and Emacs.app… I mean this is really no way to start…

19:01 technomancy: I think most people in the community would give the same advice; use what you already know and don't try to learn a new environment at the same time as a new language.

19:03 kjellski: technomancy, okay. nevermind. maybe everybody else is just fine with this ;)

19:03 technomancy, thanks again, I'll try to get into clojure questions...

19:04 brehaut: i learnt clojure with textmate and the basic repl (pretty much the worst enviroment for learning clojure)

19:04 and then picked up emacs later

19:04 much less pain

19:04 oh hes gone

19:22 kenneth: hey, so i want to try to use clojure to read a massive (140M lines) file in parallel (10 concurrent executions or so) and process & import into mongo. i think congomongo will handle the mongo part, but do you have any recommendations for the parallel part, or any gotchas in reading massive files

19:22 ?

19:23 or maybe this might be a better packageL https://clojars.org/mongo-clojure-wrapper

19:25 hiredman: kenneth: a. https://mobile.twitter.com/roflscaletips/status/189397614813384704 b. use RandomAccessFile

19:34 guns: Is the mailing list moderated? I sent off a message yesterday, but it hasn't shown up.

19:34 technomancy: it's moderated, yeah

19:34 guns: It's not terribly important, but I don't want to make a mistake of double posting

19:39 emezeske: guns: It can take a couple days to show up sometimes :/

19:40 kenneth: so, i can never figure out how to require clojure-contrib properly

19:40 is there a trick to it? with lein

19:40 brehaut: kenneth: first trick, dont use clojure-contrib with 1.3+

19:41 kenneth: aha? what to use instead then?

19:41 brehaut: ~contrib

19:41 clojurebot: Monolithic clojure.contrib has been split up in favor of smaller, actually-maintained libs. Transition notes here: http://dev.clojure.org/display/design/Where+Did+Clojure.Contrib+Go

19:41 antares_: kenneth: individual libraries under github.com/clojure

19:41 guns: emezeske: ah. kind of makes discussion difficult. I guess it's better than the spam death most google groups go through though

19:41 emezeske: guns: Yeah, it makes discussion impossible. I feel for you; I didn't get un-moderated for several weeks

19:42 kenneth: ah, okay

19:42 package management is one of the most confusing part of using clojure for me. i have no java background, which certainly doesn't help :p

19:44 brehaut: theres not really to much to it: you specifiy your dependancies in your project rather than installing them site wide, and you let lein manage fetching them and sticking them on the class path

19:44 technomancy: the most confusing thing about it is contrib

19:45 which only ever existed because clojure lacked dependency management

19:45 brehaut: kenneth: the only trick with the new contrib is that some of the libs are only available via the snapshot repo which i don't believe defaults to not being in your dependancies list

19:50 AWizzArd: guns: the list is semi-moderated: after your first post a moderator (i.e. Rich Hickey) must activate you. From that point on your posts will appear seconds later.

19:51 guns: AWizzArd: That makes sense. What a chore for Rich though

19:59 emezeske: guns, AWizzArd: You don't necessarily get off the "needs to be hand-moderated" list after your first post.

20:00 guns: I'm fine with moderation. Achieving high signal to noise in a list is pretty difficult.

20:01 I don't have much to say as a Clojure neophyte atm, anyhow

20:06 antares_: guns: any reasonably popular google group is moderated these days. Otherwise, spam.

20:10 guns: Google has a rating system in the groups interface. If they were truly interested in the problem, they could implement a stackoverflow style rep system

20:11 Not much money in newsgroups though

20:12 antares_: guns: the point of groups is to pipe you into google+

20:12 guns: ick

20:12 antares_: guns: everything else is not too interesting to the big G

20:13 guns: for example, if you join a group now, they do not prefill your name. You either have to type it in (inconvenient), or sign up for a google+ account.

20:24 kenneth: so i'm having trouble with this: https://gist.github.com/0de71c218fea3ec83c6f -- i get FileNotFoundException Could not locate monger/core__init.class or monger/core.clj on classpath: clojure.lang.RT.load (RT.java:430)

20:25 i have monger in my deps and did `lein deps`

20:25 antares_: kenneth: can you show me your project.clj?

20:25 kenneth: https://gist.github.com/ff1450649c6b40a42b1f

20:25 antares_: kenneth: also, monger is 1.3-only. clojure.contrib.json is not necessary since monger integrates with clojure.data.json (data.json under github.com/clojure)

20:25 kenneth: you don't have monger on your dependency list

20:26 you have congomongo

20:26 kenneth: er

20:26 i'm silly

20:26 very very silly

20:26 antares_: [com.novemberain/monger "1.0.0-beta4"]

20:27 kenneth: for multiple requires, should i make a new (:require …) for each, or try to combine them some other way?

20:27 antares_: you shoudl combined them

20:28 kenneth: https://github.com/michaelklishin/monger/blob/master/test/monger/test/collection_test.clj#L7

20:28 [monger core util] is the same as monger.core monger.util

20:28 technomancy: don't put bare :use calls outside tests though

20:28 "only use :use with only"

20:29 antares_: kenneth: you said you don't have Java background, what is your background?

20:29 hiredman: antares_: ugh

20:29 kenneth: antares_: objc / php / ruby

20:30 antares_: kenneth: also, monger was my 2nd clojure library ever so it sure has pieces I am dying to tidy up :)

20:30 hiredman: antares_: don't combine namespaces like that

20:30 kenneth: i wrote a mongo library too :) php orm

20:30 hiredman: antares_: and don't tell other people to do it

20:30 antares_: kenneth: ok. Then require is very similar to Ruby's Kernel#require and use is like require + include except that you can include only individual bits (functions)

20:30 hiredman: why?

20:31 kenneth: but yeah, i find dependency management / namespacing etc in clojure / java extremely confusing

20:31 hiredman: antares_: because it is bad style

20:31 antares_: kenneth: dependency management part is very similar to rubygems + bundler (combined)

20:31 hiredman: then what is good style?

20:31 technomancy: antares_: good style encourages greppability

20:32 hiredman: [monger.collection :as mgcol] ;; good

20:32 technomancy: you should be able to determine all uses of monger.util with a single grep call

20:32 hiredman: [monger core util] ;; bad

20:33 antares_: I agree that [monger core util] is not a good idea and also rarely helpful anyway. I thought the suggestion was to use (:require …) (:require …) which I don't see any upsides to.

20:34 I will tidy monger up tomorrow, good to know

20:35 kenneth: antares_: does this make sense?https://gist.github.com/dd1e10668d25dac35208

20:35 gets me a ClassCastException clojure.lang.PersistentList cannot be cast to java.lang.Comparable clojure.lang.Util.compare (Util.java:104)

20:35 antares_: technomancy: as for greppability, I am a heavy emacs user but I also love intellij idea. I think tools should move to the point when you have better ways of finding namespace usages than grep.

20:35 kenneth: added the correct dep

20:35 technomancy: antares_: I'll take that further: I don't think humans should have to write ns clauses except in edge cases.

20:36 emezeske: antares_: I'm all for better ways of finding namespace usages, but please don't break my grep

20:36 antares_: kenneth: you don't need quotes in ['clojure.contrib.json :as 'json]. Also, I strongly recommend you use github.com/clojure/data.json or cheshire

20:36 technomancy: but it's good to make concessions to the lowest common denominator

20:36 because you may want to investigate things when you don't have the full force of your tooling to bring to bear

20:36 antares_: emezeske: sorry but I am not formatting my code just for grep friendliness. that's just too much to ask for in 2012.

20:36 kenneth: i am using data.json, i think, antares_

20:37 antares_: same for 80 characters-wide columns, we are no longer on tiny terminal windows

20:37 kenneth: or wait

20:37 ugh

20:37 antares_: kenneth: if so, you need https://github.com/michaelklishin/monger/blob/master/src/monger/json.clj#L12

20:37 emezeske: antares_: I don't care what you do on your own projects, of course

20:37 kenneth: yeah, nice catch, thanks

20:38 technomancy: antares_: FSVO "we"

20:38 I'm chatting in a window that's 87 columns wide

20:38 emezeske: Well, and most people that care about 80 columns care about it because they split their screen

20:39 Not because their screen is literally only 80 characters wide

20:39 amalloy: my source files are 100 characters wide only by compromise - i'd rather our company standard were 80

20:40 hiredman: we have tests in our test suite that scan the source looking for lines over 80 characters and fail if they are found

20:40 technomancy: hiredman: also it bumps up your name in the on-call rotation if it finds them, doesn't it?

20:40 =)

20:41 amalloy: i can't see things at the tiny fonts/resolutions most people use; the most i can comfortably fit on my entire monitor is 157 columns. there are still plenty of good reasons to have 80 be a standard, even if it's not totally inviolate it's a good starting point

20:41 * hiredman likes at least two columns per emacs

20:41 hiredman: and one emacs per screen

20:41 antares_: emezeske: I split my screen as well. However, if I go above 80 or 90 on some lines, that's not a problem for me. Maybe it is a habit of using large screens.

20:42 for example, failing builds if one line is 81 character long is just a waste of time in my opinion

20:42 anyway

20:42 emezeske: I didn't mean to start a religious war

20:43 antares_: I will clean up old ns macro issues in my projects. monger was started when I was 2+ weeks into clojure.

20:43 amalloy: antares_: one advantage of hiredman's approach is now it's totally impossible to use ridiculous classes like IMavenProjectFileImmutableArtifactConfiguratorProxyBeanFactoryCacheImpl

20:44 sorry boss, can't fit that on a line

20:44 hiredman: I didn't say I added the tesst

20:44 amalloy: neither did i. it's the approach you just mentioned; i suppose you can object to my calling it "yours" if you like

20:45 antares_: amalloy: but isn't that fixing a social problem with tools? we all know how far that goes

20:45 * amalloy is starting to worry people are taking seriously this "advantage"

20:49 kenneth: antares_: can monger upset?

20:49 wkmanire: Good eeevening.

20:49 kenneth: upsert*

20:50 antares_: kenneth: yes, see monger.collection/update and /save

20:51 kenneth: monger tries to follow Java client API conventions where they make sense. It both makes it more familiar to at least some people and makes it very lightweight and fast.

20:51 even in "safe" mode that it uses by default

20:52 wkmanire: Is let implemented in clojure or is it part syntax?

20:52 antares_: kenneth: https://github.com/michaelklishin/monger/blob/master/test/monger/test/updating_test.clj#L112. You can find plenty of examples under this dir https://github.com/michaelklishin/monger/tree/master/test/monger/test

20:53 wkmanire: part of the syntax*

20:55 dnolen: mmarczyk: question, why are you using the undefined? predicate the PHM impl?

20:56 in the PHM impl I mean.

20:56 emezeske: wkmanire: http://clojuredocs.org/clojure_core/clojure.core/let

20:56 wkmanire: showing source reveals it's a macro.

20:56 mmarczyk: dnolen: hm, I'm pretty sure I put it in while trying to fix some bug or other

20:56 dnolen: which did go away, but I'm not sure about the causal relationship

20:56 dnolen: mmarczyk: yeah undefined? is only for interop.

20:57 mmarczyk: dnolen: I'd say it was probably to do with undefined values with which some array was initialized

20:57 presumably ArrayNode's array

20:57 wkmanire: I don't know much about the language yet, I've been reading Cemerick's book.

20:57 emezeske: wkmanire: although the macro expands to (let* ...)

20:57 wkmanire: When I got to the part on destructuring I was just thinking...

20:57 mmarczyk: *if* -- and that's a significant if -- it's actually needed

20:57 wkmanire: How in the world was that accomplished.

20:58 emezeske: wkmanire: This is how: http://clojuredocs.org/clojure_core/clojure.core/destructure

20:58 wkmanire: :)

20:58 dnolen: mmarczyk: you should never need undefined in CLJS

20:58 emezeske: wkmanire: better link: https://github.com/clojure/clojure/blob/master/src/clj/clojure/core.clj#L3900

20:59 mmarczyk: dnolen: in Rhino, (make-array 5) returns an array of 5 x undefined

20:59 wkmanire: jeese

20:59 I've a long way to go yet.

20:59 mmarczyk: dnolen: (nil? (aget (make-array 5) 0)) returns false

21:00 S11001001: sure, but null == undefined

21:00 emezeske: wkmanire: To be fair, that is a pretty gnarly piece of code :P

21:00 S11001001: just that null !== undefined

21:00 mmarczyk: not sure how to get at js's == in cljs

21:00 except through (js* "~{} == ~{})

21:01 but thanks, that's a great point

21:01 one check less

21:01 I'll make the change sometime soon

21:01 dnolen: mmarczyk: thinking ...

21:02 mmarczyk: incidentally, I'm working on the transient impl atm

21:02 wkmanire: emezeske: I think I can recognize some of this...

21:04 dnolen: mmarczyk: k, you need to flip your tests.

21:04 wkmanire: Its nice when major components of a language are expressed in the langauge itself.

21:04 It's*

21:04 dnolen: mmarczyk: cljs.core.truth_ tests with != null && !== false

21:05 mmarczyk: note that != is coercive.

21:05 emezeske: wkmanire: Agreed!

21:05 kenneth: hiredman: hey earlier, you mentioned using randomaccessfile to read and execute a file line-by-line in parallel. is there any helpful tutorials you know of that will show me the way? i've been trying to research it and can't find anything helpful

21:06 mmarczyk: dnolen: ok, so do I write (or (undefined? node) (nil? node)) or perhaps (js* "(~{} != null)" node) ?

21:06 hiredman: kenneth: oh, well randomaccessfile can let you read out chunks of a file without have to seek through it linearly

21:06 depending on the format of the data in the file

21:06 dnolen: mmarczyk: no, you keep handing the nil case first, just handle it last

21:07 mmarczyk: ?

21:07 kenneth: my file is a file with 140M lines each containing a json document

21:07 dnolen: (if (or (nil? ...) (undefined? ...)) case1 case2)) -> (if ... case2 case1)

21:07 hiredman: multiline json document?

21:07 that is really almost the worst case

21:08 antares_: kenneth: take a look at http://blog.malcolmsparks.com/?p=17

21:08 mmarczyk: dnolen: ahhh, ok

21:08 got it this time

21:08 antares_: kenneth: plus, if you have 1 document per line, I believe mongoimport can do what you need w/o any code on your part

21:08 kenneth: each line = a new json document. {…}\n{…} etc. wanted to see if i could read it and process it in parallel, something like 10 at a time

21:08 antares_: yeah, but i have to process 'em before importing them, not a straight import

21:09 antares_: kenneth: ok

21:09 kenneth: i could have done it fairly easily in ruby/php, wanted to try it in clojure for the hell of it

21:09 mmarczyk: dnolen: I'll wrap up a couple of loose ends in the transient stuff and make the change

21:09 kenneth: almost starting to regret it, i'm like a few hours into the project already, it would've been done a long time ago haha

21:09 hiredman: well, the like from antares_ shows how to read from the file linearly, and parallelizing after that is trivial

21:10 the link

21:10 antares_: kenneth: well, you can turn it into a lazy sequence with (line-seq (io/reader "bigfile")) and then split it into groups of N and use pmap

21:10 hiredman: parallelizing reads from a big file of json blobs is less trivial

21:10 antares_: kenneth: if ordering of input does not matter, using a thread pool (execution service in JDK parlance) is another easy option

21:12 kenneth: for pmap to have good effect you'll probably need to use groups of 10,000 or so. Plus, make sure to use monger.collection/insert-batch and not just /insert in a loop.

21:18 cemerick: antares_: thanks for lein preview 3 on travis :-)

21:18 antares_: cemerick: friend is green now? :)

21:18 cemerick: yup; it was ~2 minutes after you mentioned the upgrade

21:18 antares_: cemerick: very cool

21:19 cemerick: next up, getting ring, noir and korma on travis. May be a bit more challenging :)

21:19 cemerick: what, you haven't bribed ibdknox and weavejester yet? :-P

21:20 antares_: cemerick: I submitted PRs (for noir and korma) ;)

21:20 devn: so...i guess i never came across this, but if i have an (atom ()) and I want to (swap! my-atom cons ...), what is the right way to do that?

21:21 i know i can use conj, but i just had never considered using cons there, and got some weird behavior

21:21 ,(cons '() "bar")

21:21 clojurebot: (() \b \a \r)

21:22 dnolen: mmarczyk: are you inlining bitpos?

21:22 mmarczyk: also probably want to replace bit-count with something like this, http://stackoverflow.com/questions/109023/best-algorithm-to-count-the-number-of-set-bits-in-a-32-bit-integer

21:24 mmarczyk: dnolen: bitpos -- no, nor mask

21:24 dnolen: probably worthwhile, though I'm not sure it's possible to make a compiler macro private at this time?

21:25 dnolen: mmarczyk: no, but I don't really consider that a priority.

21:26 mmarczyk: CLJS doesn't currently respect private defs at all.

21:26 mmarczyk: less of an issue in CLJS since we don't have naked use anyway.

21:26 mmarczyk: dnolen: thanks for the SO link; I used the "Brian Kernighan's way" algo from the bit twiddling hacks page, but I'll switch

21:26 dnolen: right, I completely withdraw that remark

21:27 dnolen: mmarczyk: might as well compare, I'm not sure which is faster.

21:27 kenneth: antares_ hiredman okay will look into that

21:27 mmarczyk: dnolen: right, will do

21:28 kenneth: antares_: is there an update batch functionality?

21:28 mmarczyk: dnolen: though as mentioned above, I'll make the small changes after a just a little extra coding on the transient stuff, which is coming along nicely :-)

21:29 dnolen: mmarczyk: sounds good. PHM is a monster compared to PV.

21:30 technomancy: I feel like any discussion of line-based I/O is incomplete without mentioning _ato's widefinder2: http://meshy.org/2009/12/13/widefinder-2-with-clojure.html

21:30 mmarczyk: ~430 lines at first attempt :-)

21:30 clojurebot: Pardon?

21:30 technomancy: kenneth: ^

21:30 if you want super mega speed

21:31 livingston: I have a situation where I'm reading in some data files (just using read, not evaling them), but I have some repetitive constructs in these files (that are created by hand) I have no problem leaving read-eval on, and I have no problem with reader macros (but they aren't directly supported)...

21:32 ... the problem is the input is something like {:k1 v1 :k2 ((x x x) (a p b) (b p c) (c p d) (y y y))}

21:33 devn: technomancy: im still surprised that tbray never put ato's implementation on the results page

21:33 livingston: I'd like to be able to do something like {:k1 v1 :k2 ((x x x) (do-something-here a b c d) (y y y ))} and have the common pattern seen by the reader instead

21:34 there's really nothing I can do to do that is there?

21:34 antares_: kenneth: you want to update multiple documents or upsert them?

21:34 kenneth: antares_: upsert

21:35 antares_: kenneth: I think it's :multi true (right after :upsert true)

21:35 dnolen: mmarczyk: there's also some places where you have complex boolean tests because you aren't following the Java implementation closely

21:35 jkkramer: livingston: reader literals?

21:35 antares_: kenneth: but I am not entirely sure, I haven't used multi upserts, let me take a look at our test

21:35 *tests

21:35 mmarczyk: dnolen: ouch :-(

21:36 dnolen: I'll fix anything you point out, then go over the code again a couple of times

21:36 dnolen: mmarczyk: yeah I can improve the boolean stuff but only so much.

21:36 antares_: kenneth: https://github.com/michaelklishin/monger/blob/master/test/monger/test/updating_test.clj#L68

21:36 kenneth: basically, i have a dump of {uuid:…, otherid:…, …} documents, and i want to transform them into {uuid:…, otherids:[otherid, otherid,…], …} documents

21:36 livingston: jkkramer: like a reader macro that would expand (do-something-here a b c d) into (a p b) (b p c) (c p d)

21:36 dnolen: mmarczyk: calling not stinks.

21:36 antares_: kenneth: if mongo supports it, you should be able to use both :upsert true and :multi true, but I am not sure I understand what exactly that would do :)

21:37 livingston: jkkramer: as if the whole thing was back-ticked, I would want to ~@ splice stuff in...

21:37 mmarczyk: dnolen: ok, I'll try and refrain from that dodgy activity :-)

21:38 dnolen: mmarczyk: it's not your fault - this is low level stuff and not at all clear what the latest optimizations can actually do :)

21:38 jkkramer: livingston: maybe use data readers, new in 1.4? https://github.com/clojure/clojure/blob/master/src/clj/clojure/core.clj#L6609

21:38 mmarczyk: dnolen: "only so much" seems euphemistic in this case... but I'll try to do my part, of course

21:39 dnolen: it's fun to be exposed to that :-)

21:39 jkkramer: {:k1 v1 :k2 ((x x x) #foo/bar (a b c d) …}

21:39 amalloy: i don't think data readers can do this, because he wants to return multiple objects

21:39 jkkramer: ah true

21:39 they would need to be spliced in somehow

21:40 dnolen: mmarczyk: yeah, I'll probably add a not-nil? compiler macros to support PHM.

21:40 amalloy: likewise for macros, and reader macros in general. nothing in the lisp ecosystem i know of lets you do that

21:40 dnolen: macro I mean.

21:40 mmarczyk: dnolen: woot!

21:41 livingston: yes. ideally multiple forms.

21:41 amalloy: however you *could* do {:k1 v1 :k2 #with/magic ((x x x) (magic a b c d) (y y y))}

21:41 dnolen: mmarczyk: yeah looking over PHM.java I would follow it's pattern of very simple boolean tests where you can.

21:42 mmarczyk: no or/and/not if you can help it.

21:42 amalloy: livingston: sufficient for your needs?

21:43 mmarczyk: dnolen: well, I'm definitely getting rid of the undefined? stuff, and I guess also if-not (though I'd sort of expect it to be a flipped if rather than a hidden not call)

21:43 dnolen: and then I'll reexamine the code to see where it deviates from PHM.java

21:43 amalloy: mmarczyk: i feel similarly about if-not and when-not. it baffles me that they have a not call

21:43 livingston: maybe, although then with/magic would have to scan for magic or whatever and know how to expand it. ideally I don't want to have to know what macros were "user" defined to expand them.

21:44 amalloy: wat. whatever macros are user-defined will do their own scanning

21:44 mmarczyk: amalloy: exactly.

21:45 amalloy: livingston: you really can't get away from doing some scanning though, because someone has to be responsible for the splicing, and it can't be the "function" itself - one form can't expand to multiple forms

21:46 livingston: I really thought you could make a splicing reader macro (at least in common lisp)

21:47 mmarczyk: dnolen: ouch, I really am using not unnecessarily... what was I thinking. will fix this shortly.

21:47 amalloy: perhaps you can. i don't know everything about common lisp, not by a long shot

21:47 mmarczyk: in a way that's cool, cause it means this is gonna be faster than it is now :-P

21:47 livingston: I'm trying to avoid the scanning, because the forms are arbitrary

21:47 dnolen: mmarczyk: not-nil? compiler macro in master.

21:48 livingston: so something like with/magic would have to disassemble the whole form and reassemble it if it found magic

21:48 mmarczyk: dnolen: thanks!

21:48 amalloy: mhm

21:50 livingston: but more importantly I would have to know all the types of magic that could be used. I guess I could have one flag and then dispatch on a second argument... ideally I want the users defining and using the expansions, without my code having to see them or know.

21:51 how frowned upon / stable is the read-eval #= macro?

21:52 amalloy: it's frowned upon, relatively stable, and not any more useful for your purposes

21:53 livingston: well it would crud things up but I could eventually get to a back-tick form that way

21:55 dnolen: mmarczyk: I looked more closely at PHM.java, I think we need something more general than not-nil?

21:56 kenneth: so with pmap, is there a way to only use the side-effects, not create a new collection?, if the function i map with returns nil?

21:56 dnolen: mmarczyk: I think a private != is called for here.

21:57 mmarczyk: dnolen: that would be great

21:57 dnolen: coercive-not= ?

21:57 dnolen: mmarczyk: != is JS !=

21:57 mmarczyk: so very dangerous.

21:57 mmarczyk: but I think the only way to get PHM in CLJS fast.

21:58 mmarczyk: dnolen: right

21:58 dnolen: I know I'm not planning to use it for any other purpose

21:58 dnolen: mmarczyk: I like that name, tedious and dangerous sounding, lets go w/ coercive-not=

21:58 mmarczyk: dnolen: cool

21:59 livingston: jkkramer: amalloy: do you know where I can find the timeline for 1.4? when might it be available?

21:59 amalloy: well, they're on the Nth beta, for some N

22:01 livingston: have you used it? stable?

22:01 dnolen: mmarczyk: done

22:01 mmarczyk: dnolen: great, I'll be switching to that

22:06 dnolen: mmarczyk: excellent.

22:20 livingston: this is as close as I've gotten to a splicing reader macro - and it's kinda ugly: https://gist.github.com/9dbbb5e1a9a796d93d99

22:20 kenneth: can you critique this script? i'm running it on a 20-line file, but the goal is to run it on a 140M line file

22:20 https://gist.github.com/1253f5c5800672324e38

22:20 i'm a clojure newbie, but tried to follow best practices

22:22 devn: why's it private? (the gist)

22:22 the host/port?

22:23 Null-A: kenneth: (:uuid decoded) instead of (get decoded :uid)

22:23 (in terms of style)

22:23 devn: i would also move the parens on 38 to the end of 37

22:24 kenneth: devn: oh my gists default to private, i don't care about the host / port, it's firewalled off

22:24 devn: i'd also move ; comments to hang off the end of a line instead of breaking up the fn

22:25 kenneth: Null-A: neat, is that shorthand syntax for accessing hash data?

22:25 livingston: kenneth: I don't think you need the do on line 27 it's an implicit do in the function body (although maybe that needs to be a try/catch if your db connection fails?

22:26 kenneth: the reader should probably be in a with-open also so that you're sure it gets cleaned up

22:26 Null-A: kenneth: Yah, keywords are actually functions and you can pass collections to them and they look themselves up in the collection

22:27 you'll also want to learn about destructing syntax

22:28 also that (do ) on 27 can just be removed.

22:29 (->> file io/reader line-seq (pmap each-line) (map println))

22:30 livingston: that map println is ugly, but if it's what you want fine. I'd have each-line return something more useful or do it's own logging / printing if that's what you want

22:30 Null-A: yah and generally you should separate pure from impure functions

22:30 but as a beginner you can postpone that

22:32 livingston: from a more nit-picky point of view, "each" implies that you are getting a list of things and you are going to do something to all of them, that function would be more appropriately named process-line or process-single-line or something...

22:33 kenneth: livingston: i was mostly doing the (map println) to force the lazy sequence to be evaluated, is there another way to do that that returns nil? that'd be ideal

22:34 Null-A: that actually doesn't force lazy sequences to be evaluated

22:34 well it depends on what level we're talking about I guess

22:35 in anycase, you probably want doall or dorun

22:35 that forces evaluation

22:35 livingston: dorun doall will hold the head pointer and that might kill you dorun for side-effects

22:37 I made a suggestion for simplifying that last let, although potentially you need a dorun if you want to force the side effects

22:38 Null-A: kenneth: i recommend joy of clojure, it'll teach you all this stuff.

22:38 devn: kenneth: https://gist.github.com/1e4e397ffb267b737ef9

22:38 i'd probably write something more like that FWIW

22:38 Null-A: devn: you wrote clarsec right?

22:39 devn: Null-A, no, just made it a little bit easier to read - https://github.com/mmikulicic/clarsec

22:40 kenneth: wow that looks a lot better

22:40 Null-A: devn: ah, cool. i wrote a java compiler with it, and man did the performance of clarsec suck :)

22:40 still got the job done though.

22:41 I believe some of the java files were taking 30 seconds just to parse

22:42 devn: kenneth: I think it's better to require :as than to use the ns-qualified/name. that can really make things difficult to read, but mainly i would say, extract more functions and data in general.

22:42 kenneth: small bits are nice

22:42 Null-A: :\ sorry about that

22:43 Null-A: hah, no worries, combinator parsers are inherently slower compared to LR1/LL1 parsing.

22:43 i suspect all the lambdas being created were a source of bottleneck too

22:43 not sure how fast clojure is at this

22:48 devn: kenneth: this is probably going a bit overboard, but here's another pass: https://gist.github.com/1e4e397ffb267b737ef9

22:49 i like it more personally, but i think some people might be inclined to disagree with the make-connection fn

22:50 kenneth: i also made the ()'s in the :import section of the import macro []s, and finally added an arg to import-file-to-db to make it a bit more flexible

22:54 kenneth: so, running this with `lein run` i get an exception: java.lang.ClassNotFoundException: importer.core

22:54 which i don't when i run it via leon repl

22:55 this is my current code: https://gist.github.com/1253f5c5800672324e38

22:55 refactored like devn suggested, plus a couple other changes

23:08 devn: pmap might not be your best bet FWIW

23:09 kenneth: devn: is there a way to say "i want to run 10 at a time"

23:09 devn: kenneth: as in 10 lines?

23:10 kenneth: essentially, run 10 threads at a time / process with a parallelism of 10

23:12 devn: kenneth: you could partition the file by 10 lines, and then (pmap (map process-line lines) line-group)

23:13 kenneth: ever seen something like this? Exception in thread "main" java.lang.RuntimeException: EOF while reading, starting at line 40, compiling:(importer/core.clj:45)

23:14 mmarczyk: dnolen: I've done some adjustments -- if branch reordering, use of coercive-not= -- and put them on a branch at https://github.com/michalmarczyk/clojurescript/tree/phm-wip-2

23:14 kenneth: devn: how would i partition the file?

23:15 mmarczyk: dnolen: unfortunately I think I'm going crazy, because currently all tests I run complete in about 2.5x the time they used to previously, *regardless of which version I use* (including the first all-in-one commit)

23:15 no idea what's going on here :-/

23:16 devn: kenneth: (partition 10 lines-of-file-as-strings)

23:16 ,(partition 10 (range 100))

23:16 clojurebot: ((0 1 2 3 4 ...) (10 11 12 13 14 ...) (20 21 22 23 24 ...) (30 31 32 33 34 ...) (40 41 42 43 44 ...) ...)

23:17 mmarczyk: at any rate, I'm closing in on a transient hash map implementation, which should be ready some time this weekend... I'm still hoping today, but Monday at worst, if time contraints prove overwhelming

23:18 devn: kenneth: the benefits of pmap go down if you aren't granular enough. there is overhead in managing futures, so it is usually better (from my understanding) to use pmap for expensive operations

23:19 or to spend some time tuning how big the chunks should be to get the best hockey stick graph

23:20 kenneth: finally, read this:

23:20 ,(use 'clojure.repl)

23:20 clojurebot: nil

23:20 devn: ,(doc pmap)

23:20 clojurebot: "([f coll] [f coll & colls]); Like map, except f is applied in parallel. Semi-lazy in that the parallel computation stays ahead of the consumption, but doesn't realize the entire result unless required. Only useful for computationally intensive functions where the time of f dominates the coordination overhead."

23:20 devn: Note that last sentence.

23:20 http://clojuredocs.org/clojure_core/clojure.core/pmap

23:25 kenneth: as the above link shows: when in doubt, use (time ...)

23:35 kenneth: hmm, i must have fucked up something here… https://gist.github.com/1253f5c5800672324e38

23:36 trying to implement your partition idea, devn, in `read-parallel`

23:37 when i run import-file, it evaluates to `nil` and doesn't print anything…

Logging service provided by n01se.net