#clojure logs

2011-09-14

00:29michaelr525hello!
00:38iceyis there anything like a pep-8 for Clojure?
00:41jliicey: not AFAIK. reading clojure code is probably the best thing to do.
00:42brehauticey: not clojure specific, but http://mumble.net/~campbell/scheme/style.txt they are in the right ballpark
00:43iceybrehaut: thanks, i'll give that a read
00:43iceyjli: i'm starting to get into reading the clojure source now; which made me realize I've picked up a few bad habits :)
00:44jlithat's always good :)
00:46brehauticey, the biggest difference between that guide and idiomatic clojure is probably that we use vectors for literal data rather than a list, but the rules otherwise hold
00:48iceyright now i think my biggest problem is when to apply which technique / decide which style to use
00:49iceyfor example (defn myfun [someinput someother someother]... vs (defn myfun [{:keys [someinput someother etc]}])
00:49brehauticey: so you know that the second is a destructuring right?
00:51brehauticey: so you'd be passing a composite argument to the fun, whereas the former cas you are passing 3 distinct values
00:52iceybrehaut: right; i guess i'm just figuring out when it's appropriate to wrap values in maps for consumption by other functions
01:05amalloybrehaut: hm, i didn't follow the link to http://blog.romanandreg.com/post/2755301358/on-how-haskells-arrows-might-just-be-function last time. the "split/first" notation looks like a nice generalization/expansion of juxt
01:05brehautamalloy: yeah i think thats reasonable
01:06amalloylet's try again. lazybot, are arrows just functions??
01:06lazybotamalloy: Definitely not.
01:08amalloy~ping
01:08clojurebotPONG!
01:09brehautamalloy: i'd still occasionally like to get something like (***) in clojure. probably (defn *** [& fs] (partial map #(%1 %2) fs))
01:10brehauthmm thats not quite right
01:10amalloyyeah, i think that's actually juxt, isn't it? which that link leads me to think is called &&&
01:10brehautthey are similar
01:10brehaut&&& takes two funs and applies them to the same value
01:11brehaut*** takes two funs and apples them to the first and second of its argument respectively
01:11lazybotjava.lang.Exception: Unable to resolve symbol: && in this context
01:11amalloyoh, i see
01:11amalloybrehaut: btw fun fact, did you know clojure does include a builtin that does #(%1 %2), basically funcall?
01:11brehauthuh no i didnt
01:11amalloyexcept afaict it was an accident: ##(doc deliver)
01:11lazybot⇒ "([promise val]); Alpha - subject to change. Delivers the supplied value to the promise, releasing any pending derefs. A subsequent call to deliver on a promise will throw an exception."
01:12brehautamalloy: 1.3?
01:13amalloyno, it's in 1.2 - it's just that promises happen to be implemented as functions which, when you call them, save their argument. so (deliver promise value) is implemented as (promise value)
01:13amalloy&(deliver inc 10)
01:13lazybot⇒ 11
01:13brehautoh right
01:15brehautthats very cool
01:15brehautthe problem with *** is that if you gave it a words name it would probably be something like parallel, which is going to confuse everyone
01:15amalloyyeah, very cool in the sense that you probably should never do it
01:16brehauthehe
01:23amalloybrehaut: you could use a mostly-nonsense name, just to make it easier to talk about the thing
01:23amalloyi hereby (def collude ***)
01:23brehauthaha
01:23brehautfantastic
01:29jlican anyone give a sense as to how patches go from jira issues to applied?
01:30jlido things need to be brought up on the mailing list or voted on to get attention?
01:30brehauthi joshnz; is the NZ for new zealand?
01:30joshnzyup
01:30brehautexcellent
01:30joshnzyou to?
01:30brehautyup; the tron
01:30joshnzlol. same here
01:31brehautsmall world
01:31joshnzyup
01:31joshnzwhat's your day job?
01:31amalloyjli: in theory they get attention just from being on jira, eventually
01:31brehautjoshnz: self employed web monkey (py/django)
01:32brehautjoshnz: you?
01:34joshnzI help build a web app for mental health NGOs. It's in asp.net webforms, and I'm so over it. It's a horrible horrible technology. My journey this year has been exploring other technologies outside Microsoft, and once you're out you don't really want to have anything to do with MS again :)
01:34joshnzSadly there's not heaps of jobs in hamilton outside MS or Java.
01:34brehautreally not
01:35brehauti was doing webforms, C++ and VBScript (death) at my last job
01:36brehautand webforms is broken by design
01:36joshnzah. This is a step up from my prior job which was VBA and VB6.... but still. I've even over c#..... too much noise and madness going on that I just don't care about. Lol.
01:36brehautC# 4 is nice, and F# is great
01:36joshnzwebforms needs to taken out back and shot.
01:37brehauthave you been using clojure much?
01:38joshnzwe are at least using .net 4...but the thing with MS stuff is that if you don't use it exactly the way they intend you to use it, you're in a world of hurt. And often I find it's not how I want to work ;) When you combine it with TFS - which is a terrible source control program and horrible task management system - and all the rest of it, you find life becomes so much harder than it really needs to be. lol
01:39brehauthah yes
01:39joshnzNo, I haven't don't much at all. I've managed to get emacs set up with swank :)
01:39brehauthah with swank is better than me :P
01:39joshnzBut I really like the ideas clojure embodies, and lisp in general.
01:40joshnzWhat's your clojure experience?
01:40brehautive been using it since about mid 2008 for my side projects
01:40brehautmostly web stuff
01:43sean_corfieldi only started with clojure in early 2010 but we're in production with it now and loving it :)
01:43brehautsean_corfield: lucky bastard :P
01:43joshnzI'm not sure exactly when I'm going to get around to doing much with clojure. I want to work my way through SICP sometime some also.
01:45sean_corfieldi'm looking forward to the conj and finding out what others are doing with clojure
01:45joshnzbrehaut: do you if there's any company in tron that uses ruby/rails for primary development?
01:45brehautsean_corfield: im confident that its only social issues that would stop me actually using clojure on real client sites.
01:45brehautjoshnz: no idea. aquis uses django
01:45brehautbut i dont know if they are doing much these days
01:45joshnzThe funny thing is that the client shouldn't really care too much. It's just implementation details. What they care about is the finished result doing what they require
01:46brehautjoshnz: its not the client who would know; its the other freelancers i work with
01:47brehautand its fair enough; django is a pretty good fit for a lot of the sites we build and everyone knows it
01:47brehauti do wish it had enlive though
01:47joshnzWe have the "we're a MS shop..." issue, despite the fact that MS development tech is typically worse than the rest of the industry. It's like it's a marketing thing, but seems totally misdirected to me.
01:48sean_corfieldwe're using clojure for a lot of stuff... persistence (to mysql and mongodb), searching (against a json-driven search engine), mail delivery log analysis...
01:48brehauti am of the opinion that the hoi polloi of developement is a morass of pain no matter the platform
01:48sean_corfieldthis week we'll take the new search code to production as well as the mysql -> xml -> search engine publisher stuff
01:49sean_corfieldand it'll be clojure 1.3.0-RC0
01:49brehautsean_corfield: are you using clojure sql or clojureql?
01:49sean_corfieldclojure.java.jdbc - because i maintain it :)
01:49brehautwait. you maintain the sql lib now right/
01:49sean_corfieldyeah, and i'm a committer on congomongo which we also use
01:50brehautsure
01:50sean_corfieldbasically whatever we have a vested interest in, i try to help with
01:50brehautcool :)
01:50sean_corfieldand since we're on 1.3, we have a vested interest in getting contrib libraries migrated... hence my constant pushing on that
01:50brehautim slowly porting my site to mysql atm. ive been using clojureql, but ive been considering switching it out
01:51brehautits been great when it works, but sometimes it just does unexpected thigns and i get totally baffled for ages
01:52sean_corfieldwe wrote a little "orm" (more of a data mapper) on top of c.j.jdbc so we can use that for crud... and it automatically switches to mongodb for tables / collections as needed
01:53brehautORM is a bit of a funny idea in a functional language :P
01:53sean_corfieldhence the quotes :)
01:53brehautyeah :)
01:53joshnzisn't mysql pretty loose? I saw a video (can't remember where) about it doing mad stuff like allowing nulls in non-null fields or something...
01:53brehauthow do you manage schema migrations?
01:53sean_corfieldwe traffic in sequences of maps and handle the relationships in the app layer - so that we can easily integrate with nosql stuff
01:54sean_corfieldcurrently we're using sql scripts executed by our build script
01:54sean_corfieldfor mongodb we're writing clojure tho'
01:54sean_corfieldthe sql scripts predate our use of clojure
01:54brehautjoshnz: yeah it is; postgresql is a great DB but sometimes its a bit heavy weight.
01:55brehautjoshnz: although how loose depends on the backend you choose for a table
01:58jliamalloy: hum. maybe a comment will bring it to the top of the stack.
01:58jliamalloy: does voting do anything?
01:59amalloyi don't think you can do anything to stop jira from being a bottomless pit of despair. that system makes everything hard
02:00sean_corfieldwell,voting records a vote :) then it's up to the project lead to decide whether votes are worth anything...
02:01joshnzreally? Jira is is hard to use?
02:01joshnzI installed a trial the other week at work, and it seems so much easier to use than TFS
02:02brehauteverything is easier than TFS :P
02:02pmbauer*sprinkles holy water at mention of TFS*
02:02brehautthats built on the legacy of source safe. the slowest, most unsafe version control ever :P
02:04amalloyjoshnz: you should try using github issues. not as all-encompassing as jira, i'm sure, but about a hundred times easier to do anything you could *actually* want to do
02:04joshnzIt's still not much better. We lose web pages from our project due to auto merges gone wrong fairly regularly. And it's a simply text (xml) merge... and we don't even know they've been excluded!
02:05joshnzamalloy: thanks, I'll look into it. We're not a big dev group (less than 10), so we don't need anything complicated.
02:05joshnzit's just hard to get any change going :)
02:07amalloya couple weeks ago i got tired of being unable to find a list of jira issues i'd reported, and spent 5-15 minutes finding and configuring a "custom issue filter" to find them for me
02:08amalloyseemed like it should be built in already, or at least more discoverable than that
02:08tsdhamalloy: Hi Alan.
02:08joshnzThat's not hard :) Me and another dev separately have written small console apps querying the TFS api directly in an attempt to get the info we need from it. And failed.
02:08sean_corfieldwe use Unfuddle at world singles and we love it (with git)
02:10sean_corfieldbrehaut: thanx for the follo
02:10sean_corfieldw
02:10brehautno problem :)
02:12jliamalloy: any idea why clojure/core doesn't use github issues?
02:12jliI guess jira has support for milestones and releases and sstuff
02:12tsdhamalloy: I just got a OverConstrainedVersionException for your ordered library version [0.3,), but trying a second time it worked again. Maven sometimes likes to fool me...
02:12brehautjira's been used since before githubs issues were as good as they are now i recall
02:12sean_corfieldjira/confluence provides more control over permissions
02:13jliI use mantis at work. it's pretty crufty too
02:13amalloywhat brehaut is certainly true; there may be other reasons as well
02:15brehautwe used salesforce at my last gig
02:15brehautthat really underscores everything that was wrong there
02:17khaliGcould be worse, there is always Trac ;)
02:17brehautsurely not
02:17brehautmy memory of trac is mostly reasonable
02:17brehautbare bones, but reasonable
02:17amalloyah, trac
02:18amalloyi used pivotal tracker at my last job. kinda pretty looking, but some critical missing features, and some "features" that made me want to murder the devs
02:19sean_corfieldwhen i worked at adobe, they use perforce and watson :(
02:35jlihurray clojurescript! http://circularly.org/mangle/
02:50thorwilwow, with a relevant picture from ghost in the shell, i think!
02:57sgronblothat's a pretty cool little page
03:02michaelr525jli: what's different from the original?
03:07khaliGgah, it shouldn't be this difficult to setup slime/swank
03:11joshnzkhaliG - I went through these issues the other week.
03:12joshnzIt's actually quite simple
03:12khaliGjoshnz, are you using a snapshot emacs now?
03:12joshnzWhat os are you on?
03:12khaliGubuntu amd64
03:12joshnzno, I haven't got around to updating yet, but did download it.
03:13joshnzAre you using lein?
03:13khaliGyep
03:13khaliGi'm having the same problem as this person http://stackoverflow.com/questions/6506739/slime-mode-error
03:14clgvnow with clojure 1.3 RC0 - who nows what intrinsics are for?
03:14joshnzkhaliG I dunno about using the elpa. I suggest just doing it manually, it's not hard.
03:15khaliGjoshnz, ah i might try that then
03:15joshnzkhaliG: have you installed clojure-mode? You can get this from the elpa, that worked fine for me. Then simply lein plugin install swank-clojure 1.3.2
03:15joshnzhttps://github.com/technomancy/swank-clojure
03:15joshnzthat's it
03:15khaliGjoshnz, that's why i'm bothering actually since i want a newer clojure-mode to get jack-in which I didn't have in my elpa one
03:16joshnzHave you added marmalade as package source?
03:17joshnzI'm running clojure-mode 1.10.0
03:18khaliGjoshnz, trying to but it seems the elpa package.el doesn't support other sources
03:19joshnzyou could just clone the clojure-mode git repo as a quick alternative. The swank-clojure link above suggests this.
03:22joshnzkhaliG: what version of emacs are you running? I understood 24 to include package.el... and otherwise you need to obtain it yourself, since you can't use the elpa since you don't have package.el... chicken and egg syndrome
03:22khaliGjoshnz, i've got 23 atm
03:23joshnzif you Mh v package-archives what do you get?
03:24zakwilsonI'm having a problem with Apache Commons Mail that the intertubes says can be solved with
03:24zakwilsonThread.currentThread().setContextClassLoader( getClass().getClassLoader() )
03:24zakwilsonThat call to getClass() doesn't look like valid Java to me. Is it? How do I translate it in to Clojure if it is?
03:24thorwilkhaliG, joshnz: this seems to work for adding sources for elpa: http://paste.pocoo.org/show/475682/
03:25thorwildo a package-refresh-contents after changes in that regard
03:26joshnzthis is what I have in my dotEmacs, via the starter-kit http://paste.pocoo.org/show/475684/
03:26clgvzakwilson: the getClass() refers to the instance of the class containing that code
03:30thorwilpackage-install-from-buffer with clojure-mode.el is a nice way to be very sure about the version you end up with
03:31zakwilsonclgv: oh, because every class inherits from Object and that's a method of Object. I get it.
03:33clgvzakwilson: right
03:33khaliGjoshnz, that didn't work for me.. it was still hitting only tromley
03:34khaliGsorry thorwil not joshnz
03:35thorwilkhaliG: even with marmalade listed first and after a package-refresh-contents?
03:36khaliGyeah
03:36khaliGgoing to try the starter kit route now :)
03:36yayitsweiis anybody still maintaining clj-facebook (https://github.com/likestream/clj-facebook) or is there a more recent fbconnect library?
03:37thorwilkhaliG: strange, but how about skipping that and using package-install-from-buffer, then?
03:37zakwilsonSo I'm still not getting how to call getClass() from Clojure.
03:37joshnzkhaliG: do you have paredit mode or yaml mode installed?
03:37khaliGnope none of those
03:38amalloy&(class "")
03:38lazybot⇒ java.lang.String
03:38amalloy&(.getClass "")
03:38lazybot⇒ java.lang.String
03:39joshnzkhaliG: did you try the setup I listed in the paste link of mine above?
03:39khaliGjoshnz, it didnt like require package
03:39amalloyzakwilson: they're using getClass() just to get a reference to the current classloader, it looks like
03:40hiredman,((fn x [] (class x)))
03:40clojurebotsandbox$eval10300$x__10301
03:40amalloy&((fn f [] (.getClassLoader (class f))))
03:40lazybot⇒ #<DynamicClassLoader clojure.lang.DynamicClassLoader@bf3c44>
03:40joshnzkhaliG: Is package.el in ~/.emacs.d/ ? Make sure it's on the load path. Dinner for me now. Will be back in about 40 mins or so.
03:41khaliGjoshnz, lemme double check
03:41zakwilsonamalloy: thanks. That works, however it doesn't magically make my email send work.
03:42amalloyyeah, setting your classloader in order to interface with an email system sounds bona fide ridiculous
03:45yayitsweito answer my previous question, this works: https://github.com/maxweber/clj-facebook-graph
03:45hiredmanzakwilson: what error? missing classes?
03:45zakwilsonhiredman: javax.activation.UnsupportedDataTypeException no object DCH for MIME type multipart/mixed
03:46zakwilsonhttp://blog.hpxn.net/2009/12/02/tomcat-java-6-and-javamail-cant-load-dch/ <-- page suggesting setting the classloader
04:00clgvzakwilson: there seem to be two other options
04:02zakwilsonI just fixed it as you posted that, clgv.
04:02khaliGyay i have clojure-jack-in working :)
04:05khaliGspoke too soon, it never brings up a repl lol
04:06zakwilsonFor anyone curious, Java's mailcap file needed to exist and have appropriate entries for multipart types.
04:13clgvzakwilson: seems like you can do it programatically as well -> http://www.jguru.com/faq/view.jsp?EID=237257
04:15zakwilsonclgv: thanks. I found that page and just went with the mailcap solution as initilaly presented without reading the comments about doing it programatically. I added the mailcap thing to the project documentation and am considering it fixed.
04:38joshnzkhaliG: what's your current status? You still don't get the repl? There should be a *slime* buffer which lists any errors. I had to add lein to my path within emacs
04:39khaliGjoshnz, i've got a repl now thankfully! but trying to use clojure-jack-in with my existing project didn't bring up a repl - so i need to investigate that
04:40joshnzis it a lein project?
04:40khaliGit is
04:40joshnzwith the project.clj file present?
04:41khaliGjoshnz, yes its a lein project with project.clj
04:41joshnzcheck the relevant slime buffer and see if there are any errors, perhaps?
04:43khaliGjoshnz, there are no slime buffers, i had a look, and the only other buffer is messages but it just says 'starting swank server'
04:46joshnzI get the following buffers: *slime-repl* *swank* and *slime-events*. Oh, you mean you don't get any other buffers on your existing project which doesn't work.... presumably you get these buffers on the new project where you got the repl, of course. silly me.
04:46khaliGjoshnz, yep! :)
04:47joshnzWhen you exit emacs it will kill the swank process. Perhaps restart emacs and try again incase something got tripped up...? I had to do that once while trying to get it initially set up.
04:48joshnzalso, ensure you have a file from that project open in a buffer, and that buffer active when calling jack-in
04:49khaliGjoshnz, i tried restarting it several times; also had open files from the project, didn't seem to make a difference. i wonder if its to do with lein plugin
04:51joshnzwhat version is the project? Does it use a recent clojure version?
04:51khaliG[org.clojure/clojure "1.2.0"] and :dev-dependencies [[swank-clojure "1.3.2"]
04:57joshnzTry removing the dev dep on swank-clojure. I don't have it in my test project and can still jack-in. It might be causing issues....?
04:58khaliGgood idea, lets see
04:58joshnzYou may need to remove it from the libs dir also, if there's a copy there.
04:58khaliGyes, i'll remove those now
04:59joshnzAlso, check ~/.lein/plugins and remove any older swank plugins that may exist
05:01khaliGjoshnz, nope no luck. it's funny the cpu fan goes louder just like when starting swank normally
05:01khaliGwait, now i have a new buffer that wasn't there before *swank*
05:02khaliGuser=> Connection opened on local port 65203
05:02khaliG#<ServerSocket ServerSocket[addr=localhost/127.0.0.1,port=0,localport=65203]>
05:02khaliGbut no slime!
05:09clgvkhaliG: uh, more than 2 hours now - you are pretty persistent on that.
05:09khaliGclgv, lol i've been multitasking but yeah i'm giving up hope :P
05:09joshnzit's one of those annoying things - it should be simple, but in reality it's not.
05:10joshnzwhat version of clojure-mode are you running?
05:10khaliG1.10.0 now :)
05:12clgvkhaliG: and following technomancy's instructions entirely from zero doesnt work?
05:13cees_Hi, does anyone know how to create a full-word match in clojure?
05:13cees_(re-find #"^te*" "test") returns "te"
05:13cees_and (re-find #"^te*$" "test") returns nil
05:13khaliGclgv, it did for new lein projects; just not my existing one for some reason
05:13clgv,(re-find #"^te.*" "test")
05:13clojurebot"test"
05:14clgv,(re-find #"^te.*\b" "test bla")
05:14clojurebot"test bla"
05:14clgv,(re-find #"^(te.*)\b" "test bla")
05:14clojurebot["test bla" "test bla"]
05:15clgv,(re-find #"^(te.*)\B" "test bla")
05:15clojurebot["test bl" "test bl"]
05:15clgv,(re-find #"^(te.*)\s" "test bla")
05:15clojurebot["test " "test"]
05:16cees_Hi clgv. so the ( )\b in the reg-exp should do the trick. What does the \b mean?
05:17clgvcees_: no the \“ doesnt - at least not what I wanted ;)
05:17clgv*\b
05:17clgv.* does match multiple arbitrary symbols
05:18clgvcees_: details can be found here -> http://download.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html
05:19cees_Oke, I look there. I was hoping for a simple function in clojure that matches whole words instead of parts. That's easier than fiddling with the ^ and $ in the reg-exp.
05:19cees_clgv, thanks for the help.
05:19joshnzkhaliG: You could try making a new lein project and copying the contents of the old one in the new dir and trying? I'm really clutching at straws... lol
05:20clgvcees_: you might split your string with the whitespaces that separate your words and then run a match on that sequence of words
05:22cees_Hi clgv, Done that part already. The problem is to prevent matches of part of the string. So "t*s" should match "tes" but shouldn't match "test".
05:23clgv ,(re-find #"(t.*s)" "test")
05:23clojurebot["tes" "tes"]
05:24khaliGjoshnz, haha, why not!
05:27joshnzclgv: if you want to match on tes but not test, you need to end with $
05:28clgvjoshnz: cees_ wanted to match on "tes"
05:28joshnz,(re-find #"^t.*s$" "test")
05:28clojurebotnil
05:28joshnz,(re-find #"^t.*s$" "tes")
05:28clojurebot"tes"
05:29joshnzmatch on tes, but not on test. Is that what clgv wanted?
05:29clgvjoshnz: I know. my example tried to do what I undestood cees_ wanted to do^^
05:30cees_,(re-find #"^t*$" "tes")
05:30clojurebotnil
05:30cees_while I would expect that this would return a match.
05:30joshnzah, sorry, I mixed up users. I should have been directing that at cees_
05:31joshnzcees_: that doesn't match because t* means zero or more t characters...
05:31clgvcees_: I showed you already that you need to use ".*"
05:31joshnz,(re-find #"^t*$" "tttt")
05:31clojurebot"tttt"
05:33cees_,(re-find #"^t.*$" "tes")
05:33clojurebot"tes"
05:33cees_,(re-find #"^t.e.*$" "tes")
05:33clojurebotnil
05:34cees_The user provides a simple mask using * and this needs to be translated to a set of matches on a list of strings. It seems like that I hae to do quite some translateions.
05:38cees_,(re-find #"^te.*$" "tes")
05:38clojurebot"tes"
05:38joshnzcan you get an example of what the user would enter cees_? Is it a single * per character, or could it be a range?
05:39khaliGjoshnz, good call. Turns out there was one swank-clojure-1.2.0.jar lying around in dev, i had deleted the 1.3 one but the former went unnoticed. All good now! thanks for the help :)
05:39joshnzkhaliG: good to hear you got it sorted!
05:40cees_The mask are like "*test" or "path*names/te*" etc... (so only the meta-characters that you expect at the linux-shell)
05:40cees_I think replacement of all "*" with ".*" brings me closer.
05:42pyrotherwise for purely analytics type stuff
05:42joshnzyeah, I was thinking the same, which might suffice
05:42pyroops
05:43cees_joshnz: thanks for the help
06:49khaliGis there a way to write this sort of thing neater: (when (= "FOO" (.getName model)) (do-foo (.getName model)) - i wanted to use when-let but since = returns true/false and not the value compared it won't work unless i'm missing some trick
06:50opqdonutwell you could bind (.getName model) with let
06:50khaliGyep
06:50opqdonutor use some custom macro :)
06:50opqdonutbut nothing nicer comes to my mind
06:51khaliGwhen-let got my hopes up - ah well
06:52kzarWith the -> macro what do you do when you need to use a function that takes arguments in a different order? Say if I want to thread a string through re-seq, the regexp is the second argument not the string
06:54kzarOh I could use ->>, sorry
06:57bsteuberkzar: and in the general case, if you need -> because of other function, you can add a single function with different args by passing ((fn [x] (my-fn foo x bar))
06:57bsteuberone paren missing
06:57bsteuberyou need the (( before fn, otherwise the expression will be put in the fn form ^^
06:57kzarbsteuber: Aha gotya
06:57kzarbsteuber: Yea I never really got -> and ->> before but it just clicked
06:57bsteuber^^
06:57bsteuberalso note that inside -> you can use ->>, but not the other way round
06:58bsteuberwhich makes sense when you think about it
06:58bsteuberas ->> expects the thing to thread as first param
06:59kzaroh yea
07:37kzarIs there a good example anywhere of how to structure your directory structure for a clojure web app. With Rails it's quite good in that everything has it's place but with this I'm not sure where to put Enlive templates or static files and things like that
08:09bsteuberkzar: you might want to use noir
08:10bsteuberhttp://webnoir.org/
08:10bsteuberit is built on top of ring/compojure and has some useful defaults
08:38wunkifor those interested, just open sourced the API written in Clojure for http://www.epis.to
08:38wunkiyou can find it here: https://github.com/wunki/episto-api/
08:38wunkistill needs a lot of documentation though
08:39wunkiit's my first Clojure code evah, so feedback is very much appreciated
08:47kzarbsteuber: oo cool, that sounds perfect
08:49Chousukewunki: I didn't notice anything extra weird glancing over a couple of the files, but in one place you had a cond with a single clause in it (could use when instead) and (if (not (nil? foo))) ...) in a couple places could be just (if foo ...) couldn't it?
08:50wunkiChousuke: yes, I wasn't sure about that list thing if I should check for nil? or if ``if`` would be sufficient
08:52Chousukewunki: explicit nil checks are usually not needed. sometimes you have to differentiate between false and nil though
08:52wunkiChousuke: clear, thanks
08:55Chousukein general most (not (nil? foo)) can be replaced with either foo or (boolean foo) if you want a boolean values
08:56Chousukesince any non-nil value that is not false is considered truthy
08:57Chousuke,(boolean (Boolean. false)) :P
08:57clojurebotfalse
08:57Chousukehm, that one works it seems
08:57Chousuke,(when (Boolean. false) "test")
08:57clojurebot"test"
08:57Chousukeright. The point is, don't try to create new Boolean objects :P
09:00khaliGChousuke, i've been enjoying some of the supplementary material referenced in Joy
09:31clgv,(when (boolean (Boolean. false)) "test")
09:31clojurebotnil
09:31clgvlol hehe
09:59clgva java io question: I have long running process that is writing into a file. meanwhile I want to have another program reading from that file to have a look at it during the run of the first process. is there any locking of the OS involved that could throw any kind of exception in my writing process when it wants to write the file and I am currently reading it?
10:10clgvhumm accessing the file with vim meanwhile is working.
10:34pjstadigclgv: there are no file locks that I know of in java.io, but there are in java.nio
10:34pjstadigactually java.nio.channels.FileLock
10:35clgvpjstadig: ok. so if I dont use any I guess I am safe to read from the file without interupting the write process
10:35pjstadigclgv: sure, i'd guess all bets are off as to what you might see, half written data, etc.
10:36clgvpjstadig: I can skip the last dataset that was not read correctly, since it's only intended for getting a temporary view.
11:06mattmitchellCould someone tell me why this works: ({:id 1} :id) => 1
11:06mattmitchellI knew that (:id {:id 1}) worked, but the other way around... Is there an advantage to one over the other?
11:07TimMcmattmitchell: Maps are functions of keys to values.
11:07TimMcUse whichever is more appropriate.
11:07joegallohey, there was a blog post somewhere a while back about how protocols are commonly used wrong. it particularly was calling out the definition of functions that happen to be implemented in terms of a protocol at a low level, but are not themselves members of the protocol (as the right way to do things). does that jog anybody's memory?
11:08joegallogoogle leaves me unsatisfied so far
11:08mattmitchellTimMc: OK thanks, I think I knew that but seeing it threw me off a bit.
11:08TimMcmattmitchell: (:id ...) says "I want the value of the :id field", (my-map ...) says "use this as a lookup table".
11:09mattmitchellTimMc: OK thanks
11:09TimMcmattmitchell: Also consider if your key or your map might be nil -- rearrange or guard appropriately.
11:09cemerickmattmitchell: (:key map) is generally more idiomatic IMO, FWIW
11:10mattmitchellgood to know, thanks
11:10clgvmattmitchell: the idiomatic way is to use (:id my-map)
11:10TimMcI think it really depends on what you know about the key and the map.
11:11TimMcIf you have a literal keyword, definitely (:id my-map)
11:20manutterjoegallo: that sounds faintly familiar, have you skimmed back through old posts at disclojure.org? Might be a link there
11:20joegalloyeah, i'm back to aug 2.
11:21joegalloand still looking :(
11:23jweisstechnomancy: i saw you updated serializable-fn, was hoping it would fix the NPE you get if the fn is returned from within a defn form: (defn abc [] (serializable.fn/fn [x] (+ 1 x)))
11:24pjstadigjoegallo: this? http://kotka.de/blog/2011/07/Separation_of_concerns.html
11:24joegalloSO GOOD! Thanks, pjstadig!
11:24joegalloHow'd you find that?
11:24pjstadigi have a mind like a steele trap
11:25joegalloba-zing!
11:44leedahow do I send post data with clj-http? This isn't working: (http/post "http://localhost:8080/test&quot; {:body "abc=def"})
11:44leedaand neither is: (http/post "http://localhost:8080/test&quot; {:body (.getBytes "abc=def")})
11:45mdeboardhm
11:45mdeboardleeda: https://github.com/mattdeboard/clj-usdol/blob/master/src/clj_usdol/core.clj#L54
11:45mdeboardmine's GET but
11:45mdeboardreally no idea, but maybe that snippet will help I guess
11:46leedathat's not POST nor is it sending any data...
11:46st3fanleeda how is it not working?
11:46leedaGET requests are working fine for me
11:46leedast3fan: the server doesn't receive the data
11:47st3fanthere is a POST example on http://mmcgrana.github.com/2010/08/clj-http-clojure-http-client.html but it is pretty much what you have
11:47st3fanexcept they also specified the content-type
11:47manuttercontent-type might be a key there
11:47leedaoh wow, that worked...
11:47leedathat's annoying but ok
11:48leedaprobably an HTTP thing rather than an issue with clj-http
11:48st3fanmaybe it needs to be multipart?
11:48mdeboardYes that's how HTTP works, if you'd actually looked at my code snippet you'd have realized you have to send a header
11:48st3fanx-form-blah-something
11:48mdeboardinstead of dismissing it shittily.
11:48leedamdeboard: haha ok man.
11:49leedamdeboard: your snippet has nothing to do with this.
11:49mdeboardok
12:11leedaoh actually, Content-Type: application/x-www-form-urlencoded header is required
12:27mdeboard:|
12:27ifesdjeenhi, does anyone know how to define a protocol with optional params?
12:27ifesdjeenit's possible to define protocol implementation with optional params
12:27ifesdjeenbut not the defprotocol thing :/
12:28ifesdjeenfor instance, that's possible in extend-protocol: [^String blob-id & { :keys [output-format, frame-size, codec] :or { output-format "avi", frame-size "qvga", codec "ffodivx" } }]
12:28ifesdjeenbut defprotocol accepts only things like [blob-id], and that's it...
12:28ifesdjeeni'm not quite sure what would be the syntax for that...
12:29mdeboardifesdjeen: How would a protocol with optional params work?
12:30ifesdjeenmdeboard: quite easily, if you pass/define keys, it uses whatever you passed, otherwise it just uses defaults
12:31ifesdjeenthe same way usual function definition works, i'd suppose mdeboard
12:31mdeboardi see, I've never defined a protocol so I was thinking you'd have to at least pass a message
12:31ifesdjeeni mean - it picks up my optional arguments, taking default ones, that's for sure
12:31ifesdjeenbut whenever i try to pass one of params, it says it cant find a protocol, which is quite true, since signature differs...
12:32ifesdjeenok..
12:33manutterifesdjeen: I don't know much about protocols, but I think I remember overhearing that you can't define a protocol with optional params, HOWEVER
12:33manutteryou can define a function with optional params, and have that *call* your protocol
12:33manutterhttp://kotka.de/blog/2011/07/Separation_of_concerns.html
12:34ifesdjeenmanutter: ok..
12:34bsteuberyes I think so, too
12:34ifesdjeenok, thanks guys
12:34ifesdjeenit really helps!
12:34manutter:)
12:35ifesdjeenbut it's still quite weird to me why default values get picked up..
12:35jweissdoes &env not include arguments passed to the enclosing fn?
12:36ifesdjeennot sure...
12:39manutterjweiss: do you mean the arguments defined for the enclosing fn at read time, or the arguments actually passed to the fn at run time?
12:39jweissmanutter: run time
12:40jweissit looks like they are indeed part of &env, but seems like i can get the actual values of bindings set with (let []) but not arguments to the enclosing fn
12:41manutterhmm, I was going to suspect that &env was a read-time thingy, but reading up on it, it doesn't look that way
12:42jweissi guess what i'm asking, is 'are args passed to the enclosing function set as LocalBinding values in &env the way they'd be if the enclosing form was a let'?
12:42jweissit appears to be no, but i'm not sure if there's a good reason for this
12:46manutterjweiss: I'm reading the post at http://blog.jayfields.com/2011/02/clojure-and.html, and playing in my local repl
12:46manuttersince none of the bots will let you defmacro ;)
12:46jweissmanutter: that's exactly the page i'm looking at :)
12:46manutterwhen I define the (show-env) macro, and do ((fn [a b] (show-env)) 1 2), I get a and b in the printout
12:46jweissi'm trying to improve the serializable-fn library so that it works with fn's inside defn forms
12:47manutterthat sounds cool
12:47jweissthe current version will throw NPE's. I have a fix for the NPE, but i don't get nicely wrapped let's for the args in the defn like i would expect
12:48jweisssomehow variables bound with a let are different than ones bound as a fn arg.
12:49TimMcyup
12:50jweissyeah i guess that makes sense in a way, (let [x 3] ...) you know the value of x at compile time. you won't know the value of the fn arg
12:50naeuso, I'm trying to use the new contrib stuff - how do I get them as a dependency for my project?
12:50khaliGI wish clojure had objects, it's annoying wrapping closure thingies in vectors to pass around
12:51naeuI tried doing somethign like this in my project.clj: [org.clojure/core.incubator "0.1.1-SNAPSHOT"]
12:52naeuThe new contrib documentation seems to be quite fragmented - and geared towards contributors rather than users
12:52naeuDoes anyone know of a resource that tells me "If you want to use contrib X this is what you have to do..."
12:53TimMckhaliG: What do you mean? Clojure has objects.
12:53khaliGTimMc, it does?
12:53TimMcUh, yeah... everything.
12:53khaliGoh in the sense that C has objects? right not the kind i had in mind :P
12:53jweissi think khaliG wants to do object oriented
12:53TimMckhaliG: You know about defrecord?
12:54khaliGjweiss, yep but not so much oriented
12:54TimMcAnd you can do deftype if you need methods attached.
12:54TimMc(Or wait, can defrecord take methods?)
12:54khaliGTimMc, vaguely, i stopped using them when i read their usage is frowned upon
12:55TimMcWho told you that?
12:55VinzentTimMc, why methods, we have protocols!
12:55khaliGi can't remember :/ it was in the channel
12:56TimMcVinzent: True, if you don't need Java interop.
12:57technomancynaeu: there's a page on confluence and a thread on the clojure mailing list about that
12:57naeutechnomancy: I read the page on confluence, and am now working through the mailing list
12:58naeutechnomancy: so is it the case that the new contrib stuff isn't accessible in maven yet?
12:58technomancynaeu: I think it varies. the vast majority should be there though.
12:58naeuok, so take the incubator as an example
12:58naeuI know that the new ns is clojure.core.incubator
12:59naeubut I don't know what the maven name and current version are - is there a simple way of finding that out?
12:59technomancylein search --update && lein search incubator
13:01naeuinteresting, is it typical for `lein search --update` to take a good long while?
13:02technomancyyeah, the maven index mirrors are often slow
13:03naeuok, it just looks hung that's all
13:04naeugoing for dinner now, hopefully it'll be finished when I am
13:04Vinzenttoday lein search took about 10 min for me
13:04Vinzentat "Downloading index from central "
13:05manutterfess up: how many other lurkers all hit "lein search --update" when technomancy posted?
13:05manutter:)
13:07technomancymanutter: that must be why it's so slow--everyone hopping on at once =)
13:32duncanmdnolen: what do you mean by mapping problem?
13:33dnolenduncanm: Gregor Kiczales OOPLSA '94 talk, http://www2.parc.com/csl/groups/sda/projects/oi/towards-talk/transcript.html, as well much of the Art of the Metaobject Protocol.
13:34duncanmahhh
13:34duncanmdnolen: yes yes, i read that, that's a good talk - i wish there were a recording of it
13:35dnolenduncanm: yeah, at least the slides are there
14:05dnolencore.logic with constraint logic programming additions is gonna be cool.
14:06jolydnolen: how soon will CLP be coming?
14:07nickikI just started a CS repl (with the browser) it says it started to listen to port 9000 and switched the namespace to "ClojureScript:cljs.user>" but when I enter something nothing happens.
14:08kjeldahl`Any pointers to recent articles that explain the whole ^:dynamic changes with examples? I'm strugglig to get rid of some warnings...
14:09dnolenjoly: probably before the Conj. So a month or so I think.
14:09jolydnolen: nice
14:11mdeboarddnolen: I just watched your preso on the (match) library(?) from last month. I'm in a discrete math class so it was pretty awesome hearing about clojure.core.logic and predicate matching and Prolog. Definitely had no idea Prolog was anything but a toy db :P
14:12amalloyi wish i had so many toys i had to put them into a db
14:12anttihnickik: I have the same problem. No idea.
14:13mdeboardsextoy database
14:14anttihnickik: are you using a custom HTML page of some of those samples?
14:14nickikno
14:15anttihnickik: ?
14:18nickik@anttih Im not sure what you mean I just followd the Browser Repl read me.
14:23kjeldahl`Nevermind; clojureql was to blame, and not my code (we both had stuff named "db" which confused me quite a bit).
14:24nickikIm confused. Should the browser-repl be on the consol or on the
14:25nickik* or in the browser.
14:27nickiki got it now.
14:36charllsheyo
15:41mattmitchellI have an ugly way to convert nil items in a hash-map to an empty string, what would be the most idiomatic way to do this?
15:42amalloyprobably to not do it
15:43pcavshaha, yeah, I'm not sure what your goal is here mattmitchell
15:49thorwilmattmitchell: perhaps (map #(or % "") m) but i does sound suspicious
15:49bhenrythorwil: i don't think that would work
15:49bhenrynot on a hashmap
15:50mattmitchellWell I have a problem where an underlying library blows up when I pass in a nil value. It likes empty strings, but removing the keys altogether works fine too.
15:51bhenry,(into {} (map (fn [k v] (if (nil? v) [k ""] [k v])) {:a 1 :b nil}))
15:51clojurebot#<ArityException clojure.lang.ArityException: Wrong number of args (1) passed to: sandbox$eval10856$fn>
15:51bhenry,(into {} (map (fn [[k v]] (if (nil? v) [k ""] [k v])) {:a 1 :b nil}))
15:51clojurebot{:a 1, :b ""}
15:51bhenrycertainly yours can't be that ugly
15:52amalloyagain, there are lots of ways to do the basic task, such as ##(into {} (remove (comp nil? val) {:a 1 :b nil}))
15:52lazybot⇒ {:a 1}
15:53mattmitchellVery similar actually :) But I decided to just chuck the nil pairs instead, and that made it simpler.
15:53kharrington,(doc replace)
15:53clojurebot"([smap coll]); Given a map of replacement pairs and a vector/collection, returns a vector/seq with any elements = a key in smap replaced with the corresponding val in smap"
15:55mattmitchell,(replace {nil nil} [{:id 1 :val ""}])
15:55clojurebot[{:val "", :id 1}]
15:56kharrington,(replace {nil ""} [{:id 1 :val nil}])
15:56clojurebot[{:val nil, :id 1}]
15:56kharringtonerr not in the []'s though
15:56kharringtoni was doing it with a zipmap actually : X
15:57bhenry,(replace {nil ""} {:id 1 :val nil})
15:57clojurebot([:val nil] [:id 1])
15:57bhenrynot quite.
15:57kharringtoni think amalloy's wins, mine works if you use the replace on the vals of the map
15:59kharrington,(let [m {:a nil :b "foo" :c "bar" :d nil}] (zipmap (keys m) (replace {nil ""} (vals m))))
15:59clojurebot{:d "", :b "foo", :c "bar", :a ""}
16:09robermannhello. Which IDE / shell do you prefer to work with when programming Clojure?
16:09tufflaksMost people prefer emacs robermann
16:09bpr^
16:10pcavsemacs + clojure-mode + swank-clojure + lein is the usual route
16:10kharringtondoes anyone use clooj?
16:10robermannemacs on Windows?
16:10jolyI've been using Counterclockwise + lein, but emacs is the more common route
16:10cemerickrobermann: If you ask 10 people, you'll get 11 answers.
16:10Vinzentrobermann, eclipse would be just fine imo
16:11robermannI know cemerick, but knowing what most people use / suggest could speed my way
16:12tufflaksI use vim myself, it works decently
16:12cemerickrobermann: some actual data here FWIW http://cemerick.com/2011/07/11/results-of-the-2011-state-of-clojure-survey/
16:13cemerickIMO, it's probably better to use what you're comfortable with, at least while you're starting.
16:14robermannWell, I currently I'm using the "lein repl". Tryied Counterclockwise but I'm not confortable with it
16:16robermannwhat I don't like of REPL is that it is missing an autoident feature
16:18TimMcrobermann: I often compose in Emacs and paste into the REPL.
16:18TimMcIf you use a REPL attached to Emacs this becomes a lot easier.
16:18jolymight be worth checking out clooj. It's straightforward and seems to have promise
16:20jhickneris anyone using vimclojure with clojure 1.3? I'm trying to get some vim -> browser repl action going but it doesn't look like it works yet.
16:22tufflaksbrowser repl?
16:25dnolentufflaks: ClojureScript lets you use the browser as the evaluation environment
16:26tufflaksoh, i haven't tried clojurescript yet
16:27jhicknerit's pretty great
16:33dnolenjhickner: borders on understatement ;)
16:34robermann_I'm just trying clojurebox
16:34robermann_http://clojure.bighugh.com/index.html
16:34robermann_great job
16:35technomancydnolen: have you looked at mozrepl at all?
16:35technomancythat was the only thing that made JS bearable for me back when I had to do things in a browser
16:35technomancywondering how clojurescript's approach compares to that
16:36dnolentechnomancy: demolishes it
16:36dnolenmozrepl was crap
16:36dnolenno sane workflow
16:36technomancyso does it give you access to each separate browser tab as evaluation contexts?
16:37dnolentechnomancy: no but that's not how I dev client apps anyhow, that's what sucked about mozrepl, finding the window you wanted to work in.
16:37technomancydnolen: oh, well that's kind of crucial for developing browser extensions
16:38technomancyif you're trapped in a single page then it's much more difficult
16:38dnolentechnomancy: yes, so not really about dev'ing clientside apps - limited utility
16:38technomancywell, it's a superset
16:38jhicknerI suppose each tab could make its own repl connection though couldn't it?
16:38technomancyif you have access to the browser innards, it's easy to just find the evaluation context you want for a given page
16:38dnolenbrowser repl also uses googele iframe hack, you can test every browser even IE6
16:38technomancybut if you're stuck in a page, that's all you've got
16:38dnolentechnomancy: limitation to FF makes it worse than useless as well.
16:39technomancywell except mozilla is the only platform with a somewhat reasonable extension mechanism =(
16:39dnolentechnomancy: for serious extensions yes, but Safari and Google exts cover 95% ground.
16:39technomancywell call me mister edge-case, because I can't stomach either of those =(
16:40dnolentechnomancy: I like FF, but mozrepl was a tease, not useful for actual dev. browser repl is.
16:40technomancyi actually hate FF
16:41cemerickI've never seen a worthwhile Safari extension.
16:41technomancybut I like mozilla as a platform
16:41technomancybecause it's got its primitives in the right place and uses JS for everything it can
16:41danlarkincemerick: click2flash is a safari extension and I wouldn't browse the web without it
16:41brehautis click2flash an extension now?
16:41dnolentechnomancy: well I have to use them all, they all have their issues. I'm a Safari man myself.
16:42cemerickdanlarkin: That's pretty lightweight. My biggest peeve is the lack of corollaries for tree-style tabs (or even vertical tab strips) outside of FF.
16:42technomancytabs... just do not scale
16:42RaynesI'm giving Safari a go, but I'm not entirely impressed at this point.
16:42cemerickThen there's the AWS stuff, yslow, etc.
16:43danlarkinyeah
16:43danlarkinno doubt ff has better extensions on the whole
16:43cemericktechnomancy: I have 72 right now. FF's expose-esque thing in v6 + tree style tabs is very scalable IMO.
16:44technomancycemerick: I added an ido-style buffer switcher to conkeror (the browser I use day to day) so I can just do 0) switch keystroke, 1) type only enough keystrokes needed to uniquely identify my target tab and 2) return.
16:45pjstadigis it in your dotfiles?
16:45technomancypjstadig: it was part of conkeror back in the day, but they've since rewritten it
16:45technomancythe new one is better anyway
16:45cemericktechnomancy: FWIW, FF's awesome bar does roughly that now.
16:45technomancycemerick: oh does it? that's good news.
16:46technomancyanyway, that's really the only context in which I'm interested in writing JS right now
16:46technomancybut I guess it's understandable that clojurescript isn't targeting that
16:46cemerickYup. Matching history pops up; if a currently-open tab has a match, it's included with a "switch to tab" subtitle.
17:17jweissmy swank process has grown to 515mb, any suggestions for common memory leaks? I don't know if things like recompiling namespaces should keep eating more memory (i'd hope not). Seems like as far as data does, once a value is returned to the repl and passes out of the *1 *2 *3 it should be GC'd, right?
17:19hiredmanjweiss: grown to 515mb in what sense? if you want a smaller max heap size you should specify one
17:19hiredmanmeasuring real memory usage for jvms is not simple
17:19jweisshiredman: in this case i'm looking at 'top' - RES column
17:20hiredmanyeah, the jvm will just allocate up to max heap amount of ram, and the jvm never lets it go, even if it is not actively using it
17:21jweisshiredman: i see, i'll try a smaller Xmx
17:21jweissi'm not sure what the default is
17:22jweissi guess lein swank probably just uses the jvm default
17:23hiredmanthe default depends on 32bit vs 64bit and how much ram you have
17:23hiredmanhttp://stackoverflow.com/questions/2915276/what-is-the-default-maximum-heap-size-for-suns-jvm-from-j2se-6
17:24jweissi get: (-> (Runtime/getRuntime) .maxMemory) 878051328
17:24jweiss878mb, too much for my 4gb system
17:37smnirvenhey folks, im running into a strange error with lein deps, on leiningen 1.6.1.1
17:38smnirvenhere's some of the error: class leiningen.core$loading__4414__auto__ overrides final method meta.()Lclojure/lang/IPersistentMap
17:38smnirvenbasically after lein deps, im unable to do anything with lein
17:39technomancysmnirven: it's possible for corrupt plugins to cause issues; try clearing out lib/dev
17:40smnirventechnomancy: thanks - I tried removing everything in lib and re-running
17:40smnirventechnomancy: same effect
17:41technomancysmnirven: right, you need to figure out which dependency is corrupt and remove it from project.clj so it doesn't keep downloading it
17:42technomancyprobably something involving clojure 1.3 (or possibly 1.1)
17:43smnirventechnomancy: hey, I noticed that I have clojure 1.2 specified in my project.clj file, but in lib/dev clojure 1.1 is downloaded
17:43smnirventechnomancy: I removed those and lein works again
17:44smnirventechnomancy: thanks for the help
17:48technomancysure
17:57solussdhow does clojure represent irrational numbers?
17:59ssiderishello, does anyone know whether it's possible to "watch" all namespaces for new defs or re-defs?
18:02ssiderisI suppose it's pretty tricky...
18:09pashieldsdoes anyone have any advice on how to run count(distinct foo) queries with clojureql? For example, how would I output "select count(distinct foo) from bar"
18:59leedahi, i need some help with writing idiomatic tests for an API. the problem i'm having is that most tests need data in a certain state before they run, but if i split into separate tests, i have to recreate the data and prepare it to the desired state before i test anything in each function.
19:01leedaHere's some code to show what I mean: https://gist.github.com/78d179586da96cb7406a
19:03leedahow can i split this up into post-task, accept-task, complete-task tests?
19:05hiredmanhttp://richhickey.github.com/clojure/clojure.test-api.html#clojure.test/use-fixtures
19:05leedahiredman: aha, cool!
19:55dnolentechnomancy: I take it you've never done any serious JS development ;) Refreshing the browser means reinitializing a bunch of state.
19:56dnolenyour page may have tons of images, assets, scripts, who knows, other sources of network latency, etc.
19:57dnolenI've written around 200,000 lines of JavaScript in 6 years. Yes, refreshing the browser is a pain.
20:07technomancydnolen: sure, and that's why mozrepl helps. I understand you're excited, but it's not like interactive development in a browser is a new thing.
20:08dnolentechnomancy: mozrepl is not development environment. There's this crazy thing called the DOM and it's not the same across browsers.
20:10mdeboardI don't like it when mom and dad fight
20:10technomancyI guess I'm just a little burned out on breathless advocacy. ClojureScript is great, but that doesn't mean everything that came before was crap.
20:10tomojanyone gotten clojure-protobuf working with leiningen?
20:10dnolentechnomancy: MozRepl is completely irrelevant to the conversation is all.
20:11technomancydnolen: depends how much of your time is spent debugging cross-browser issues I guess. for me that was a smaller slice than it is for you I guess.
20:12dnolentechnomancy: let's say I've lost many unrecoverable hours of life and continue to do so to this day.
20:14technomancylike I saw in the promotional materials for Programming Clojure that "Clojure has recently surpassed Scala in relative growth." -- how is that remotely helpful as advocacy?
20:14technomancylet's take a deep breath and have some perspective.
20:14dnolentechnomancy: as far as advocacy. To each his own. I'm jumping up and down cause everything that came before is actually pitiful … IMO. JS / DOM is innately hostile. Clojure solves that. No one else is even trying.
20:14technomancybecause Mirah totally trounces Clojure in terms of relative growth
20:15dnolentechnomancy: don't really see what that has to do w/ my perspective as a JS dev, saying here's a better tool … pay attention.
20:20technomancyas an outsider it's pretty easy to dismiss advocacy that claims no one else is even trying.
20:20dnolentechnomancy: can't do anything about that. Same way some backend folks don't get what the big deal about Clojure is.
20:21dnolenand I've already pointed out specific problems, not hand waving here.
20:24dnolenI agree that "no one else is even trying", that's harsh. What I really meant was that - they're hands are tied they can't actually fix the problem.
20:29technomancysure, that's more reasonable
20:47TimMcdnolen: Is there somewhere clojure.browser.dom is documented?
20:50dnolenTimMc: not that I'm aware of. But there's not a whole lot there. I recommended just using Google Closure directly. I think it's going to take a lot of thinking to figure out what the best way to deal w/ the DOM is.
20:50TimMcOK
20:51TimMcI hadn't realized just how young this project is.
20:51dnolenTimMc: dealing w/ the DOM is a real challenge - you have string, templates, and actually DOM, perhaps they can be unified.
20:52TimMcNo question about that.
20:52TimMc(The challenge, that is.)
20:53dnolenI'm thinking this is a good opportunity to see if Out of the Tarpit can translate here.
21:30mdal1register
21:31mdal1register leenam mukdal.wt@gmail.com
21:31brett_hmdal1: you may want to /msg NickServ that ...
21:31mdal1set hidemail on
21:37TimMcmdal1: ...
21:37gtrakhow do you do require from the cljs repl?
22:16mmarczykhi
22:17mmarczykdoes anybody know what might be causing JSC_DUPLICATE_INPUT errors during ClojureScript compilation?
22:45mmarczykok, figured it out
22:45mmarczyknot a good idea to put the .cljs sources on the classpath, apparently
23:52srid4clojure issue -- I get "java.io.IOException: couldn't connect to [elephant.local/10.0.1.2:27017]" error when connecting to mongo. I think it is failing because the mongo connector uses hostname (not local IP even though that's what I passed) and mongo server refuses connection at that host.
23:53sridhad to comment out bind-ip from mongo conf file to workaround it.