#clojure logs

2012-11-17

00:00TimMcI don't know if that's the case.
00:00mholmqvistamalloy: yes I had to bind *print-dup*
00:00TimMcmholmqvist: For clarity, what happens if you pr-str the record with *print-dup* false?
00:00mholmqvistTimMc: I get "#MyRecord{:timestamp #<DateTime 2012-11-17T04:47:14.25}"
00:01TimMc(What happened to the ">"?)
00:01TimMcamalloy: ^ that's not usable
00:02amalloymholmqvist: what's *clojure-version*?
00:02mholmqvistTimMc: the > should be there. :)
00:02amalloyTimMc: i misunderstood what he was saying. it sounded like he fixed it by *nod* using print-dup
00:03mholmqvistamalloy: {:major 1, :minor 4, :incremental 0, :qualifier nil}
00:03amalloyi thought one of 1.4's "big features" was that jodatime things were supposed to print as #inst literals?
00:03TimMcYeah, that's bugging me.
00:05mholmqvistamalloy: well, doesn't look like it...
00:05mholmqvistthanks anyway guys
00:05TimMcmholmqvist: Check if #inst reader literals read properly in your environment.
00:05mholmqvistat least got it working using the rubbish
00:05mholmqvistTimMc: yeah regular dates seem to work fine
00:06mholmqvistI get #inst
00:06TimMcOh, interesting.
00:06amalloybut i bet they read as Date objects, not as jodatime objects
00:06mholmqvistamalloy: exactly
00:07amalloyso clojure.core thinks you don't have joda on your classpath
00:08mholmqvistamalloy: hmm. do I need to set that up someway special for this?
00:09mholmqvisti mean it IS on the classpath
00:11mholmqvistgotta go, but thanks for now!
00:11mholmqvistat least I get move forward now...
00:14amalloymaybe rich decided not to auto-detect jodatime after all? i can't see it in the source anywhere
01:13Sgeo,(map identity {:a 1 :b 2})
01:13clojurebot([:a 1] [:b 2])
01:14SgeoBlah, if I wanted a hash-map from that I could just throw that into (into {}) I guess
01:15arrdemincanter is off of contrib, amirite?
01:16arrdemyep.
01:18amalloySgeo: (map identity x) is the same as (sequence x)
01:19Sgeoamalloy, I just wanted to see that the result would look like what I was expecting. I wanted a function that would take a function that would (take a key and value and return a new value) and take that and make that the "new" value for that key
01:19SgeoI think what I want could be described as
01:19Sgeo(comp (partial into {}) map)
01:20amalloyyeah. i love into/for, peronally; i don't use into/map nearly as much
01:56alex_baranoskyanyone used VoltDB from Clojure? (or from Java or any other language for that matter?)
04:13SgeoIs reduce a thing to avoid writing except when needed in favor of other functions, the way recursion is, or is it fully acceptable and idiomatic to use it where, in an imperative language, I might use a loop?
04:13SgeoBecause one of the things I want to do, I could only think of in imperative terms until I remembered reduce, but still trying to mentally work out if there's a better way
04:17thorwilSgeo: if reduce makes for a concise solution, use it
04:20Sgeoassoc-in
07:36Licenserasd
07:36Licenseroops
09:32Sgeo,`(.foobar)
09:32clojurebot(.foobar)
09:32SgeoI guess I should smile at that
09:32Sgeo,`(baz .foobar)
09:32clojurebot(sandbox/baz .foobar)
09:32Sgeohrm.
09:52tufflaxWhat does ANN mean on the mailing list?
09:52tufflaxor google group, whatever :p
09:52tmciverannouncement
09:53xeqiAnnouncement
09:53tufflaxah, ok. thanks
11:10ForSparePartsI'm using localrepo for a couple of dependencies, and my project checks for them online every time it starts. Can I prevent that?
11:12xeqiForSpareParts: are they looking for a .pom?
11:12ForSparePartsLet me check.
11:28ForSparePartsxeqi, it looks like it's looking for a pom, yeah. In addition to some Maven metadata.
11:29ForSparePartsSorry for disappearing, I've been on the train and my connection is spotty.
11:29xeqiI don't think localrepo makes a pom, if you add one it should stop going out to look for it
11:29xeqinp, the conj wifi isn't perfect either
11:30xeqiForSpareParts: ^ + also make sure you didn't add them as a -SNAPSHOT version
11:32ForSparePartsxeqi, where would I put it? In the repo?
11:34xeqiyeah, same file name as the .jar, just .pom instead
11:34xeqiit should look something like http://www.sonatype.com/books/mvnex-book/reference/simple-project-sect-pom.html
11:34xeqibut without the dependencies section
11:35xeqiand with the right data based on group, artifactname, etc
11:38ForSparePartsThanks!
12:52jodarohrm
13:54solussdif I have a datastructure like this: {:a {:id 3 :b {:c {:id 8} :id 6}}}, what would be the beist way to get the keypath to the map containing :id => 8 (e.g. [:a :b :c])?
13:55uvtc,(get-in {:a {:id 3 :b {:c {:id 8} :id 6}}} [:a :b :c :id])
13:55clojurebot8
13:55ChongLiI don't think that's what he's looking for
13:55uvtcOh, whoops.
13:56ChongLiI think he wants a function that, given 8, searches the tree for {:id 8}
13:56ChongLior something
13:56solussdyeah, I know how to get the value after I know the keypath, I want to do the reverse. :)
13:57metellus$findfn {:a {:id 3 :b {:c {:id 8} :id 6}}} 8 [:a :b :c]
13:57metellusI doubt that will find anything
13:57lazybot[]
13:58ChongLi$findfn {:a {:id 3 :b {:c {:id 8} :id 6}}} 8 [:a :b :c :id]
13:58lazybot[]
13:58ChongLihmm
13:59solussdwow, findfn is crazy
13:59uvtcsolussd: maybe something involving `clojure.walk`.
14:00solussduvtc: yeah, but that just seems too meta for this problem. :)
14:02solussd.. and I cant think of a way to do it without side effects along the way (e.g. keeping track of where I am in an atom or something each step along the way)
14:02ChongLiyou're talking about back-tracking
14:02solussdthere we go
14:02metellusrecursively search and build the path as you come back out
14:03ChongLiI think doing some stream stuff might work
14:03ChongLihow about transforming the tree into a lazy seq of pairs
14:03ChongLithe pairs being keypaths and values
14:03ChongLiand then finding the first value, returning its corresponding keypath
14:03solussdthat would work, then when I find it (in a loop) I can see where I've come from
14:05solussdexcept, of course, it can have "branches": {:a {:id 3 :b {:id 4} :c {:id 5 :d {:id 6 :e {:id 7} :f {:id 8}}}}}
14:06ChongLisure, but the contents of any tree can be represented in a linear structure
14:10TimMcYou want breadth-first or depth-first?
14:10ChongLiwhat is easier?
14:11ChongLiI don't think it matters in this case, but I don't know if his trees will be wide or dep
14:11ChongLideep
14:14solussdthey're more likely to be wide
14:15Luythttp://wiki.theory.org/YourLanguageSucks , but not Clojure ;-)
14:18uvtcRaynes: refheap down?
14:24Raynesuvtc: Really? Of all the god awful times.
14:24RaynesIt's not like I'm in a hospital with my mom or anything.
14:28RaynesUgh. If this keeps happening, I'm going to have to add some real logging. I can't get heroku logs far enough back to find out what happened
14:28RaynesI don't think...
14:28Raynestechnomancy: Is there a way to snatch Heroku logs from `heroku logs` and download them for like the last day?
14:29solussdRaynes: try the -n option for up to 1500 lines of logs
14:29ekoontzRayes best wishes to your mom
14:29RaynesThat might do the trick.
14:29ekoontzsorry Raynes
14:29solussde.g. heroku logs -n 1500
14:29Raynesekoontz: Thanks. Latest news was relatively good.
14:29RaynesHence my ability to stand here and type without shaking too hard to type. ;)
14:30jacobsenHi all, can anyone suggest the best (most idiomatic, preferably) way to intercept single keystrokes on the command line (i.e., rather than reading whole lines) in a clojure app?
14:30RaynesYou're going to want to use .read instead of read-line or .readLine
14:33jacobsenThanks Raynes - and good luck w/ your mom.
14:33RaynesThanks.
14:33Raynesuvtc: Should be back up or coming back up.
14:35ambrosebsRaynes: glad to hear
14:37uvtcRaynes: yup, tnaks
14:37uvtcthanks
14:59SgeoIs there a version of clojure.set/project that doesn't deal with relations in general but just associatives? I mean, I could do it myself by putting the argument into a vector and calling first on the result, or something, but I think there should be a simpler way
15:03SgeoOh, select-keys is in clojure.core
16:23firefuxHi, are the books of Clojure for someone new to functional programming?
16:26solussdClojure Programming (Orielly) is a good place to start if you're familar with more mainstream languages
16:26ChongLisolussd: did you solve your problem?
16:27solussdChongLi: just getting back to it.. going the seq route, but haven't figured it out yet.
16:27firefuxsolussd: I'll check it out
16:27ChongLiit's pretty complex
16:27ChongLitree recursion always confuses me
16:28solussdme too. :)
16:28solussdmaybe a zipper is the way to go
16:28ChongLia zipper is for navigating a structure
16:28ChongLione step at a time
16:28ChongLiand then making edits
16:29ChongLifor example, a GUI application for browsing and editing a DOM tree
16:30ChongLiit has stuff like "up, down, left, right"
16:30ChongLifor doing that
16:31ChongLiso it'd be more suitable for the backtracking approach
16:35mpenetDoes anyone know what is the equivalent of clojure.lang.Sequential in cljs? To be used with extend-protocol, it seems I can only do it the other way around (using extend-type and cljs.core.ISequential) ?
16:35alexykhow, from a running nrepl, can I learn the port used?
16:36ChongLicheck the buffer *Process List*
16:36ChongLi?
16:36ChongLior do you mean at the repl?
16:37alexykyep
16:37solussdChongLi: yeah, I used a zipper effectively in production a couple of times.. :) pretty cool, I think
16:38HodappHrmph. What's a typical stack depth that will make things explode?
16:38HodappI'm deciding whether to use a trampoline and make up my own sort of stack for just what I need, or just recurse directly.
16:43TimMc,((fn r [x] (when (< x 2000) (r (inc x)))) 0)
16:43clojurebotnil
16:43TimMc,((fn r [x] (when (< x 20000) (r (inc x)))) 0)
16:43clojurebot#<RuntimeException java.lang.RuntimeException: java.lang.StackOverflowError>
16:43TimMc,((fn r [x] (when (< x 10000) (r (inc x)))) 0)
16:43clojurebotnil
16:43TimMc,((fn r [x] (when (< x 16000) (r (inc x)))) 0)
16:43clojurebot#<RuntimeException java.lang.RuntimeException: java.lang.StackOverflowError>
16:44TimMcHodapp: Somewhere around 13k in this case?
16:44Hodappalrighty
16:45TimMcSame range on my server laptop -- 10k - 16k.
16:45TimMcI suppose it depends on how your JVM is started, though.
16:48TimMc,((fn r [x _ _ _ _] (when (< x 10000) (r (inc x) 0 0 0 0))) 0 0 0 0 0)
16:48clojurebot#<RuntimeException java.lang.RuntimeException: java.lang.StackOverflowError>
16:48TimMc,((fn r [x _ _ _ _] (when (< x 8000) (r (inc x) 0 0 0 0))) 0 0 0 0 0)
16:48clojurebot#<RuntimeException java.lang.RuntimeException: java.lang.StackOverflowError>
16:48TimMc,((fn r [x _ _ _ _] (when (< x 5000) (r (inc x) 0 0 0 0))) 0 0 0 0 0)
16:48clojurebotnil
16:48TimMcHodapp: ^ Depends on how big your stack frames are too. :-)
16:50HodappTimMc: ah, yes, true too :)
16:59clizzinanyone here have experience with crossover clojure/clojurescript code using lein-cljsbuild?
17:11abphell-o
17:12zodiakheaven-o
17:13abpIs there any way to bind qualified symbols in a macro?
17:22TimMcBind?
17:24TimMcCan you give an example of input and output?
17:32yediare there any sites similar to disclojure?
17:33yedianyone know of any*
17:35Urthwhytethere's the weekly http://reborg.tumblr.com/post/35055123582/clojure-weekly-nov-5-2012 newsletter
17:37yedisweet
17:40ChongLihmm
17:40ChongLiif I edit 2 different files (in 2 separate instances of emacs) and use nrepl-jack-in on both
17:40ChongLione of them has colorized stacktraces whereas the other does not
17:40ChongLiI can't figure out why!
17:42Urthwhyteyedi: you might also try fogus' blog and following the #clojure tag on Twitter. I find lots of interesting things through there
17:44yediword, good looks
17:44ChongLianyone have any ideas?
17:47ChongLiahhh, hmm
17:48ChongLiif I move the file out of its project directory and just edit it on its own
17:48ChongLiit works
17:48ChongLiso it must be an old version of one of the deps or something
17:49Mr_Bondanyone running Clojure on raspberryPi ?
17:49abpTimMc: Sorry, didn't recognize the timeout or whatever that was. I think I know how to do what I want. I can replace all occurences of a qualified symbol with a gensym.
17:49abpTimMc: Will show when done
17:50ChongLihmm, it's not the clojure version
18:08yediAny sufficiently complicated Clojure (or Lisp) program contains an ad-hoc, informally-specified, bug-ridden, slow implementation of half of Haskell.
18:08yedi- some guy on the internet
18:08Hodappyedi: Have you seen the origin of that quote?
18:08yedidon't believe so
18:09Hodapphttps://en.wikipedia.org/wiki/Greenspun's_tenth_rule
18:09amalloyhah. repeating the derivative in a lisp room without knowing the original is nicely ironic
18:11yedii wanted you guys to help me understand what the guy who said that was getting at
18:20seangroveHey all, with clojurescript, when compiling and runnig it in the browser with no optimizations (just whitespace), it seems to run fine.
18:20seangroveBut with even with simple optimizations turned on, I get "Namespace "goog.debug.Error" already declared."
18:21seangroveLooking at the generated Javascript, it looks like the goog.debug.Error namesapce is actually provided 3 times, with big repeating sections
18:21seangroveAnyway, wondering if anyone's come across this and knows what I've mixed up to get repeating javascript
18:22abpHodapp: yedi: http://s-expressions.com/
18:22abpsecond post "Any sufficiently complicated Clojure (or Lisp) program contains an ad-hoc, informally-specified, bug-ridden, slow implementation of half of Haskell."
18:23cmeiklejohnseangrove: can you gist your project.clj?
18:24seangrovecmeiklejohn: Definitely, one moment...
18:24seangrovehttps://gist.github.com/0c462cf39fce5b6e970c
18:24seangroveI've just tried it with advanced optimizations and it seems to work locally, pushing it to production to test
18:25seangroveWondering if for every namespace I require some library all the dependencies get included all over again
18:26alexykanybody using La Clojure?
18:27abpalexyk: Eclipse isn't pretty but counterclockwise (the clojure plugin) is worth it.
18:27HodappCounterclockwise is way too buggy for me.
18:27amalloyif you don't already love eclipse, why would you choose ccw over emacs?
18:27alexykabp: couldn't care less about Eclipse, am using IDEA for Scala very well. La Clojure seems fine, just don't know how to look up definitions by names
18:28alexyktried Sublime Text and Aquamacs too
18:28Hodappamalloy: I learned Emacs just because I wanted to use it for Clojure stuff. I haven't been disappointed.
18:28amalloyme too
18:28abpalexyk: So use Eclipse with counterclockwise and use it's proper autocompletion with docs etc.
18:28Hodappthis is after knowing and trying to use Eclipse and Vim.
18:29alexyknice thing about nrepl is that I hope to be able to work from several different IDEs against the same JVM if I want to
18:29abpHodapp: amalloy I will, but not now. Busy writing libs... :o Bad reason?
18:29HodappCCW just gave me all sorts of idiotic issues... the latest one was not worth it to try to diagnose, like the REPL giving me a NullPointerException for no reason that I could not find any information about.
18:29amalloyhow dare you, abp? being productive instead of fiddling with productivity settings?
18:30abpHodapp: amalloy The setup is good now, not much to do, probably using paredit commands more.
18:33abpamalloy: Main productivity is in my head anyways. Working on 30 lines of code for some hours now. I want something like prismatics graph. But with some custom tweaks, too.
18:33HodappI need to learn paredit.
18:33Hodappthe extent of my current knowledge is that I'm vaguely aware something called paredit exists.
18:34abpamalloy: First time writing macros after one and a half year of clojure.
18:34abpHodapp: I used some of it's commands but no muscle memory built. :(
18:35FoxboronNew to Clojure, spent the whole day debugging a lambda, then i saw i had a set of () too much ._.
18:35TimMcParentheses overkill is a pretty common mistake for beginners.
18:36TimMcFoxboron: Did you have "((" anywhere in your code?
18:36FoxboronTimMc, no. Its was a set of paranthesises around the whole expression i did not see.
18:36abpVisual recognition accustomizing to ((((((()))))))
18:36TimMcConsecutive open parens are rare in beginner and intermediate functional programming.
18:38FoxboronBut its fun really.
18:38abpFoxboron: Before it becomes pure joy, yes.
18:39UrthwhyteHodapp: It only takes about ~20-30 minutes to learn the basics and it's a huge productivity boost
18:39HodappUrthwhyte: Is it just a mode in Emacs?
18:39UrthwhyteI use the vim plugin, can't speak to emacs
18:40Urthwhytebut it is much better supported there, I'm sure someone else in the channel can advise
18:50HodappUrthwhyte: just got it installed in a couple minutes; not understanding if I'm seeing all its features, but I can see how it might be useful
18:51UrthwhyteI would just do the emacs equivalent of `:help paredit` and print out the keybind section
18:51HodappI am looking at the mode help right now
18:51Hodappthat's the root of the 'not understanding if I'm seeing' etc.
18:52Urthwhyteahh
18:52UrthwhyteIt's relatively simple, keeps parens balanced automagically
18:52Hodappoh, nevermind, somehow I missed like 9 pages of documentation
18:52Urthwhyteonly remotely complex stuff is probably slurping and barfing
18:52Hodappmust have hit Ctrl Meta Shift End mouse-3 V by mistake instead of C-V, I do that all the time
18:53Urthwhytehah
18:53UrthwhyteThis is why I stick to modal editors ;)
18:53Hodapp<troll>vim has two modes, 'beep' and 'break everything'</troll>
18:54Urthwhytehttp://www.gnu.org/fun/jokes/ed-msg.html
18:55Hodapp-rwxr-xr-x 1 root 5.89824e37 Oct 22 1990 /usr/bin/emacs
18:55Hodappbahahahahaha
18:55Hodapp-rwxr-xr-x 1 root 24 Oct 29 1929 /bin/ed
18:55Hodapp1929, that's a good touch :)
18:59HodappI really shouldn't knock 'ed'. I've never used it.
18:59UrthwhyteI have...once
18:59UrthwhyteIt was not a pleasant experience
19:00Hodappyou just need to learn to use it!
19:01UrthwhyteOne editor is enough for me
19:01HodappAt work, I use: Emacs, Visual Studio *gag*, Eclipse, MATLAB's editor, vim, and sometimes notepad/notepad++
19:02FoxboronI use Sublime Text 2
19:02Foxboronand Light Table sometimes for the repl ^^
19:02HodappI should poke around at Light Table soon
19:02UrthwhyteI use vim exclusively, Eclipse@Google put me off ever using an IDE again
19:02FoxboronHodapp, its actually quite fun for basic stuff :)
19:03mattmossI position the disk platter according to the incoming gamma rays so that those rays flip the correct bits on the platter.
19:03HodappFoxboron: 'fun' is surprisingly underestimated for a lot of programming tasks
19:03uvtcjEdit recently got good Clojure support. See http://clojure-doc.org/articles/ecosystem/development_tools.html .
19:03FoxboronHodapp, indeed. and watching how the variables evolve with the reple with blocks of code is quite interesting.
19:03HodappI was messing with Lively Kernel the other day - an implementation of the Morphic graphics model that Self and Smalltalk used for a GUI that you can do live-editing, live-inspection, live-everything on
19:04Hodappthat was actually kind of fun.
19:04FoxboronI just pray the end version of Light Table is great and got as great support for other languages
19:04TimMcHodapp: paredit is more than just keeping parens balanced -- it's a decent implementation of "structural editing". You move entire forms around.
19:04TimMcHodapp: paredit-convolute-sexp is my favorite <3
19:05Hodappsounds kinky.
19:05TimMcVery.
19:05eisFoxboron, how do you like Sublime Text? can you compare it to anything? I've been using emacs, but I can't say I'm quite happy
19:05HodappM-x happy-mode
19:05Hodappgeez
19:05TimMcHodapp: If you have (let [x 5] (if foo x y)) and want to put the if around the let, that command lets you do it.
19:06Urthwhyteeis: It's a better Textmate with some very nice packages
19:06eisHodapp, that would be real nice! I'd bind that to every key combination right away
19:07Foxboroneis, ummmm. I can't really compared it to anything as i am mostly a windows person and havent been that emerged with vim/emacs
19:07FoxboronI do however feel Sublime is a viable option for VIM users who want some GUI
19:07Foxboronas all keybinds are available in Sublime.
19:08eisUrthwhyte, I've seen people writing plugins, looks like it's quite extensible. Do you think it can be comparable to Emacs, in like power-ness?
19:08UrthwhyteFoxboron: The problem is it doesn't implement word objects quite properly IME
19:08UrthwhyteI had the same problem when trying viper mode in emacs; the subtle differences tripped me up
19:09Urthwhyteeis: I can't really speak to that one way or another since I'm not familiar at all with the extensions API. I use a completely stock copy and only pull it out when pairing with someone who doesn't know vi basics
19:12eisUrthwhyte, oh, it's been like that for me. Some time ago I read a post by a guy who I'd say is a quite advanced emacs user (like, his .emacs is huge, and he's written a lot of elisp code), and he wrote that he's considering a switch to Sublime
19:12Hodappsnazzy, I can wipe out an entire expression with one C-k!
19:13Foxboroneis, really. Just try Sublime Text 2
19:13Urthwhyteeis: I tend to keep a simple config for sake of portability. I was for a time really deep into customising my tooling and writing tons of automation and realised it wasn't really helping me as a developer, just a distraction from learning.
19:13FoxboronGet the Package manager, and check some plugins. If you are dependant on multiple views, Origami is your friends. SublimeREPL for REPL etc
19:14eisFoxboron, oh yeah, I've seen those. I tried to code in Scala with ENSIME and some Sublime plugin, but that didn't work out too well. What do you use for Clojure in Sublime?
19:15Foxboroneis, the standar Clojure support is actually kinda poor.
19:15ivanEmacs is worth using for org-mode for me
19:15ivanhave you tried using #emacs to get happier about Emacs?
19:15FoxboronYou got SublimeREPL to get a REPL up and running, and you can use it to evaluate stuff
19:15eisUrthwhyte, spot on! Sadly, unconfigure Emacs isn't much of an editor, at least for a novice like me
19:15Foxboronbut more then that, its poor :P
19:15UrthwhyteNot really fair to compare tooling for clojure and scala :P
19:16UrthwhyteScala is much closer to the Java school in terms of package naming and methods
19:17eisivan, I'm kinda new to IRC. I might try the #emacs channel, despite the fear of being ridiculed by gurus :D
19:18HodappIt took me a couple hours to earn two ignores in #emacs
19:18ivanthere are also a bunch of screencasts on youtube that have shown me the things I wanted
19:18antares_eis: have no fear, IRC is full of nice people, not just dicks
19:19Hodappwell, I don't know how many ignores I earned, but I know that two people were vocal about it
19:19Urthwhyte++antares_
19:19eisyeah, there's the emacsrocks.com IIRC, it's quite an awesome screencast
19:19HodappI've never had a single issue here though
19:20UrthwhyteThis channel is great; has answered my queries time and time again
19:20Urthwhytenicely, even
19:20Hodappin #c++ on the other hand my experience has always been that to get my question answered I first have to spend 10 minutes smacking around the first asshole who tries to tell me my question just ain't worthy and I'm a dumbass for asking it... and then the channel pays attention.
19:21eishaha, wow. glad that I don't code in c++ :D
19:21Urthwhyte##java is the worst by far IME
19:22HodappUrthwhyte: I fear you're right. I've spent some time there.
19:22HodappUrthwhyte: In both channels I've had all sorts of issues with them just not even wanting to give me the time of day until I had produced an almighty "test case".
19:22Hodappas if conceptual knowledge is just something that is impossible
19:23HodappUrthwhyte: what sort of lovely issues have you had?
19:26UrthwhyteJust rudeness and a sense they were reluctant to answer questions. Not worth getting into specifics of it really. Editor wars are more fun than IRC channel pissing matches ;)
19:26Hodapp:P
19:27HodappSounds about right. I just got really sick of the bunch of curmudgeony dicks that were there, and I've never seen anything close to that here
19:28Hodappbut since we're actually having an editor war
19:28Hodappvim sucks.
19:29UrthwhyteIt's too bad emacs doesn't have a decent text editor
19:29Urthwhyteit's a decent OS
19:30HodappI once was banned from a channel for saying that.
19:32Urthwhytewell, I have an actual Clojure question: https://gist.github.com/dd6d904fa86b9697c518 is there a more idiomatic way to write this?
19:33Foxboronwait
19:33Foxboronyou guys complain about #c++ and ##java
19:33Foxboronseen #python?
19:33Foxboronwhere everyone believes THEY are right
19:33Foxboronand if you do anything even remotly "magic" or hacky, they flame you
19:33Foxboronand if you come and give them a comment, they flame you along with your hackey script.
19:33Foxboronits madness
19:37UrthwhyteIt seems a huge mess to me atm. String interpolation would help a bit but the nested doruns and huge anonymous function could do with improvement
19:48solussdUrthwhyte: check out doseq, for one
19:49Urthwhyte,(doc doseq)
19:49clojurebot"([seq-exprs & body]); Repeatedly executes body (presumably for side-effects) with bindings and filtering as provided by \"for\". Does not retain the head of the sequence. Returns nil."
19:56solussdUrthwhyte: marginally better I think: https://www.refheap.com/paste/0955ce736403a66c4a8754564
19:56solussdat least not forcing maps and holding on to the heads of the produced seqs
19:57abpUrthwhyte: https://gist.github.com/4102158
19:58Urthwhyteah, that is much better. I've been somewhat consciously avoiding for and doseq due to a lack of comfort with them
19:58solussdor do what abp suggested and make it one write. :D
19:58Urthwhytebut it really does make everything much clearer; overreliance on map is a holdover from Ruby habits
19:59FrozenlockI see that that lein Noir (plugin) is deprecated. Is there something to replace it?
20:01abpUrthwhyte: Comfort comes with experience. Be patient and try things out. doseq etc. is rarely needed.
20:01Bergle_1lol, i see so many refernces to cool libs and tools.... sooo much to learn.
20:01abpBergle_1: :o way to long...
20:02Bergle_1bought Pragmatic programm Programming CLojure last week - about 1/2 way into it :)
20:02abpBergle_1: I've survived around 4 years of java and can't take much more.
20:02Bergle_1ive been in .net / sql server / cold fusion / js land ;) heh
20:03Bergle_1pre java 1.0 :")
20:03UrthwhyteRuby/Python with a very brief stint in Java-land
20:03Urthwhytebut my career has yet to really begin, so not a fair comparison
20:03abpBergle_1: Then read Clojure Programming, The Joy of Clojure and ClojureScript: Up and running too. :D
20:03Bergle_1finish this book first, then play some more, come with a project to muck with.
20:03FoxboronLike, i am a fulltime basher of Java, yet i learn Clojure
20:03Foxboronhmmm
20:04Bergle_1im pretty happy with the Programming Clojure book,
20:04Bergle_1so far. :)
20:04UrthwhyteJoy of Clojure is next on my reading list (I've just finished with Programming Clojure)
20:04Bergle_1only one swear point wher ei chased my tail for an hour or so cause he didnt explain what a specific construct was - but found it online :)
20:04abpBergle_1: I've spent to much time reading and trying libs, now all those things are in my head and i want to unify them.
20:04Bergle_1howd you find Programming Clojure Urthwhyte ? its one of the better books ive read on a languages so far.
20:05Urthwhytea coworker's recommendation
20:05Bergle_1ive also been toying with lighttable :) lol i kicked some $ to it bakc on kickstarted - cause it looked so cool just to encourag edev, its only alpha but its a neat toy at moment. :)
20:06abpUrthwhyte: Does my code work for you? :)
20:06abpBergle_1: Funded too, waiting to write plugins.
20:07Bergle_1ive played with smalltalk on on off over the years and its a wonerful environment :)
20:07Bergle_1just never did anything serious with it.
20:08abpBergle_1: Ah ok, that was some time ago?
20:09Bergle_1smalltalk with squeak hmm 5 years
20:09Urthwhyteabp: Needs a second map across the questions hash, since questions is a nested col
20:11Urthwhytesolussd: worked well
20:11solussddid you try abp's approach? it's much cleaner / more functional
20:13UrthwhyteI'm fixing it up right now
20:13Urthwhytejust trying to rewrite my partition func first
20:14abpUrthwhyte: Yeah thought something like that ;)
20:14abpUrthwhyte: Little challenge for you now.
20:16solussdChongLi: In case you're interested, here's how I solved my problem (it's lazy, in a good way): https://www.refheap.com/paste/b3e00d3aa3a5b7c7791dbfa30
20:25abpFinding labrary names is tough but a little imagination applied and neat things appear: clevejate
20:25abpDoes that sound good? I'm no native english speaker. German, actually.
20:28solussdabp: i like it
20:32abpa
20:32abpIt's elevate + clj = clevejate
20:33brainproxyis there a 'not' form for checking that an exception is not thrown?
20:33brainproxy(is (not (thrown-with-msg ...))) doesn't work
20:35uvtcabp: I think there has been a recent rule instituted severely restricting Clojure pun names. :)
20:42ChongLisolussd: nice
20:42solussd:D
20:43ChongLiquite a long function name
20:43ChongLihaha
20:43ChongLiwhy not just use namespaces?
20:43solussdyeah, I'm an objective-c developer by day!
20:44solussdoh I am, it's in the <something>.models.group namespace (and groups have org_hierarchies)
20:44solussd(objective-c doesn't have namespaces, in case that didnt make sense as a joke)
20:44ChongLihaha
20:49abpuvtc: Problem is, it's not puny. I want to elevate programming in clojure into a mainly declarative and occassionaly funtional sphere.
20:50abpThen every sort of tooling like datomic queries and core.logic applies to your program like to your data.
20:53TimMcI've started using biological taxonomic names for projects.
20:53TimMcBookmarking tool -> Chelydra (after the snapping turtle genus)
20:54FoxboronWriting Python for over a year, Started with Clojure yesterday, and now i forget to add :'s D:
20:54TimMc(the tool does not exist yet, so don't bother searching for it :-P)
20:55abpTimMc: That's true for my lib too. Just a github organziation.
20:56Foxboronhm
20:56abpTimMc: But biological taxonomies is a good idea. Will try mixing purpose of my lib with those. :)
20:56FoxboronAchive max geekynes, type equations as project names.
20:57abpWow! First big task done. Now I think I'm at least not totally stupid. :D
21:00TimMcabp: technomancy generally uses literary references -- e.g. "Leiningen Versus the Ants"
21:04abpTimMc: Oh, I didn't know that. Everything that is on peoples minds end up as their library names. I want revolutions! Clojure, ClojureScript and Datomic lead the way. :D But really, Datomic is a name by the central concept, datoms. My central concept is elevating programming from functional into declarative style.
21:05abpHas *everyone* seen http://blog.getprismatic.com/blog/2012/10/1/prismatics-graph-at-strange-loop.html and https://github.com/strangeloop/strangeloop2012/blob/master/slides/sessions/Wolfe-Graph.pdf?raw=true and understood the implications? That's huge.
21:06abpStill waiting for the recording of the presentation at strangeloop 2012 though.
21:07abpAnd the open source version of graph. So much so that I start writing everything I need by myself. I did exactly that for Java, but fixed on swing-properties, thousands of lines of javassist compiler extensions and jgrapht management. Thats all vanishing now into pure functional awesomeness.
21:11uvtcTimMc: Oooh, good idea (re. naming).
21:11abpIt's going to get modules for cljs (history, localstorage, rpc, ajac, websockets, dom), ring ((reversable) routes, view-rendering), swing (declarative binding through graph nodes), datomic (event-sourcing, writing, reading) etc.
21:11abpIt's realy only about bridging into graph nodes at some point.
21:13abpControl flow and state are always drawable as graphs. Timing of functions can be written into the graph at nodes, besides their results.
21:14abpAnd graphs can be stored in datomic.
21:15abpSo you write data, to process data, to present data, to export data. Abstract all the things. Now imagine I've got crazy hear and
21:16abp'am standing on the stage at the conj. :(
21:16abp*crazy hear -> crazy hair
21:29wingy_ibdknox: if you are there .. (require 'myapp.server :reload-all) doesn't seem to reload the namespace
21:29wingy_in Light Table
21:30TimMcabp: Have you seen scgilardi's kiln library?
21:31TimMcAlso, a couple of folks at the last Boston Clojure Meetup got me hooked on "Engineering a Safer World", which in part discusses the kinds of complex problems you can get in big dependency graphs.
21:32TimMcBasically, all the components can be working as designed and the system can still fail -- so you'll need really good ways of debugging module graphs.
21:34wingy_hm im using (require 'myapp.server :reload-all) from the lein repl but with no effects
21:34wingy_how do i reload the code i have made?
21:40TimMcwingy_: Perhaps code-reloading is not sufficient for your needs, then.
21:40TimMcIs the server still running all this time?
21:40wingy_it is .. cause i reloaded that one file and it works
21:41wingy_the server file requires all other files, reload that one doesn't work
21:41wingy_which is weird since :reload-all should re-require all files that one requires
21:41wingy_TimMc: yes
21:42abpTimMc: Will investigate on kiln. For debugging visualization of every state and flow seems enough.
21:43abpTimMc: scgilardi has no kiln
21:43abpHas he? ;)
21:45TimMcabp: Oops, it's not on his account: https://github.com/straszheimjeffrey/The-Kiln
21:46TimMcHe gave a presentation about it some months ago.
21:47robinkWhat's currently the best Clojure HTTP client library?
21:47robinkclj-http?
21:47clojurebotdakrone maintains clj-http
21:49abpTimMc: Oh, yeah, I've seen that. But looks much to cluttered and read arkward things about it. :/
21:50TimMcOK. I'm just starting to read about Prismatic's Graph, thanks to your link.
21:52abpTimMc: Sure, no problem, I think it's very relevant for programming. My graph-lib is coming along great. I'm putting together graphs, in terms of (compile your-graph)
21:53abpTimMc: Oh, more like (compile your-fnk-map)
21:53TimMcI wrote my own little graph thing once upon a time for a GUI that had annoying computational dependencies between events, state, and display.
21:53TimMcI think everyone eventually writes such a thing. :-D
21:55TimMchttps://github.com/timmc/cascade
21:55abpTimMc: To bad nothing get's flexible and enjoyable enough to become widely adopted.
21:56TimMcYeah, it's hard to imagine something that's generic enough.
21:57abpTimMc: Looks quite nice at a first glance.
21:58TimMcMine is useful for (I hope!) efficient recomputation of intermediate state as inputs change over time.
21:58abpTimMc: For me it's much work to implement now. ;) But it's my first day working on it.
21:58TimMcI'd be hard-pressed to merge that with something like The Kiln, which is functional.
21:58abpTimMc: Yea, I call that iterative graph updates.
21:59abpTimMc: Yours is not functional?
21:59TimMcNo, it is entirely based on side-effects.
21:59abpTimMc: Oh, yeah, you mentioned state.
22:00TimMcThe API looks functional (you get a new cascade object back), but each node is supposed to mutate stuff externally.
22:01abpTimMc: But some state will always be there. When I unify Clojure and ClojureScript into one graph it can depend on server side storage, session cookie, other cookies, localstorage, history, dom, rpc etc.
22:01TimMcAh, sure.
22:03abpTimMc: I've thought about reducing state to what already is stateful, but between that, theres always one coherent state. Even when employing side-effects. You can't write when there is nothing to write.
22:04TimMcDidn't follow that.
22:05abpTimMc: user-typed -> do-calculations = result, coherent state, pause, next thing happens. Async result -> do-calculations = result, coherent state, pause, ...
22:07TimMcI understood that even less -- what do you mean by coherent state?
22:08abpTimMc: Point at a time were nothing happens, everything is done. You have everything the graph produces in any way in a single map. That's a coherent state.
22:09abpTimMc: not?
22:09abpTimMc: Even datomic uses one atom to snapshot these. :D
22:10TimMcAh, I see.
22:10TimMcYou don't always get that in distributed systems, though.
22:10abpTimMc: Sure?
22:11TimMcI don't know enough about datomic, I guess.
22:12abpTimMc: I've only seen "Writing Datomic in Clojure" http://www.infoq.com/presentations/Datomic (and the other talks on it)
22:13bbloomabp: TimMc: have you seen adobe's adam and eve?
22:14bbloomhttp://stlab.adobe.com/group__asl__overview.html
22:14bbloomin particular the property model is interesting
22:15TimMcI will check those out tomorrow, thanks!
22:15bbloomthis paper too http://dl.acm.org/citation.cfm?id=1449927
22:15abpbbloom: Yeehaw, more inspiration!
22:15abpbbloom: I think reactive programming is overrated. :x
22:16bbloomi wouldn't call this "reactive"
22:16bbloomin short, they define inputs, variables, constraints, and outputs
22:16abpbbloom: That's good, haven't looked into it.
22:16yediso I have a list of strings formatted like this "<value> <key>". How can I make a map that contains a matching of keys to the list of corresponding values from that list of strings?
22:16abpbbloom: That's the way.
22:16bbloominputs are initial values, constraints relate the variables, the variables are bound to the UI, and then outputs form the "command" in the adobe photoshop command history sense
22:17bbloomundo/redo style
22:17bbloomin also plays nice with that event sourced view of the world
22:18bbloomthere is local state for a form, which is 1-to-1 data bound, but the global document state is always event sourced
22:18bbloomunfortunately, command models for applications have a high investment cost. most applications don't necessarily need complex undo/redo from step 1
22:18bbloomso the model demos poorly
22:18bbloombut i think it's a really strong approach for larger systems
22:19bbloomyedi: you have a space separated list?
22:19yediit's a list of strings
22:19bbloomyedi: ah, alternating key, value, key, value, ...
22:19bbloom?
22:20bbloom&(apply hash-map [:x 1 :y 2 :z 3])
22:20lazybot⇒ {:z 3, :y 2, :x 1}
22:20yediit's not one entire string tho
22:20bbloomyedi: that what you need?
22:21abpbbloom: Will have a look, at least it doesn't exist in clojure now.
22:21yediits like ["val1 key1" "val2 key2" "val3 key1"] => {"key1": ["val1" "val2"], "key2": ["val2"]}
22:22bbloomyedi: ah, you want a "multi-map"
22:23bbloomdo you want the values ordered? or do you want sets? ie {"key1": #{"val1" "val2}...
22:23yedisets would be fine
22:23solussdyedi: &(into {} (map #(clojure.string/split % #"\s") ["key value" "key2 value2"]))
22:23solussd,(into {} (map #(clojure.string/split % #"\s") ["key value" "key2 value2"]))
22:23clojurebot{"key" "value", "key2" "value2"}
22:23solussdthere we go
22:24bbloomsolussd: that won't produce a multiset, that will clobber values
22:24bbloomer multimap
22:24solussdooh
22:24solussdreduce using update-in
22:25bbloomyup
22:27bbloomyedi: start by getting a list of key value pairs
22:27bbloombreak the problem down into steps
22:28bbloom&(->> ["val1 key1" "val2 key2" "val3 key1"] (map #(string/split % #" ")))
22:28lazybotjava.lang.RuntimeException: No such namespace: string
22:28bbloom&(->> ["val1 key1" "val2 key2" "val3 key1"] (map #(clojure.string/split % #" ")))
22:28lazybot⇒ (["val1" "key1"] ["val2" "key2"] ["val3" "key1"])
22:28bbloomso that gets you val key
22:29bbloom&(->> ["val1 key1" "val2 key2" "val3 key1"] (map #(reverse (string/split % #" "))))
22:29lazybotjava.lang.RuntimeException: No such namespace: string
22:29bbloom&(->> ["val1 key1" "val2 key2" "val3 key1"] (map #(reverse (clojure.string/split % #" "))))
22:29lazybot⇒ (("key1" "val1") ("key2" "val2") ("key1" "val3"))
22:29solussdyedi: (reduce (fn [m [k v]] (update-in m [k] #(conj % v))) {} (map #(clojure.string/split % #"\s") ["key value" "key2 value2" "key2 anothervalue2"]))
22:29solussd,(reduce (fn [m [k v]] (update-in m [k] #(conj % v))) {} (map #(clojure.string/split % #"\s") ["key value" "key2 value2" "key2 anothervalue2"]))
22:29bbloomthat gets you key/val
22:29clojurebot{"key2" ("anothervalue2" "value2"), "key" ("value")}
22:29bbloomthen do what solussd is saying :-)
22:29bbloomi recommend using multiple steps with lets or ->> for clarity
22:29solussdsorry, just jumped out of the repl and pasted. :D
22:40SgeoI'm very much missing the nice documentation that static typing naturally provides
22:40SgeoWriting out the types of stuff in English is annoying
22:41abpSgeo: Have you tried/read about typed clojure?
22:41SgeoHeard about it
22:44yedihey thanks guys, now i can look at this and try to understand what each part is doing
22:44yediso when i come up against something similar later, i know whwat to do =D
22:50bbloomyedi: so are you familiar with sets?
22:50bbloom&(conj #{1 2 3} 3 4 5)
22:50lazybot⇒ #{1 2 3 4 5}
22:52bbloomthere is also a clojure.set namespace:
22:52bbloom&(clojure.set/union #{1 2 3} #{3 4 5})
22:52lazybot⇒ #{1 2 3 4 5}
22:52bbloomthere's a bunch of different approaches
22:52bbloomto problems like yours
22:52bbloombut the key thing is: break it down into steps!
22:52bbloomsimplify the problem as you go
23:04nightfly_Why would you have january be month 0 in a date library and leave everything else normal...
23:05amalloynightfly_: C set the precedent for date representations
23:12nightfly_amalloy: Didn't realize this was such a pendemic thing. Mystery solved at least.
23:34SgeoHow many libraries have functions that disallow certain arguments, where those arguments might make sense but the creator of the function decided not to support it because s/he couldn't imagine why anyone would pass those arguments in?
23:34Sgeo(Example: partial)
23:34Sgeo,(partial identity)
23:34clojurebot#<ArityException clojure.lang.ArityException: Wrong number of args (1) passed to: core$partial>
23:35dakrone,((partial map inc) [1 2 3])
23:35clojurebot(2 3 4)
23:35dakroneSgeo: ^
23:35ivanI think Sgeo knows how to use partial
23:36dakroneah, I'm sorry, I mistook the "(Example: partial)" as desiring an example for it
23:36Sgeo(partial identity) might not be useful to write directly, but when a macro emits code, it shouldn't be forced to check out many arguments will be passed to partial, if there's a sensible but useless-seeming result.
23:37ivanyeah, I've run into another one of those in core
23:37dakronetoo much conj, not enough sleep
23:37Sgeoivan, which?
23:37abpdakrone: Be happy. :)
23:38amalloySgeo: there's a bug report for that in jira somewhere, and i think maybe there's a plan to change it? not sure about that
23:38ivanmaybe I wanted (assoc {}) to work
23:38Sgeoamalloy, yeah, I think I heard that too
23:39ivanor perhaps (conj {})
23:39Sgeo,(conj [] 1 2 3)
23:39clojurebot[1 2 3]
23:42amalloybut why would you ever (conj {})? (apply conj m vs) should really just be (into m vs)
23:44ivanah, right