#clojure logs

2013-01-02

00:02callenDeece: ugly.
00:25Deececallen: yeah. looks like this project has a fix for it.. just need to do CLASSPATH=$(lein classpath) -__-
00:29callenDeece: I usually end up making a ./scripts dir at the same level as src and stashing stuff in there.
00:34callenRaynes: have I mentioned how ridiculously awesome Blood of Kingu is?
00:44Raynescallen: I don't think you have.
00:45Raynescallen: But really, if it sounds like a large animal or a wood chipper being fed titanium, I probably don't like it.
01:18wingyi so love datomic!
01:23callenwingy: weirdo.
01:23wingy:)
01:24wingycallen: you can use whatever data storage as you want .. so you are not locked in right?
01:24wingyyou still own your data
01:25callenwingy: that's one reason I stay away from datomic, yes.
01:26muhoogreat. so a library specifies clj-stacktrace 0.2.4, and that conflicts with lein-cljsbuild, which wants clj-stacktrace 0.2.5. so if i exclude clj-stacktrace from the library, clj-stacktrace doesn't get included in the tree at all! and so lein check fails, because clj-stacktrace isn't there.
01:26callenmuhoo: that's pretty weird.
01:27muhooyeah, it was pretty surprising.
01:27muhooi wish there was a way to specify a wildcard in versions
01:27callenmuhoo: I figured exclude would've done it.
01:27callenmuhoo: you should revert that change and science that shit up.
01:28muhoolike "use clj-stacktrace, whataever the hell is the latest stable version"
01:28callenmuhoo: understanding > quick fix
01:28callenmuhoo: that wildcard stuff generally breaks things.
01:29muhootrue, but i've already burned too much time and haven't gotten close to touching what it is i originally set out to do. only so many hours in the day.
01:29callenmuhoo: do you have a reproducing project.clj you can refheap?
01:29callenmuhoo: so that I can investigate independently?
01:30callenmuhoo: because *I* would like to understand.
01:30gtraksometimes the yak just needs shaving
01:30callengtrak: it's not about yak shaving, I just like to understand things.
01:30muhoothat'd be cool, hmm. i'll take a few to see if i can do that. i'll bet it can't be reproduced, because that's how my luck goes.
01:30gtrakI was going to suggest a particular problem I ran into, but it looks like technomancy reverted that commit here https://github.com/mmcgrana/clj-stacktrace/commit/efb73bee4fecfb072c253ebbbf9e04db5b2a2fb4
01:30callenmuhoo: sorry, I'd just not like to lose a chance to potentially fix something wide-reaching if you can reproduce it.
01:33RaynesAw, tomoj isn't here.
01:33RaynesI wanted to shove some laser down his throat.
01:33callenRaynes: you got in trouble the last time you tried to shove something down somebody's throat. Best refrain.
01:34RaynesHow was I supposed to know about the sexual harassment policy?
01:34RaynesBah.
01:34muhoocallen: https://www.refheap.com/paste/8028 here it is
01:34muhooand, yes, it's reproducible
01:35RaynesHoly god.
01:35muhoocallen: very much appreciate your time on this. i'm curious myself, but, man, i am finding myself with less and less time to work on clj stuff these days
01:35Raynesmuhoo: I should write a hard rock song about that project.clj
01:35muhooRaynes: oh yeah, any new mp3 files come out of Studio Raynes?
01:36RaynesNope, not yet. :p
01:36gtrakguano is a codename for guava?
01:36RaynesI was singing Fine By Me a moment ago, but didn't have a mic handy, muhoo.
01:36Raynesgtrak: Guano is poo.
01:36callenRaynes: I've written similar project.clj before.
01:37RaynesOf bats, certain birds, and seal, to be specific.
01:37muhooguano, guava, whatever, it was making my life miserable
01:37Raynescallen: https://github.com/geni/geni-gedcom/blob/develop/project.clj Longest one I've ever written.
01:37muhoocljs seems to accrete long project.clj's
01:37gtrakthat's a long project.clj?
01:37muhooall those options to lein-cljsbuild
01:38callenRaynes: use lein cljsbuild.
01:38RaynesI did once.
01:38callenmuhoo: doesn't break for me.
01:38RaynesBut then I realized I still hated cljs and moved on.
01:38callenRaynes: you'd rather use vanilla JS
01:38callen?
01:38gtrakours is 135 lines
01:38muhoocallen: really?
01:38RaynesYes. Not because I don't like cljs code, but because I don't like anything else about it.
01:38muhoocallen: try "lein check"
01:38muhooon that project.clj
01:39callenRaynes: please to explain?
01:39muhoooh, hmm. maybe my version of lein-pedantic is bad.
01:39callenmuhoo: yep, it's fine for me.
01:39muhoo[lein-pedantic "0.0.5" :exclusions [org.clojure/clojure]]
01:40callenmuhoo: I don't use lein-pedantic.
01:40Raynescallen: Cljs is a bizarre box of bizarre to me, probably because I'm also not very familiar with js. I can't figure out how to use it at all, and I don't really want to spend a lot of time trying, so I just write javascript when I need it because I save time and sanity that way. I can google things I don't know about javascript, but questions I ask about cljs usually result in vague answers that assume plenty of knowledge about js.
01:40callenI'll try it though.
01:40muhooah, well lein-pedantic is what is failing
01:40callenmuhoo: repro, h/o
01:41callenRaynes: that makes sense, but I and my frontend guy are fairly experienced with JS and would like to bump that part of world up a notch.
01:41callenpart of our world*
01:41callenRaynes: particularly since our apps tend to be JS heavy.
01:41Raynescallen: I do like the concept of cljs and think it is a nice thing, it's just that without any good documentation it is pretty useless to me.
01:41muhoocallen: this should repro: https://www.refheap.com/paste/8029
01:41RaynesIt's like how people feel about Clojure sometimes.
01:41RaynesRegarding documentation.
01:42callenmuhoo: I already got it to repro, that's what I was telling you. h/o
01:42muhoooh, ok
01:42callenRaynes: carthago delenda est: I still say a community wiki would help.
01:42muhoowell at least that refheap is now a complete minimum required to repro
01:42Raynescallen: A simple thing like "How would I write a library that I can distribute" resulted in a 30 minute long debate among cljsers in here that I eventually gave up on.
01:42callenmuhoo: got it to pass, I don't see any issues here.
01:42callenmuhoo: want the line that fixed it?
01:43muhoocallen: that'd be useful, yes
01:43callenRaynes: normally I'd recommend looking at something like jayq or fetch to determine something like that.
01:43aaelonyraynes: is refheap seachable? I'm sure there is a lot of good stuff in there...
01:43callenRaynes: since ibdknox has more cljs experience than most.
01:43callenmuhoo: [firealarm "0.1.2" :exclusions [[clj-stacktrace] commons-codec]]
01:43Raynesaaelony: Good question. You'd have to try with google.
01:43muhoocommons?
01:43aaelonyi've heard of that, but still...
01:44callenmuhoo: yes, all I did was read lein pedantic's output and follow the instructions.
01:44callenmuhoo: it broke twice, once with your original paste after adding lein-pedantic.
01:44Raynesaaelony: site:www.refheap.com seems to work somewhat.
01:44Raynesaaelony: I need to do some robots.txt rejiggering though to make it better.
01:44callenmuhoo: then I excluded clj-stacktrace, saw some stuff that was still breaking, then changed it one more time to produce that line. now lein-check passes.
01:44RaynesBecause it grabs raw links and stuff.
01:44callenmuhoo: but all of it came from just reading and understanding the output.
01:44Raynesaaelony: Note that the pagination on the latest pastes page is broken.
01:45muhoocallen: fascinating, thanks. but i did do what it said, exactly, and it gave me a different failure. hmm.
01:45callenmuhoo: I chose the simplest solution in each case that seemed to make the most sense. I don't know what to tell you.
01:45muhoocallen: it said nothing about commons
01:45callenmuhoo: you run into this again, ping me. I've been doing a lot of lein wrangling lately.
01:45muhooi got this error:
01:45muhooPlease use [firealarm "0.1.2" :exclusions [clj-stacktrace]] to get [clj-stacktrace "0.2.5"] or use [cljsbuild "0.2.10" :exclusions [clj-stacktrace]] to get [clj-stacktrace "0.2.4"].
01:45aaelonyraynes: would something solr be useful? say, https://github.com/mikejs/clojure-solr
01:45callenmuhoo: did for me.
01:45callenmuhoo: I'll paste the full project.clj
01:46Raynescallen: Also, it bothers me how long it took for the node.js targeting to work. It was utterly broken until I reported at least 6 issues with it. It bothered me that they included it at all with it that terribly broken.
01:46callenmuhoo: https://www.refheap.com/paste/8030
01:46muhooi'm more concerned with why lein-pedantic gave you a correct output, but didn't give me correct output
01:46callenRaynes: my main concern atm is sourcemaps.
01:46callenRaynes: that doesn't seem to be going anywhere still. That it doesn't bother them enough to fix deeply concerns me.
01:46callenmuhoo: look at the damn refheap and do a differential diagnosis.
01:47muhoocallen: i see that. what i don't see is where you got the idea to exclude commons-codec
01:47callenmuhoo: you will note that line 17 and adding lein-pedantic are the only things I changed.
01:47callenit *told* me.
01:47callenmuhoo: remove the commons-codec exclusion
01:47muhooit did *not* tell me
01:47callenrun lein check
01:47callenit'll bitch at you about it.
01:48callenchange line 17 to [firealarm "0.1.2" :exclusions [clj-stacktrace]]
01:48callenyou'll note that it specifically recommends the current version of line 17 towards the end of the output.
01:50muhooaha. there's also another matter. the failure i'm seeing after excluding clj-stacktrace is in a file which requires firealarm
01:50muhooit's probably something stupid in there. will look.
01:50muhoothanks
01:51callenmuhoo: np.
01:51callenRaynes: http://www.youtube.com/watch?v=GtvYkyAqNfU
01:51aduclojure metadata is so cool
01:51Raynescallen: You broke my macbook's speakers.
01:52callenRaynes: they were sacrificed to the blood god.
01:53muhoocallen: can i ask one more small favor?
01:53callenmuhoo: not unless russian hookers are involved.
01:53muhoocallen: what does "lein deps :tree" say to the project.clj you refheaped?
01:53muhoolike, is clj-stacktrace *anywhere* in there? at all?
01:53callenI like that muhoo can tell when I'm joking.
01:54callenmuhoo: $ lein deps :tree | grep stack
01:54callen [firealarm "0.1.2" :exclusions [[clj-stacktrace] [commons-codec]]]
01:54muhoocallen: yeah, but, notice something?
01:54muhooclj-stacktrace isn't included
01:54muhooso, any ns that needs clj-stacktrace, what will happen to it?
01:55muhoothis. is. my. problem.
01:55callenmuhoo: I don't know, do you want me to require it in my test project and see?
01:55muhoowell, no. here's what's confusing me.
01:55muhoocljsbuild says it requires clj-stacktrace.
01:55callenmuhoo: I don't mind helping you out, but if you don't ask for something specific, I'm going to get cranky. I haven't had my coffee yet.
01:55muhooin fact it says it requires 0.2.5
01:55muhoobut then, it doesn't actually require it
01:56callenmuhoo: submit a PR.
01:56muhooi'd do that if i knew even which project to do that on :-)
01:57callenRaynes: Ukrainian Black Metal
01:57muhooanyway, i'll go one better. i'll just explicitly require clj-stacktrace 0.2.5 in firealarm, which was my original hack, then problem will be solved.
01:57callenmuhoo: you should submit a PR to them asking them to upgrade.
01:58muhoofirealarm is *me*
01:58muhoowhich, is what i originally said, oh hell, i'll just do that.
01:58callenmuhoo: ah well. that's on you obviously.
01:59muhoothe yak now thorougly denuded, i'll call this one done :-)
01:59callenas thou wilt.
01:59muhoobe careful with those russian hookers
01:59callenmuhoo: always.
02:10dyresharklithuanian hookers are where it's at
02:10dyresharkthat is all
02:16Raynesdyreshark: And you know this by experience?
02:18callencareful, Raynes will call the cawps.
02:18dyresharkRaynes: one of my friends who grew up there tells many stories
02:18RaynesI bet.
02:19dyresharkcallen: will he backtrace my IP and call the cyber police?
02:21callendyreshark: CYBER SHERIFF
02:21dyresharkOSHIT
02:22callenI wonder what it's like to grow up in a country where it's the norm to lose your virginity to a hooker instead of your high school sweetheart.
02:22callenprobably depressing.
02:22muhoothis topic of discussion is interesting, because it reminds me so much more of #emacs than #clojure
02:23muhooanyway, my first cljs hello world now works. may god have mercy on my soul.
02:23callenmuhoo: I'm an #emacs refugee, if that explains anytihng.
02:23callenmuhoo: my dotfiles repo is legend.
02:23aaelony(drop topic)
02:23Raynesdyreshark: CONSEQUENCES WILL NEVER BE THE SAME
02:24callenI cackled.
02:24muhoothat actually explains quite a lot. and yes, i do believe your name is familiar to me, and i may have pinched some of your code for my .emacs.
02:25dyresharkdidn't she get on some huge reality TV show at some point?
02:25dyresharkfor that incident?
02:25Raynesdyreshark: She was on ABC news, IIRC.
02:25RaynesNot sure about a huge reality show.
02:25RaynesMaybe a huge reality *check*.
02:27callenmuhoo: the repo is bitemyapp on github, but yeah.
02:27callenRaynes: whodathunkit, antagonizing /b/ isn't a great idea.
02:28callena young couple tried to do the same, pictures of them having sex ended up getting sent to relatives, including some fairly religious ones.
02:28dyresharkRaynes: ah. i could've sworn somewhere i saw that she got on oprah for it
02:28dyresharki know she made an "i'm back, bitches" video
02:28RaynesEverybody got on Oprah.
02:28dyresharktrue
02:29p_lBees for everyone!
02:29n_bWhat did I just walk into
02:29p_lBees.
02:29callendyreshark: that is fantastically stupid.
02:30dyresharkcallen: are you even remotely surprised?
02:31callendyreshark: I suppose not, but I figured the parents might've gotten a hold over her. Guess not.
02:31Raynescallen: Did you... you know... see her parents?
02:31dyreshark^^^^
02:31RaynesThey weren't exactly model sane beings.
02:32callenI remember that.
02:32dyresharkprobable chain of events:
02:32dyreshark"NO MORE COMPUTER" -(1 week)> "ok you can use your computer with a webcam but be careful and backtrace anyone who talks to you funny"
02:32p_lcallen: I recall once seeing mention of organizing either a "gentleman friend of family" or father-assisted visit to high-class brothel (depending on gender) for one's kid :>
02:33callenp_l: in what context/culture?
02:33callendyreshark: I once got grounded for like 2 months man. Some kids get raised with no discipline at all.
02:34p_lcallen: western europe, and probably in france
02:34muhoon_b: it seems #clojure has gone temporarily #emacs.
02:34callenp_l: meh/ick.
02:34muhooyeah, guys, probably best to cut this out before more people flee.
02:34dyresharki remember getting grounded for 1.5 months because i accidentally my parents files once when i was 7. i also had to retype lots of budgeting stuff in excel
02:35dyresharkbecause that was among what was deleted :p
02:35callendyreshark: I think mine was probably about not having come home for a week or something.
02:35ivanhttps://github.com/cykl/infoqscraper
02:35callenI don't really remember, but I remember thinking it was hella stupid.
02:36dyresharkbut now getting grounded is more like "omg im grounded now i only have my iphone, laptop, tv, gaming console, etc. fml"
02:36p_lcallen: I sometimes wonder if it's not a better option than constantly bombarding with the message of "do not" but expecting it to not be followed and for random shit to happen
02:36dyresharkah
02:36callenivan: me. gusta.
02:36ivanI did not try it yet because CentOS and EPEL lack ffmpeg
02:36callenp_l: I prefer, "proper sex education about safety et al" but encourage they stick to people their own age and cohort.
02:37callenivan: makes me think of Knuth.
02:37p_lcallen: tends to get "authority" riled up
02:37callenivan: "I have only proven it correct, not tried it."
02:37callenp_l: not in my country.
02:37p_lanyway, EOT from me :)
02:37p_lcallen: lucky
02:37callenp_l: not really. Cheers.
02:39callenis there something like fabric/capistrano/saltstack for Clojure?
02:39callenand don't say pallet.
02:40callenvijaykiran: what do you use for deployment?
02:44nightfly_Are clojure's set operations optimized when working with sorted sets?
02:45callennightfly_: probably? it's PersistentTreeSet I think.
02:45callenhttps://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/PersistentTreeSet.java
02:46dyresharkso, question. if (eval '(* 3 2)) is 6, and (class (first '(* 3 2))) is symbol, then why is (eval '((symbol "*") 3 2)) 2? >.<
02:46vijaykirancallen: sorry - I don't understand - deployment of what ?
02:46callenvijaykiran: clojure web apps.
02:47callenI don't like pallet and I'm not sure what else to use. Most of my experience is with things like Fabric.
02:47vijaykirancallen: Ah, heroku for playing, and others - "just zip upload, lein deps .. blah blah " < shell script
02:47vijaykiranvery primitive
02:48callenvijaykiran: yeah I have a background in dev-ops, so that won't swing it.
02:49vijaykirancallen: I don't think there's more clojure-y option than pallet
02:50callenvijaykiran: it's not clojure-y ness that is the problem, it's what pallet assumes.
02:50callenvijaykiran: pallet assumes you bringing machines up and down via something like AWS
02:50callenwhat I need is "existing" machine deployment, configuration, compliance.
02:51callenI don't often find myself firing up 50 machine clusters on the fly.
02:52nightfly_Dang, looks like they aren't optimized at all. https://github.com/clojure/clojure/blob/master/src/clj/clojure/set.clj
02:52vijaykirancallen: in that case Fabric looks like a better tool for the job.
02:53callenvijaykiran: I don't really want to use Python and Fabric is deeply flawed in a lot of ways.
02:53vijaykirancallen: may be you can use clj-ssh and see what you can use in that
02:54callenI'm investigating it.
02:54callenthere's gantry too.
02:56vijaykirancallen: gantry is still using 1.2
03:05Raynescallen: I think https://github.com/mislav/git-deploy does what I want with regards to deploying with a git push like I do on Heroku. I really wish I had an actual Heroku-like thing running on my server though. Something that'd handle nginx and stuff.
03:06Raynesdyreshark: ##((symbol "*") 3 2)
03:06lazybot⇒ 2
03:07Raynesdyreshark: Looks like it is just returning the last thing.
03:09callenvijaykiran: yeah I was considering bringing it up to date.
03:09callenRaynes: fuckin' ruby.
03:09callenI'll use fabric before I do that.
03:09Raynescallen: There is also...
03:10Raynescallen: https://github.com/peterkeen/dokuen
03:10Raynescallen: But I don't trust dokuen at all because it was originally just a thing that only worked on OS X.
03:10callenstill Ruby.
03:10RaynesYou can probably understand why that makes no sense at all.
03:10RaynesYeah, I think the fact that it is Ruby is the least of my worries. You can write nice things in Ruby.
03:10callenRaynes: yes.
03:11callenRaynes: the point is that the moment Clojure is removed from consideration, I'll just use Fabric.
03:11callenwhich is python and I have a ton of experience in it.
03:11Raynescallen: I'm talking about my personal use for refheap.
03:11callenRaynes: ah okay.
03:11callenRaynes: did you move off heroku yet
03:11callen?
03:11RaynesAlso, dokuen's readme says it supports 'Mac and Ubuntu'
03:11RaynesIt supports... Ubuntu.
03:12callenRaynes: ...
03:12RaynesHow do you support Ubuntu?
03:12callenby supporting Debian and not knowing it I guess?
03:12RaynesAlso, no, haven't moved it off of refheap.
03:12callenusing Ubuntu specific repos?
03:12callenheroku?
03:12RaynesI said that backwards, yes.
03:12RaynesI haven't moved refheap off of it.
03:12callenI'm considering using Heroku just so I don't have to futz around.
03:13RaynesBut if I do, I'd probably use git-deploy.
03:13callenI think the moment I considered flipping the switch for a more expensive dyno, I'd go back to a nice SSD VPS or something though.
03:13RaynesYeah, I pay $20 a month just for them to let me use SSL. That's getting old.
03:14callenLOL
03:14callenI didn't know they charged for that.
03:14callenRaynes: do they still not allow you to use a custom domain with SSL?
03:14RaynesIt's actually AWS that charges for it.
03:14callenELB?
03:14RaynesThey've always allowed you to use a custom domain with ssl, iirc. In fact, that's what the charge is for. You can use piggyback ssl for free.
03:14RaynesWhatever. I don't understand those stupid amazon acronyms.
03:15callenah okay.
03:15callenI'm just trying to figure out which Amazon service is responsible for charging for it.
03:16noididyreshark, evaluation of (symbol "*") results in the symbol *, not the function *
03:16noididyreshark, you have to evaluate the symbol to get the function
03:17Raynescallen:
03:17Rayneshttp://www.activestate.com/stackato
03:17noidi##(eval '((symbol "*") 2 3))
03:17lazybotjava.lang.SecurityException: You tripped the alarm! eval is bad!
03:17noidiah, figures :)
03:17callenRaynes: k, I'll just use Fabric.
03:17callenor Heroku until it gets old, then Fabric.
03:17dyresharknoidi: i got it. i have to call (resolve (symbol "*"))
03:17dyresharkbut thanks :)
03:19noidiand the behavior of returning the second argument is caused by the fact that symbols are functions that look themselves up in the collection given as the first argument and the second argument is a not-found value
03:19noidi##('foo 1 :not-found)
03:19lazybot⇒ :not-found
03:19noidi##('foo {'foo :bar} :not-found)
03:19lazybot⇒ :bar
03:20dyresharkohh, that makes sense
03:20dyresharkcool
03:20Raynesnoidi: TIL
03:21noidiRaynes, yeah, that's kind of strange as I've never seen anyone use that feature :)
03:21noidibut it makes sense that symbols work like keywords
03:26Raynesdyreshark: Also, (eval `(~(symbol "*") 3 3))
03:26SgeoThat looks completely unsurprising
03:26dyresharkTIL you can use those outside of macros :p
03:26RaynesIndeed.
03:27Raynes&`(~(symbol "*") 3 3)
03:27lazybot⇒ (* 3 3)
03:27Raynesdyreshark: ^ Bask in the glory.
03:28dyresharkso, because this isn't legal code, what's the best way to do something like (def foo ([ [a] ] :bar) ([ [a b] ] :baz) ([ prior-destructures-failed ] :oh-noes))
03:30dyresharkjust to take a, b, etc as args themselves and use & more at the end?
03:30RaynesThose spaces between brackets make it almost completely unreadable to me.
03:30dyresharkmy apologies :p
03:30dyresharki can amend if you'd like
03:31RaynesI can't forgive you.
03:31dyresharkD:
03:31dyresharknuuuuuu
03:31RaynesI can't tell what you're trying to do here.
03:32callenokay this sucks.
03:32dyresharkdo different things essentially depending on the length of a passed in seq
03:32callenI need Korma's connection pooling (because fuck using c3p0 directly) but it's configured in a retarded fashion.
03:33noididyreshark, I think you'll need to use something like core.match for that
03:33RaynesYou won't be able to do that with arities, dyreshark.
03:33noidiClojure only does destructuring, not pattern matching
03:33RaynesUgh, I wouldn't use core.match just for that.
03:33SgeoThe "db" library that Racket has is ... literally writing SQL
03:34Raynes(case (count s) 1 foo 2 bar)
03:34RaynesIf you actually need the elements, on the other hand.
03:34RaynesI wish core.match was in Clojure itself.
03:34RaynesIt's silly that it isn't.
03:34RaynesPattern matching is the bee's knees.
03:34dyreshark^
03:35dyresharki'll look into it though. thanks
03:35SgeoWhat's wrong with just ... specifying the library in leiningen
03:35tufflaxI think Rich said "that's very bad" of pattern matching in Simple Made Easy :P
03:35noidiRaynes, I'd use core.match a lot more often, but just like you said, I don't like to add it as a dependency just to match one form
03:35SgeoAh
03:35RaynesSgeo: What he just said.
03:36SgeoSo no idea how they compare
03:37SgeoIncidentally, someone has started a racket-clojure project https://github.com/takikawa/racket-clojure
03:38Sgeohttps://github.com/takikawa/racket-clojure/blob/master/tests/test.rkt
03:39SgeoUsing the native Racket require rather than hobbling a Clojure-like one probably makes more sense, really
03:39SgeoIt shouldn't be an exact match, should it?
03:39SgeoThis lang does not use a custom reader. It probably should
03:40SgeoAlthough doing the paren stuff at a higher level does make sense, come to think of it
03:40RaynesIt doesn't look like it is trying to be serious.
03:41SgeoYeah, but it's a start
03:41SgeoDoes it do anything in a way that wouldn't make sense for a more serious attempt?
03:42SgeoWell, besides the little things that make it more Rackety
03:42RaynesI don't guess. I've never written a Clojure implementation before.
03:42SgeoI assume def and defn just expand to define. Meaning no vars for those, and no declare
03:43SgeoI have no idea what this ~and stuff is
03:44SgeoHmm, I think I see a bug
03:45SgeoThey redefine what function application means such that, if the function application uses [] it's not a function application but a vector
03:45SgeoSame with {}
03:46SgeoBut [some-thing-thats-normally-a-macro 1 2 3] is not a function application, and thus not processed by that mechanism
03:46SgeoMeaning it will try to do the macro rather than error
03:46Sgeo,[-> 1 2 3]
03:46clojurebot#<CompilerException java.lang.RuntimeException: Can't take value of a macro: #'clojure.core/->, compiling:(NO_SOURCE_PATH:0)>
03:47AnonnyHey Raynes, what pattern would you go with to create a bunch of links in laser from a seq containing urls and link titles?
03:47AnonnyI got it to work with a fn but it seems clunky.
03:47RaynesCould you show me what you've got?
03:47AnonnyOne sec
03:50Sgeo"Sgeo opened this issue in 2 minutes"
03:50SgeoI really need to fix my system clock
03:50Rayneslol
03:51RaynesAnonny: It doesn't have to actually work or anything, I just wanted a reference point. :p
03:52Anonnysimlified (fn [node] (for [file files] (let [node-content (first (:content node)) new-content [(-> node-content (assoc :attrs new-attrs)(assoc :content new-content))]] (assoc node :content new-content)))
03:53AnonnyParens horrible there.. but ignore that
03:53AnonnyIt works.
03:53AnonnyJust not pretty.
03:53RaynesAnonny: What are you selecting? A blank <a> tag in your html?
03:53AnonnyJust a random a tag, yea.
03:54AnonnyBTW, I should say... except for the fact that I have to write html, I'm LOVING laser.
03:55AnonnyAnd I'm a devout hiccuper
03:55AnonnySo nice job.. :)
03:56RaynesAnonny: That code you gave me doesn't actually make sense, does it? :p
03:57RaynesAlso, thanks! I love hearing that. <3
03:57AnonnyIt doesn't run, no.
03:57AnonnyBut it does on my real code
03:57Anonny:P
03:57RaynesRegarding the code, you appear to not be using 'file' at all, and referring to new-content in new-content.
03:57RaynesSo I'm not sure what it is doing.
03:57AnonnyYea, I cut out the long part in the middle that did that.
03:57AnonnyLemme just say what it's doing
04:02AnonnyI'm selecting an <a> node and then running a for loop on it for a group of files that I make links/titles out of. Inside the for loop I select the content of the <a> node, and inside of that content I then assoc {:href url} to :attrs and the title to :content. Finally re-assoc each of those newly created things back to the original <a>'s :content.
04:02AnonnyBloody hell, that's still not clear.
04:03RaynesThat's plenty clear.
04:03RaynesSec.
04:03RaynesOne thing that isn't clear is: are do you have a nested <a> here?
04:03AnonnyNo
04:03RaynesLike, it looks like your code would produce <a><a href..>..
04:03AnonnyJust the one, but I need to get into that original <a>'s content to get to it's attrs and content.
04:04AnonnyThat's the weird part.
04:04RaynesThat doesn't make sense.
04:04Anonnyone sec.
04:04Anonnylol
04:04RaynesWhat does your selector look like?
04:05RaynesIt looks like you're not selecting the <a>, but the tag above the <a>.
04:05AnonnyAh.. bloody hell.
04:05AnonnyNo wonder it's complicated
04:06AnonnyOkay, doesn't make sense because I'm actually selecting a li surrounded an <a>
04:06Anonnysurrounding*
04:07AnonnyI'm selecting something like <li=class><a></a></li>
04:07RaynesAnonny: Here is what you'd want to to replace an <a> tag with a bunch of <a> tags (if you actually select the <a> tag ;)): (laser/replace (for [file files] (let [link dosomethingwithfile title dosomethingwithfile] (node :a :attrs {:href link} :content title))))
04:08Raynes(laser/child-of (laser/class= "li's class") (laser/element= :a)) ; something like this would match the :a there.
04:08AnonnyWould it also replicate the li?
04:09RaynesNo, not as long as you select the actual <a> tag.
04:09AnonnyYea, that's why I did it the way I did.
04:09RaynesYou want to replicate the li tag too?
04:09AnonnyI wanted each one to be an <a> inside of the <li>
04:09RaynesOh, then you're not dumb at all.
04:10AnonnyGood to hear.
04:10AnonnyI wonder some times.
04:10RaynesWe can do that.
04:11Raynes(fn [node] (for [file files] (let [stuff with file to get title and link] (assoc node :content (laser/node :a :attrs {:href link} :content title))))
04:12RaynesSomething like that, Anonny?
04:12AnonnyThat looks about right.
04:13RaynesWell, it'd be like [(laser/node :a :attrs {:href link} :content title)], but you get the point.
04:13AnonnySo you'd just make an fake node in there instead of selecting for the original?
04:13AnonnyOr am I misunderstanding.
04:13RaynesWhat do you mean fake?
04:14AnonnyDoes node select a node?
04:14AnonnyOr mock one?
04:14Rayneslaser/node?
04:14Anonnyyea
04:14RaynesIt creates a node.
04:15RaynesIt's the same as doing {:type :element, :tag :a, :attrs {:href link} :content [title]}
04:15AnonnySo if your original html had an <a> already inside of the <li> you're ignoring it's data and replacing it, correct?
04:15RaynesYes.
04:15AnonnyWhich is what I meant about it being a fake node.
04:15RaynesIf you have a class or something on the old dummy <a> tag, your code would be what you'd want, unless you wanted to add the class in the (laser/node) call too.
04:16AnonnyI suppose that works better than what I have, though mine would work to preserve classes or such
04:16RaynesBut if your <a> tag is just a dummy tag sitting there, you can just replace it and not bother.
04:16Anonnyer
04:16Anonnyas you said.
04:16RaynesAnonny: Your code can be improved too.
04:16callenwhy can't I use any of the required symbols in my ns when I C-c M-n the namespace?
04:16AnonnyI have no doubt of that!
04:16AnonnyHow would you do it?
04:16Raynes(assoc node-content :attrs new-attrs :content new-content)
04:16callenI can only reference symbols that are def'd in my file.
04:17RaynesAnonny: You can assoc multiple keys, so no need for the (-> node-content ..) stuff./
04:17callenhrm, yeah, it's an in-ns. Okay. this is annoying.
04:17AnonnyDur.
04:17Anonny:d
04:17AnonnyThanks Raynes.. :)
04:18ejacksonmorning folks
04:18RaynesNo problem. If you need any other help, let me know. Also, be sure to report any nasty boogs.
04:18callenejackson: morning.
04:18AnonnyHaven't found any yet. Works... surprisingly... unsurprisingly.
04:18AnonnyNo gotchas.
04:19RaynesAnonny: Also, look for a new release later this morning/tomorrow with improved descendant-of, adjacent-to, and child-of combinators (among other things).
04:19AnonnyI will.
04:28jajuHello folks - I am running into a problem I need help with. I'm trying to define a class in Clojure that derives from another base class, and needs to over-ride one polymorphic method.
04:28ejacksonthere isn't inheritence in Types in clojure
04:29ejacksonbut, if your class is in Java then you may be in luck
04:29jajuI'm using gen-class - and whatever it provides to derive from a Java class.
04:29ejacksonok, that'll do it
04:29jajuYes - I'm trying to implement some replacement stuff for existing code - but in Clojure.
04:29ejacksonbut its really painful :
04:29jaju:)
04:30jajuYeah - the idea is to take this pain for a while but see how we can use more Clojure in our Java app!
04:30jajuI have an embedded nrepl server to connect to the app.
04:30ejacksonthat's always fun
04:30jajuAnd emacs to try and fix with a lot less pain.
04:31jajuYes, and now I'm in a situation I haven't been able to figure out the cause of.
04:31jajuThe method I override has 3 variants - one without any argument, and two with one argument of different types each.
04:31jajuI only am over-riding the argument-less method
04:42AnonnyRaynes: This isn't a bug, just a bit of complication I can imaging tripping somebody up. (laser/content "Lolol") is the same as (fn [node] (assoc node :content ["Lolol"])), not (fn [node] (assoc node :content "Lolol"])). The latter raises a "No matching clause" IllegalArgumentException.
04:44AnonnyRaynes: Don't really think you can do much about it, but maybe a better exception message would let people know what the problem is.
04:51AnonnyEr. The second one was supposed to be (fn [node] (assoc node :content "Lolol")) I don't think I should be allowed to talk this late at night.
05:19RaynesAnonny: Aye, that is Hickory exploding.
05:23RaynesAnonny: At least, I think it is. I need to get around to rewriting its hickory-to-html function. Hopefully I can add some better error handling when I do.
05:30SgeoIf Clojure had lightweight threads, would there be as much desire to have something like Lamina?
05:36jajuSgeo: How light is "lightweight"? There's always some overhead in maintaining more runtime state that needs to be processed as an overhead when switching context.
05:37thorwilis there a better way to get :roles out of a request map passed through Friend than (-> r :session :cemerick.friend/identity :authentications vals first :roles) ?
05:38thorwilthe map looks like this: {:session {:cemerick.friend/identity {:authentications {"admin" {:roles #{:tlog.data.account/admin}, :identity "admin", :username "admin"}}, :current "admin"}}}
05:40callenSgeo: I don't get the impression that threading on Clojure is bad or anything, most of the concurrency stuff is built on it.
05:43jajuthorwil: Relying on order in maps isn't a good idea unless you know it is ordered and you know which element you want.
05:44jajuthorwil: (If I read it right) I'm talking about the 'first' in your code
05:44jajuthorwil: A better way could be (get-in <your-map> [:session :cemerick.friend/identity :authentications "admin" :roles] nil) etc.
05:46thorwiljaju: i would like to not rely on the name "admin"
05:46thorwilthat is, get roles independent on the account name
05:46jajuSure - even I wasn't sure what you want, so I added the "etc." at the end. :)
05:47thorwilthe sole reason for the vals, first combo is that i get the map independent of its string-key
05:49svedubois(new topic) I would like to compute the md5 hash of an image. I have tried this, but it doesn't work:
05:49svedubois(org.itk.simple.HashImageFilter$HashFunction/MD5 image)
05:49sveduboisThe C++ API of this class is here:
05:49sveduboishttp://www.itk.org/SimpleITKDoxygen/html/classitk_1_1HashImageFilter.html
05:51Raynescallen: Have you seen this? http://news.ycombinator.com/item?id=4994208
05:51Raynescallen: The comments make me never want to get another of my blog posts on HN.
05:52RaynesGuy is just showing an example of macros in Clojure, and all the of the comments are like "Why do this in Clojure when it already has list comprehensions? Bluuuuh" and at least one calls him self-impressed.
05:52callenRaynes: I'm usually the negative one, but this is pretty ridiculous.
05:52callenwhy would you trash the guy over something he wasn't even trying to do?
05:52callenfucking wackos.
05:53callen>Also, this fucking hippy culture of "classes suck; functional programming rockz; lolz" need to die.
05:53callen>Someone's very happy to have authored Clojure's for special form.
05:53callensince when is for a special form?
05:53callenif you're going to nitpick at least do it correctly.
05:53callenRaynes: stop making me read HN, it makes me angry.
05:54callenI'm trying to figure out why I'm retarded and can't get this thing to work in Clojure.
05:54Raynescallen: Several people are complaining because his list comprehension macro isn't exactly the same as the 80 line version in clojure.core. This is ridiculous.
05:54ejackson yup, HN is filled with humans, no good ever comes of that.
05:54Raynesejackson: In my experience, it is filled with idiots. Not humans.
05:54RaynesNot human idiots, in fact.
05:54RaynesA special breed.
05:55ejacksonyou may be on to something there
05:55Raynescallen: There is a guy there complaining about the keyword directives in doseq, for, etc.
05:55RaynesHe makes me a little angry.
05:55sveduboisAny advice about what's wrong with (org.itk.simple.HashImageFilter$HashFunction/MD5 image) ?
05:55RaynesI enjoy a good (for [x y :let [foo (* x x)]] ..)
05:56thorwilRaynes: it will surely calm you to consider that the niveau on HN is already an improvement over slasshdot or most of reddit :>
05:56AnonnyOn the other hand, two of the top 30 on there right now are clojure related. And clojure articles get on the front an awful lot. Idiots or not there seems like there is a lot of clojure love on HN.
05:57tufflaxsvedubois: It looks like you are missing a `.`
05:58RaynesAnonny, callen: The '2012 in review' post on HN has two comments, one of which is that Clojure needs RoR clone, which is the utter antithesis of what Clojure needs.
05:58RaynesI hope Clojure never becomes the language that people *think* they need, but the one that they do need.
05:59callenRaynes: Clojure needing a RoR clone? jesus christ.
05:59RaynesNew people frequently think they want this.
05:59RaynesUntil they actually start using Compojure and a few libraries.
06:00RaynesAnd their face promptly melts.
06:00ejacksonyes, its a horrible balance: not popular enough you die out, too popular you die of idiots
06:02sveduboistufflax: Nope, I had tested with dots and doesn't work neither.
06:02algernonhn in adblock helps a lot, I found. if one's too weak to resist the temptation, adblock saves him, because laziness prevails and one will not remove the blocking then put it back on.
06:02tufflaxsvedubois: with dots? It is a call right?
06:03tufflaxsvedubois: I don't mean that you should replace $ or / with dots, but you need one dot in the beginning
06:03sveduboisIt is a static method MD5 of an image
06:04sveduboistufflax: I have tested this, and they don't work: (. org.itk.simple.HashImageFilter$HashFunction/MD5 caster)
06:04svedubois(.. org.itk.simple.HashImageFilter$HashFunction/MD5 caster)
06:04svedubois(org.itk.simple.HashImageFilter$HashFunction/MD5. caster)
06:04svedubois(org.itk.simple.HashImageFilter$HashFunction/MD5 caster)
06:04tufflaxsvedubois: hm, ok, maybe I'm wrong :P
06:05AnonnyRaynes: If Clojure is going to become a language people NEED we have to build libraries that make it REALLY fast to jump in and get a project off the ground. I'm not saying there needs to be a ROR clone, but tools (or lein templates) that take care boring/slow stuff is what will make people NEED the language.
06:05tufflaxWhat error do you get?
06:05RaynesAnonny: Luminus is a template that is doing just that.
06:05RaynesA RoR clone or other giant framework is just not the way to go about it.
06:06AnonnyRaynes: I know about Lum, yes. It is a step in the right direction. I think the lein plugin for lobos might be another one of those steps.
06:06sveduboistufflax: java.lang.IllegalArgumentException: No matching field found: image for class org.itk.simple.HashImageFilter$HashFunction
06:06svedubois(. org.itk.simple.HashImageFilter$HashFunction/MD5 image)
06:07tufflaxsvedubois: What is that function signature in java?
06:08tufflaxor, wait, that looks weird
06:08tufflaxfield image?
06:09AnonnyRaynes: It's things like that... simple command line stuff that makes import things happen... like project frameworks appear or databases build, that needs to be created. The clojure culture would be a lot more friendly to beginners, or just people who want to get things done, if creating lein plugins/templates was standard practice.
06:10AnonnyRaynes: IM-very questionable-O, at least.
06:11tufflaxsvedubois: is there javadoc of that class anywhere?
06:12sveduboistufflax: Yes there is a javadoc local generated in the building time. I have found this in the javadoc:
06:12sveduboisprotected HashImageFilter(long cPtr, boolean cMemoryOwn) {
06:12svedubois swigCMemOwn = cMemoryOwn;
06:12svedubois swigCPtr = cPtr;}
06:12sveduboispublic final static HashImageFilter.HashFunction MD5 = new HashImageFilter.HashFunction("MD5");
06:12sveduboisprivate static HashFunction[] swigValues = { SHA1, MD5 };
06:18callenI don't suppose anybody has implemented a session store in terms of Korma, have they?
06:25sveduboistufflax: Here is the javadoc of HashImageFilter: http://jsfiddle.net/svedubois/tA4tJ/
06:28tufflaxsvedubois: Hm, what about the HashFunction inner class? :P
06:28sveduboistufflax: And here the info about HashImageFilter.HashFunction: http://jsfiddle.net/svedubois/kgpLP/
06:31tufflaxStrange class, I don't understand how to use it. The HashImageFilter$HashFunctio/MD5 is a class not a method
06:33tufflaxsvedubois: maybe you should you setHashFunction of HashImageFilter, and then do something with it :P
06:33tufflaxs/should you/should use/
06:35sveduboistufflax: Something like that: (-> (org.itk.simple.HashImageFilter.)
06:35svedubois (.setHashFunction org.itk.simple.HashImageFilter$HashFunction/MD5)
06:35svedubois (.execute image))
06:36tufflaxyeah, but I'm just guessing. It doen't say what execute is supposed to do
06:37hyPiRionIt's probably better to use `doto` here
06:38hyPiRionNot sure if .setHashFunction returns the image filter or void, but if void, then doto woould work
06:38hyPiRionand -> wouldn't
06:39sveduboishyPiRion: With doto:
06:39svedubois(doto (org.itk.simple.HashImageFilter.)(.setHashFunction org.itk.simple.HashImageFilter$HashFunction/MD5)(.execute image))
06:39sveduboisI obtain no errors but I obtain only this:
06:39svedubois#<HashImageFilter itk::simple::HashImageFilter
06:39sveduboisHashFunction: MD5
06:40hyPiRionright. doto returns the first argument
06:40tufflaxhow is -> working?
06:41hyPiRion(-> (a) (b c) (d)) == (d (b (a) c))
06:41sveduboisWhat how I can compute the md5 hash of this image?
06:42hyPiRion,(macroexpand-1 '(-> a b c))
06:42clojurebot(clojure.core/-> (clojure.core/-> a b) c)
06:42sveduboistufflax: With ->
06:42svedubois(-> (org.itk.simple.HashImageFilter.)(.setHashFunction org.itk.simple.HashImageFilter$HashFunction/MD5)(.execute image))
06:42tufflaxI meant working for svedubois
06:42sveduboisI obtain this:
06:42hyPiRion,(require '[clojure.walk :as walk])
06:42clojurebotnil
06:42svedubois"3dcb8bce1c174f358608927212aa4cf7"
06:42hyPiRion,(walk/macroexpand-all '(-> a b c))
06:42clojurebot(c (b a))
06:42hyPiRion,(walk/macroexpand-all '(-> a (b e f) c))
06:42clojurebot(c (b a e f))
06:42sveduboisWith no errors
06:42tufflaxsvedubois: that looks about right, svedubois no?
06:43sveduboisYes thanks, it works
06:43tufflaxok ;)
06:44sveduboisAnyway I don't understand the difference between -> and doto, when I have to use each one ?
06:45tufflaxdoto returns the first agument (the following forms are for side-effects), while -> turns (a (b (c d))) into (-> d c b a)
06:47tufflaxsvedubois: this is a nice site for documentation, sadly it does not include all the new functions in 1.4 and 1.5
06:47tufflaxhttp://clojuredocs.org/quickref/varsonly/Clojure%20Core
07:23ejacksonotfrom: 'grats on the coverage :)
07:24otfromejackson: thanks!
07:30Raynescallen: Man. I need to stop playing Half Life. I've been quick saving so much that I just tried to hit F6 to save a file in Emacs.
07:31wingyRaynes: you should start with StarCraft2
08:18callencemerick: shoreleave-remote-ring, how stable is it?
08:39cemerickcallen: how do you mean?
08:39cemerickit works as it should
08:39cemerickbut, it's, what, 0.0.2?
08:40cemerickThat said, it's not like the API is large, and the domain isn't complicated, so any changes probably won't be earth-shattering
08:51bprI'm getting intermittent "Namespace not found" from nrepl.el. Does anyone know what some possible causes for that might be?
08:54xeqibpr: I get that sometimes when I kill the *nrepl-server* and re nrepl-jack-in
08:54bprAh. In my current case, it's being caused by a compile error in a required namespace
08:54bpryes, i've done that :]
08:54bprthe issue was no information about the compile error was getting returned to me
08:55bpri had to run: lein repl and connect to it and then the exception was printed to the terminal running the lein process
08:56bproddly, (pst *e) in the nrepl.el doesn't print anything, but running that in the terminal repl works (ie. prints the compiler error)
09:00callencemerick: I'm having an issue where _fetch is 404'ing
09:01callenwell now it's throwing a null pointer exception.
09:07bpri think nrepl.el might not be shutting down properly, because all is fine after restarting emacs
09:10callencemerick: ^{:remote-name :validations/blah} is breaking things.
09:16justincampbell<-- clojure noob, what am i doing wrong? https://gist.github.com/996d5207b527c6a25d59
09:16justincampbelli get a Long cannot be cast to IFn error
09:16joegallo(n)
09:16joegalloYou are calling (4), for instance.
09:17joegallo4 is not a function.
09:17joegalloYou can't call it.
09:17joegalloYou want n, not (n).
09:17justincampbellahh
09:17justincampbellthanks!
09:17justincampbellthe n looked all naked and alone without the parens
09:18SgeoThere's a Haskell bot that used to have numbers be functions
09:18bprjustincampbell: what that error is saying is that Long isn't a function (ie. IFn)
09:18SgeoBecause it considered all functions from a number to a number to themselves be numbers
09:18borkdudenumbers don't implement IFn? ridiculous ;)
09:18SgeoSo a regular number like 4 would ignore its argument and return 4
09:18SgeoThe arrangement meant you could do something like (sin + cos) 5
09:18SgeoWhich would be the same as sin 5 + cos 5
09:19justincampbellmy ruby-mind was just assuming i could infinitely put parentheses anywhere i want
09:19justincampbellbut it makes sense that it evals the contents
09:19SgeoProbably confused a lot of newbies though, especially since that's not how Haskell is set up by default
09:19borkdudejustincampbell you can put indefinite , and spaces though
09:19justincampbellspeaking of whitespace
09:20justincampbellusing vim and on a newline, it indents to the first argument/or something of the previous line
09:20SgeoDo note that there are some whitespacing possibilities that we'd get mad at
09:20justincampbellhttp://cl.ly/image/2d0G2X0e2x2v
09:20justincampbellif prefer the former but its doing the later
09:20SgeoSince indentation is more critical than with other languages for reading code
09:20justincampbelli'd* prefer
09:21borkdudeI prefer to indent with , instead of spaces… so much clearer
09:21justincampbellany vim users have a fix? im using vimclojure already
09:21borkdude(defn foo [x]
09:21borkdude,,(+ x 10))
09:21clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: x in this context, compiling:(NO_SOURCE_PATH:0)>
09:22hugodcallen: pallet can work with existing machines
09:23hugodsee the node-list provider, and http://palletops.com/doc/how-tos/using-pallet-with-existing-servers/
09:27callenhugod: not really worth it when compared to fabric in terms of complexity.
10:03Raynescallen: I can't sleep.
10:03callenRaynes: me either.
10:03ejacksonRaynes: I think this may be a trained behaviour... :P
10:03RaynesLife is hard.
10:03callenRaynes: seems so.
10:04Raynestpope: You should write a pure-viml version of refheap.vim.
10:15RaynesHe probably isn't going to take my bait.
10:15RaynesWhat do you bait viml authors with?
10:15RaynesRat tails?
10:17jocrauIn ClojureScript: Is there a reason why (type …) doesn't take (with-meta something {:type MyType}) into account?
10:17RaynesReally? That sounds bugish, but too much of a big deal to be something that was overlooked.
10:17RaynesSo I'm curious now too.
10:19ejacksonhehe
10:19jocrau:-)
10:19Raynesejackson: You know, your Clojure machine learning talk didn't have much Clojure in it. It just occurred to me.
10:19ejacksonAs a superhero dnolen would have to be "The Unifier"
10:20ejacksonRaynes: bollocks to that ! I have a 20minute coding session !
10:20RaynesI remember considering bringing you some of my spare parentheses, but didn't to look like Kanye West.
10:20Raynesdidn't want*
10:20ejacksonlol
10:21ejacksonson, i'd a whooped you right back into your seat !
10:21RaynesI'd have been too you saying "PUT YA DUKES UP, BOY" in your fantastic accent to fight.
10:21Raynestoo distracted
10:22ejacksonand it was glorious information theory, not slutty machine learning...
10:22RaynesWow, I'm hemorrhaging words today.
10:23ejacksonmy my, the youth are restless in here today
10:23RaynesI'll be 19 in a month, old man.
10:24ejacksonenjoy it while it lasts....
10:24RaynesDid you just tell me to go get plastered?
10:24ejacksonsoon you'll be spitting out teeth, and forgetting your words... oh wait !
10:24`fogus19 is practically one foot in the grave
10:24Raynes`fogus: Yeah, my knees are starting to get weak.
10:25jocrauI am over 40 yrs old, so no jokes about feet in graves here, ok? ;-)
10:25ejacksoni wont tell you how old I am Raynes, you'd suffer an overflow
10:26RaynesI bow to your elder glory, sirs.
10:27ejacksonso when's the LA move ?
10:27RaynesEarly February.
10:27ohpauleezejackson is older than time itself - he's been here since the birth of matter (he is a timelord)
10:28ejacksonbut I moisturise generously, so it doesn't show
10:28ohpauleezhaha
10:28justincampbellso if im testing a function that returns a function
10:28justincampbellwith speclj
10:28justincampbellid like to test the function it returns
10:28ohpauleezfogus! It's good to see you in here!
10:28ejacksonRaynes: enjoy, what an exciting time !
10:28justincampbelland the describe "original-function" seems not right for that
10:29Raynesejackson: http://www.youtube.com/watch?v=kXiY1_H7NkQ
10:29ejacksonI *love* that one !
10:29RaynesI recalled it when you said you moisturize.
10:29justincampbelli guess i could nest describes
10:30ejacksonwhen they wheel me up, all translucent like, to speak at Conj 3012, you'll be lucky to be looking so goooood.
10:30ohpauleezhahaha
10:31RaynesYeah, I'll only need one guy to moisturize me at that point.
10:31ejacksoneeeew
10:31RaynesI bet poor justincampbell is thinking "Wtf, they're making jokes about being old and I"m here with a real problem…"
10:32RaynesTIL that speclj is a thing.
10:32ejacksonme too
10:33RaynesThe TDD part scares me.
10:33RaynesIt is well known that I cannot think far enough ahead to do TDD>
10:33RaynesFurthermore, I am fascinated at the variety of words these libraries use to say "this thing should be true". is, should, expect, etc
10:34justincampbellRaynes: lol
10:34RaynesI'm going to write one of these libs and alias it to all of is, should, will, can, hopefully, expect, maybe, better, promise, and ensure.
10:35algernonRaynes: the trick is to think backwards. Imagine you're a logic program, driven by webyrd, ran backwards. There. TDD.
10:35RaynesSpeclj looks nice.
10:36RaynesIt's really just a testing thing, the header shouldn't imply it is only good for TDD/BDD.
10:36RaynesIt'd be better just saying that "btw, it's excellent for tdd"
10:36Raynes"and it won't give you an std"
10:36Raynesetc
10:37justincampbellRaynes: its just familiar to me coming from ruby
10:37justincampbellalthough speclj is a little weird because in rspec you describe classes and methods, and there is value from that because you have a lazily evaluated subject that you can reference
10:37RaynesThis is by far the best website I've seen for a library.
10:38justincampbellbut in speclj it only seems to make your test output pretty
10:39RaynesI like it.
10:39RaynesIt's a thousand times simpler than midje.
10:40RaynesI use midje in one project, but never in any others because midje was confusing as hell.
10:40justincampbellive heard of midje, isnt the advantage of midje stubbing?
10:41ejacksoni still just use clojure.test. Luddite.
10:41Raynes*shrug*
11:39beffbernardWhy is it that rest and cons always return sequences?
11:39AimHereWhat should they return?
11:39beffbernard,(class (reset [1 2 3 4]))
11:39ohpauleezbeffbernard: Are you using cons when you really mean to be using conj?
11:39clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: reset in this context, compiling:(NO_SOURCE_PATH:0)>
11:40AimHereAlso, cons returns a 'cons'
11:40S11001001beffbernard: because overspecification of the results of the API limits the potential for future improvements
11:40beffbernardohpauleez: I was just asking out of curiosity
11:40ohpauleezahh gotcha
11:41RaynesI'd venture to guess that one reason is that cons is only fast on lists, right?
11:41S11001001Raynes: cons is just Cons.
11:41RaynesBlew my mind.
11:42AimHereCons is probably reasonably fast on sets
11:42S11001001its big benefit is it doesn't force the seq you give it
11:42S11001001,(cons 42 #{1,2,3})
11:42clojurebot(42 1 2 3)
11:43AimHere,(cons 3 #{1 2 3})
11:43clojurebot(3 1 2 3)
11:43AimHereOkay, might not be that fast
11:43S11001001AimHere: it's entirely fast
11:43S11001001since it just constructs a Cons
11:43S11001001maybe it seqs non-seqs
11:44AimHere,(car (cons 3 #{1 2 3}))
11:44clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: car in this context, compiling:(NO_SOURCE_PATH:0)>
11:44S11001001,(cons 1 "hi")
11:44clojurebot(1 \h \i)
11:44AimHere,(first (cons 3 #{1 2 3}))
11:44clojurebot3
11:44AimHere,(rest (cons 3 #{1 2 3}))
11:44clojurebot(1 2 3)
11:44AimHereSeems to convert the set to a list though
11:44S11001001AimHere: I doubt it
11:44beffbernard,(class (rest (cons 3 #{ 1 2 3})))
11:44clojurebotclojure.lang.APersistentMap$KeySeq
11:45AimHere,(rest #{1 2 3})
11:45clojurebot(2 3)
11:45metellus,(rest (cons 4 #{1 2 3}))
11:45clojurebot(1 2 3)
11:46TimMcAimHere: You're geting back a seq view over that set, so of couse it prints as a seq.
11:47AimHereSo I see
11:47beffbernardIs there an equivalent 'conj' for rest?
11:47RaynesI wish I could get a seq view of TimMc.
11:47metellus,(seq "TimMc")
11:47clojurebot(\T \i \m \M \c)
12:02TimMcRaynes: You already are.
12:19hyPiRionbeffbernard: 'conj' for rest?
12:19TimMcs/are/have one/ ;; dammit Raynes your word-fail is infectious
12:20llasramhyPiRion, beffbernard: `pop` maybe?
12:22hyPiRionpop is kind of like rest, but without the seq in between
12:22hyPiRion,(pop '(1 2 3))
12:22clojurebot(2 3)
12:22hyPiRion,(pop [1 2 3]) ; [1 2]
12:22clojurebot[1 2]
12:22hyPiRioncons always add in front, so that's kind of like 'conj' for rest, though I'm not entirely sure what he asked for
12:23hyPiRion(that's why I asked in the first place :)
12:52bosieany brazilians in here?
13:04callenbosie: god I hope not.
13:04bosiecallen: huh?
13:04callenbosie: que?
13:04bosiecallen: i see, guess you are brazilian? ;)
13:05callenbosie: HUE HUE HUE HUE HUE no.
13:05bosiek
13:05bawrstereotypes
13:05bawrstereotypes everywhere
13:05callenI don't see any
13:11nDuffWhen using autocompletion in nrepl.el, a bunch of newlines get injected into the output of the next command I run. Anyone familiar with this issue / know where it might be coming from?
13:17ghengisis there a pure-clojure implementation of a BlockingQueue anywhere? I've got this library that's very close to pure-clojure except for this LinkedBlockingQueue
13:17ghengisseems like it'd be a tricky thing to write correctly
13:18technomancywhy do you want it to be pure clojure?
13:18noidighengis, I've got the impression that using java.util.concurrent stuff is the way to go in Clojure
13:18technomancyjava's LinkedBlockingQueue is very good
13:21ghengisnot really a great reason.. I've trying to make a general-purpose api, and if i wanted it to be useful in clojurescript or some non-java clojure, it'd be nice to avoid java dependencies
13:22technomancyany code that uses queues is probably going to depend on concurrency semantics in some way, making it unsuitable for a JS runtime
13:24lucianyou can just use an array for the JS version
13:24lucianor a clojure list
13:24ghengisyeah, good points.. i'll just leave it in there
13:28ghengiscgranger had a clever pipes implementation on his blog that seemed close to what I was trying to do.. using promises to provide the blocking instead of polling
13:29technomancymost of what makes it difficult to implement a proper queue on the JVM (actual (or even fake) concurrency) simply isn't possible in JS
13:31ghengisnow i'm just trying to figure out how it could be done in clojure
13:32ghengisso there's not a lot of code reuse between clojurescript and clojure, i take it?
13:32FoxboronSo, my new years resolution is too learn Clojure well enough to use it for hobby projects. Lets hope this goes well ^^
13:33ghengisgood luck! that was my 2012 resolution and it was a fun year :)
13:34FoxboronLets hope my mind can handle functional programming and LISP.
13:35alexbaranoskyFoxboron you're in the right place; lots of people to learn from on this IRC channel
13:35ghengisit took 4 or 5 months for my brain to switch
13:35Foxboronalexbaranosky, been lurking the past months and bought books. So well prepared, just had problems balancing code time and school :P
13:38Foxboronbtw, anyone running a emacs and clojure setup on windows? attempted getting one up but i encounter a few problems here and there as most guides assume you sit on a *unix box.
13:39ihodestechnomancy: hey phil! i was wondering if you may know of an updated guide to getting a clojure app up and running on Heroku? i'm having major trouble using the DB on my app (my local pg DB works fine, but if i try to use the Heroku DB (locally or on heroku), i cannot connect to it.)
13:40ihodesFoxboron: not to be the guy that says "use something else", because people definitely have success using emacs with clojure on windows (it's doable!), but if it's possible and okay for you to try using Linux (maybe in a VM), you may find developing a bit easier (just because of those assumptions people make when they write blog posts, etc). but hopefully someone else here can help you!
13:41technomancyihodes: no known issues afaik; if you pm me with the app name I can take a look.
13:42justincampbelldoes it make sense to compare functions in tests?
13:42ihodestechnomancy: i'm sure it's an issue with my app in particular, so i don't want to waste your time! thanks, though :) i may do a SO post at some point…it's been a bit of a mystery to me
13:42justincampbellfor instance, i have a function that returns a function, and i have another function that returns a sequence of those functions * n
13:42technomancyihodes: no worries; it's my day job.
13:43justincampbelli want to write a test that its returning what i asked it to
13:43justincampbellcan you compare functions?
13:43AimHere,(compare + -)
13:43clojurebot#<ClassCastException java.lang.ClassCastException: clojure.core$_PLUS_ cannot be cast to java.lang.Comparable>
13:44justincampbell,(compare (fn [] true) (fn [] true))
13:44clojurebot#<ClassCastException java.lang.ClassCastException: sandbox$eval53$fn__54 cannot be cast to java.lang.Comparable>
13:44ihodestechnomany: haha, alright. thank you very much (messaging)
13:44amalloyjustincampbell: no
13:44amalloyi mean, you can compare them for pointer-equality
13:44justincampbellamalloy: for a test, whats the best way to test the return value if the return value is a function?
13:44AimHereYou could probably write some sort of function that compares the outputs given fixed inputs
13:44justincampbellcall the function returned?
13:45amalloywow, did clojurebot get restarted recently? eval53$fn__54 are really low numbers
13:45amalloyjustincampbell: indeed. verify that the function works as expected
13:45hiredmanthe oom killer kills clojurebot sometimes, and I have it launched in shell while loop
13:46AimHereIf you're doing this in clojurescript, there's probably a way of comparing the resulting javascript functions as strings
13:47amalloyoh hiredman, did you notice my feature request for some kind of in-message clojurebot notifier, like so i could mention ~~flatten now and have him spout the factoid?
13:48Foxboronihodes, haha. I know, i am in the process of getting a Zenbook and putting Arch on it.
13:48hiredmanamalloy: I'll think about it, I would prefer some kind of more automatic pos tagging, but it would require running every line through it and responding to every line, which I doubt people would like
13:49amalloypos?
13:49clojurebot(def transpose (partial apply map vector))
13:49hiredmanparts of speech
13:49nDuffHrm. I get the distinct feeling that there's something in the standard library I should be using to make this simpler; I'm trying to reduce a series of [key set] 2-tuples into a map with a union for each key, and my current implementation is as such: (reduce (fn [x y] (let [[y-k y-v] y] (update-in x [y-k] clojure.set/union y-v))) {} input-key-set-sequence)
13:49ihodesFoxboron: awesome! I'm jealous. definitely come back here if you have q's about Arch—i haven't run it on my own box, but lots of people here have iirc, and i've run it on my linode for 5 years now haha
13:50ihodesFoxboron: it's a challenge in itself setting it up, esp on your own box, but i guess it'll be more doable with a zenbook :) that's awesome
13:51amalloynDuff: (apply merge-with union (for [[k s] things] {k s}))?
13:52amalloyor merge-with into, if that's your preference
13:53nDuffamalloy: (merge-with clojure.set/union input-key-set-sequence) is perfect; thanks!
13:54amalloyuhhhhh, really? it shouldn't work without the two changes necessary to turn your code into mine
13:54Foxboronihodes, i have so far failed 4-5-6 times on a VM ;P So i am not looking forward to it, so to speak.
13:54nDuff*shrug* -- does work in practice. Perhaps I misrepresented something in the question?
13:55technomancyFoxboron: arch is kind of finicky. if you're having trouble with it why not use something that isn't designed to be hard to set up?
13:55amalloyapparently. because, say, ##(merge-with clojure.set/union '([a #{b c}] [a #{d e}])) shouldn't work afaik
13:56lazybot⇒ ([a #{c b}] [a #{d e}])
13:56amalloywhich is the structure you alleged to have
13:56Foxborontechnomancy, whats the fun in that?
13:56ihodesFoxboron: oh boy haha, you may want to try something else to start :) but if you really want to do arch, their irc is great
13:57ihodesFoxboron: and i'm sure you've checked, but they also have a superb wiki
13:57Foxboronihodes, been using Ubuntu for a few years on other PC's etc. So yeah, i think the guide is failing somewhere or i am not reading between the lines.
13:57Foxboronihodes, i did follow the wiki btw.
14:03DaReaper5Hi is there any way o pass a list of args to a macro?
14:03DaReaper5to*
14:03DaReaper5while keeping it lazy
14:04justincampbellis there a better way of doing option args than [arg1 & arg2] … (or (first arg2) "default")
14:04justincampbelldefault* args
14:05Raynes(defn foo ([arg1] (foo arg1 "default")) ([arg1 arg2] dostuff)))
14:05justincampbellermagerd
14:05justincampbellso cool
14:05justincampbellthanks! Raynes
14:05RaynesI am to please.
14:06Raynesaim
14:06RaynesDefinitely aim.
14:08DaReaper5Is there any way to pass arguments lazily to a function (which expects lazy args)
14:08DaReaper5ex: (fields :client.luid) want: (apply fields `(client.luid))
14:09DaReaper5but apply is not lazy
14:09amalloyyes it is
14:09DaReaper5... well why is it trying to eval client.luid gah
14:09amalloy&(apply (fn [& args] (first args)) (range))
14:09lazybot⇒ 0
14:09DaReaper5"client.luid" does not exist
14:10llasramDaReaper5: I think you're confusing lazy vs. strict evaluation with macro-expansion time vs evaluation time
14:13DaReaper5llasram no i just mixed up apply, i realized what i did. Now i have a different issue/question
14:13technomancyhttps://www.ioncannon.net/projects/code2012/
14:13ppppaulis it easy to get pretty printing for failing test assertions?
14:14DaReaper5i need to splice into a list without unquoting (that might be a weird condition but I cant surround the call with a `)
14:14technomancyclojure and haskell neck and neck
14:15DaReaper5if i do use a ` i need to either unquote it or eval
14:15llasramDaReaper5: Example?
14:15ppppaultechnomancy, that page doesn't work for me (console error "d3 is not defined")
14:15TimMcDaReaper5: I get the feeling you're asking for a chainsaw so that you can get into your front door, when all you really need is a locksmith.
14:15ppppaulinfo.js line 6
14:16DaReaper5TimMC probably
14:16DaReaper5i am fighting with korma lol
14:16callenoh yeah, macros on top of korma. That'll end well.
14:17DaReaper5works (fields :address.state), but what if i want to pass a list of fields to ... "fields" (instead of defining them statically)
14:17ihodesDaReaper: maybe avoid korma (cc technomancy)
14:17technomancycallen: well macros are infectious. it's hard to abstract over something that over-uses macros without resorting to macros yourself.
14:17ihodesDaReaper5: though if it's working for you, stick to it
14:17DaReaper5ihodes, cant
14:17ihodesDaReaper5: I
14:17ihodesDaReaper5: i've lost about 5 hours to korma :(
14:17DaReaper5ya it is mostly working for me
14:18DaReaper5i think my issue is with clojure knowledge
14:18ihodesi envy you.
14:19DaReaper5http://pastebin.com/dqEtu0F3
14:19DaReaper5that works but i need to build the list of fields
14:19DaReaper5like this:
14:20DaReaper5http://pastebin.com/BKqMFnQH
14:21DaReaper5that works if the condition is true
14:21DaReaper5null error if false
14:21ziltiDaReaper5: (defmacro fieldlist [ent lst] `(fields ~ent ~@lst)) ?
14:22DaReaper5zilti i cant surround fields with `
14:22DaReaper5error is thrown
14:22ziltiWeird stuff happening
14:23llasramDaReaper5: Your macro is producing some sort of quoted output, yes?
14:23DaReaper5clojure.lang.ArityException: Wrong number of args (2) passed to: core$seq
14:23Rich_MorinIs there a consensus regarding the terms clojurist, clojurista, etc?
14:23llasram(defmacro macro-name [args...] `(stuff))
14:23TimMcRich_Morin: Conjurer. :-P
14:23gfredericks&((fn works-anyways [] {these symbols aren't defined anywhere man} :still-works))
14:23lazybot⇒ :still-works
14:23DaReaper5llasram i am assuming that fields is a macro. It is from korma and it expects lazy fields
14:24llasramAgain with that term "lazy"
14:25DaReaper5llasram ya your right that is not the best term for my scenario
14:25ziltiDaReaper5: Fields is a function
14:25ziltihttps://github.com/korma/Korma/blob/master/src/korma/core.clj#L152
14:26llasramDaReaper5: So it looks like the problem is really that you can't call `fields` with no fields
14:26DaReaper5if i used apply then i get this: org.postgresql.util.PSQLException: ERROR: relation "client.luid" does not exist|
14:27DaReaper5llasram i know i cant but that error still happens if i have an additional static field
14:27llasramDaReaper5: If you just add `apply` to the snippet you have, then the `->` macro will thread the previous expressions between `apply` and `fields`
14:28ziltiDaReaper: ##(eval (flatten (cons '(identity) [1 2 3])))
14:28lazybotjava.lang.SecurityException: You tripped the alarm! eval is bad!
14:28ziltiwarg. But that'll work. Although it's a pretty ugly hack.
14:28llasramWhat' no
14:28llasramThere's no need to eval or unquote or anything
14:29DaReaper5llasram so you are saying that my use of apply within -> is causing an issue (due to the other things before the apply and after the ->)
14:29llasramDaReaper5: If I understand you correctly, then yes
14:29DaReaper5how would i best call apply in my scenario?
14:30DaReaper5or should i do it outside of the ->
14:30llasram(let [q (select* client)] (apply fields q whatever sequence))
14:30llasramOr maybe even (-> (select* client) (#(apply fields %&) whatever-sequence))
14:30llasramalthough I'm not a fan of the latter
14:31llasramOH, and it doesn't work
14:31llasramheh
14:31llasramYou get the idea though
14:38DaReaper5llasram sorry i still cant get it to work. Why does that one nto work?
14:38DaReaper5not*
14:39llasramHmm? Oh, because ##((juxt #(apply + %&) +) 2 2)
14:39lazybot⇒ [4 4]
14:41llasramDaReaper5: Can you refheap/pastie a whole function showing what you have so far?
14:44DaReaper5works: http://pastebin.com/dqEtu0F3, does not work when false: http://pastebin.com/index/dqEtu0F3, does not work: http://pastebin.com/09zDB4XA
14:45llasramThe second link is the same as the first
14:46DaReaper5http://pastebin.com/BKqMFnQH sorry
14:47thorwilis there a variant of and that will return nil as soon as it sees a false?
14:48bawruhh, doesn't and already do that?
14:48amalloyindeed
14:49thorwilmy repl claims it uses false, not nil
14:49nDuffDaReaper5: Could you consider using something with fewer ads than pastebin.com? We tend to be fans of refheap here.
14:49gfredericks&(and false false false)
14:49lazybot⇒ false
14:49amalloythorwil: it returns the first falsey thing it sees
14:49gfredericks&(or (and false false false) nil)
14:49lazybot⇒ nil
14:49DaReaper5nDuff sure, bookmarked
14:50amalloyhah, very good gfredericks
14:50nDuff&[(and nil false) (and false nil)]
14:50lazybot⇒ [nil false]
14:50llasramDaReaper5: I'm sorry, but I think you have some misunderstanding which exceeds my level of #clojure volunteerism to untangle. Hopefully someone else can help you out
14:50gfredericks(defmacro orandnil [& args] `(or (and ~@args) nil))
14:50bawrthorwil: well, false and nil are both falsy
14:50bawrthorwil: but anyway
14:50bawrthorwil: you're perhaps better off explaining what you're doing ;)
14:51DaReaper5llasram probably but im getting closer (#(apply fields %&) :client.luid) works
14:51thorwilbawr: it's for a conditional into
14:51thorwilinto doesn't like to see false
14:51llasramDaReaper5: Yeah, but that's exactly the same as just (fields :client.luid)
14:51bawraah
14:51justincampbellany vim users have refactoring tips/tricks?
14:51DaReaper5llasram exactly im wondering what the usage is to pass a list
14:51justincampbellid like to visual select the outer form with a keystroke
14:52justincampbelland hopefully refactor it to a defn with a given name
14:52llasramDaReaper5: Ok, I'll bite one more time. What are you actually trying to get to happen, at a higher level? Is the function not supposed to call `fields` at all depending on the value of your condition?
14:52DaReaper5like: (#(apply fields %1) `(:client.luid) )
14:52DaReaper5llasram i just need to pass it a list of arguments
14:53llasramDaReaper5: Where is there a list? All the examples you've shown so far just have the single `:client.luid`. That's why I asked for a full function
14:53amalloygfredericks: maybe you could rearrange the letters a bit and call it inland-or
14:53thorwilgfredericks: but of course! ty
14:53DaReaper5here is a simple one: (#(apply fields %1) `(:client.luid :client.luid) )
14:54DaReaper5that wont break to mention the same field twice
14:54DaReaper5(it just works without defining a bunch of other stuff
14:54DaReaper5)
14:54DaReaper5hmm one second
14:56DaReaper5works: (#(apply fields %1 %2) (list :client.luid :client.luid :client.luid) )
14:57DaReaper5only works because %2 is mentioned
14:57DaReaper5is that due to the "->" and "(select* client)"
14:57llasramYes
14:57DaReaper5(sorry half thinking out loud here)
14:58DaReaper5llasram so if ther was another thing above/before it %3 has to be defined
14:58DaReaper5... how do i directly pass the list wihtout knowing its place/ordering?
14:59llasramDaReaper5: I'm getting the impression that you don't have an entirely solid grasp of what `->` is doing. I think that if you look into that a bit further, you'll be able to sort it out
15:00llasramAnyway, I need to shift back to focusing mostly on work. Best of luck!
15:01DaReaper5-> recursivly add defines arguments
15:01gfredericksamalloy: that sounds practically mandatory
15:02DaReaper5-> recursivly defines arguments **
15:02DaReaper5llasram thanks btw~!!
15:05SgeoOoh, nice example of how it could be nice to be able to specify keyword arguments before required arguments
15:07SgeoBeing able to, in a function called call-with-output-file, specify keywords like #:exist 'truncate before the lambda form that makes most sense to leave at the end
15:09nDuffamalloy: ...as an aside/follow-up: Your solution was correct; I wasn't paying enough attention when testing the cut-down version.
15:14callenif I've got a pattern where I've got a tree of parent and children functions (children calling parents) and I want to passing a context map of potential default argument overrides, is there a clean way to do this?
15:15callenbecause doing this over and over in the args syntax is sapping my sanity.
15:15SegFaultAXcallen: Paste an example perhaps?
15:15callenSegFaultAX: I was hoping to avoid that, but I'll dig something up.
15:16callenSegFaultAX: https://www.refheap.com/paste/8036
15:16callensomething like that.
15:17callenSegFaultAX: there's eventually going to be a lot more children and layering and overriding going on.
15:18callenSegFaultAX: and having to if-case and call out within the template to utility functions and poking into session/db state is ugly as hell.
15:19SegFaultAXcallen: I'm not even sure I fully understand what you're trying to accomplish.
15:20callenSegFaultAX: see that title thing?
15:21callenSegFaultAX: in order to handle the possibility that a caller might want to override it, every single child has to include that default arg syntax
15:21callenSegFaultAX: blows.
15:24llasramcallen: Just have a global dictionary of defaults ?
15:24llasramer, map
15:24callenllasram: global?
15:25llasramWell, namespace-level
15:25ziltiDoes "fn" set a recur-point as well?
15:25callenright but how would I handle fiddling with/changing it?
15:25callenevery time I'd brought up something like that, people rent their clothes to shreads
15:25callenshreds*
15:26amalloyzilti: try it and see
15:26llasramHow would you update something now? Wouln't you need to change values in <n> functions now vs 1 map?
15:26callenI'm asking how to safely mutate a namespace global map from afar.
15:27callenI would guess an atom or something, but it's something I'd avoided.
15:27llasramWho said anything about mutation?
15:27llasramOh, you still want keyword args
15:27callennot necessarily, how do my route handlers change what the template renderers see?
15:27callenwithout passing the state/map?
15:27callenshould I drop the keyword args and pass a map/
15:28callenI still have to manually chuck the map around.
15:28llasramYou need to pass something, this really seems like a map sort of use-case
15:28callenokie-dokie.
15:37zilti&(apply dissoc (cons {:a 1 :b 2 :c 3} [:a :b]))
15:37lazybot⇒ {:c 3}
15:37ziltiIs there a more elegant way to achieve this?
15:39gfrederickswoah
15:39gfredericksapply lets you give initial args
15:39gfredericksso at worst, ##(apply dissoc {:a 1 :b 2 :c 3} [:a :b])
15:39lazybot⇒ {:c 3}
15:40ziltiIs there an alternative to apply?
15:40gfredericksnot if it's a runtime list of keys
15:40gfredericksobviously you can also ##(dissoc {:a 1 :b 2 :c 3} :a :b)
15:40lazybot⇒ {:c 3}
15:40gfredericksbut that's only if you have the list of keys at code-time
15:41ziltiThanks!
15:41gfredericksnp
15:41amalloyit all depends how much knowledge you have at compile time. the easiest way to get there if you have all the information is to just write {:c 3} to begin with
15:41gfrederickshaha
15:41gfredericksmaybe he's obfuscating
15:41pendlepantsif I've got two lein projects - project A and project B - and I want to use code from project A in project B, what's the best way to do that?
15:42pendlepantsI imagine lein compile or building a jar or something?
15:42gfredericksare you dev'ing on them in parallel?
15:42gfredericksor is one of them stable?
15:42pendlepantsgfredericks: I'm building them in parallel.
15:42gfredericksI guess either way you'll be running `lein install` on the dependency
15:43gfredericksto get it into your local maven repo
15:43gfredericksand then you can use it as a checkout dependency in the other project so you don't have to lein install with each change
15:44amalloyi just lein-install, myself
15:44pendlepantsokay, so lein install gives me a pom, and then I point to that in the second project's project.clj?
15:44amalloya bit cumbersome, but that way i don't have to understand the subtleties of checkouts
15:44amalloypendlepants: yes
15:45TimMccallen: What if you apply defaults at retrieve time?
15:45TimMci.e. supply a default value when you ask for an option's value
15:46pendlepantsthanks gfredericks/amalloy.
15:49callenTimMc: the inversion wouldn't match the structure
15:50TimMcI didn't understand that, so I'll explain my suggestion more explicitly.
15:50callenideally there'd be some kind of global state that resets with each fulfilled request.
15:51callenthat would solve a number of problems.
15:51callenand reduce the amount of inter-dependence
15:51TimMcOh, the defaults are stateful?
15:51ziltiHuh. I didn't expect that it's possible to build an infinite loop out of reduce and recur.
15:51callenno, I just remembered a related problem.
15:51TimMccallen: Sounds like something kiln might help with.
15:52amalloyyou don't even need reduce, zilti: ##(recur)
15:52callenTimMc: oh, yeah. This guy gets it.
15:52lazybotExecution Timed Out!
15:52callenhe knows mah paiiiin
15:53TimMcBack to the defaults... instead of (defn base [& {:keys [title] :or title "Garbwell"}] title), you'd do (defn foo [opts] (opts :title (global-defaults :title)))
15:54TimMcThat double-lookup could be stuck into a helper fn.
15:54callena better templating library and a simple request global would've done the trick rather than kiln, but I might be able to make it work.
15:55callenTimMc: that's what I had in mind after somebody'd said to use a map. Seems better.
15:55callendefaulted kwargs in Clojure are fuckin' painful.
15:55TimMcYeah, and they
15:56TimMcthey're even more painful to call than to consume.
15:57TimMcI really prefer [foo bar {:keys [title]}] instead of [foo bar & {:keys [title]}].
15:58amalloyindeed. & keys is marginally useful in a small set of cases, but it *looks* like it's really awesome in a large set of cases
15:58amalloyso you end up with most uses of it eventually making someone sad
16:00callenI'm surprised it made it into the language.
16:00francistechnomancy: I was using s3-wagon-private on a lein1 project and am attempting to upgrade to lein2, following the README is causing me to get the following error. https://www.refheap.com/paste/8037
16:00francisthoughts?
16:01gfredericksslamhound is useful for removing unused requires?
16:01alexbaranoskyis there a link about moving from lein1 to lein2?
16:01alexbaranoskygfredericks: yes it is
16:02gfredericksalexbaranosky: I expect there's a lein file under /doc
16:02gfredericksalexbaranosky: I think my expectation has been violated
16:02gfrederickshttps://github.com/technomancy/leiningen/wiki/Upgrading
16:03gfrederickslinked from the main README
16:03alexbaranoskygfredericks you should totally try slamhound, it is pretty awesome
16:04amalloyalexbaranosky: i hear you improved the require/as handling. how did you make it work?
16:06SegFaultAXOh man, slamhound is awesome.
16:06SegFaultAXI'm so happy this is a thing.
16:06gtrakis there a way to create a compojure bindings as a function of the request? like, (context nil [identity (friend/identity %)]...
16:08SegFaultAXAlthough, what's "No Dutch surgeon required" referencing in the slamhound README?
16:08francisSegFaultAX: It's based off a book. In which a Dutch surgon puts the protagonist back together
16:09SegFaultAXfrancis: Oh, hah. Any idea of the title?
16:09alexbaranoskyamalloy: hey. this code does it: https://github.com/technomancy/slamhound/blob/master/src/slam/hound/regrow.clj#L68 basically it looks for any symbol that looks like 'foo/bar then looks a for namespace on the classpath that contains all the bars
16:09TimMcSegFaultAX: It's explained at the top of the README
16:10djwonkare there general guidelines or conventions when it comes to naming functions when it comes to "getting" and "setting"? for example, is it recommended to use (defn get-status) or (defn status)?
16:10SegFaultAXTimMc: Pffff, my eyes totally glazed over the quote.
16:10SegFaultAXTimMc: Derp derp, thanks.
16:10amalloyso, it can't work for, eg, s/reverse?
16:10francistechnomancy: nevermind - stupid mistake.
16:11alexbaranoskyamalloy: why not?
16:11amalloybecause clojure.string and clojure.core both have a reverse
16:11alexbaranoskyyes, exactly
16:11alexbaranoskythat's an issue.
16:11djwonkI tend to prefer `status` because it is shorter
16:11alexbaranoskyamalloy: the way it currently works you have to look over the namespaces is creates and make sure they still make sense after running it
16:12amalloyit always seemed to me that slamhound should just stop throwing away the information in the original ns form. the knowledge that the file *used* to start with (:require [clojure.string :as s]) is plenty sufficient to resolve the ambiguity
16:12alexbaranoskyit actually does use that info. So when disambiguating it would choose string/reverse in that case
16:12callenTimMc: Kiln is fucking sweet.
16:12alexbaranoskythe problem becomes when you have say clojure.string and clojure.set in athe ns form
16:13amalloyoh. complaint withdrawn, then
16:13alexbaranoskythen ou have problems with `join`
16:13TimMccallen: scgilardi gave a talk on it at a Boston Clojure Meetup. :-)
16:13callenTimMc: this solves like 1/3 of my problems with Clojure Ring/Compojure apps.
16:13amalloyso it remembers that they were both there, but not which aliases they had?
16:14alexbaranoskyamalloy: currently, I think that is correct. But is does keep the alises around as well, but might not be using them intelligently at the moment
16:15tufflaxDoes anyone by any chance know what's going on here? http://stackoverflow.com/questions/14118380/lein-repl-makes-my-clojure-source-files-readonly-in-vim-on-windows
16:15amalloywell, i'm glad to see you've gotten it as far as you have. i made a desultory effort shortly after phil first released it
16:16alexbaranoskyamalloy I just checked out the `disambiguate` function. It just looks at the namespace, not the old alias: https://github.com/technomancy/slamhound/blob/master/src/slam/hound/regrow.clj#L100
16:16alexbaranoskymaybe when I get excited about it I'll revisit it, and improve the heuristic a little
16:17djwonktufflax: if you can reproduce, which it looks like you can, I would file an issue with lein
16:18tufflaxdjwonk: Yeah it happens every time. But I'm not sure it it's lein's fault
16:18tufflaxs/it it/if it/
16:19technomancyfeel free to file an issue with lein, but we don't really have the expertise in any of the common maintainers for debugging windows issues unfortunately
16:19djwonktufflax: well, from what you wrote it is at least correlated with leiningen, perhaps a dependency, perhaps lein itself
16:20tufflaxtechnomancy, djwonk ok
16:20systemfaultWhat is a good tutorial to learn clojure?
16:20djwonki'm scratching my head at what part of lein repl would make a file read only
16:21gfredericksI think slamhound just deleted the last half of my source file?
16:21gfredericksmaybe this would be a good time to learn how to use git
16:21systemfaultUnfortunately, the "Getting Started" section of the main website doesn't help at all for that.
16:21tpopeRaynes: if I do yet another pastebin client, it'll be some general purpose extensible one. and I don't really have the energy for that right now
16:21tufflaxsystemfault: If you are an experienced programmer I recommend clojure.org's doc
16:21technomancytufflax: eeeeeeehh
16:21technomancyI would be very hesitant to recommend clojure.org as a learning resource
16:21tufflaxtechnomancy: that's what I found the most helpful, and I read 2 books
16:21djwonksystemfault: have you looked over http://learn-clojure.com/clojure_tutorials.html ?
16:22hyPiRiongfredericks: half your source file? that's kind of unfortunate.
16:22systemfaultdjwonk: Not really, just read the channel's topic :/
16:22technomancysystemfault: Mark Volkmann's is very good as are most of the ones on http://clojure-doc.org
16:23gfrederickshyPiRion: yeah; it was a particularly big file. Maybe slamhound is passive aggressive about large namespaces?
16:23TimMceeep
16:23systemfaulttechnomancy: Thank you, I just needed something to learn the basics, after I'll be able to just use the official documentation.
16:23TimMcBetter get the Dutch surgeon.
16:23TimMcgfredericks: Not under source control?
16:23TimMc(or backup)
16:23gfredericksTimMc: it is; I was making a jokes :)
16:24technomancysystemfault: there are political reasons for the official documentation not being as good as it could be. there's no substitute for asking in IRC =)
16:24TimMcHrm, OK.
16:24gfredericksI mean it did delete the stuffs. But git checkout is easy.
16:24gfredericksI'll make a patch to slamhound that makes it delete stuff from the git repo as well.
16:24alexbaranoskygfredericks: weird. If you want to file an issue, I'll take a look at it later
16:24gtraktufflax: windows likes to 'lock' files more eagerly than linux/mac, check out http://www.emptyloop.com/unlocker/ for a dirty hack workaround
16:24TimMcIt could still have deleted uncommitted work, of course.
16:24tufflaxgtrak: sounds interesting, thanks
16:26nDuffgtrak: that's a much more generous description of Microsoft's gratuitously POSIX-incompatible filesystem semantics than I usually give. :)
16:26tmciverTimMc: was it scgilardi that gave the talk on kiln? I didn't think so. Was it the author . . . straszheimjeffrey perhaps?
16:26nDuff(well, not _that_ gratuitously... goes back to the lack of support for inodes in FAT16, and backwards-compatibility for same...)
16:26gtraknDuff: yea... my answer is just to use a VM, cygwin's a hassle anyway
16:27TimMctmciver: Oh, maybe. I remember being confused about this at one point.
16:27scgilardiI talked about the organization of our Clojure code in Sonian's software
16:27TimMcThat was *at* Sonian, right?
16:27gtrakit takes less time to get an ubuntu VM up and running with clojure than it does to do anything in cygwin.
16:27systemfaultI'm using the IntelliJ plugin at the moment, works nicely (Windows)
16:27tmciverI thought is was at Basho . . .
16:27TimMckiln talk was at Basho
16:27scgilardiYes, in a small auditorium in the building where Sonian lives.
16:27systemfaultStill.. I just started so it might explode in the next minute
16:28hiredmanscgilardi: where the part of sonian that doesn't write software lives?
16:29scgilardizactly :)
16:30technomancybbloom: seajure tomorrow dude
16:30bbloomtechnomancy: heh, thanks :-)
16:30technomancybbloom: thinking about getting dinner at that mongolian place beforehand if you're up for it
16:30djwonktufflax: if you can recreate your problem only with tools.nrepl then that will at least reveal that it is not lein's problem
16:31tufflaxdjwonk: ok... let me try
16:32tufflaxdjwonk: btw it happened before when I was using lein vimclojure too
16:34TimMcscgilardi: Do you think it was Jeffrey who gave the Kiln talk, then?
16:34technomancyhiredman: are you planning on coming?
16:35TimMcOh wait, Kiln is out of Akamai or something. Never mind.
16:36TimMcI have no idea how I got that all mixed up.
16:36hiredmantechnomancy: I have no plans yet, I think it would be nice, where is it this time?
16:36technomancyhiredman: zoka at 7; thinking of mongolian for dinner beforehand.
16:37technomancylemme know if you want a ride; thinking of going down to Trabant in the afternoon
16:37scgilardiboston clojure meetups have a breadcrumb trail. Here's the one I spoke at: http://www.meetup.com/Boston-Clojure-Group/events/53233492/ (others nearby)
16:40hiredmantechnomancy: wait, the mongolian on the ave?
16:40technomancyhiredman: aye
16:41TimMcscgilardi: Huh. When I looked through the list of past meeups, I didn't see those detailed descriptions.
16:41hiredmanI think I'll make my own way to zokas
16:42bja -=recall=-
16:47emidlnis there an alternate way to construct a map from a sequence of itself besides (conj {} (seq {"k" "v"}))?
16:48gtrakinto {}, apply hash-map
16:48hyPiRionwould conj work?
16:48hyPiRion,(conj {} (seq {:a :b :c :d}))
16:48clojurebot{:c :d, :a :b}
16:48gtrakconj is special-cased for that, I think. It's weird.
16:49hyPiRiongtrak: even weirder
16:49maio,(into {} (seq {:a :b :c :d}))
16:49clojurebot{:a :b, :c :d}
16:49hyPiRion,(= (list [:a :b] [:c :d]) (seq {:a :b, :c :d}))
16:49clojurebottrue
16:49hyPiRion,(conj {} (list [:a :b] [:c :d]))
16:49clojurebot#<ClassCastException java.lang.ClassCastException: clojure.lang.PersistentVector cannot be cast to java.util.Map$Entry>
16:50gfredericks,(conj {} [[:a :b] [:c :d]])
16:50clojurebot{[:a :b] [:c :d]}
16:50hyPiRionThe crème de la crème of Clojure.
16:51hyPiRionahh.
16:51gtrakyea... don't use conj for that, it's bizarre
16:51hiredmanthat is an unfornate bug in the case logic in .cons for APMap
16:52emidlnerr
16:52gtrakconj should be thought of as taking a single bit and putting it into a collection
16:52technomancyit works on bytes too though
16:52djwonkhow do I execute a previous command in the nrepl emacs mode? I looked and tried various keybindings. No luck yet.
16:52technomancyand also objects consisting of multiple bytes
16:52emidlnit looks like into is implemented in terms of (reduce conj {} seq) in terms of (into {})
16:52amalloyhiredman: i'd argue that the mere existence of that case logic is a bug in the api for APMap
16:53gtrakmakes more sense to just say ##(reduce conj {} {:a :b :c :d})
16:53lazybot⇒ {:c :d, :a :b}
16:53gtraktechnomancy: a single unit I guess :-P
16:53gtrakthings with elements
16:54gtrakwhich is an entry in context of a map
16:55hiredmanI dunno that I ever conj on to any thing that is not a vector, come to thing of it
16:55gtrakI use 'into' a lot, but sometimes there nice things like 'set' and 'vec'
16:55amalloysets
16:55hiredmanah, yes, sets
16:55amalloyand possibly other custom collection types, like queues
16:57systemfaultinline-block sucks for columns.
16:57amalloynow a totally unrelated question: is there a convention for formatting an 'if with fewer newlines? eg, i have a small one in the middle of an expression, where writing (if test RET y RET z) looks ugly
16:57technomancyamalloy: and+or =)
16:57amalloyi sometimes do (if test then, else)
16:58callenyou really don't want to use inline-block.
16:58callenyou think you do, but you don't.
16:58hiredmanI once started to write a custom collection type, which was a kind of List with fast sorting via indexed element components, and the rest of the element components where kept as compressed bytes, then I realized it was crazy and just embedded derby
16:58pjstadigamalloy: i just do (if test then else), does that make me bad?
16:59callenI have this conversation with my frontend guy monthly like clockwork.
16:59amalloytechnomancy: leaving aside that you weren't serious: that doesn't really work, does it?
16:59emidlnwas just trying to get a handle on the built-in types for clojure
16:59hyPiRionamalloy: You could do (or (and test then) else)
16:59technomancyamalloy: sure it does
16:59amalloy(or (and test then) else) is not the same as (if test else)
16:59amalloyer, (if test then else)
16:59emidlnnever quite sits well with me if I don't know how to construct, deconstruct, then reconstruct something
16:59technomancyamalloy: well, it conflates false+nil
16:59pjstadigalso (if test then else) is learer
16:59amalloytechnomancy: it also returns else if then was false
16:59pjstadiger
16:59pjstadigclearer
17:00callenpjstadig: migratus has "just worked" for me of late, fyi.
17:00amalloyi do like to write these "clever" trees of or/and when they come out nicer than if, but you can't do that for every if
17:00pjstadigcallen: good to hear
17:01hyPiRionhuh, is it impossible to create if by and/or?
17:01S11001001amalloy: church encode all your booleans then leave off the if :)
17:01gtrakwe could make a nil-conscious logic ops with nor and nand
17:03hiredmanamalloy: a nice linear cond is almost always nicer than a tree
17:03S11001001(def true (fn [_ f _ _] (f))) (def false (fn [_ _ _ f] (f))) (someb #(then) #(else))
17:03S11001001(if test conseq #_else altern)
17:03S11001001(someb :then #(then) :else #(else)) rather
17:03technomancyhiredman: except the formatting dilemma of cond is even worse =\
17:03hiredman(if you really want to take the disucssion off in to the weeds)
17:04S11001001but I don't adorn one-line ifs :)
17:04amalloyactually, in my current case i should just use cond. i was confused because a previous version of the code was shaped wrong for cond to work
17:04pjstadigi usually just write a macro to parse C's ternary operator into an if
17:05pjstadig^ problem solved in the best way possible
17:05S11001001pjstadig: we should have a discussion on the meaning of "best" :]
17:05amalloyso thanks for the easy fix, hiredman
17:05hiredmanif we just used core.logic we'd all have condos now
17:05pjstadigi already have a condo
17:05callenS11001001: SIMPULL IS BESTT
17:05pjstadigbut i want a houseo
17:05hiredman(joke ruined)
17:06hiredmanconde or condv or conda
17:06callenjesus christ lol
17:06technomancypattern matching, my friends.
17:06gtrak(? test :< then else)
17:06callenI always though core.logic was esperanto for Clojure.
17:06dnolen_:P
17:06hyPiRiondefmulti to the rescue
17:06amalloycond isn't a cure-all either, though. (or (and allow-foo? (find-foo)) (bar)) doesn't come out well as either cond or if
17:07hiredmanyeah, defmulti is nice
17:07hiredmananything that pulls conditional logic up towards the top level and out of function bodies
17:08borkdudecallen cxu vi parolas Esperanton?
17:09hyPiRionamalloy: (if allow-foo? (find-foo), (bar)) ?
17:09hyPiRionor may find-foo return nil/false?
17:09amalloyhyPiRion: no good: what if we allow foos but can't find a foo
17:10amalloyright
17:11callenborkdude: Mi ne parolas hundo-lango.
17:14amalloyhyPiRion: it gets more fun if you want to reuse values across clauses too, like (or (and test1 (expensive-f)) (and test2 (expensive-g)) (combine (expensive-f expensive-g)))
17:14aphyrHi folks. Any idea how I'd go about extracting only the *non-basis* entries from a defrecord?
17:14amalloyer, got the parens wrong in the combine clause, but i think you see what i mean
17:15aphyre.g. in (assoc (Foo. 1) :custom-attr 2), I want to get only :custom-attr
17:17hyPiRionamalloy: (let [f' (delay (expensive-f)) g' (delay (expensive-g))] (or (and test1 @f') (and test2 @g') (combine @f' @g')))
17:17hyPiRionI suppose.
17:17amalloyhyPiRion: yes, indeed
17:18amalloyi also wrote let-later to make that prettier: (let-later [^:delay f (expensive-f) ^:delay g (expensive-g)] (or (and test1 f) (and test2 g) (combine f g)))
17:18jlewisaphyr: this is silly, but you could just say (apply dissoc your-record (keys (Record. :doesn't :matter :what :these :are)))
17:19llasramjlewis, aphyr: or more generically, (apply dissoc record (keys (map->Record {})))
17:19gtrakjlewis: aphyr: you'd want to use the map constructor to generalize it
17:19aphyrYeah, I was hoping to reach into its internal hashmap directly for speed
17:20aphyrI know it's in there, just can't figure out where the source is
17:20hyPiRionamalloy: But when you're turning down that logic alley, I seem to find code a bit hairy regardless of what language I use
17:20aphyrthis is in a tight parser loop, would really prefer not to waste any cycles
17:21amalloyaphyr: so create (keys (map->Record {})) once, close over it, and use it over and over in the tight loop
17:21dnolen_aphyr: (.__extmap (Foo. 1 2))
17:22gtrakthat seems a little... undocumented
17:22aphyrHA! Thanks dnolen!
17:22jlewisalso seems like exactly what aphyr wanted :)
17:22gtrakha.. reminds me of python
17:22aphyrYeah, avoiding object allocation here is of the essence, need to push a few million of these/sec :)
17:23dnolen_only mutable fields of deftype/record are ever hidden, I doubt that .__extmap will change anytime soon. but yes some risk.
17:23jonasenkovas: ping
17:24kovasjonasen: hey, just composing a response on the github issue right now :)
17:24jonasenkovas: heh.. I'll probably work on it tomorrow (if you think it's worthwile)
17:25kovasjonasen: definitely worth doing
17:25amalloyanyone happen to know if (let [^long x 1] ((fn ^long [^long n] (inc n)) x)) keeps you in primitives or boxes everything?
17:25ziltiIf someone in here has some minutes to spare: Is this idiomatic? Or incredibly ugly? https://gist.github.com/4438765
17:25kovasjonasen: I've been putting it off since i wanted to take the time to understand nrepl (haven't worked with it before)
17:26amalloyzilti: that is too long to be anything but vile
17:26jonasenkovas: I've not used it either.. but it seems well designed and documented
17:26kovasjonasen: yup. a fair amount to read and digest
17:27kovasjonasen: though probably very easy to hack a simple version
17:27kovasjonasen: just to replace the evaluation "service"
17:27amalloyfor the merge function, anyway. contains-map? is short enough to say that it's going about things the wrong way
17:28jonasenkovas: yep. I think it would be a good idea to make the datomic schema play well with it
17:28kovasjonasen: that is my instinct as well, though I worry about that forcing incompatibility with other people's middleware
17:28amalloyit seems to be a bad way of writing (some #{cmap} coll)
17:29technomancykovas: curious: have you thought at all about what a common nrepl middleware stack would look like for multiple (possibly different) clients connecting to a single server and wanting to be aware of what others are doing?
17:30kovastechnomancy: yes
17:30ziltiamalloy: What's so wrong about "contains-map?"?
17:30kovastechnomancy: though i think the answer depends on a lot of factors
17:30amalloyzilti: i already answered that
17:30kovastechnomancy: like how many people..
17:30technomancykovas: it would be good to get some common conventions in place. I've noticed a couple of independent implementations recently
17:30kovastechnomancy: and do you force everyone to see everything, or is it more pull than push
17:31technomancykovas: you're thinking it would get too crowded/noisy?
17:31jonasenkovas: the maps submitted and returned to/from nrepl could be turned into tx-data. Maybe we even could do codeq style schema evolution for nrepl middleware
17:31kovastechnomancy: my humble opinion is that the sessions should be stored, and then people can retrieve them at will
17:31dnolen_zilti: in spirit looks ok, but I would break it apart, two reductions makes it noisy.
17:31kovastechnomancy: yes
17:32jonasenkovas: https://github.com/clojure/tools.nrepl#talking-to-an-nrepl-endpoint-programmatically
17:32technomancykovas: I think you'd want both; having to poll for stored sessions doesn't sound like much fun
17:32kovasjonasen: yes, that would be one way to go. I'm also not totally happy with the current session schema
17:32technomancythough I guess since it's interactive it wouldn't be a bottleneck
17:33kovastechnomancy: right. you don't want to poll for the updates. But what if you join in the middle of a session?
17:33technomancyright; it needs to be reified; makes sense
17:34kovastechnomancy: if everyone is sharing the same evaluator there is probably a reasonable simple solution
17:34ravsterhello everyone
17:34kovastechnomancy: but that scenario is scary :)
17:34technomancykovas: we do it all the time at seajure =)
17:35kovastechnomancy: is it not a problem?
17:35technomancywell, it's very primitive in our case. we just share a tmux instance. =)
17:35kovastechnomancy: i think when everyone is in the same room, that is workable
17:36technomancysince we're all in the same room it's easy to pass around control to whomever has an idea, and the group is small enough that we don't want subgroups hacking asynchronously
17:36technomancyright
17:36ziltikovas: About multiple people using the same nREPL, I've done a proof-of-concept, it's actually pretty simple: https://github.com/munrepl/server
17:36kovastechnomancy: if you have remote people joining, then who knows what they might try to eval
17:36kovasright
17:36amalloyi know i would try to evaluate technomancy's patience limits
17:36technomancykovas: well I put it in a dummy user account on my box anyway
17:36technomancyheh
17:36kovashaha
17:37callenlolcathost: not bad.
17:37technomancykovas: unfortunately my illness made me miss your conj talk, but it sounds like you've got a bigger design in mind here than just a single client implementation?
17:37hiredmankovas: are you worried from a security stand point? or something else? security can be delegated to the transport layer
17:37kovastechnomancy: yes, repl sessions should be first class things we can pass around
17:38technomancyaw man... it's not a full OSS stack =\
17:38technomancybleaugh
17:39kovashiredman: basically the same principle as we apply to code collaboration: what you do shouldn't clobber someone else
17:39kovashiredman: unless they want it to
17:39kovaszilti: thx will check it out
17:39kovasyeah i know
17:39gtrakhow do you detect clobberness?
17:40ziltikovas: It's just an aleph-wrapper around the nREPL
17:40kovasgtrak: i think thats a personal decision
17:40jonasenkovas: You also talked (somewhere?) about some cljs refactorings... How's that work going? I tried to dig in to the client part of session but I found it quite difficult to follow.
17:41kovaslike, if i define some function, and someone else uses the same name for another function, i shouldn't automatically lose my definition by default
17:41kovasjonasen: yeah, me too :)
17:41ppppauli'm trying to do nested destructured binding for maps... can someone help me out with it. 'company-id and user-id' is coming out nil
17:41ppppaul[{:keys [{:keys [company-id user-id]} params] :as request}]
17:41kovasjonasen: we don't have a great cljs web paradigm yet
17:41gtrakit seems like if you don't want to clobber in-memory state, everyone needs their own process and namespaces, then coordination of the central memory is a separate issue.
17:42kovasjonasen: what i want to do there is to find a simple way to just mirror datomic into the UI
17:42kovasjonasen: and make the client-side UI totally minimal
17:42kovasgtrak: yes
17:42TimMcppppaul: Input looks like {:params {:company-id 1 :user-id 2}}?
17:42Sgeoppppaul, :keys is for taking a key from the map and binding it to a variable named the same as the key
17:42gtrakshare text, separate processes, manual central-eval
17:43gtrakthat everyone can see
17:43SgeoYou should instead use the form where you specify the variable directly, and use the inner pattern there
17:43kovasgtrak: I imagine you could follow someone's session, and then fork at a certain point into your own evaluator
17:43gtrakyea, as long as nothing relies on external data or things like timestamps, you could replay a log locally
17:44technomancygit seems like it could be a natural backing store
17:44Sgeo{{:keys [company-id user-id]} :params :as request}
17:44SgeoI think
17:44kovasgtrak: the plan is to have an abstraction for external data
17:44kovasgtrak: "values are location independent"
17:44gtrakthe sense I'm using is 'user input'
17:44hiredmanthe problem with git is (ironically?) the lack of an index
17:44Sgeo,(let [{{:keys [company-id user-id]} :params :as request} {:params {:company-id 1 :user-id 2}}] [company-id user-id])
17:44clojurebot[1 2]
17:44kovastechnomancy: i would love to find a way to use git
17:45kovastechnomancy: but I'm short of ideas there
17:45hiredmanso doing queries that are not just "what blob does this sha match too?" is difficult
17:46kovasdatomic is a great fit, apart from not being OSS and not being easily storable in a git repo
17:47gtrakcodeq is most of the way there already, no?
17:47technomancyyeah I was thinking of noodling on collaborative nrepl at seajure, but not if it's going to bring in a proprietary dependency
17:48kovastechnomancy: if its possible to do this stuff another way, I'l all ears. But better to use datomic than not do it at all
17:48technomancyeh; I'm OK with not doing it
17:49kovastechnomancy: fair enough.. I'm pretty desperate for this stuff
17:49callenkovas: for what?
17:49kovascallen: https://github.com/kovasb/session
17:51rdreyhi everyone
17:51rdreyI'm a newb and created a little code review question, here: http://codereview.stackexchange.com/questions/20028/idiomatic-clojure-performant-functional-enough
17:52rdreyif anyone had a moment to give me feedback, that'd be amazing
17:53callenkovas: just needs an iPhone app.
17:53kovaslol
17:53S11001001technomancy: :)
17:53kovasandroid more likely to come first :)
17:53kovasflight boarding, later yall
17:54callenkovas: whatever bro, I'd totally crush some code on iOS.
17:54jonasenkovas: websockets doesn't work on android if I remember correctly
17:54kovascallen: alright, we will count on you for that ;)
17:54kovasdoh
17:54gtrakrdrey: why does neighbours need to call vec?
17:54ne1_1Hi - is there a way to check how much of a lazy-seq is realised? I thought I could just call realized? on rest, but that doesn't seem to work for chunked seqs
17:54rdreypoints are little vecs
17:54rdrey[x y]
17:55S11001001ne1_1: I doubt anything's built-in
17:55djwonkI've been following along with http://clojure-doc.org/articles/tutorials/emacs.html but I'm having trouble with C-x C-e : Symbol's function definition is void: lisp-eval-last-sexp
17:55S11001001ne1_1: I think iterating over rest and checking realized? as you acc an int would be defined for all well-behaved seqs.
17:55technomancydjwonk: is nrepl-interaction-mode active?
17:56S11001001ne1_1: since rest *specifically* doesn't force its result
17:56gtrakne1_1: there's no way to know 'how much' unless you count
17:57djwonktechnomancy: I see (nREPL ElDoc Paredit) as my modes. C-h m shows: Auto-Composition Auto-Compression Auto-Encryption
17:57djwonkEldoc File-Name-Shadow Font-Lock Global-Font-Lock Ido-Ubiquitous
17:57djwonkLine-Number Menu-Bar Mouse-Wheel Paredit Recentf Show-Paren
17:57djwonkTransient-Mark
17:57djwonksorry for the mess
17:57S11001001ne1_1: however, be warned that your function would by necessity not be referentially transparent, as realized? is not
17:58S11001001realized? should be called realized?!
17:59callenS11001001: call it the OhFuck monad.
18:01gtrakrdrey: try shuffle instead of rand-nth
18:02ne1_1S1100100: so that works fine if none of the items are realised, but fails if some of them are because (type (rest (range 20) )) is clojure.lang.ChunkedCons and that doesn't support realized?
18:03S11001001I don't know, but if that's the case you'll just have to assume an answer for any seq that doesn't implement whatever realized? uses
18:03S11001001while iterating
18:03rdrey@gtrak will try, thanks
18:04rdreygtrak: thanks, will try. (haven't used IRC in a while)
18:07ne1_1S11001001: OK, thanks sounds I'll take a look at ChunkedCons and see if it has anything I can use for this
18:08rdreygtrak: `(let [current (first (shuffle candidates))] …` is 25% faster, thanks! Any other suggestions?
18:08S11001001ne1_1: ChunkedConses can't possibly be lazy
18:09gtrakrdrey: I'm trying to figure out if by some combination of shuffle, cycle and take you can create a lazy seq of shuffles, but having trouble
18:09gtrakI might leave it as an exercise to the reader :-)
18:10ne1_1S11001001: ah, OK that makes more sense
18:10rdreygtrak: I was also looking into lazy-seq, but I haven't found any examples of using lazy-seq to make sets. (And having sets is neat, because I need so many "within tests"
18:10S11001001ne1_1: like I said, you can't enumerate all the seq implementations; you'll just have to assume some things about some seqs
18:10gtrakrdrey: yea, sets realize a seq, if it's possible to reuse it over and over again, then it's worthwhile
18:11gtrakthat's where the 'take' would come in on your stream of shuffles
18:11TimMcS11001001: Where does realized? mutate things?
18:11gtrakperhaps your stream can be shuffled less often than you think
18:11gtrakleave it to the generator
18:11S11001001TimMc: realized-length, given the same input multiple times, ...
18:11rdreygtrak: yupp. I'm wondering how "pseudo random" the first item in a set is
18:12gtrakshould be fine
18:12TimMcS11001001: And what is realized-length ?
18:12S11001001TimMc: the function we're talking about
18:13S11001001but skipping to realized
18:13gtrakthere should be no difference between concatenating randomly shuffled collections and picking a random index each time, except there is no lookup, and in seqs, lookup is not constant time
18:13S11001001TimMc: exists s. (second [(count s) (realized? s)]) != (first [(realized? s) (count s)]), just for example
18:13amalloyTimMc: his claim is not that realized? mutates anything, but that it's not referentially transparent. call it on the same (identical?) seq twice, and you may get different results
18:13TimMcOh, OK.
18:14TimMcI was confused by S11001001's use of "!", which generally indicates mutation or side effects, not other causes of referential... opacity.
18:14rdreygtrak: I tried removing the shuffle completely and the current implementation now produces 3 vertical stripes, no more random island.
18:15S11001001TimMc: none of them are friends with laziness :)
18:15ne1_1S11001001: yup, that works nicely, thanks
18:15TimMcsure
18:15TimMcrealized? is inherently asking about the state of something, so it doesn't seem that interesting to me.
18:16S11001001I've never used it
18:16TimMcI've never heard of a use for it.
18:17TimMcMaybe a print fn that only prints out the realized portions of a data structure...
18:17gtrakrdrey: yes, putting it into a set is not random
18:17rdreygtrak: http://cl.ly/code/4133091e2w41 here is the full source, should be self-contained, if you want to play around with it, too
18:17gtrakI might check it out, looks fun, thanks
18:17gtrakbut not right now
18:17rdreyno worries
18:17rdreythanks for the first little improvement
18:19djwonktechnomancy: did my modes look ok to you?
18:20technomancydjwonk: yeah, nREPL should be enough
18:24djwonktechnomancy: ok, now that I am practicing and reading closer, it works great. I think I was trying inappropriate commands in the wrong window (nREPL instead of Clojure buffer and vice versa)
19:04technomancywow, the new gist is awful
19:09hyPiRionhm. There's no short way of doing (if (x foo) (y foo) (z foo))?
19:10technomancyhyPiRion: useful has something
19:10hyPiRionI think I should start look in useful before asking. Thanks
19:10amalloyyeah, i think that's (fix foo x y z)
19:11amalloyhyPiRion: yep, it is. flatland.useful.fn/fix
19:12hyPiRionamalloy: Thanks
19:24technomancyconcerned about how hard it is to get started using Clojure? could be worse: https://gist.github.com/c7c5fd1df3524704287c / https://gist.github.com/7f3142fd076b308042df
19:33amalloytechnomancy: yes, the new gist sorta suggests that maybe they broke gist.el a while back so that people would stop using gist before it became unpleasant
19:36technomancythe look is improved, but I literally cannot click any of the buttons in both the browsers I tried, and I couldn't even paste in one
19:38tpopeby both browsers, do you mean "the browser that runs in emacs" and "the other browser that runs in emacs"?
19:38tpope:)
19:38amalloymy biggest objection is that it keeps signing me out
19:39technomancytpope: close, but not quite. it's actually "the browser that pretends to be emacs, and the browser I hate using."
19:39amalloyi've definitely had problems with the formatting, where i had to horizontally scroll to get to a button i wanted, but i can't repro at the moment
19:39technomancyanyway, gist.el is working for me now
19:39technomancybut it stores creds in plaintext
19:39technomancy$kill
19:39lazybotKILL IT WITH FIRE!
19:40amalloyi stopped using it when, after it broke, a sincere effort didn't make it start working. Raynes offers an alternative that works, so i'm happy
19:42technomancyI use scpaste for non-sensitive things
19:43xeqi.. and what do you use for your sensitive things?
19:43amalloyfamily-friendly channel!
19:43Foxboronxeqi, birds.
19:43technomancyheh
19:44technomancyxeqi: probably will install refheap.el
19:44xeqiFoxboron: careful, they might get stuck in a fireplace in England for 50+ years, and when found people will still fail to crack them
19:44Foxboronits cracked
19:44technomancyI put it off since refheap's auth also doesn't work with my browser
19:44xeqioh? link?
19:48TimMcLast I heard, *someone* had proposed a solution. Doesn't mean it was confirmed...
19:50Foxboronwell, i cant find the news article about it :/
19:50Foxboronnever knew 'bird ww2 code decrypted' would yeild this many bad results
19:51TimMcLast I heard: http://www.bbc.co.uk/news/uk-20749632
19:52TimMcI moderate reddit.com/r/codes, so I heard an endless stream of crap about that damn pigeon. :-P
19:52Foxboronhaha.
19:53TimMcI figure if there was anything official, I'd know about it 3 times over.
19:53Foxboronwell, the current solution sounds reasonable
19:53xeqilatest thing I can find is http://www.telegraph.co.uk/news/uknews/defence/9766130/GCHQ-dismisses-claims-D-Day-pigeon-riddle-has-been-cracked.html
19:55Foxboronah, i had only heard the news that it had been decoded. Didn't see they dissmissed those claims
20:09TimMcI wish `lein new org.timmc/foo.bar` would create a project called org.timmc/foo.bar with src/org/timmc/foo/bar.clj
20:10TimMcin a folder called foo.bar
20:11technomancyTimMc: me too
20:11technomancypull req plz?
20:11TimMcOh, hmmm -- lein2 almost does it.
20:11TimMcMaybe I misremembered.
20:11technomancyI hate having to rm src/whatevs/core.clj and the test
20:11technomancyto add an actually meaningful name
20:12TimMcI was going to actually start a project tonight, but maybe I'll shave this yak instead. :-P
20:14TimMcWell, I'll certainly open an issue, at the very least.
20:17TimMctechnomancy: Should the test stub be test/org/timmc/test/foo/bar.clj?
20:17Raynestechnomancy: refheap.el will consume your soul.
20:18technomancyTimMc: oh man... I get so confused by that =(
20:18TimMcI don't know what your philosophy is on where "test" goes in the namespace.
20:18technomancyTimMc: I get pull requests on clojure-mode.el on a regular basis offering to switch it "back to how it was"
20:19TimMcWhat changed?
20:19TimMcOh, I guess I can check the issues...
20:19technomancyat one point it was test/foo/bar_test.clj, then test became a directory, but it gets inserted in the N-1th segment or something?
20:19technomancyand then it changed again?
20:19technomancyI don't know
20:20technomancyI always just ask pjstadig how it's supposed to work =)
20:20technomancyhm
20:20technomancyI wonder if linking tests and implementation would be a good fit for ns-level metadata
20:20technomancyat least on the tests themselves
20:20TimMcOh hey, nice idea.
20:21TimMcJust make sure slamhound preserves metadata. :-P
20:21technomancyoh dang
20:21technomancyI don't think it does
20:21TimMc*Nothing* does. :-/
20:21technomancywell, it preserves the docstrings
20:21loganlinnQuick concurrency/race-condition question: I have 2 threads accessing an atom, where 1 thread accumulates data into the atom, and the other flushes the data periodically by writing the snapshot to database then reset! the atom. Do I need to worry about race-conditions when flushing where new data is added between, (persist @data)(reset! data {}) ?
20:22technomancybut most ns-level metadata is :author, which I deliberately didn't want to support because it's dumb
20:22TimMcIt's a feature, not a bug!
20:22technomancyloganlinn: why not have the persist function return an empty map?
20:22technomancyTimMc: also: clojure itself doesn't support ns-level metadata if you AOT
20:23xeqiloganlinn: I expect you could lose data with that
20:23TimMctechnomancy: Oh, curious.
20:23loganlinntechnomancy: then do (swap! data persist) ?
20:23technomancyloganlinn: right
20:23technomancyloganlinn: needs to be idempotent though; it'll retry
20:24TimMcloganlinn: Might be better to use a dedicated queue of some sort.
20:24loganlinnyeah, that would work, thanks
20:24TimMctechnomancy: Why not refs and dosync?
20:25technomancyTimMc: if all you're doing is idempotent persistence, why get fancy?
20:25technomancyeasy enough to collapse it into a single atomic operation
20:25technomancyif you need refs, use refs of course =)
20:28loganlinnI was under the assumption that doing IO inside dosync is disallowed
20:29TimMcloganlinn: You could return the new data from the dosync and persist it outside.
20:29technomancyif you send to an agent inside dosync it's not triggered until the transaction succeeds
20:30loganlinnIt seems like using an atom is most appropriate for my situation, no?
20:30technomancybut don't fool yourself into thinking it's ACID; the agent doesn't participate in the transaction, so it's not truly atomic
20:30loganlinnyeah
20:30TimMc(let [data (dosync (let [d @someref] (ref-set d []) d))] (persist data))
20:31loganlinnTimMc: Ah, i see
20:31TimMc(ref-set someref []), rather
20:34AnonnyIs there a way to run a series of functions that don't depend on each other except that the next can not run until the current is finished?
20:35TimMcAnonny: agents
20:35TimMcNo wait... that's overkill.
20:35amalloy(do (a) (b) (c))?
20:36TimMc(doseq [f [a b c]] (f))
20:36ibdknoxamalloy: too easy, clearly should use a monad there
20:36hiredmanAnonny: single threaded executor
20:37SegFaultAXAnonny: I'm assuming these are side-effecting functions?
20:37AnonnySegFaultAX: yes.
20:38SegFaultAXAnonny: Perhaps (io! (a) (b) (c)) then?
20:39amalloyibdknox: maybe @@@@@@@@@@(last (map (nth 10 (iterate (fn [f] (fn [] (delay (f)))) identity)) fs)) is complicated enough?
20:40amalloyi guess it doesn't work at all, which is probably a downside, although it probably *looks* like it works
20:42TimMctechnomancy: Where the hell is leiningen.new?
20:43technomancyTimMc: https://github.com/Raynes/lein-newnew
20:43technomancyit's treated like a plugin to allow for a quicker release cycle
20:43technomancythough that's probably no longer necessary
20:44TimMcmagic
20:44TimMcSo I probably should have created that issue over there.
20:45technomancyeither way
20:46SegFaultAXIs anyone other than datomic using edn? Like, forealrealz using it.
20:46SegFaultAXBecause it's pretty awesome IMHO.
20:47TimMcSegFaultAX: Doubtful. It sounds incredibly specific.
20:47TimMc*to clojure
20:51SegFaultAXIt doesn't really need to have support for lists AND vectors, or symbols AND keywords. One ordered list type and one symbol/atom/keyword type is enough for a generic data format.
20:53DeeceIs it possible to do something like 'read-string' tht just returns the form, without evaluating it?
20:53SegFaultAXDeece: slurp?
20:53amalloyyes, read-string does that
20:54amalloy&(read-string "(+ 1 1)")
20:54lazybot⇒ (+ 1 1)
20:54Deeceamalloy: welp, you're right. thanks.
21:05justincampbellis there a way to have a lein dependency in a path for development purposes
21:05justincampbellsimilar to bundler's gem 'mygem', path: "../mygem"
21:06bpri'm not familiar with ruby, but maybe lein checkouts does what you want?
21:08bprhere's the link: https://github.com/technomancy/leiningen/blob/master/doc/TUTORIAL.md#checkout-dependencies
21:09hyPiRionjustincampbell: use the :dev profile, I suppose?
21:09justincampbellhyPiRion, bpr: thanks! ill check those out
21:10hyPiRionjustincampbell: Example use here: https://github.com/michaelklishin/langohr/blob/master/project.clj#L12
21:15DeeceI'm looking at the source for clojure.string/reverse and I can't understand why it would create an instance of the mutable java StringBuilder and call reverse on that instead of just doing (str/join (reverse s)). Is it for performance reasons? I just find it surprising that library functions don't seem always to build upon each other.
21:17ibdknoxDeece: it's for perf, seqs are really slow
21:17ibdknoxrelatively speaking
21:38Deeceibdknox: makes sense, thanks
21:40TimMcDeece: Specifically, that approach would involve allocating a cons cell for every character of the string, then iterating over them. StringBuilder is specifically designed for fast string munging.
21:40justincampbellcan i interpolate strings somehow?
21:41TimMcjustincampbell: Like format, or like a templating lib?
21:41justincampbellinstead of doing (str "my name is " first-name " " last-name)
21:41justincampbellin ruby: "my name is #{first} #{last}"
21:42ibdknox,(doc format)
21:42clojurebot"([fmt & args]); Formats a string using java.lang.String.format, see java.util.Formatter for format string syntax"
21:42TimMc,(format "lib-%04d" (rand-int 1e4))
21:42clojurebot"lib-2768"
21:42justincampbellah perfect, thanks!
21:47amalloyDeece: you might want to read the design notes at the top of clojure/string.clj
21:51amalloyi wonder why delay objects don't implement IFn. seems like it could be handy to treat them like thunks
21:51dyresharkwhere can i submit a feature request for a --do-what-i-mean-not-what-i-say flag?
21:52xeqijira?
21:52clojurebotto be fair I dunno that I've ever had code out right rejected, it just sits in jira or assembla or where ever, or if I ask if there is any interest (before writing any code) I get told to go write alioth benchmarks
22:01amalloytry perl
22:02TimMcRaynes: In newnew, why does sanitize-ns do s/_/-/?
22:15TimMcYak shaved.
22:33tmcivernewb macro question: what's the idomatic way around this problem: https://www.refheap.com/paste/8046
22:35amalloytmciver: no problem is evident, just some code that does nonsense. without a goal in mind, who can direct you around the problem?
22:35amalloy#accidentalzen
22:36tmciveramalloy: it's a contrived example of a problem I'm running into in a 'real' project. Am I supposed to make vectors out of the lists?
22:36amalloyi don't know, man, because i don't know what you want the macro to expand to, or what it should do
22:37tmciverOK, let me think on it and come back.
23:03TimMctmciver: Provide an example input and output and we can talk. :-P
23:07alexbaranoskyTimMc: parts# is not inside the syntax quote.
23:08alexbaranoskyTimMc: no need for an autogensymmed binding in that case
23:11TimMcalexbaranosky: Hey, don't tell me, tell tmciver. :-)
23:12alexbaranoskyTimMc oh, hey, my bad :)
23:12alexbaranoskytmciver
23:13Sgeosyntax quote?
23:13SgeoIs this #clojure ?
23:14alexbaranoskytmciver it IS a little hard to understand what you are trying to achieve. As is, the code sample given is not something you should usually do with a macro. IT's blowing up because it expands to a list, and that list w/ a number at the front, and numbers cannot be called as fns
23:14tpopethis is #clojure
23:14alexbaranoskySgeo yes
23:15SgeoOh, I call that quasiquote
23:15SgeoThe word "syntax" makes me think Scheme now
23:15SgeoI'm becoming a Racket person maybe
23:16TimMcSgeo: I thought it was called quasiquote in Scheme as well.
23:16alexbaranoskySgeo I don't know what quasiquote is, but i think it is not the same as syntax-quote
23:17alexbaranosky...after a brief googling
23:17SgeoTimMc, ` is
23:17SgeoBut syntax-quote makes me think something other than `
23:17SgeoMaybe it's racket-specific
23:17SgeoBut #' makes a syntax object
23:17SgeoSimilarly to how ' makes a list
23:19amalloyuh, ' doesn't make a list in any meaningful sense, in clojure or racket
23:20SgeoResults in a list when evaluated
23:20SgeoErm
23:20aaelonyI'm processing lines of a large file with a function that i call on each line. The output of each call to this function will go to a log. I'd like the lines to be processed asynchronously and am looking into using Agents because each line will output to the log, or potentially multiple log files. I'm reading this link, http://lethain.com/a-couple-of-clojure-agent-examples/, but curious if others can point me to references or exampl
23:20aaelonythat tackle this kind of thing.
23:20SgeoWell, when passed a form that is a list syntactically, evaluates to a list
23:22TimMcSgeo: The relationship between ` and ' in Clojure is not the same as in Scheme.
23:22TimMcAt least, I don't recall ` having anything to do with namespaces in Scheme... :-)
23:22aaelonyOne thing that is strange to me is that a couple examples I've seen with Agents seem to have a let statement with defn definitions inside the let...
23:22SgeoTimMc, similar except for the namespace thing and Scheme actually defines non reader-syntax names for those
23:23SgeoI think
23:23justincampbelltmux users: https://github.com/justincampbell/speclj-tmux
23:23TimMc,''foo
23:23clojurebot(quote foo)
23:23TimMc,'`foo
23:23clojurebot(quote sandbox/foo)
23:23Sgeoaaelony, those create a thing called a "closure". Basically, within the function made by defn, you can access the things bound (defined) by the let
23:23TimMc^ the latter would be (syntax-quote foo) or similar in Scheme.
23:24SgeoTimMc, oh
23:24TimMcSo you're right -- ` is reader sugar in Scheme, but not in Clojure.
23:24SgeoI'm not that familiar with Scheme really, just all this syntax-case syntax-blah etc. makes me think syntax objects
23:24TimMcIt *could* be -- hiredman has written a more or less drop-in replacement, IIRC, but it isn't.
23:25Sgeoaaelony, do you know what an atom is? (If you don't, no big deal, I just wanted to use it in an example)
23:25aaelonysgeo: i guess i would have expected an fn rather than a defn, because i tend to use defn when a function will also be a stand alone
23:26aaelonysgeo: I use atoms frequently, this is my first foray into agents
23:26aaelonyfrom what i've read, agents are good for handling io
23:26Sgeoaaelony, defn is (kind of) def + fn
23:26aaelonysgeo: i realize this :)
23:27Sgeoaaelony, well, if you want a standalone function that has a bit of hidden state, you could use let over defn
23:27aaelonyi see
23:28Sgeo(let [a (atom 0)] (defn inc-counter [] (swap! a inc)))
23:28SgeoThis will define, in the namespace, a function called inc-counter
23:28SgeoOnly inc-counter has access to that a
23:28aaelonyanother thing I've noticed is that you can send wtrs to agents, but it doesn't acutally go to the file until the (close) is called
23:29aaelonyi wonder if this is desirable for a (very) large file
23:29aaelonysgeo: i think i understand atoms
23:29aaelonyagents seem different to me
23:29Sgeoaaelony, they are. I just wanted to illustrate let over defn
23:30aaelonyi see, i rarely see defn within a let, but then again it's nice to learn :)
23:31SgeoI'm not going to claim it's idiomatic, just that it's possible
23:31aaelonyis there something about agents that makes clojsures more desirable?
23:31aaelonyclosures
23:32SgeoCould just be the style of the examples, rather than due to anything about agents. But I'm not sure.
23:33aaelonysgeo: i definitely appreciate your comments
23:33amalloyi can't think of any reason it would be more prevalent for agents
23:34aaelonyi'm also looking at this (https://raw.github.com/clojurebook/ClojureProgramming/master/ch04-concurrency-game/src/com/clojurebook/concurrency/game_validators.clj) example of agents and writing to file
23:35aaelonyamalloy: thanks, maybe I'm not looking in the right places. the clojurebook link above seems to be a better example… looking to understand that better now.
23:37technomancySgeo: how are you finding racket?
23:39dcbtpope: Having a problem with vim-foreplay.  Every once in a while (probably every 25 times or so) when I :Eval, vim crashes saying "Vim: Caught Deadly Signal ABRT".  Sometimes the terminal shows the process and the status as aborted after it crash/exits.
23:39dcbtpop:  I'm running on OS X with vim an a terminal.  I have updated the plugin within the last few hours.  I know this isn't a lot to go on, but I was hoping you might have some insight.  Other than this issue I really like foreplay, much better than vim-clojure
23:40Sgeotechnomancy, the ecosystem sometimes feels abandoned (there are a lot of libraries on PLaneT that still call it "PLT Scheme"). I do like the whole using internal defines for lexical scope. Also really like the thought of the lightweight threads, but haven't touched them. Still trying to understand macros. Simple syntax-rules stuff is easy enough, easier than defmacro for that sort of simple substitution, but no idea how to do anything more com
23:40Sgeoplicated
23:40dcbtpope:  I'm running on OS X with vim an a terminal.  I have updated the plugin within the last few hours.  I know this isn't a lot to go on, but I was hoping you might have some insight.  Other than this issue I really like foreplay, much better than vim-clojure
23:42tpopedcb: is it macvim?
23:42dcbtpope: yes, macvim
23:43tpopemacvim likes to crash :/
23:43Sgeotechnomancy, in Racket, there's a very good reason to use (let ((x 1) (y 2)) ...) and not (let (x 1 y 2) ...)
23:43SgeoWell, that sort of thing in general, not necessarily that specific example
23:43tpopedcb: you might try ruling out plugins (any that use the ruby interface are great candidates)
23:44SgeoBecause if you're defining the form, it's easier to pattern match on
23:44tpopedcb: you could also try deleting the part of nrepl/foreplay_connection.vim after the final finish, so that it doesn't use the ruby interface
23:44dcbtpope: OK, I'll deactivate them and let you know if that doesn't fix it
23:45tpopedcb: also let me know if it does
23:45dcbtpope: okay I'll try that too
23:45dcbtpope: OK
23:45technomancySgeo: thinking of picking it up in a year or two to teach my kids
23:46technomancySgeo: do I remember correctly that it ships with a Logo implementation?
23:46SgeoI believe it does, yes
23:47SgeoOr at least a logo-like language
23:47SgeoHrm
23:47ihodestechnomancy: good evening—i was wondering if you might have an idea of what the issue is here. i'm using c.j.jdbc now, but when i try to connect to even my local DB, i get this: http://cl.ly/LunU, which results in this error: db-spec postgresql://localhost:5432/cloblot is missing a required parameter. However, the local DB is definitely there and running nicely: http://cl.ly/LuC5
23:48Sgeotechnomancy, http://docs.racket-lang.org/turtles/index.html
23:48ihodesman…i learned to program with turtles
23:48ihodesgood times
23:49technomancyihodes: postgres:// vs postgresql:// maybe?
23:49ihodestechnomancy: nope :\ hah
23:50ihodeshah, oh well. i'll keep at it. thanks though!
23:50ihodeshaha putting the blog together: couple hours. making the DB stuff work: days.
23:50ihodeser, *trying* to make it work
23:51technomancythe ecosystem still has a long way to go in that area
23:52xeqiihodes: jdbc:postgresql://localhost:5432/clobot ?
23:53ihodesxeqi: still the following: db-spec jdbc:postgres://localhost:5432/cloblot is missing a required parameter
23:57technomancypostgres://localhost:5432/db-name works for me
23:58xeqiI've moved to using {:connection-uri "jdbc:..."} to avoid the c.j.j connection parsing
23:58xeqiforgot about that part
23:59ihodestechnomancy: which version of clojure, c.j.jdbc, and postgres/postgresql are you using?