#clojure logs

2012-04-12

00:52technomancyquil! http://p.hagelb.org/quilin-villain.png
00:54wkmaniretechnomancy: Nice
00:55i_si'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)
00:57technomancyi_s: you're using `for` for side-effects; you should use doseq.
00:58i_stechnomancy: you mean the print statements?
00:58technomancyi_s: oh, I see; those are just for debugging
00:58i_syeah
00:59technomancythat's a pretty convoluted recursion; are you sure it can't be expressed in a single reduce?
01:03i_shmm, i'll think about it. was worried about blowing the stack, so i tried this seq
01:22i_shm, i can't think of a good way to do that technomancy
01:54tmcivertechnomancy: is there a method to add paths to the classpaths used by 'lein repl' that are outside the project directory?
02:09emezeskeWoo, lein-cljsbuild 0.1.7 released: https://github.com/emezeske/lein-cljsbuild/blob/0.1.7/doc/RELEASE-NOTES.md
02:09emezeskeMaybe, just maybe, I didn't break anything this time
02:15wei_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)
02:38katratxoemezeske: i tried the simple sample example project, but the main.js is not present after starting the server
02:39katratxoemezeske: i followed the instructions in the README
02:39emezeskekatratxo: Oh, it looks like those instructions are wrong. How'd that happen?
02:40emezeskekatratxo: You just need to run 'lein cljsbuild once'
02:40katratxoemezeske: ok, testing
02:42emezeskekatratxo: Thanks for catching that! I pushed a doc fix to master.
02:43katratxoemezeske: now i get the expected alert :)
02:43katratxoemezeske: thanks
02:44emezeskekatratxo: Cool beans.
02:56Iceland_jackIs there any way of getting a list of Java methods?
02:57Iceland_jackso for (“methods” "HI") you might get charAt, concat, format, substring, etc.
02:58xumingmingva have simillar question: is there a function to list all the methods of a namespace?
02:58xumingmingve.g. (methods 'clojure.lang)
02:58hiredmannamespaces don't have methods
02:58hiredmanthere is no namespace called clojure.lang
02:59xumingmingvoh, sorry, i mean the methods declared in a namespace
02:59Iceland_jackxumingmingv: maybe look at: (map ns-map (all-ns))
02:59hiredmanmethods are things classes have
02:59xumingmingvoh, sorry again, i mean functions lol
03:00Iceland_jack(all-ns) lists existing namespaces
03:00Iceland_jack,(doc ns-map)
03:00clojurebot"([ns]); Returns a map of all the mappings for the namespace."
03:06xumingmingvIceland_jack thanks
03:07Iceland_jackNo problem xumingmingv
03:09Iceland_jackI found the answer to my question if anyone was wondering the same
03:09Iceland_jackhttp://stackoverflow.com/questions/5821286/how-can-i-get-the-methods-of-a-java-class-from-clojure
03:13muhooIceland_jack: this is how i usually do it: https://refheap.com/paste/2026
03:13muhooactually, or this: https://refheap.com/paste/2027
03:14Iceland_jackah
03:14Iceland_jackthanks muhoo
03:15Iceland_jackit would be nice to have that provided by (doc …), similar to Python's dir()
03:15muhoothat's exactly what i was going for :-)
03:15muhooand spoiled by
03:15Iceland_jackheh
03:35clizzinanyone know what the equivalent of ruby's capistrano is for clojure? or just generally, what is the story for deploying clojure web applications?
03:45amalloymuhoo: it's rather simpler to write as (map :name (remove (comp :private :flags) (:members ...)))
03:45emezeskeclizzin: There's "pallet", which I think can be used similarly
03:46clizzinemezeske: 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?
03:49emezeskeclizzin: It's hard to point at a specific example without knowing more about how you, specifically, want to deploy your app
03:49emezeskeclizzin: I mean, you can deploy by just sticking the app on the server and doing a "lein run"
03:50emezeskeclizzin: Or you might need to fire up some EC2 instances and configure databases, etc
03:50clizzinemezeske: 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
03:51clizzinemezeske: 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.
03:52clizzinemezeske: or i could build the uberwar locally, rsync it into place on the production instance, and then restart the server
03:52clizzindoes that clarify things a bit?
03:52clizzini'm also open to hearing about better ways to deploy
03:52ibdknoxdeploying a webapp is just a matter of calling lein trampoline run with nginx as a reverse proxy :)
03:53ibdknoxno war needed
03:53emezeskeYeah, ibdknox' way is definitely the simplest
03:53emezeskeIf you want to automate the setup of that, I still think pallet is the right thing
03:53emezeskeCheck this out: http://palletops.com/doc/how-tos/using-pallet-with-existing-servers/
03:54emezeskeYou could extend that example to run the commands you need to copy things and configure them, etc
03:56clizzinibdknox: what is lein trampoline?
03:56ibdknoxit tells lein to shutdown and then start your process
03:57ibdknoxjust saves you a little memory by cleaning up the extra JVM
03:57ibdknoxnot important per se
03:57ibdknoxbut might as well
03:59ibdknoxclizzin: if you use Noir lein trampoline run prod is all you need
04:00clizzinibdknox: what server is it actually running in that case? is jetty embedded or something?
04:00ibdknoxyep
04:00ibdknoxembedded jetty
04:00ibdknoxanyways, gotta run.
04:00clizzinibdknox: ahh cool
04:01clizzinibdknox: cool, thanks for the tip
04:01ibdknoxbut fwiw, I run numerous websites that way
04:01ibdknoxnever had any issues
04:01clizzinemezeske: thanks as well
04:09emezeskeclizzin: NP, good luck with that!
04:11muhooamalloy: i do not think that kibit will be able to replace you anytime soon :-)
04:12amalloythe day the language itself does better static analysis than i do, i'ma switch languages
04:29muhoosorry (filter #(not ...)) with (remove #(...))
04:35amalloyyou can replace most of your #(not ...) with (complement ...) too
04:54clgvcemerick : ping
04:54cemerickwow, that was fast
04:55cemerickclgv: pong
04:55clgvcemerick: thunderbird is open here ;)
04:56clgvcemerick: the completion idea was meant like the behavior that you get when using rlwrap with clojure.
04:57cemerickI can't say I've ever used rlwrap
04:58clgvcemerick: 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
04:58cemerickIn 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?
04:58clgvyou mean paredit in REPL view?
04:59cemerickyeah
05:00clgvthe 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"
05:01cemerickheh, yeah, we could do that
05:02amalloywe're talking about C-r from readline?
05:02amalloyor M-p from emacs, i guess
05:03clgvamalloy: a feature request for CCW REPL view that allows searching repl history
05:03amalloythat's one reason i don't use paredit in my repl
05:03amalloyclgv: right, i can tell. i'm just confirming what the feature you want added is
05:03cemerickas you can all tell, not something I've ever thought to want :-)
05:05clgvcemerick: 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
05:06cemericksure
05:08clgvcemerick: by the way, is the repl history limited? I don't see any option for that
05:10cemerickclgv: yeah, 1000 entries
05:11clgvcemerick: shall I make a ticket requesting an option for that?
05:17cemerickclgv: what, configurable history? Sure.
05:19lpetitcemerick, 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 ?
05:20clgvlpetit: +1. but you could also use the above reg exp trying to match both sides in paredit mode if that makes sense
05:21amalloyi 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
05:22cemerickclgv: and this is supposed to work in bash with Ctrl+PageUp?
05:22clgvcemerick: in bash it works when you uncomment the corresponding line in /etc/inputrc
05:23cemerickheh, ok
05:23clgvcemerick: it's one of my first changes to a fresh linux ;)
05:23cemerickI just `history | grep xxx` at that point :-)
05:24clgvI often just type "ssh" + CTRL+PAGE-UP + ENTER ;)
05:24cemerickThe fewer customizations I make to my env, the less irritated I am when things aren't *just* right. :-)
05:24lpetitIf 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 ?
05:25amalloyclgv: it works in bash out of the box
05:25amalloybound to C-r, not C-pgup
05:26cemericklpetit: shouldn't; as it is, you can go back in history, and then go forward until you're back at your original input
05:26clgvamalloy: didnt know about C-r - bu it seems different
05:26amalloyC-r ssh RET
05:26lpetitcemerick: i was talking "after" having added what clgv suggests
05:27amalloyor tbh if you're just using it for something as primitive as "repeat previous ssh command", you should just do !ssh RET
05:27cemerickamalloy: C-r gives me an odd (reverse-i-search) prompt.
05:28clgvamalloy: wow, something new again. I guess I am a bash noob ;)
05:28amalloyindeed, cemerick
05:28cemerick!foo is in every shell, I think ;-)
05:28amalloyC-r <thing to search for> RET [...further editing if you want...] RET
05:28amalloyyou can hit C-r again instead of RET to continue searching back
05:29cemerickC-r "git pu" RET ===> "git: 'pu' is not a git command"
05:30amalloyi 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
05:30amalloyassuming you're not actually typing those quotes
05:31amalloyclgv: imo any time i have to use an arrow key or something in the PGDN area i realize i'm misusing bash :P
05:31cemerickamalloy: all the better to grief you with :-D
05:31amalloyhm?
05:31cemerickBut, no. Not sure why it's borked here.
05:32amalloyclgv: a related bash tip: !?push -- repeat most recent command that included push
05:33clgvamalloy: the backsearch via PAGE-UP (it is PAGE-UP only - no CTRL) is similar to ARROW-UP has no overhead like C-r
05:33amalloyoverhead?
05:33clgvamalloy: awesome
05:34amalloythe 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
05:34clgvamalloy: the command line ui "(reverse-i-search)`': ..."
05:35amalloybtw cemerick: just SSH'd to an osx machine, it still works for me. i wonder what dark rituals you've performed to break it
05:36cemerickamalloy: you've probably ssh'd to that OS X machine before, found it broken, and tweaked it out without remembering. :-P
05:36amalloyhaha, no. it's just a coworker's machine that i happen to have an account on
05:37amalloyANYWAY, 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
05:37amalloyand go to bed. night folks
05:37cemerickMy .profile has one alias and three env vars in it. I wouldn't know how to break bash. ;-)
05:38clgvamalloy: the additional information about ! and !? is appreciated :)
05:39andyfingerhutMy .profile has lines that I can recall putting in there in 1990 :-)
05:43wei_functionally what's the difference between these two functions? one uses "let" and the other "def" https://gist.github.com/2365902
05:44Iceland_jackdon't use def
05:46andyfingerhutwei_: Is the first one missing ( after doall?
05:46andyfingerhutNot sure if that is typo, or part of the problem.
05:48wei_typo, thanks. just amended it.
05:54andyfingerhutI'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.
05:54andyfingerhutIt is defining symbols globally, not locally. let keeps the symbol scope local to the body of the let.
05:56andyfingerhutMy 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.
05:56andyfingerhutHave you Googled for the exception message?
06:02sandbagshi. been a while since i poked around with Lisp so I just bought the 2nd ed. Prag's programming clojure
06:03sandbagslast time i bought Paul Graham's Lisp book and noodled my way through most of that
06:03sandbagsalways liked it but was put off by the environments and cruft, looking forward to trying clojure
06:04sandbagsi'm coming from mainly Ruby in the past 6 years or so, and most recently Obj-C
06:05ngwsandbags: you'll have lots of fun then
06:06sandbagsi'm hoping the book is good, i nearly went for the O'Reilly one but i missed the 50% off sale
06:06sandbagsi buy a lot of prag books
06:06sandbagsthe Erlang one was pretty good
06:07sandbagsi really enjoyed Erlang but couldn't see myself ending up using it
06:07sandbagsbut it definitely gave me a taste for functional stuff
06:08andyfingerhutI'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.
06:09sandbagsandyfingerhut: 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
06:09sandbagsLispworks, for example, is way more than i could justify at this point
06:09sandbagsso i was cobbling stuff together with emacs & slime and I hate emacs
06:10ngwI personally prefer the O'Reilly one
06:10andyfingerhutCommercial 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.
06:10sandbagsand by cruft i'm largely referring, i think (as I say it was a while ago), to the syntax cruft in the language
06:10sandbagslooks like Clojure goes some way to addressing that
06:11sandbagsi'm not really making a cogent argument, just trying to dredge up what i remember :)
06:11sandbagsngw: oh well :)
06:11andyfingerhutYou'll definitely find a lot of Emacs users among Clojure programmers, but there are other editors fairly commonly used.
06:11sandbagsi just can't get on with Emacs.... Vim i clicked with in 2 minutes
06:11sandbagsi've tried emacs 3 times already but... it just won't go :)
06:12andyfingerhutI'm weird enough to use VI key bindings inside of Emacs :-)
06:12sandbagsheh
06:12ngwsandbags: http://writequit.org/blog/?p=386 this was very helpful to me
06:12sandbagsoh, nice, thanks
06:18rodnaphsandbags: this looks better, but i've never gotten it to work: https://github.com/vim-scripts/slimv.vim
06:18andyfingerhutsandbags: 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
06:19sandbagsta
06:19andyfingerhutSeveral flavors there -- my personal favorite is the one you get from clicking the upper leftmost link.
06:19sandbagsi tend to get 2/3rd of the way through a book then go off-road :)
06:19andyfingerhutThat one will probably be available at clojure.org/cheatsheet some day
06:20sandbagscool, thanks
06:20sandbagsi 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
06:20sandbagsbut, realistically, i think that about every language that is not Obj-C :)
06:21rodnaphi'm sure someone will write a clojure -> obj-c compiler pretty soon.
06:22Iceland_jacklol, don't hold your breath
06:24sandbagsi think a clojure->objc compiler would be a pretty horrible solution
06:25clgvsandbags: I think rodnaph meant a Clojure implementation in obj-c similar to the one for .Net
06:27sandbagsi'd love to see it happen but think that would be quite a challenge
06:27rodnaphyup. haven't thought about it too much, but i don't see any reasons obj-c couldn't be a clojure host.
06:28clgvdoes obj-c have a vm underneath it?
06:28sandbagsno
06:28sandbagsi was goign to say
06:28sandbagsi may be missing something, but the challenge of porting Clojure to .Net
06:28sandbagswould not be the same thing at all, you'd have to invent your own VM on top of the Objective-C runtime
06:28sandbagsit's doable, this is essentially what MacRuby does
06:28clojurebotYou don't have to tell me twice.
06:29sandbagsusing LLVM
06:29clgvyeah, no vm makes it hard, I guess
06:29sandbagsharder still since OSX is deprecating libauto
06:29sandbagsso no free GC
06:29sandbagsalthough the code, IIRC, is open so I guess it could be maintained and used
06:30sandbagsthe MacRuby guy seems to have some plan to port ruby to use ARC type semantics
06:30sandbags(ARC is compile-time automatic retain/release if you're not familiar with it)
06:32sandbagsbut if anyone wanted to scale that mountain, it'd make me happy :)
06:34andyfingerhutNathan 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
06:35andyfingerhutNot sure if I used a good link there. Intended to be to the email thread on the clojure Google group.
06:35maiodoesn't work
06:36wei_andyfingerhut: thanks for your help on https://gist.github.com/2365902. I found the error
06:37wei_it was just a typo :)
06:38andyfingerhutJust Google search on: clojure scheme gambit
06:38andyfingerhutTop 5 links all look relevant.
06:40andyfingerhutThat phrase tickles my funny bone: "yak shaving"
06:41andyfingerhutExplanation: 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.
06:57hoeckhttp://www.infoq.com/interviews/hickey-clojure-reader
07:14sandbagshoeck: interesting, i didn't follow 98% of it but interesting none the less
07:16hoecksandbags: haven't seen it in action (the extensible reader), but I imagine you can do funny stuff with it in IDEs
07:48ngwdoes someone have any idea what this is about? https://gist.github.com/0cc62ad7996b9c5177e1
07:49RaynesIt's about 4 lines long and a real pain in the ass.
07:49Raynesngw: This is Noir validation stuff?
07:49ngwRaynes: yep
07:50ngwI honestly can't understand the error
07:50ngwI guess something that should be bound is unbound
07:50ngwgo figure what, seems basic to me...
07:51samaaronngw: it's hard to know without knowing what vali is all about
07:51Raynesngw: 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.
07:51Raynessamaaron: I know what it is. Go doctor or something.
07:51Raynes:p
07:51samaaronRaynes: bully for you
07:51ngwoh, I see
07:51Raynesngw: 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.
07:52ngwok, now it's clear Raynes, thanks
07:52ngwdefinitely not how I would validate stuff...
07:52samaaronngw: does the documentation make it clear that you need to call valid? within a request?
07:52Raynesngw: 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).
07:53ngwwell, I was looking inside the blog example samaaron, and validation is inside the model
07:54ngwI didn't think that the request was available in there too
07:55RaynesThis sort of function has to be called from inside a defpage or from something that it calls.
07:55samaaronRaynes: if you're so awesome at fixing issues - perhaps you can figure out why REPL-y doesn't like Overtone atm
07:55clgvngw: there is noir.util.test/with-noir that sets all bindings
07:55RaynesFor 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.
07:55Raynessamaaron: REPLy is a big dark box of evil and fire. Only trptcolin can put it out.
07:56samaaronnice to hear your vote of confidence
07:56RaynesI've been pretty ticked off at it too lately.
07:56RaynesBut my problem isn't REPLy itself.
07:56ngwyes, I got it Raynes
07:56RaynesIt's jline, which is even more evil.
07:57samaaronoh ok
07:57ngwbut check from line 88 on: https://github.com/ibdknox/Noir-blog/blob/master/src/noir_blog/models/post.clj
07:57samaaronso would you have any idea why REPL-y might interfere with Overtone's boot process?
07:57samaaronCould it be blocking the main thread or something?
07:57ngwit seems validation is at the data level: at least this is my interpretation of what a model is
07:57RaynesI've never really looked at how REPLy works. Or Overtone for that matter.
07:58samaaronRaynes: but you seem to know everything... ;-)
07:58RaynesI know your dress size.
07:58samaaroncrazy scenes
07:58Raynesngw: Where would you put validation?
07:59ngwat the data level :)
07:59ngwmeaning that the request is not needed
08:00ngwbut I'm not an expert by any means, very noob with clojure as you can see
08:00RaynesWell, you can certainly do that if you want, just not with noir.validation.
08:00clgvngw: have you tried calling your valid? with 'noir.util.test/with-noir yet?
08:00RaynesI expect that noir.validation does things the way it does at least partially to isolate state.
08:07groovemonkeyis there a reference that explains the different REPL errors?
08:09groovemonkeyI'm getting an 'IllegalStateException Attempting to call unbound fn' error. Not sure where to look for an explanation
08:17mccraigcemerick: 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 ?
08:18clgvgroovemonkey: what did you do?
08:20cemerickmccraig: That was mostly to make it usable with partial, though I think that might have been not worth it at this point.
08:26mccraigcemerick: 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 ?
08:27cemerickmccraig: heh, well, that's #(afn % known-arg) :-)
08:35gfredericks,(-> 8 (/ 0) (try (catch Throwable t "threading is fun")))
08:35clojurebotgfredericks: Huh?
08:36gfredericks&(-> 8 (/ 0) (try (catch Throwable t "threading is fun")))
08:36lazybotjava.lang.SecurityException: You tripped the alarm! catch is bad!
08:36gfredericksfine
08:41mccraigcemerick: i meant fix args at the end of the list.. more like : (defn rpartial [f & fixed] (fn [& args] (apply f (concat args fixed))))
08:41cemerickmccraig: oh; well, bummer about something like that is that you can't stack rpartials.
08:46mccraigcemerick: what does 'stack' mean in that context ?
08:48cemerickmccraig: nm, I misread your defn
09:25Raynescemerick: You're pink.
09:26cemerickHuh, ok.
09:26Raynescemerick: I felt it important to note the color of your nickname in my IRC client.
09:27fdaoudcemerick: and you think *I'm* insane?
09:28progoRaynes, so are you :p
09:28cemerickfdaoud: I'll bet Raynes will only write one book. ;-)
09:28fdaoudcemerick: :-D
09:29TEttingerfdaoud is pink in my client.
09:29fdaoudTEttinger: there is no pink in my client, because, you know, you can customize those colors.
09:30RaynesTo adjust the pink would be to reject the pink. This is not the way of the Clojurian.
09:30TEttingerfdaoud, I have a really wide variety of colors in mine (Floe on windows)
09:33Raynescemerick: http://code.google.com/p/clementine-player/issues/detail?id=219
09:34cemerickRaynes: I couldn't quite remember where the last pink reference came from, but I knew it was lingering back there somewhere.
09:35fdaoudEvery 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.
09:37Raynesfdaoud: Did you see the Clojure pull request where the guy renamed it to Lava?
09:37fdaoudOf 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?"
09:38RaynesYou need better problems.
09:38fdaoudRaynes: yeah I saw that! heh
09:39fdaoudme? better problems?
09:40fdaoudI 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.
09:40RaynesYour problems are boring. Traffic.
09:41RaynesNow that's a decent problem.
10:00dgrnbrgWhere can I see an example usage of the extensible reader in 1.4?
10:02trptcolinis this behavior surprising to others, or just me? https://refheap.com/paste/2034
10:04trptcolinspecifically, the fact that an agent dispatch within a *different* agent's action seems to be delayed until the calling agent's action completes
10:11sattviktrptcolin: Interesting.
10:11antares_trptcolin: I use agents very rarely but it makes sense to me. I think agents interact with STM the same way?
10:12antares_trptcolin: it is basically to avoid unexpected race conditions, I think
10:12trptcolinantares_: for a single agent dispatching to itself, totally makes sense
10:19cemericktrptcolin: all sends are held within an agent action until it completes; as antares_ said, same semantics as sends within a transaction.
10:20trptcolinyeah. 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:20trptcolinalso couldn't find any docs on it
10:22cemerickan 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:23trptcolinthe problem i'm trying to solve (tm) is: https://github.com/overtone/overtone/issues/85
10:24cemerickThe 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:27cemericktrptcolin: so each native dep is loaded via an agent send?
10:27trptcolinright
10:27cemerickwhy?
10:27clojurebotwhy is the ram gone is <reply>I blame UTF-16. http://www.tumblr.com/tagged/but-why-is-the-ram-gone
10:29trptcolinwell, i mean, it's so the "main" thread can Thread/sleep until they're all done
10:30trptcolinseems like a reasonable thing to do. maybe eventing would be better, but it still seems like it ought to work.
10:30trptcolin(of course given what i now know i understand why it doesn't)
10:32cemerickso, 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:32cemerick(that's probably wrong, but mostly rhetorical anyway)
10:33cemericktrptcolin: so does overtone never work, or sometimes work?
10:33trptcolinnever w/ nrepl, as far as i can tell
10:34trptcolinalways w/ reply --standalone
10:34cemericktrptcolin: that's true for technomancy's report as well?
10:35trptcolinthe native deps/ java 7 thing (#86)? not sure on that one.
10:36cemerickno, his comment on #85
10:38trptcolinas 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:38alexyakushevIs there a way to connect to an external nREPL using Counterclockwise? I'm feeling very stupid right now:)
10:38cemerickalexyakushev: Window -> Connect to REPL
10:39cemerickYou need 0.7.0, I think.
10:41trptcolincemerick: i'll do some more thinking/looking into this after work today, need to get back
10:42cemericktrptcolin: Sure. If it really comes down to it, we can stop using agents for sessions. :-(
10:43alexyakushevChas Emerick: Thanks a lot, the old version of CCW was the issue
11:10Licenser(filter #(= "dhcp") ("172.16.8.5" "172.16.1.1"))
11:11Licenser,(filter #(= "dhcp") ("172.16.8.5" "172.16.1.1"))
11:11Licenser&(filter #(= "dhcp") ("172.16.8.5" "172.16.1.1"))
11:11lazybotjava.lang.ClassCastException: java.lang.String cannot be cast to clojure.lang.IFn
11:11clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.NoClassDefFoundError: Could not initialize class clojure.lang.RT>
11:12hroarkeLicenser: Your list of IPs should either be quoted '() or a vector [].
11:13Licenserhroarke you're right :) I was just pasting the prn'ed output
11:13Licenserbut I found my bug it's a missing %
11:14samaaronRaynes: howdy pardner
11:15Raynessamaaron: Hi there Dr. Aaron.
11:15samaaronRaynes: so this refheap thing...
11:15samaaronI *think* I want to use it..
11:16samaaronI'm looking at the elisp thing you wrote - which has an ominous readme
11:16RaynesHahaha
11:16samaaronis it in a workable state?
11:16RaynesShould be fine for use.
11:16samaaronI must admit, my elisp-reading skills need a lot of work
11:16Raynesmuhoo uses it, IIRC.
11:17samaaronso what's the defcustom thing do?
11:17LicenserRaynes you've a emacs plugin for refheap?
11:17RaynesThe original issue was a problem with connection closing on the server, but that has long since been fixed.
11:17samaaronhow do i plug in my usename/token?
11:17Raynessamaaron: Allows you to customize the variable via Emac's pretty customization UI.
11:18RaynesEmacs's? Whatever.
11:18Raynessamaaron: Should be... M-x customize-group RET refheap? Something like that.
11:19samaaronRaynes: is there anyway to do that in my elisp?
11:19samaaronI never use the pretty customisation thingy
11:19LicenserRaynes can you share a link to your emacs thing? ^^
11:20samaaronLicenser: https://github.com/Raynes/refheap.el/blob/master/refheap.el
11:20Licenserthanks :)
11:20samaaronnp
11:20RaynesWell, doing that will produce elisp. That said, you should be able to do (custom-set-variables '(refheap-token "") '(refheap-user ""))
11:21samaaronoh ok - and fill in the empty strings with my golden details?
11:21RaynesYessir
11:21RaynesThat emacs thing is on marmalade too, so accessible via ELPA. I *think* it's up-to-date enough.
11:21RaynesI haven't used this in quite a while since I switched to Vim.
11:21samaaronoh, can some friendly people upvote this link: http://news.ycombinator.com/item?id=3832499
11:22RaynesDONE
11:22samaaroni think overtone can help increase awareness of Clojure in general
11:23RaynesWho doesn't like music, right?
11:24LicenserRaynes sweet :D
11:24samaaronLicenser: did you get the refheap thing working?
11:25Licenseryea just put it in my .emacs.d folder and laoded it in the .emacs
11:26samaaroni'm struggling to log into refheap
11:26Raynescustom-set-variables not working?
11:27LicenserRaynes how can I bribe you to support dtrace scripts?
11:27samaaronno, i'm having issue logging in with a browser atm
11:27Licensersamaaron oh I just did it w/o the login part
11:28Raynessamaaron: What's going wrong?
11:28RaynesLicenser: First step is to write a lexer for pygments.
11:28Licenseroi
11:28RaynesSecond step is to send me a pull request adding it to the language list.
11:28Raynes:P
11:29samaaronRaynes: I think I must have registered a while back - but have no idea what password I used
11:29samaaronand their password reset thing is broken
11:29RaynesWell that sucks.
11:30samaaronindeed
11:30TimMc*poker face*
11:30samaaronI can't even create a new account
11:30Raynessamaaron: It works for me.
11:30RaynesWhat browser is this?
11:30samaaronsafari
11:31RaynesI'm using Chrome.
11:31RaynesSafari is for people who write musical code.
11:31samaaroni get the same issue with Chrome
11:31Raynes Your computer is broken.
11:31llasramRefheap's login has also never worked for me, but I consider that my own fault for using Conkeror
11:31samaaronclearly
11:32samaaroni'm actually on https://browserid.org/signup
11:32TimMcRaynes: I gave up on using BrowserID. It doesn't work with the Firefox password manager (despite being made by Mozilla).
11:32Raynesllasram: Yeah, technomancy pointed that out.
11:32LicenserRaynes acutaylly you support D already
11:32TimMcIt's not worth it to look it up in my password manager every time.
11:32llasramLicenser: Are you sure that isn't Digital Mars D?
11:32RaynesIt is.
11:33Licenserno I'm not but it does not seem to be that off :P I don't get errors in example code
11:33RaynesTimMc: Shame.
11:33samaaronRaynes: try registering with a fake email - see if you get past the "Verify Email" button...
11:33RaynesTimMc: I don't use password managers for that exact reason. I just use 'password' for all my passwords and I get by fine.
11:34samaaronRaynes: that's WEEEEEEAK. I use P455w0rd
11:35Raynessamaaron: Yup.
11:36RaynesIf someone wanted to send me a patch to add github authentication, I'd accept said patch.
11:38fdaoudsamaaron: love the comments in that ycombinator link.
11:38samaaronfdaoud: haha.
11:38samaaronwhy can't people comment on the CONTENT?
11:39Raynessamaaron: "better video, 4 minutes, no crappy foreplay, just some guy live-coding with overtone"
11:39RaynesSeems like that's about the content.
11:40fdaoudsamaaron: same reason there's always this one guy who reviews an amazon book saying that the book arrived fast and in good condition.
11:40samaaronhaha
11:40samaaroncrappy foreplay???? wft?
11:40samaarontwf?
11:40samaaronftw?
11:40samaaronWTF?
11:41Bronsalol
11:41fdaoudno such thing.
11:41samaaronhaha
11:44Raynessamaaron: That was an excellent talk. I think I stayed awake during it, even.
11:53samaaronRaynes: what did you think of the crappy foreplay?
11:54hhutchRaynes: darn but that refheap.el is handy
11:55gfrederickslook 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:56samaarongfredericks: hahaha
11:56Bronsalol
12:17Bronsais there a better way to achieve this than (take-while not-empty (iterate rest (range 10))) ?
12:18S11001001! (doc tails)
12:19S11001001&(doc tails)
12:19lazybotjava.lang.RuntimeException: Unable to resolve var: tails in this context
12:19S11001001uh, maybe
12:19goodieboycould 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:19goodieboy,(re-find #"(?m)a.*b" "a\nasdfasdf\n\nb")
12:19clojurebotnil
12:19S11001001goodieboy: you're looking for s, not m
12:19goodieboy,(re-find #"(?s)a.*b" "a\nasdfasdf\n\nb")
12:19S11001001m changes how ^ and $ work
12:19clojurebot"a\nasdfasdf\n\nb"
12:20goodieboyS11001001: Woohoo! Thanks :)
12:23amalloyBronsa: well, seq rather than not-empty, at least
12:23S11001001goodieboy: interesting aside: in posix extended regexp, s is called p, for "posixline". I'm not sure s is less ambiguous
12:24goodieboyS11001001: interesting, good to know
12:27Bronsaright amalloy
12:37jondot1hi 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:38jondot1its not my project so i can't push a new build
12:38technomancysamaaron: feel free to yoink those sketches as quil samples btw
12:38technomancysamaaron: were you able to run the jar with "java -jar [...]"L
12:39technomancyit 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:41samaarontechnomancy: ah, that works fine
12:41samaaronI just tried to double click it
12:41samaaronso instead I just unzipped the jar and ran the sketches manually
12:41samaaronthey're lovely :-)
12:41technomancythanks =)
12:42samaaronbtw, did you know about set-state! and state
12:42juhu_chapahi 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:42technomancymost of them are from 2½ years ago
12:42samaaron:-)
12:42technomancysamaaron: I was just thinking something nicer could be done wrt state
12:42samaarontechnomancy: I'm all up for ideas
12:42technomancylike if the update function just took an argument like a reducer function
12:42samaaronI just thought that adding per-sketch state was very useful
12:43technomancyor it seems like having the frame-count as a function argument would be useful too
12:43technomancyman, it sucks that fn literals don't have :arglists metadata, or you could do this automagically without breaking backwards-compat
12:44samaaronso whatever was returned by #'draw was passed to it as an arg?
12:44technomancyyeah
12:44samaaronyeah, i thought about that - I just thought it was adding a lot of boiler plate
12:44samaaronI wish we could support both
12:44technomancymaybe you could have an :update function as an alternative to draw that took state as an argument
12:44amalloyjondot1: you have two reasonable options
12:44samaaronhmm, interesting
12:45technomancystate and possibly frame-count
12:45samaaronyeah, precisely
12:45samaaronframe-count is super useful
12:45technomancywould help make sketches more functional
12:45achinweavejester: Have you had a chance to take a look at my web.xml PR?
12:45amalloyyou 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:45samaaroni also would prefer it if things like the x and y coords were passed to mouse handlers
12:46technomancyoh yeah, absolutely
12:46technomancybtw; is there an equivalent to defonce for defsketch?
12:46samaaronbut for version 1.0 i just wanted things to be as similar to processing as possible
12:46technomancyso C-c C-k doesn't open up a new window?
12:46weavejesterachin: Didn't I already merge that? Hang on...
12:46samaarontechnomancy: no, there's not - but that's an excellent idea
12:46amalloyor 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:47achinweavejester: Thanks.
12:47amalloythen lein can pull it down like any other dependency
12:47jondot1amalloy: i see. isn't the second option considered rude?
12:47amalloymeh. it wouldn't hurt you to ask them to update their version first
12:47amalloybut i don't think it's terribly rude to push your own version, is it? anyone?
12:47samaaronamalloy: what are you suggesting?
12:48weavejesterachin: Okay, it's merged. Sorry about that, I thought I had already done it.
12:48technomancyjondot1: have you tried checkout dependencies?
12:48samaaronI'm not the one that ate a pint of bacon...
12:48amalloysamaaron: i just dragged you in as an example
12:48jondot1amalloy: i see. is it possible that i built the jar and check it into source control?
12:48amalloyi shared! i didn't eat it *all*
12:48RaynesRude...?
12:48RaynesWhy would it be rude?
12:48amalloyjondot1: i will strangle you
12:48amalloyif you do that
12:48Raynesjondot1: I'll cut you.
12:48jondot1yep.
12:48amalloy(i totally would have eaten it all)
12:48achinweavejester: No worries. Thanks. Do you think you're going to cut a 0.6.4 anytime soon?
12:48samaaroncor, there's some brutality in here
12:49samaaronjondot1: I woudl neither strangle nor cut you. I'd just politely suggest that there was a better option
12:49RaynesThe only resolution for people who check jars into source control is seppuku.
12:50weavejesterachin: I can. Have you used the web.xml behavior from a fork or something? i.e. is it tested?
12:50amalloyfor 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:50samaaronamalloy: you'd have no competition from me. I never understood why people eat other animals flesh. In pint glasses or not.
12:50TimMcBut but but... the Twelce Factor app tells me to vendor things in!
12:50TimMc*Twelve
12:50RaynesBecause they rewrote it 6 times and couldn't figure out how to make it build on 80 different JVM/OS combinations.
12:50jondot1ok.. 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:51achinweavejester: 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:51Raynesjondot1: I'd just shell out.
12:51samaaronRaynes: ah man, again, that's not such a nice thing to say. You should celebrate life - not describe hideous suicidal methods
12:51weavejesterachin: Okay, I'll push out 0.6.4 in a few minutes then
12:51Raynessamaaron: Apparently this was at one time acceptable behavior.
12:52achinweavejester: Great. Thank you!
12:52samaaronRaynes: many awful things were once acceptable. i.e. slavary
12:53RaynesYou mean to tell me I'm supposed to give up my slave!?!?
12:53amalloyi have a master/slave relationship with my databases. what we do behind closed doors is not samaaron's business
12:53samaaronFree him/her immediately!
12:53technomancywhy you gotta be hatin' on a man's hobbies? http://wondermark.com/152/
12:53samaaronamalloy: don't bring up your databases again - we've been through that before
12:54RaynesHahaha
12:54weavejesterachin: Done
12:54samaarontechnomancy: haha
12:54RickInGAit 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:55samaaronRickInGA: :-)
12:56samaaronRickInGA: as long as you dont' start talking about strangling, cutting, killing or selling yourself to slavery, then I'm cool
12:56achinweavejester: Thanks. Pulling it now.
12:56jondot1is there any mapping between clojure 1.2.0 and 1.2.0 contrib to clojure 1.3.0 (and merged contrib functionality) ?
12:56gfredericksare you asking where contrib went?
12:56achinjondot1: http://dev.clojure.org/display/design/Where+Did+Clojure.Contrib+Go is what I use.
12:56weavejesterSometime I've got to make lein-ring reload the checkouts folder as well.
12:57jondot1great, thanks
12:57weavejesterOr add something to the options to customize it.
12:57RickInGAsamaaron: 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:58samaaronRickInGA: no, I just haven't added cljs support yet. For now you can force it into clojure mode with M-x clojure-mode
12:58RickInGAsamaaron awesome, Thanks!
12:58technomancycemerick: so did you follow https://github.com/overtone/overtone/issues/85? what does this mean for reply/nrepl?
13:00fdaoudjuhu_chapa: did you get an answer to your question?
13:00cemericktechnomancy: it probably means it needs to stop using agents for REPL sessions.
13:00samaaroncemerick: agreed
13:00cemerickwhich is ironic, since that's the path I took ~2 years ago. :-P
13:01samaaronI had composing agents issues about ~1.5 years ago
13:01juhu_chapanot yet, but i think the def var and binding later is the right choice
13:01samaaronit was super frustrating to debug
13:02technomancycemerick: so that sounds like a fairly involved change
13:02cemericktechnomancy: not particularly. Doesn't change semantics a whit.
13:02cemerickI mean, except for not causing the current PITA.
13:03cemerickhiredman: Yeah. Back to the nREPL 0.0.x-series approach.
13:05gfredericks(defroutes test-server (GET "/foo" [] "bar")) (test-server {:uri "/foo"}) => nil
13:05gfredericks^ what am I misunderstanding about compojure?
13:05technomancycemerick: but probably not something that should block preview3 any more
13:05weavejestergfredericks: You haven't specified a :request-method
13:05cemericktechnomancy: no
13:06gfredericksweavejester: haha quite; thanks!
13:06weavejestergfredericks: ring-mock is a good library for creating Ring requests, btw
13:06gfredericksweavejester: I'm just doing some sanity checks
13:07technomancyat least the overtone issue has a workaround with just requiring it twice
13:07samaarontechnomancy: and I expect most overtone users aren't using lein repl anyway
13:08cemerickwell, they'll be able to in short order
13:08samaaronindeed :-)
13:08samaaronhaving it work in lein is super important
13:09technomancycemerick: will this require changes in reply or just nrepl?
13:09cemerickjust nrepl
13:09technomancycool; so it'll be easy for people to bump without upgrading lein once the fix is out
13:10cemerickthough reply has a separate issue as well: https://github.com/trptcolin/reply/issues/49#issuecomment-5083824
13:10cemerickyeah, overtone + nREPL 0.2.0-betaX will do it
13:10sattvikAbout 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:11cemericktechnomancy: I've come to enjoy this long prerelease thing quite a lot ;-)
13:12technomancycemerick: it's great; I love it =)
13:12samaaronsattvik: did you write VimClojure?
13:12samaaronoh i misread it's for I'm
13:13sattviksamaaron: No, that's Meikel Brandmeyer.
13:13samaaronsattvik: 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:14sattviksamaaron: OK, I'll probably do that. It works fine with slimv and clojure-swank, but I am used to using VimClojure.
13:14samaaronso what's the current solution for cljs in emacs?
13:15technomancythere's a clojurescript-mode; don't know much about it
13:16samaaroni currently use clojure-mode for both
13:16technomancyI think it just has some inferior-lisp setup for a cljs repl
13:16technomancyoh, it uses script/repl; gross
13:16samaaronoh ok
13:17samaarontechnomancy: are you referring to this: https://github.com/carllerche/.emacs.d/blob/master/extra-packages/clojure-mode/clojurescript-mode.el
13:17cemerickit can't really use anything more sophisticated because of how browser-repl works.
13:17technomancysamaaron: that looks like a copy; the canonical version lives in the clojure-mode repo
13:17samaaronoh ok
13:17technomancyprobably needs to be updated to work with lein-cljsbuild
13:21lynaghk-clojurebot-: Thanks for the intro. ANN: cljs-chosen, a ClojureScript wrapper for everyone's favorite <select> library.
13:21Bronsawhat's the reason of doing Util.ret1(something, something = null) ?
13:21samaaronlynaghk what's a <select> library?
13:21samaarondoes it choose things for me?
13:21Rayneslynaghk: Cool. I use chosen in refheap. Speaking of that, go write refheap's js in clojurescript for me.
13:21Bronsai see this done a lot of times in the clojure codebase
13:22lynaghksamaaron: it makes giant <select> tags not suck in the brower by adding things like in-line search field and clickable tags for multiselects
13:22lynaghkAs 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:22Raynessamaaron: The language dropdown on refheap is chosen.
13:22samaaronwhat is my favourite select library?
13:23samaaronoh ok, so <select> is a cljs lib, and chosen adds useful helpers?
13:23samaaronor is <select> some js thing?
13:23Raynessamaaron: It's a html tag.
13:23lynaghkRaynes: 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:23RaynesHave you ever done anything *besides* music?
13:24lynaghksamaaron: <select> is the html tag that makes drop down menus.
13:24samaaronRaynes: nope
13:24Rayneslynaghk: I would hope that you would realize I was joking.
13:24technomancyis that for hypertext? that markup thingy language?
13:24lynaghkRaynes: a bottle of whiskey in the mail can turn jokes like that INTO REALITY
13:24samaaronlynaghk oh, I knew that - you just described it as "for everyone's favourite <select> library"
13:25true_droidhi! 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:25samaaronso i thought you meant an existing lib
13:25lynaghksamaaron: I don't appreciate you adding extra 'u's to my language. I saw what you did there, okay.
13:25lynaghk= P
13:25samaaronlynaghk *your* language? Ahem!
13:25scriptorbrits...
13:26samaaronI'm English, I live in England and I speak English
13:26lynaghksamaaron: americans have been around the longest, everyone knows that.
13:26scriptor*Englandish, you mean
13:26amalloytrue_droid: some of both
13:26samaaronlynaghk oh, yeah I forgot - since I spent so long today studying at a university OLDER THAN AMERICA!
13:26technomancyI've heard of Englandish before; isn't that what they speak on the BBC?
13:26amalloyit'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:27scriptorclojurescript can't have true tco either, right?
13:27lynaghkRaynes: how come you didn't write refheap using CLJS?
13:27scriptorwithout trampolining and such
13:27mefestowhat is the proper way to round bigdec? i'm doing the following which must be the looong way :)
13:27mefesto,(with-precision 10 (-> (/ 1M 3) (.setScale 3 RoundingMode/HALF_UP)))
13:27clojurebot#<CompilerException java.lang.RuntimeException: No such namespace: RoundingMode, compiling:(NO_SOURCE_PATH:0)>
13:27mefestodoh
13:27mefesto,(with-precision 10 (-> (/ 1M 3) (.setScale 3 java.math.RoundingMode/HALF_UP)))
13:27clojurebot0.333M
13:27cduffyscriptor: ...neither does Clojure on the JVM (without loop/recur), so that's not exactly a difference.
13:27Rayneslynaghk: 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:28scriptorcduffy: right, hence "either" :)
13:28cduffyahh.
13:28amalloyscriptor: i imagine some js implementations would have it
13:28lynaghkRaynes: give #2 some time, maybe add some more features to refheap...
13:28RaynesOh, I'm sure.
13:28RaynesBut #2 is directly related to #1.
13:28RaynesI don't need much js to add features to refheap.
13:28Bronsatrue_droid: technical limitation
13:29RaynesAt least, not the features I've planned to add.
13:29samaaronRaynes: like github authoriSation?
13:29amalloyyou should add a bear that dances around the page when you hit Paste
13:29Raynessamaaron: Someone else can do that. :p
13:29Raynesbrowserid isn't broken for me.
13:30Raynesamalloy: Didn't we plan to add a secret button that would play video game music?
13:30amalloyi do recall that
13:30true_droidamalloy: thanks
13:48technomancyand it's out. ladies and gentlemen, leiningen 2.0.0-preview3: https://groups.google.com/group/clojure/browse_thread/thread/91079a531ee1f1c8
13:53ibdknoxit's a real-time web week lol
14:01sattvikdnolen: Any ideas on how to coordinate selecting proposals for GSoC?
14:03samaaronRaynes: awesome, I now have refheap working from my emacs with authentication. Thanks so much :-)
14:13Raynessamaaron: I'm just happy it works. I don't know elisp. Most of that was copied from various libraries.
14:26llasramtechnomancy: And there was much (belated) rejoicing!
14:26samaaronRaynes: well, it was a good job :-)
14:26Raynes<3
14:32dnolensattvik: yes details forthcoming in the next couple of days.
14:32RaynesMaaaaaaaan, why is brehaut never here when I need to spew now playing information to him? :(
14:34sattvikdnolen: Sounds good. I am really looking forward to seeing what GSoC will produce for Clojure.
14:39sandbagsuser=> (clojure.repl/source applyTo) -> "Source not found"
14:39sandbagsdoes that mean applyTo is a built-in of some kind?
14:39sandbagsor am i doing it wrong?
14:39aperiodicsamaaron: i tried the quil 1.0.0 release with my kinect thing yesterday, to no avail
14:39sandbags(i was looking at the source of apply using c.r/source)
14:40technomancysandbags: source only works on Clojure functions; applyTo is a Java method I believe
14:40sandbagsahhh
14:40sandbagsthanks
14:40technomancynp
14:40S11001001sandbags: it is also easier to browse with M-. if you are using slime
14:40sandbagsS11001001: thanks for the tip, but i'm not
14:40technomancyare there any fans of Leiningen shell wrappers who would be offended if they were replaced with a more general post-install mechanism?
14:41sandbagstechnomancy: leiningen yours?
14:41technomancysandbags: indeed
14:41sandbagstechnomancy: cool beans, using it now
14:44technomancyexcellent
15:03sandbagsnot 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:06fdaoudsandbags: which book are you reading?
15:06sandbagsfdaoud: the new ed of the prag's book
15:07sandbagsso far i kind of wish i'd bought the O'Reilly book
15:07sandbagsbut i missed the half-price deal and balked at paying full-price
15:07sandbagsi guess this one will hit it's stride
15:08sandbagsbut the O'Reilly one seemed a better introduction out of the gate
15:08cemericksandbags: not too late, eh? ;-)
15:08sandbagscemerick: too late for what?
15:09AimHereToo late to turn back now, and learn PHP before it's too late
15:10cemericksandbags: 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:10sandbagscemerick: yes i have the first chapter
15:10sandbagscemerick: that's how i know it was a better introduction :)
15:10headiusspeaking of PHP...I found this entertaining: http://me.veekun.com/blog/2012/04/09/php-a-fractal-of-bad-design/
15:10sandbagsheadius: that is some scary shit in there
15:11sandbagsi found it hard to read
15:11headiusI couldn't believe it doesn't provide stack traces of any kind
15:11headiusI only got about halfway through, but jesus, PHP isn't even a programming language as far as I can tell
15:11S11001001headius: it sort of does, you just have to write your own catcher and trace printer for every project :)
15:13headiusas a language implementer I can certainly appreciate the reduced complexity of no stack traces by default, but yeah :)
15:13Wild_Catheadius: 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:13headiusjruby doesn't get its pretty stack traces without a lot of fiddling
15:14mrb_bkdnolen: high five man, wish i could go to that conf
15:21dnolenmrb_bk: thx. StrangeLoop is way fun.
15:21dnolenmrb_bk: Emerging Languages looks extra hot
15:22mrb_bkdnolen: damn i know
15:22scriptorooh, cool, the cfp is still open
15:22scriptorwait, is this the emerging languages camp?
15:23fdaoudsandbags: I'm waiting for both (paper) books to arrive..
15:23mrb_bklearn ALL OF THE LANGAUGES
15:24dnolenscriptor: i believe Emerging Langs CFP is now closed. but CFP for StrangeLoop open till mid May I think.
15:24sandbagsfdaoud: cool, the prags book has an uneven style so far
15:24sandbagsbut the content is good
15:24sandbagsbut i'm taking it on trust they're going to explain a heap of shit
15:25ibdknoxdnolen: now I have to figure out what I'm going to talk about :p
15:25sandbagsbecause they don't stop to explain much as they go
15:25scriptordnolen: really? Their last thing on their blog is that the cfp is open
15:25dnolenscriptor: I could be wrong!
15:25scriptorbut I've seen confs not updating this stuff before
15:26scriptoreh, the submission page is open, don't have anything to lose
15:26dnolenibdknox: haha, I'm sure Alex will be up for more than one Clojure related talk. Mine is all nerdy internals stuff.
15:26ibdknoxI have a couple ideas
15:27ibdknoxone 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:27ibdknoxI'd love to do a bret victor-ish talk about the possibilities with clojure/clojurescript too
15:27scriptoribdknox: whereat will you talk?
15:27ibdknoxAs many places as I can this year
15:28ibdknoxhopefully strangeloop
15:28lynaghkibdknox: I would love to hear a "Behind the mirror" talk.
15:28ibdknoxdefinitely oredev in sweden
15:28scriptorah, nice
15:28dnolenibdknox: you should, especially since Bret Victor will be there!
15:28ibdknoxI know :)
15:30ibdknoxlight table would be another potential thing to talk about
15:31sandbagstechnomancy: is there a way to get tab-completion of symbols in leiningen repl?
15:33autodidaktosandbags: ohmyzsh has a plugin for it
15:33autodidaktooh wait, lol nm
15:33autodidaktoI thought you mean "of commands in bash"
15:33llasramsandbags: the terminal repl for lein 2.x has tab-completion
15:33autodidaktonote to self: don't start answering questions within 5 minutes of waking up
15:34sandbagsah, homebrew gave me 1.7.1
15:34llasramAh, homebrew
15:34llasramActually, lein2 isn't stable yet
15:35sandbagsi can live without, just lazy
15:35llasramThere 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:35llasramsandbags: You can have both at the same time for individual deving
15:35llasramI doubt homebrew buys you anything over the "self install"
15:35llasramwhich consists of putting the 'lein' shell script in your path, and running it
15:37autodidaktollasram: that's pretty much it. it copies it to your PATH and runs it for you
15:38llasramOh, what homebrew does? Er, nice?
15:38llasramI try to pretend proprietary operating systems don't exist *la la la*
15:39autodidaktollasram: don't blame homebrew. blame technomancy for much an awesome script/program
15:40autodidaktollasram: usually though, homebrew leverages thousands of unix loving mac guys to give you the perfectlly tweaked make/config file ready to build
15:41autodidaktowell, apt-get for mac is a better way to put it
15:43llasramWell, maybe `emerge` for Mac OS X? Doesn't it typically pull in source and compile it?
15:43llasramOr maybe... whatever the *BSDs use
15:43llasramAnyway
15:44llasramAt my current office we spend waaaay too much time arguing about packaging :-)
15:46alfborgeAre 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:47alfborgeAs 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:48S11001001alfborge: further failures/errors would probably be cascades
15:49S11001001alfborge: and the best way is to look at various libraries' tests and see how they do it
15:51S11001001alfborge: 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:51scriptorah, emerginglang's cfp *is* closed for this year
15:51emezeskealfborge: That seems fishy to me; when one of my (is ...) fails, it doesn't cause any others to fail
15:51alfborgeemezeske: The test isn't failing, it's throwing an error.
15:52emezeskealfborge: Oh, that would be hard to help with without seeing the code.
15:53alfborgeNot a problem, I'm able to fix the error (despite clojure and the testing macros every attempt to confound me)
15:53alfborgeI'm just annoyed that an error causes all other tests to stop running.
15:54alfborgeWhich is a sure sign that I'm "doing something wrong"
15:54S11001001so split up your deftests
15:54S11001001if you need common setup, use fixtures
15:54emezeskeSo it's actually the testing library that raises the error?
15:54hcumberdaleHi guys ;)
15:55alfborgeemezeske: Nah, the current error was just me being stupid and shadowing a function with my let. :)
15:55hcumberdaleDoes anybody know how efficient clojure is when macros are used a lot?
15:55hcumberdaleOr do macros cause memory holes?
15:55S11001001hcumberdale: macros slow down the compiler, not the execution speed of the running code
15:55alfborgehcumberdale: macros are evaluated to code at compile-time
15:55progono matter since the macros are gone by runtime
15:56hcumberdaleyeah but the runtime needs to allocate memory for it?!
15:56alfborgethe runtime doesn't know about macros
15:56hcumberdaleAnd the macros stay in memory after execution!?
15:56S11001001the macro *definitions* stay loaded, not the *uses*
15:56hcumberdale*confused*
15:56alfborgehcumberdale: the macros are replaced with actual code during compilation
15:56joegallotechnomancy: is checksum-deps no longer a thing?
15:56alfborgehcumberdale: so the runtime only sees regular code
15:57alfborgehcumberdale: think of it as code generation at compile time
15:57emezeskehcumberdale: Are you familiar with C programming?
15:57hcumberdalealfborge, 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:58hcumberdaleyes emezeske
15:58hcumberdaleBut I thought lisp macros are different from c macros?!
15:58emezeskehcumberdale: Well, the thing is, they are both evaluated at compile time
15:59emezeskehcumberdale: So if you have #ifdef 0 ... #endif, that happens at compile time, right?
15:59S11001001hcumberdale: they are, but "different" doesn't mean "there are no similarities whatsoever"
15:59hcumberdale^^ crazy yes.
15:59emezeskehcumberdale: So picture clojure macros as similar to #ifdef and friends, except vastly more powerful. ^_^
15:59hcumberdaleand (macro x) (macro y) => two instances that are generated at compile time ;)
16:02alfborgehcumberdale: 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:03jkruegeri 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:04hcumberdalejkrueger, i'm using slf4j and logback to capture all the logging output (including the clojure logging output) and filtering it if needed
16:05hcumberdaleI recommend this if other java libs are used that write dirty logging output to SYS_OUT
16:06hcumberdaleor to SYS_ERR. Most java libs write errors to SYS_OUT ;(
16:06jkruegeri'm less curious about workarounds, than to understand why my code breaks
16:07llasramjkrueger: How is your AOTed code getting loaded when it breaks?
16:08jkruegertools.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:08jkruegernaming the protocol from tools.logging
16:08technomancyjoegallo: checksum-deps isn't needed in lein2
16:09cduffyHow 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:09llasramjkrueger: 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:09joegallotechnomancy: ah, okay. also, i have lein tar in my dev profile's dependencies (new version). but it says it's not a task. :(
16:09jkruegerthat's what it looks like
16:10_312mattsorry for this really really stupid questions
16:10_312matt(def hello (fn [] "Hello world"))
16:10jkruegeri wonder if this dependency could be removed if the logging interface in tools.logging used functions instead of macros
16:10_312matthow do i execute that and get it's return value
16:10_312mattwhen i execute it and try to do (prn hello)
16:10_312mattit goes
16:10mefesto_312matt: (println (hello))
16:11_312mattmafesto: it prints #<user$helloA user$helloA@755c62bc>
16:11llasrams,tools.logging interface,tools.logging namespace,
16:11llasramHmm
16:11llasramI *thought* though that references to a class weren't enough to force class resolution and initalization
16:11llasramIs your code making logging calls in what ends up in static initializers?
16:11technomancysandbags: yeah, give lein2 a try if you are using the command-line repl; the one that comes with lein1 is not very good
16:11mefestoyou need parens around hello
16:11raekcduffy: proxy uses "reflection-ish" parts of java and methods are looked up via a clojure map from strings to functions
16:11_312mattTHX! mafesto
16:11_312mattsorry for the stupid question, so bored today so i thought i would mess with clojure, i assure you i am not retarded
16:11sandbagstechnomancy: will do, thx
16:11technomancyjust be prepared to fall back to lein1 for some projects; not everyone is onboard with the full awesomeness yet
16:11raekcduffy: reify on an interface generates a new jvm class that implements the methods directly
16:12sandbagstechnomancy: this is clojure day 1, i suspect i will not be straying into interesting areas of awesomeness any time soon :)
16:12jkruegerllasram: it's used in a multimethod dispatch at one point to emit a warning
16:12jkruegerotherwise no unusal places
16:14mefestoso does lein2 use nailgun?
16:14technomancymefesto: no, it uses nrepl
16:16llasramjkrueger: 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:17llasramI know that I've AOTed code referencing Protocols without issue
16:19sw1nnAny zipper experts around?
16:19sw1nnI was looking at this question on SO - http://stackoverflow.com/questions/10127023/filter-a-map-with-complex-nested-structure
16:19mefestoon first run lein2 launches an nrepl server?
16:20sw1nnThere's an answer already, but I was trying a zipper based solution without much luck
16:20technomancymefesto: oh, no that is not implemented. hopefully jark will allow that to work though.
16:20sw1nnI don't follow the make-node param to (zipper branch? children make-node root)
16:21sw1nnWhere can I find examples of zipper usage?
16:21sw1nnhttp://clojuredocs.org/clojure_core/clojure.zip/zipper isn't helping me
16:23kephalesw1nn: you probably dont want to use the function "zipper" directly, but instead seq-zip, vector-zip, or xml-zip
16:26sw1nnkephale: problem is that doesn't seem to work for maps
16:28sw1nnbecause (seq my-map) returns a sequence of [key val] which doesn't recurse presumably?
16:29mefestoif the latest version of lein-swank is 1.4.4 why doesn't that show up in: lein2 search lein-swank ?
16:30technomancymefesto: probably your search indices are stale
16:30technomancyrm -rf ~/.lein/indices/http___clojars.org_repo_/
16:32autodidaktotechnomancy: that's what she said
16:32jkruegerllasram: 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:32mefestoif i wanted to run a project in production using lein2 is there any special env vars or other configuration stuff i should know?
16:33mefestoim guessing it'd be something like: lein2 with-profile prod run
16:33autodidaktomefesto: did you read the Upgrading page on the leiningen githubs?
16:34mefestoautodidakto: nope, i'll check that out. thanks
16:34kephalesw1nn: well you can write a recursive seq-ing function
16:34autodidaktomefesto: you mean, as opposed to lein1? in either case, check out the sample.project.clj
16:34kephale, (require '[clojure.zip :as zip])
16:34autodidaktoit's on the githubs, or you can type "lein help sample"
16:34clojurebotnil
16:35kephale, (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:35clojurebot[:a {:l [], :pnodes [(:a (:b 3))], :ppath nil, :r ((:b 3))}]
16:35llasramjkrueger: I'm confused as to how that happens though. AFAICT, the code emitted by the macros never mentions the protocol interface directly
16:35jkruegeri think the special case here may be that the protocol is implemented in a reify
16:35jkruegerand that is emitted into my code
16:35jkruegernot sure though
16:36llasramjkrueger: 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:37sw1nnkephale: hmm, thanks I'm gonna have to study that a bit!
16:38Bronsa?
16:40technomancymefesto: yeah, "with-profile prod" is the way to go for something like that
16:41jkruegerllasram: i agree. it shouldn't. but i can definitely reproduce this behavior by switching from macro to function and back
16:42llasramjkrueger: Very very strange. If tools.logging isn't doing anything especially unusual, then that may be a Clojure compiler bug
16:44dnolenlooks like we're getting very close on PersistentHashMaps for CLJS.
16:44rplevydoes anyone have a util library with condp-let in it?
16:46lpetitdnolen: you're doing my day, everyday :)
16:48pandeirohave the recent optimizations on CLJS made it into an official release?
16:48dnolenlpetit: ha not me, other people :)
16:48dnolenpandeiro: not yet.
16:50hcumberdaletechnomancy what is the advantage of lein2?
16:51technomancyoh man... where to start? =)
16:51llasramhcumberdale: 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:52technomancyhcumberdale: http://technomancy.us/158 is a good overview
16:52technomancythough it doesn't really mention the fact that the repl has been totally rewritten to use jline2 and have full tab completion
16:52pandeirotechnomancy: like in slime?
16:52hcumberdaleyeah!
16:53technomancypandeiro: pretty much
16:53afoolsuchasihey, 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:53technomancyI think it's actually the same codebase driving the completion
16:53pandeirothat is terrific
16:53pandeirowould that mean that it works with cljs?
16:53technomancyhm; I don't think so
16:53technomancycljs doesn't have reified namespaces, does it?
16:54pandeiropaging dr nolen
16:54pandeiroi assume not
16:54technomancythere'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:54dnolentechnomancy: if the files have been analyzed tools can look inside of the cljs.compiler/namespaces atom for the same info.
16:55hjshey, anybody using clojurescriptone here? is there any better combination of libraries for web dev?
16:55llasramProfiles 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:55hcumberdalesuper-awesome
16:57technomancydnolen: 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:58technomancyhas anyone tried cljs with swank-js?
16:58AWizzArdhcumberdale: 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:59hcumberdaleIs the emacs clojure repl better than the one from vimclojure
17:00hcumberdaleIt really frustrates me! Start nailgun, open vim, \sR ESC ^ww v \eb \p ^ww ... begin to work here
17:00AWizzArdhcumberdale: depends on who you ask. Ask this question an emacs user (like me), or a vim user (:
17:01hcumberdaleI like vim cause it seems so simple and I never understood this str+?! things in emacs
17:01hcumberdale>> http://mrozekma.com/editor-learning-curve.png
17:02antares_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:02emezeskehjs: I'm using clojurescript, but did not base my project on clojurescript one
17:03technomancyprofiles are definitely the biggest new feature in lein2; I'm very pleased with how they turned out
17:03emezeskehjs: A good start is just to use a combination of ibdknox' libraries (noir, crate, fetch, etc)
17:04AWizzArdtechnomancy: yes, this finally allows me to use Leiningen for every project, also in my company. We needed parameterized compilation, which is now provided.
17:08ibdknoxbwahaha
17:08ibdknoxtime to write a blog post
17:10emezeskeibdknox: Uh oh, am I feeding people misinformation?
17:10mefestolein2 repl is nice. is there any emacs / nrepl integration?
17:10ibdknoxemezeske: oh no, that was completely unrelated
17:10emezeskeibdknox: oh haha
17:10ibdknoxI just got something very, very cool to work
17:10emezeskeawesome!
17:10ibdknoxAnd I think that's enough to finally talk about this thing I've been playing around with :)
17:11hjsibdknox: i'd like to know too :)
17:11hjsemezeske: looks very good, thanks
17:11dnolenibdknox: bring it on!
17:11ibdknoxhjs: cljs-template is the quickest way to get going
17:12ibdknoxdnolen: should get the post + video out tonight or tomorrow :)
17:12hjsibdknox: thanks, i'll play with it. any thoughts on clojurescriptone?
17:13technomancymefesto: no nrepl.el yet; it's a long way off from being competitive with slime
17:13ibdknoxhjs: 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:15hjsibdknox: why it's not a good starting point for new project?
17:15ibdknoxhjs: too much going on that's unrelated to what you're probably doing
17:16hjsibdknox: 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:16ibdknoxI 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:16hjsibdknox: i see
17:17ibdknoxeither way, there's nothing wrong with starting from it
17:17ibdknoxwhatever works :)
17:18ibdknoxas a clean, simple starting point for something new, cljs-template is probably the right place to look
17:18hjsibdknox: yeah, i'll give it a shot :) and then probably cleanup libs for my specific need.
17:22tmciverI'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:23amalloytmciver: don't do that
17:23hiredmantmciver: don't do that
17:23hiredmantmciver: the class generated by the proxy macro is not for you
17:24amalloyand even if it were, (.newInstance foo) wouldn't work if the proxy body closed over any locals
17:25tmciverhiredman, 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:25muhooi 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:25kjellskils -lh
17:25kjellskiarch, sorry guys
17:25amalloyyou 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:26antares_tada! lein2-preview3 is live on travis-ci.org. (cc cemerick)
17:26technomancyantares_: nice!
17:26tmciveramalloy: yeah, that's what I thought. I just wanted to make sure.
17:26tmciverand it looks like deftype won't work either becasue it only accepts Object, correct?
17:27amalloyif 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:27tmciveramalloy: OK, thanks for the help.
17:29mmarczykdnolen: ping?
17:29dnolenmmarczyk: hello
17:29mmarczykhi
17:30mmarczykfighting git atm, but almost done with it
17:30dnolenmmarczyk: excellent!
17:30mmarczykabout the #_-commented-out-code
17:30mmarczykdo you want the old map-emitting code in the compiler removed?
17:31mmarczykI originally left it in on the off chance there are some uncaught bugs, so there's a natural quick fix
17:31mmarczykof course, there are no uncaught bugs
17:31mmarczyk(right?)
17:31mmarczykbut anyway.
17:33mmarczykI 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:35dnolenmmarczyk: yes replace the map emitting code. We can figure out later whether to emit ObjMaps or ArrayMap or whatever for small maps.
17:36mmarczykok
17:37mmarczykabout proto perf vs. direct impl via Object
17:37mmarczykthe difference is rather striking in Rhino
17:37mmarczykthanks for the hint
17:37dnolenmmarczyk: mark the current maps as deprecated.
17:37mmarczykok, will do
17:37dnolenmmarczyk: np.
17:37mmarczykdoes gclosure shave any of that off?
17:38dnolenmmarczyk: no gclosure optimizations are very specific. remove deep property access and unwrapping needless functions are the biggest wins.
17:38mmarczykok, got it
17:44mmarczykdnolen: all-in-one patch posted to JIRA
17:55hjsthe latest swank-clojure seems broken? my lein version is 1.7.1
17:57dnolenmmarczyk: 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:58amalloyhjs: 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:58kjellskitechnomancy, can you give me a hint on this? Its an installation error from starter-kit in emacs… https://gist.github.com/2371270
17:58hjsamalloy: 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:59mmarczykdnolen: sure
17:59amalloyi dunno, hop into #leiningen and give technomancy a ring
17:59hjsamalloy: ok
17:59dnolenmmarczyk: that said, update perf on V8 is pretty sick.
17:59mmarczyk:-)
18:00amalloykjellski: 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:00kjellskiamalloy, *lol* okay… is there a way to check wether it finished completels?
18:01technomancykjellski: yeah, that's expected
18:01amalloyuhhh, 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:01technomancyit's dumb; the elisp compiler whines about silly things sometimes
18:01kjellskitechnomancy, thanks =) ...
18:01technomancyso nobody pays attention to the warnings
18:02mmarczykdnolen: as a quick fix, I could add thresholding using ObjMap / HashMap; or maybe ObjMap + a port of ArrayMap (which would take slightly longer)
18:02amalloytechnomancy: 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:03zerokarmalefttechnomancy: is there a way to turn off elisp compiler warnings? does elisp have multiple warning levels?
18:03dnolenmmarczyk: 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:04dnolenmmarczyk: specifically we care about access / update perf on small / big maps - we want to be able to assess that easily.
18:04technomancyamalloy: 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:05technomancyzerokarmaleft: I don't know; I haven't looked into it
18:05mmarczykdnolen: right, I'll look into it
18:05dnolenmmarczyk: exciting stuff - thanks for taking this on!
18:06mmarczyknot at all, it's a fantastic experience
18:08mmarczykand cljs "just works" in a way which is absolutely amazing
18:08dnolenmmarczyk: it's pretty mind blowing.
18:08mmarczykit is
18:09dnolenmmarczyk: and JS engines are getting so finely tuned. The perf of persistent data structure on modern JS engines is shocking.
18:09mmarczykright
18:10mmarczykwell, I've got an unusually busy weekend ahead of me (incl. Friday), but I'll definitely be squeezing in some cljs time
18:10mmarczykI'll look into jsperf.com, thresholding etc.
18:11dnolenmmarczyk: no problem, I'll try to take a look as well.
18:11mmarczykgreat, thanks
18:11dnolenmmarczyk: it may be as simple as using ObjMap up until we hit 32 keys or we get complex keys.
18:12mmarczykI'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:13dnolenmmarczyk: cool!
18:28LicenserIn 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:28Licenserany idea?
18:30dnolenLicenser: did you not have that problem before?
18:31LicenserI'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:31kjellskiI'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:32Licenserit looks like apply was not declared which is odd
18:33hiredmando you have reason to believe set-exec-path-from-shell-PATH works?
18:33hiredmanhave you checked you path in emacs and seen that it contains the right directories?
18:33hiredman(getenv "PATH")
18:34dnolenLicenser: what I mean is did your code work before r1011
18:35kjellskihiredman, I've now just linked the ~/bin/lein to /bin… so this is gone, now slime-clj is an unrecognized symbol…
18:35technomancyyou'll want to get rid of slime-clj
18:35hiredmanslime-clj means you are mixing bits
18:36Licenseryes but I also had changes since then - when I saw this the first time make clean and make fixed it
18:36hiredmanslime-clj is part of a fork of swank-clojure that is named ritz
18:36technomancyclojurebot: slime-clj
18:36clojurebotI don't understand.
18:36Licenserdnolen what confuses meis that the like looks like boilerplate code, it does not find cljs.core.apply
18:37Licenserand the call seems to be the entry call for node.js
18:37kjellskiactually this is really frustrating… I'm now trying to get an acceptable emacs setup for 2 evenings… why is it so hard?
18:37technomancyclojurebot: slime-clj is deprecated.
18:37clojurebotc'est bon!
18:38dnolenLicenser: 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:38Licensermy main problem is that the line isn't techincally 'my' code o.o
18:38Licenserand the error pops on and off when I cahnge stuff in different places
18:39dnolenLicenser: i suspect that cljs.core._STAR_main_cli_fn_STAR_ is null sometimes.
18:40kjellskiYou 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:40Licenserthis time it works again - after changeing a string constant o.O
18:40technomancykjellski: in general it's not bad if you follow the official docs
18:40dnolenLicenser: if you can enumerate the steps to repro - then open a ticket in JIRA.
18:41technomancythough the macosecks path stuff is frustrating no matter what
18:41kjellskitechnomancy, for clojure, google is not able to find an really easy way to get you started locally… any reasons?
18:42technomancygoogle indexes a lot of things; good and bad.
18:42technomancyit's a known bug.
18:42Licenserdnolen I'll try to track it down further
18:42technomancyunfortunately I haven't been able to find the URL for the bug report form for Google Search =)
18:42kjellskitechnomancy, soooo? ^^ tell me how to find the good.
18:42technomancyhttps://github.com/technomancy/swank-clojure is probably your best bet
18:43technomancyor 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:58kjellskitechnomancy, 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:59technomancyyeah, learning Emacs at the same time as learning Clojure is not going to work very well.
19:00kjellskitechnomancy, 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:01technomancyI 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:03kjellskitechnomancy, okay. nevermind. maybe everybody else is just fine with this ;)
19:03kjellskitechnomancy, thanks again, I'll try to get into clojure questions...
19:04brehauti learnt clojure with textmate and the basic repl (pretty much the worst enviroment for learning clojure)
19:04brehautand then picked up emacs later
19:04brehautmuch less pain
19:04brehautoh hes gone
19:22kennethhey, 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:22kenneth?
19:23kennethor maybe this might be a better packageL https://clojars.org/mongo-clojure-wrapper
19:25hiredmankenneth: a. https://mobile.twitter.com/roflscaletips/status/189397614813384704 b. use RandomAccessFile
19:34gunsIs the mailing list moderated? I sent off a message yesterday, but it hasn't shown up.
19:34technomancyit's moderated, yeah
19:34gunsIt's not terribly important, but I don't want to make a mistake of double posting
19:39emezeskeguns: It can take a couple days to show up sometimes :/
19:40kennethso, i can never figure out how to require clojure-contrib properly
19:40kennethis there a trick to it? with lein
19:40brehautkenneth: first trick, dont use clojure-contrib with 1.3+
19:41kennethaha? what to use instead then?
19:41brehaut~contrib
19:41clojurebotMonolithic 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:41antares_kenneth: individual libraries under github.com/clojure
19:41gunsemezeske: ah. kind of makes discussion difficult. I guess it's better than the spam death most google groups go through though
19:41emezeskeguns: Yeah, it makes discussion impossible. I feel for you; I didn't get un-moderated for several weeks
19:42kennethah, okay
19:42kennethpackage 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:44brehauttheres 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:44technomancythe most confusing thing about it is contrib
19:45technomancywhich only ever existed because clojure lacked dependency management
19:45brehautkenneth: 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:50AWizzArdguns: 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:51gunsAWizzArd: That makes sense. What a chore for Rich though
19:59emezeskeguns, AWizzArd: You don't necessarily get off the "needs to be hand-moderated" list after your first post.
20:00gunsI'm fine with moderation. Achieving high signal to noise in a list is pretty difficult.
20:01gunsI don't have much to say as a Clojure neophyte atm, anyhow
20:06antares_guns: any reasonably popular google group is moderated these days. Otherwise, spam.
20:10gunsGoogle 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:11gunsNot much money in newsgroups though
20:12antares_guns: the point of groups is to pipe you into google+
20:12gunsick
20:12antares_guns: everything else is not too interesting to the big G
20:13antares_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:24kennethso 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:25kennethi have monger in my deps and did `lein deps`
20:25antares_kenneth: can you show me your project.clj?
20:25kennethhttps://gist.github.com/ff1450649c6b40a42b1f
20:25antares_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:25antares_kenneth: you don't have monger on your dependency list
20:26antares_you have congomongo
20:26kennether
20:26kennethi'm silly
20:26kennethvery very silly
20:26antares_[com.novemberain/monger "1.0.0-beta4"]
20:27kennethfor multiple requires, should i make a new (:require …) for each, or try to combine them some other way?
20:27antares_you shoudl combined them
20:28antares_kenneth: https://github.com/michaelklishin/monger/blob/master/test/monger/test/collection_test.clj#L7
20:28antares_[monger core util] is the same as monger.core monger.util
20:28technomancydon't put bare :use calls outside tests though
20:28technomancy"only use :use with only"
20:29antares_kenneth: you said you don't have Java background, what is your background?
20:29hiredmanantares_: ugh
20:29kennethantares_: objc / php / ruby
20:30antares_kenneth: also, monger was my 2nd clojure library ever so it sure has pieces I am dying to tidy up :)
20:30hiredmanantares_: don't combine namespaces like that
20:30kennethi wrote a mongo library too :) php orm
20:30hiredmanantares_: and don't tell other people to do it
20:30antares_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:30antares_hiredman: why?
20:31kennethbut yeah, i find dependency management / namespacing etc in clojure / java extremely confusing
20:31hiredmanantares_: because it is bad style
20:31antares_kenneth: dependency management part is very similar to rubygems + bundler (combined)
20:31antares_hiredman: then what is good style?
20:31technomancyantares_: good style encourages greppability
20:32hiredman[monger.collection :as mgcol] ;; good
20:32technomancyyou should be able to determine all uses of monger.util with a single grep call
20:32hiredman[monger core util] ;; bad
20:33antares_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:34antares_I will tidy monger up tomorrow, good to know
20:35kennethantares_: does this make sense?https://gist.github.com/dd1e10668d25dac35208
20:35kennethgets me a ClassCastException clojure.lang.PersistentList cannot be cast to java.lang.Comparable clojure.lang.Util.compare (Util.java:104)
20:35antares_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:35kennethadded the correct dep
20:35technomancyantares_: I'll take that further: I don't think humans should have to write ns clauses except in edge cases.
20:36emezeskeantares_: I'm all for better ways of finding namespace usages, but please don't break my grep
20:36antares_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:36technomancybut it's good to make concessions to the lowest common denominator
20:36technomancybecause you may want to investigate things when you don't have the full force of your tooling to bring to bear
20:36antares_emezeske: sorry but I am not formatting my code just for grep friendliness. that's just too much to ask for in 2012.
20:36kennethi am using data.json, i think, antares_
20:37antares_same for 80 characters-wide columns, we are no longer on tiny terminal windows
20:37kennethor wait
20:37kennethugh
20:37antares_kenneth: if so, you need https://github.com/michaelklishin/monger/blob/master/src/monger/json.clj#L12
20:37emezeskeantares_: I don't care what you do on your own projects, of course
20:37kennethyeah, nice catch, thanks
20:38technomancyantares_: FSVO "we"
20:38technomancyI'm chatting in a window that's 87 columns wide
20:38emezeskeWell, and most people that care about 80 columns care about it because they split their screen
20:39emezeskeNot because their screen is literally only 80 characters wide
20:39amalloymy source files are 100 characters wide only by compromise - i'd rather our company standard were 80
20:40hiredmanwe have tests in our test suite that scan the source looking for lines over 80 characters and fail if they are found
20:40technomancyhiredman: also it bumps up your name in the on-call rotation if it finds them, doesn't it?
20:40technomancy=)
20:41amalloyi 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:41hiredmanand one emacs per screen
20:41antares_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:42antares_for example, failing builds if one line is 81 character long is just a waste of time in my opinion
20:42antares_anyway
20:42emezeskeI didn't mean to start a religious war
20:43antares_I will clean up old ns macro issues in my projects. monger was started when I was 2+ weeks into clojure.
20:43amalloyantares_: one advantage of hiredman's approach is now it's totally impossible to use ridiculous classes like IMavenProjectFileImmutableArtifactConfiguratorProxyBeanFactoryCacheImpl
20:44amalloysorry boss, can't fit that on a line
20:44hiredmanI didn't say I added the tesst
20:44amalloyneither did i. it's the approach you just mentioned; i suppose you can object to my calling it "yours" if you like
20:45antares_amalloy: but isn't that fixing a social problem with tools? we all know how far that goes
20:49kennethantares_: can monger upset?
20:49wkmanireGood eeevening.
20:49kennethupsert*
20:50antares_kenneth: yes, see monger.collection/update and /save
20:51antares_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:51antares_even in "safe" mode that it uses by default
20:52wkmanireIs let implemented in clojure or is it part syntax?
20:52antares_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:53wkmanirepart of the syntax*
20:55dnolenmmarczyk: question, why are you using the undefined? predicate the PHM impl?
20:56dnolenin the PHM impl I mean.
20:56emezeskewkmanire: http://clojuredocs.org/clojure_core/clojure.core/let
20:56emezeskewkmanire: showing source reveals it's a macro.
20:56mmarczykdnolen: hm, I'm pretty sure I put it in while trying to fix some bug or other
20:56mmarczykdnolen: which did go away, but I'm not sure about the causal relationship
20:56dnolenmmarczyk: yeah undefined? is only for interop.
20:57mmarczykdnolen: I'd say it was probably to do with undefined values with which some array was initialized
20:57mmarczykpresumably ArrayNode's array
20:57wkmanireI don't know much about the language yet, I've been reading Cemerick's book.
20:57emezeskewkmanire: although the macro expands to (let* ...)
20:57wkmanireWhen I got to the part on destructuring I was just thinking...
20:57mmarczyk*if* -- and that's a significant if -- it's actually needed
20:57wkmanireHow in the world was that accomplished.
20:58emezeskewkmanire: This is how: http://clojuredocs.org/clojure_core/clojure.core/destructure
20:58emezeskewkmanire: :)
20:58dnolenmmarczyk: you should never need undefined in CLJS
20:58emezeskewkmanire: better link: https://github.com/clojure/clojure/blob/master/src/clj/clojure/core.clj#L3900
20:59mmarczykdnolen: in Rhino, (make-array 5) returns an array of 5 x undefined
20:59wkmanirejeese
20:59wkmanireI've a long way to go yet.
20:59mmarczykdnolen: (nil? (aget (make-array 5) 0)) returns false
21:00S11001001sure, but null == undefined
21:00emezeskewkmanire: To be fair, that is a pretty gnarly piece of code :P
21:00S11001001just that null !== undefined
21:00mmarczyknot sure how to get at js's == in cljs
21:00mmarczykexcept through (js* "~{} == ~{})
21:01mmarczykbut thanks, that's a great point
21:01mmarczykone check less
21:01mmarczykI'll make the change sometime soon
21:01dnolenmmarczyk: thinking ...
21:02mmarczykincidentally, I'm working on the transient impl atm
21:02wkmanireemezeske: I think I can recognize some of this...
21:04dnolenmmarczyk: k, you need to flip your tests.
21:04wkmanireIts nice when major components of a language are expressed in the langauge itself.
21:04wkmanireIt's*
21:04dnolenmmarczyk: cljs.core.truth_ tests with != null && !== false
21:05dnolenmmarczyk: note that != is coercive.
21:05emezeskewkmanire: Agreed!
21:05kennethhiredman: 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:06mmarczykdnolen: ok, so do I write (or (undefined? node) (nil? node)) or perhaps (js* "(~{} != null)" node) ?
21:06hiredmankenneth: oh, well randomaccessfile can let you read out chunks of a file without have to seek through it linearly
21:06hiredmandepending on the format of the data in the file
21:06dnolenmmarczyk: no, you keep handing the nil case first, just handle it last
21:07mmarczyk?
21:07kennethmy file is a file with 140M lines each containing a json document
21:07dnolen(if (or (nil? ...) (undefined? ...)) case1 case2)) -> (if ... case2 case1)
21:07hiredmanmultiline json document?
21:07hiredmanthat is really almost the worst case
21:08antares_kenneth: take a look at http://blog.malcolmsparks.com/?p=17
21:08mmarczykdnolen: ahhh, ok
21:08mmarczykgot it this time
21:08antares_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:08kennetheach 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:08kennethantares_: yeah, but i have to process 'em before importing them, not a straight import
21:09antares_kenneth: ok
21:09kennethi could have done it fairly easily in ruby/php, wanted to try it in clojure for the hell of it
21:09mmarczykdnolen: I'll wrap up a couple of loose ends in the transient stuff and make the change
21:09kennethalmost 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:09hiredmanwell, the like from antares_ shows how to read from the file linearly, and parallelizing after that is trivial
21:10hiredmanthe link
21:10antares_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:10hiredmanparallelizing reads from a big file of json blobs is less trivial
21:10antares_kenneth: if ordering of input does not matter, using a thread pool (execution service in JDK parlance) is another easy option
21:12antares_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:18cemerickantares_: thanks for lein preview 3 on travis :-)
21:18antares_cemerick: friend is green now? :)
21:18cemerickyup; it was ~2 minutes after you mentioned the upgrade
21:18antares_cemerick: very cool
21:19antares_cemerick: next up, getting ring, noir and korma on travis. May be a bit more challenging :)
21:19cemerickwhat, you haven't bribed ibdknox and weavejester yet? :-P
21:20antares_cemerick: I submitted PRs (for noir and korma) ;)
21:20devnso...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:21devni know i can use conj, but i just had never considered using cons there, and got some weird behavior
21:21devn,(cons '() "bar")
21:21clojurebot(() \b \a \r)
21:22dnolenmmarczyk: are you inlining bitpos?
21:22dnolenmmarczyk: 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:24mmarczykdnolen: bitpos -- no, nor mask
21:24mmarczykdnolen: probably worthwhile, though I'm not sure it's possible to make a compiler macro private at this time?
21:25dnolenmmarczyk: no, but I don't really consider that a priority.
21:26dnolenmmarczyk: CLJS doesn't currently respect private defs at all.
21:26dnolenmmarczyk: less of an issue in CLJS since we don't have naked use anyway.
21:26mmarczykdnolen: thanks for the SO link; I used the "Brian Kernighan's way" algo from the bit twiddling hacks page, but I'll switch
21:26mmarczykdnolen: right, I completely withdraw that remark
21:27dnolenmmarczyk: might as well compare, I'm not sure which is faster.
21:27kennethantares_ hiredman okay will look into that
21:27mmarczykdnolen: right, will do
21:28kennethantares_: is there an update batch functionality?
21:28mmarczykdnolen: 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:29dnolenmmarczyk: sounds good. PHM is a monster compared to PV.
21:30technomancyI 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:30mmarczyk~430 lines at first attempt :-)
21:30clojurebotPardon?
21:30technomancykenneth: ^
21:30technomancyif you want super mega speed
21:31livingstonI 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:32livingston... 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:33devntechnomancy: im still surprised that tbray never put ato's implementation on the results page
21:33livingstonI'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:34livingstonthere's really nothing I can do to do that is there?
21:34antares_kenneth: you want to update multiple documents or upsert them?
21:34kennethantares_: upsert
21:35antares_kenneth: I think it's :multi true (right after :upsert true)
21:35dnolenmmarczyk: there's also some places where you have complex boolean tests because you aren't following the Java implementation closely
21:35jkkramerlivingston: reader literals?
21:35antares_kenneth: but I am not entirely sure, I haven't used multi upserts, let me take a look at our test
21:35antares_*tests
21:35mmarczykdnolen: ouch :-(
21:36mmarczykdnolen: I'll fix anything you point out, then go over the code again a couple of times
21:36dnolenmmarczyk: yeah I can improve the boolean stuff but only so much.
21:36antares_kenneth: https://github.com/michaelklishin/monger/blob/master/test/monger/test/updating_test.clj#L68
21:36kennethbasically, i have a dump of {uuid:…, otherid:…, …} documents, and i want to transform them into {uuid:…, otherids:[otherid, otherid,…], …} documents
21:36livingstonjkkramer: 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:36dnolenmmarczyk: calling not stinks.
21:36antares_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:37livingstonjkkramer: as if the whole thing was back-ticked, I would want to ~@ splice stuff in...
21:37mmarczykdnolen: ok, I'll try and refrain from that dodgy activity :-)
21:38dnolenmmarczyk: it's not your fault - this is low level stuff and not at all clear what the latest optimizations can actually do :)
21:38jkkramerlivingston: maybe use data readers, new in 1.4? https://github.com/clojure/clojure/blob/master/src/clj/clojure/core.clj#L6609
21:38mmarczykdnolen: "only so much" seems euphemistic in this case... but I'll try to do my part, of course
21:39mmarczykdnolen: it's fun to be exposed to that :-)
21:39jkkramer{:k1 v1 :k2 ((x x x) #foo/bar (a b c d) …}
21:39amalloyi don't think data readers can do this, because he wants to return multiple objects
21:39jkkramerah true
21:39jkkramerthey would need to be spliced in somehow
21:40dnolenmmarczyk: yeah, I'll probably add a not-nil? compiler macros to support PHM.
21:40amalloylikewise for macros, and reader macros in general. nothing in the lisp ecosystem i know of lets you do that
21:40dnolenmacro I mean.
21:40mmarczykdnolen: woot!
21:41livingstonyes. ideally multiple forms.
21:41amalloyhowever you *could* do {:k1 v1 :k2 #with/magic ((x x x) (magic a b c d) (y y y))}
21:41dnolenmmarczyk: yeah looking over PHM.java I would follow it's pattern of very simple boolean tests where you can.
21:42dnolenmmarczyk: no or/and/not if you can help it.
21:42amalloylivingston: sufficient for your needs?
21:43mmarczykdnolen: 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:43mmarczykdnolen: and then I'll reexamine the code to see where it deviates from PHM.java
21:43amalloymmarczyk: i feel similarly about if-not and when-not. it baffles me that they have a not call
21:43livingstonmaybe, 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:44amalloywat. whatever macros are user-defined will do their own scanning
21:44mmarczykamalloy: exactly.
21:45amalloylivingston: 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:46livingstonI really thought you could make a splicing reader macro (at least in common lisp)
21:47mmarczykdnolen: ouch, I really am using not unnecessarily... what was I thinking. will fix this shortly.
21:47amalloyperhaps you can. i don't know everything about common lisp, not by a long shot
21:47mmarczykin a way that's cool, cause it means this is gonna be faster than it is now :-P
21:47livingstonI'm trying to avoid the scanning, because the forms are arbitrary
21:47dnolenmmarczyk: not-nil? compiler macro in master.
21:48livingstonso something like with/magic would have to disassemble the whole form and reassemble it if it found magic
21:48mmarczykdnolen: thanks!
21:48amalloymhm
21:50livingstonbut 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:51livingstonhow frowned upon / stable is the read-eval #= macro?
21:52amalloyit's frowned upon, relatively stable, and not any more useful for your purposes
21:53livingstonwell it would crud things up but I could eventually get to a back-tick form that way
21:55dnolenmmarczyk: I looked more closely at PHM.java, I think we need something more general than not-nil?
21:56kennethso 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:56dnolenmmarczyk: I think a private != is called for here.
21:57mmarczykdnolen: that would be great
21:57mmarczykdnolen: coercive-not= ?
21:57dnolenmmarczyk: != is JS !=
21:57dnolenmmarczyk: so very dangerous.
21:57dnolenmmarczyk: but I think the only way to get PHM in CLJS fast.
21:58mmarczykdnolen: right
21:58mmarczykdnolen: I know I'm not planning to use it for any other purpose
21:58dnolenmmarczyk: I like that name, tedious and dangerous sounding, lets go w/ coercive-not=
21:58mmarczykdnolen: cool
21:59livingstonjkkramer: amalloy: do you know where I can find the timeline for 1.4? when might it be available?
21:59amalloywell, they're on the Nth beta, for some N
22:01livingstonhave you used it? stable?
22:01dnolenmmarczyk: done
22:01mmarczykdnolen: great, I'll be switching to that
22:06dnolenmmarczyk: excellent.
22:20livingstonthis is as close as I've gotten to a splicing reader macro - and it's kinda ugly: https://gist.github.com/9dbbb5e1a9a796d93d99
22:20kennethcan 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:20kennethhttps://gist.github.com/1253f5c5800672324e38
22:20kennethi'm a clojure newbie, but tried to follow best practices
22:22devnwhy's it private? (the gist)
22:22devnthe host/port?
22:23Null-Akenneth: (:uuid decoded) instead of (get decoded :uid)
22:23Null-A(in terms of style)
22:23devni would also move the parens on 38 to the end of 37
22:24kennethdevn: oh my gists default to private, i don't care about the host / port, it's firewalled off
22:24devni'd also move ; comments to hang off the end of a line instead of breaking up the fn
22:25kennethNull-A: neat, is that shorthand syntax for accessing hash data?
22:25livingstonkenneth: 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:26livingstonkenneth: the reader should probably be in a with-open also so that you're sure it gets cleaned up
22:26Null-Akenneth: Yah, keywords are actually functions and you can pass collections to them and they look themselves up in the collection
22:27Null-Ayou'll also want to learn about destructing syntax
22:28Null-Aalso that (do ) on 27 can just be removed.
22:29Null-A(->> file io/reader line-seq (pmap each-line) (map println))
22:30livingstonthat 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:30Null-Ayah and generally you should separate pure from impure functions
22:30Null-Abut as a beginner you can postpone that
22:32livingstonfrom 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:33kennethlivingston: 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:34Null-Athat actually doesn't force lazy sequences to be evaluated
22:34Null-Awell it depends on what level we're talking about I guess
22:35Null-Ain anycase, you probably want doall or dorun
22:35Null-Athat forces evaluation
22:35livingstondorun doall will hold the head pointer and that might kill you dorun for side-effects
22:37livingstonI made a suggestion for simplifying that last let, although potentially you need a dorun if you want to force the side effects
22:38Null-Akenneth: i recommend joy of clojure, it'll teach you all this stuff.
22:38devnkenneth: https://gist.github.com/1e4e397ffb267b737ef9
22:38devni'd probably write something more like that FWIW
22:38Null-Adevn: you wrote clarsec right?
22:39devnNull-A, no, just made it a little bit easier to read - https://github.com/mmikulicic/clarsec
22:40kennethwow that looks a lot better
22:40Null-Adevn: ah, cool. i wrote a java compiler with it, and man did the performance of clarsec suck :)
22:40Null-Astill got the job done though.
22:41Null-AI believe some of the java files were taking 30 seconds just to parse
22:42devnkenneth: 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:42devnkenneth: small bits are nice
22:42devnNull-A: :\ sorry about that
22:43Null-Ahah, no worries, combinator parsers are inherently slower compared to LR1/LL1 parsing.
22:43Null-Ai suspect all the lambdas being created were a source of bottleneck too
22:43Null-Anot sure how fast clojure is at this
22:48devnkenneth: this is probably going a bit overboard, but here's another pass: https://gist.github.com/1e4e397ffb267b737ef9
22:49devni like it more personally, but i think some people might be inclined to disagree with the make-connection fn
22:50devnkenneth: 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:54kennethso, running this with `lein run` i get an exception: java.lang.ClassNotFoundException: importer.core
22:54kennethwhich i don't when i run it via leon repl
22:55kenneththis is my current code: https://gist.github.com/1253f5c5800672324e38
22:55kennethrefactored like devn suggested, plus a couple other changes
23:08devnpmap might not be your best bet FWIW
23:09kennethdevn: is there a way to say "i want to run 10 at a time"
23:09devnkenneth: as in 10 lines?
23:10kennethessentially, run 10 threads at a time / process with a parallelism of 10
23:12devnkenneth: you could partition the file by 10 lines, and then (pmap (map process-line lines) line-group)
23:13kennethever seen something like this? Exception in thread "main" java.lang.RuntimeException: EOF while reading, starting at line 40, compiling:(importer/core.clj:45)
23:14mmarczykdnolen: 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:14kennethdevn: how would i partition the file?
23:15mmarczykdnolen: 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:15mmarczykno idea what's going on here :-/
23:16devnkenneth: (partition 10 lines-of-file-as-strings)
23:16devn,(partition 10 (range 100))
23:16clojurebot((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:17mmarczykat 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:18devnkenneth: 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:19devnor to spend some time tuning how big the chunks should be to get the best hockey stick graph
23:20devnkenneth: finally, read this:
23:20devn,(use 'clojure.repl)
23:20clojurebotnil
23:20devn,(doc pmap)
23:20clojurebot"([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:20devnNote that last sentence.
23:20devnhttp://clojuredocs.org/clojure_core/clojure.core/pmap
23:25devnkenneth: as the above link shows: when in doubt, use (time ...)
23:35kennethhmm, i must have fucked up something here… https://gist.github.com/1253f5c5800672324e38
23:36kennethtrying to implement your partition idea, devn, in `read-parallel`
23:37kennethwhen i run import-file, it evaluates to `nil` and doesn't print anything…