#clojure logs

2013-04-19

00:57nonubyis there a function that returns true/false is item is either a list or vector or something iterable
00:58nonubyseq? return false on []
01:01technomancytry coll?
02:32tieTYTI wrote a cond with a bunch of conditions and each test uses the same argument. Is there any way to write that in a more concise way?
02:33ucbtieTYT: perhaps condp?
02:33ucb,(doc condp)
02:33clojurebot"([pred expr & clauses]); Takes a binary predicate, an expression, and a set of clauses. Each clause can take the form of either: test-expr result-expr test-expr :>> result-fn Note :>> is an ordinary keyword. For each clause, (pred test-expr expr) is evaluated. If it returns logical true, the clause is a match. If a binary clause matches, the result-expr is returned, if a ternary clause matches, i...
02:35tieTYThow could I do that? Each test is either: (.contains "some string" src) or a regex match like (.regex-matches #"some regex" src)
02:35ucboh, I see
02:35tieTYTif all the tests were one or the other, condp seems like a fit, but not when it's a mixture
02:35ucbyou're trying to get rid of all the instances of src, right?
02:36tieTYTyep
02:36ucba side point, .regex-matches can be replaced by re-matches
02:36ucb(I believe)
02:36tieTYTyeah that's not a real method, i do use re-matches
02:36ucboh, right :)
02:37ucbI'm thinking whether you could have a pred that used apply or ->>
02:37ucbso that you could write your conditions like (re-matches #"regex")
02:37ucbor (contains "string")
02:38ucbTO THE REPL!
02:38tieTYTthe thing is, sometimes if the test passes I return true, sometimes I return false
02:38tieTYThah
02:38tieTYTI could use a macro for this right? one without generated symbols
02:39tieTYTI believe that's called unhygenic, I'm not sure though
02:39ucbhum, perhaps
02:40ucbthe alternative to cond is to have a list of these things and then drop-while falsey
02:40ucbI think that's some?
02:40ucb,(doc some?)
02:40clojurebotHuh?
02:40ucb,(doc some)
02:40clojurebot"([pred coll]); Returns the first logical true value of (pred x) for any x in coll, else nil. One common idiom is to use a set as pred, for example this will return :fred if :fred is in the sequence, otherwise nil: (some #{:fred} coll)"
02:41tieTYThm maybe
02:41ucbsomething like: (some (fn [f] (f s)) [(partial re-matches #"regex") (partial str-contains "string")...])
02:41tieTYTmaybe I could and/or two condps together
02:41ucbthing is, you wouldn't know which one matched :/
02:42tieTYTi don't need to know, it returns a bool
02:42tieTYTok thanks for the help, ttyl
02:42ucbenjoy
02:45rhg135Hi
02:45deadlockx2why so many people here...?
02:45rhg135Yup
02:45deadlockx2noone cares about clojure
02:45rhg135Get him!
02:46deadlockx2and taht proves my point... ppl in this channel for no reason...
02:46rhg135Poor deadlockx2
02:47deadlockx2ur alone in this matter rhg135
02:48rhg135I'll tell rich when I see him lol
02:48deadlockx2tell everyone... obviously, your dare turned out to backfire :P
02:48rhg135Know who he is?
02:49deadlockx2nopz
02:49mthvedtdon't feed the trolls
02:49rhg135The creator
02:49RaynesI don't Rich would care about this at all.
02:50rhg135I'm stuck with him anyway
02:50deadlockx2lol
02:50rhg135Ik
02:51noprompthe's joking right
02:51noprompts/right/right?
02:51rhg135No
02:51nopromptoh that's a roflcopter...
02:51rhg135He's said it twice
02:52deadlockx2the twiceys rule :o
02:52deadlockx2anything you say twice.. you mean it
02:53rhg135Yup
02:53nopromptworks for me!
02:53deadlockx2lol
02:54RaynesOhai noprompt.
02:54nopromptwuzzup.
02:55nopromptboy lemme tell you about eating your own dog food...
02:55RaynesI don't have any dog food.
02:55rhg135+deadlockx2> if (sleep musthappen) (do (skipit)) else (do(irc))
02:55rhg135<+deadlockx2> or some bs like that
02:55rhg135<@rhg135> Bad
02:55rhg135<+deadlockx2> yeah.. its cuz noone cares about clojure
02:55rhg135<@rhg135> Go on #clojure and say that lol
02:55rhg135<+deadlockx2> will do
02:55RaynesI don't have any food at all, in fact.
02:55nopromptyeah don't eat dog food.
02:55RaynesIt's okay if you don't like Clojure, guys.
02:56RaynesWe're all fine with it.
02:56nopromptyeah, like, i don't really care for ruby.
02:56nopromptbut if you care for it, then, like, well that's ok with me.
02:56rhg135The sad part is he likes java and oop
02:56RaynesYou can, in fact, say you hate it without causing us any pain and suffering. We would however appreciate it if you don't bother us with it for the rest of the night.
02:57RaynesThat's okay too.
02:57RaynesNot everybody likes our koolaid.
02:57deadlockx2theres koolaid involved?
02:57nopromptindeed, that would be ammenable.
02:57deadlockx2ok ok i retire my comments... i want some
02:57RaynesI have some koolaid right here.
02:57deadlockx2is it purple koolaid?
02:57RaynesCherry red.
02:57RaynesI don't like grape.
02:58deadlockx2that works too :D
02:58deadlockx2lol
02:58nopromptdoes this happen often?
02:58Raynesnoprompt: I've been using Vim all day.
02:58nopromptRaynes: for realz?
02:59RaynesYeah. I think I just get bored with editors.
03:00noprompti dunno man. i mean i think there's really only two out there you could possibly use.
03:00Raynesnoprompt: The cool thing is that by using evil-mode I can more or less switch between editors and not give any shits at all.
03:01nopromptRaynes: that's certainly true, but i have found it frustrating that i can emulate some things with evil.
03:01nopromptfor instance, i can't have a normal-state binding like ,el and have it do something.
03:01nopromptit seems limited to only two key strokes at this point.
03:02nopromptin vim i have normal mode maps like ,rbt for ToggleRainbowParens.
03:02nopromptvim is really great for that sort of thing.
03:04nopromptbut yeah i hear you.
03:05nopromptright now i'm trying to port my vim colorscheme to emacs.
03:05Raynestomorrow night <3
03:05RaynesWorks everywhere.
03:05RaynesEven refheap.
03:05nopromptyeah, it's definitely a nice theme.
03:06noprompta really cool colorscheme for Vim is Galaxy.
03:06noprompthttps://github.com/Rykka/galaxy.vim
03:06RaynesMY EYES
03:06RaynesMY EYEEEEEES
03:06nopromptit's actually a weird scheme. in that it has it's own color theming tool built in.
03:07nopromptthe defaults look pretty bad but it has a few different settings for some really nice dark themes.
03:08RaynesHoly shit.
03:08RaynesToday is Friday?
03:08RaynesWhere did this week go?
03:08RaynesI need to stop taking sleeping pills.
03:08RaynesI thought maybe Wednesday.
03:09jasonjcknRaynes: melatonin?
03:09Raynesdiphenhydramine
03:09nopromptRaynes: so were you doing clojure in vim?
03:10RaynesI'm doing it right now in fact.
03:10nopromptare you using fireplace or vimclojure?
03:10RaynesFireplace.
03:10Raynestpope is a boss.
03:10nopromptindeed.
03:10Raynesnoprompt: https://www.refheap.com/paste/0eeb2ab595cdeb786ac91eefb You missed this while you disappeared.
03:10jasonjcknYou know that emacs run vim right?
03:11jasonjcknit's called viper-mode :-P
03:11RaynesIt's called evil-mode.
03:11nopromptjassonjckn: sike, it's called evil-mode
03:11jasonjcknlol
03:11nopromptboom!
03:11jasonjckni tried it once, didn't like it either
03:11noprompt:)
03:11Raynesviper-mode is the completely ancient version.
03:11RaynesI use Emacs.
03:11RaynesBut today I used Vim.
03:11nopromptyah, viper's the pits bro.
03:11RaynesI mean.
03:11RaynesI use both guys.
03:11jasonjcknme too
03:11nopromptme three.
03:11RaynesI'm ambieditorxious.
03:11jasonjcknmy brain can switch easily between vim and emacs
03:11jasonjckni'm that smart
03:12nopromptmy brain cannot handle the default emacs keybindings.
03:12nopromptit's like when i tried to pick up dvorak.
03:12nopromptthat was painful.
03:12nopromptand i went back to qwerty.
03:12jasonjcknhave you tried default emacs AND dvorak, it's even more fun
03:12nopromptbut i doubt there's an evil mode for dvorak.
03:12nopromptjasonjckn: so you're asking me to commit suicide? is that it?
03:13noprompt:P
03:13RaynesMy boss uses a modified colemak on a kinesis advantage keyboard.
03:13RaynesGood luck beating that.
03:13jasonjcknI'm asking you to suck it up princess
03:13jasonjcknCrtl + X is painful, but then you realize you're alive
03:13noprompti really want one of these http://www.datahand.com/
03:13nopromptwell i have capslock bound to both ctrl and esc.
03:14nopromptesc on tap and ctrl on hold. so it's not so bad.
03:14jasonjcknRaynes: if it didn't take so long to change keyboard layouts i'd do that
03:14jasonjcknRaynes: but i learned dvorak when I was a teen
03:15nopromptwow colemak.
03:15RaynesPUT ON YOUR WAR PAINT!
03:15jasonjcknnoprompt: have you talked to anyone that uses datahand?
03:15ZerkerAs a teen, I'm trying to learn steno :P
03:15jasonjcknnoprompt: looks interesting
03:16Raynesnoprompt: You should go to the Fall Out Boy conference with me in September.
03:16Raynesconference? Wtf.
03:16RaynesConcert.
03:16nopromptLMFAO!!!
03:16nopromptfall out boy conference.
03:16RaynesThat's for the hardcore fans. I just want the concert.
03:16RaynesUnfortunately it is in Anaheim and I don't have any way to get there.
03:17jasonjcknZerker: that keyboard layout is just non-sense
03:17noprompti dunno man, i think i'd have to have a few before i went. that's really out of my element.
03:17RaynesBaha
03:17Raynesnoprompt: http://www.youtube.com/watch?v=5hDZbroaQDc
03:18noprompti had a roomate back in the day who was really in to those guys.
03:18ZerkerIt's based on pressing several keys at once to get less frequent ones, and typing syllables at a time
03:19nopromptZerker: which layou is that?
03:19RaynesI like this new album. I only liked a few of their older songs, noprompt. I like them mostly because they discovered Panic! At The Disco which is one of my favorite bands
03:19ZerkerStenotype xD
03:19noprompts/(ou)/\1t
03:19ZerkerS/\1/&/
03:20nopromptit's funny you bring that up Zerker. i saw a commercial on television the other day about court room reporters and it got me thinking about that.
03:21Raynesnoprompt: How do you feel about Imagine Dragons?
03:21nopromptso you can really hook a stenotype up and go for it?
03:21ZerkerYup, currently machines/software cost thousands of dollars, both are being open-sourced though
03:22nopromptRaynes: i have no idea. most of what i listen to is 60's/70's. occasionally i'll listen to some newer stuff though.
03:22nopromptZerker: that it is - so - awesome.
03:23Raynesnoprompt: http://www.youtube.com/watch?v=sENM2wA_FTg
03:23nopromptZerker: so you have one of those machines?
03:23nopromptlol. there isn't a depeche mode for emacs?
03:24ZerkerI have a gaming keyboard(nkro kinda necessary) with lasercut keys stuck on top of it, first iteration of "open-sourcing the hardware" ^-^
03:26nopromptRaynes: hmm... not really my taste. most of the stuff now-a-days more or less sounds the same. but i wouldn't knock someome if they liked it.
03:26ZerkerI'm at ~10WPM at the moment, but that's because I've been helping write code a lot more than actually drilling
03:27gunfacehi guys, is there a pdf version of the whole clojure official documentation somewhere, I tried but couldn't find :(
03:27caulagiIs noir the recommended way to develop web applications in Clojure?
03:28nopromptgunface: the internet is your pdf version.
03:28noprompt:)
03:28nopromptlol but i do kinda like Dragon Force, Raynes. as cheesey as they are.
03:29nopromptsomething about wizards and fighthing for glory somehow connects me deeply to what i do as a programmer. :)
03:29gunfaceahh ok, I thought i might find something to use offline
03:29gunfacebesides the doc function
03:29gunfaceok
03:29nopromptgunface: why not pick up one of the good clojure books as a pdf?
03:30nopromptgunface: remember you also have clojure.repl/doc and clojure.repl/source at your disposal.
03:30noprompt,(doc map)
03:30clojurebot"([f coll] [f c1 c2] [f c1 c2 c3] [f c1 c2 c3 & ...]); Returns a lazy sequence consisting of the result of applying f to the set of first items of each coll, followed by applying f to the set of second items in each coll, until any one of the colls is exhausted. Any remaining items in other colls are ignored. Function f should accept number-of-colls arguments."
03:30noprompt,(source clojure.string/join)
03:30clojurebotSource not found\n
03:30gunfaceno I have all of them but they don't go full fledged in the library functions
03:31nopromptgunface: you mean as far as examples?
03:31gunfaceyeah and full coverage of functions too
03:31gunfaceok repl will work for me
03:32nopromptwell you can also try clojure-doc.org or clojuredocs.org
03:33gunfaceyeah noprompt will do :)
03:33antares_caulagi: look into Compojure or Luminus. Noir is no longer maintained.
03:33nopromptgunface: try not to pick everything up all at once. you can get a lot done with map, reduce, seq, into, etc.
03:33nopromptcaulagi: there's also pedestal too.
03:34nopromptstill not sure what the consensus is on that, however.
03:34gunfaceyeah getting a hang of map,reduce,filter stuff
03:34nopromptgunface: also it's good to recognize when fn's like comp and partial will suit you.
03:35nopromptfor instance (partial apply some-fn) can be very concise and powerful.
03:35tgoossensi never actually used comp before i think
03:35tgoossens,(doc comp)
03:35clojurebot"([] [f] [f g] [f g h] [f1 f2 f3 & fs]); Takes a set of functions and returns a fn that is the composition of those fns. The returned fn takes a variable number of args, applies the rightmost of fns to the args, the next fn (right-to-left) to the result, etc."
03:35nopromptf circl g FTW
03:35noprompt;)
03:36gunfacecomp,partial,seq,into I haven't used looking them up
03:36nopromptcomp is just function composition
03:36gunfaceas of now doing 4clojure questions :)
03:37noprompt,(map (comp inc inc) (range 3))
03:37clojurebot(2 3 4)
03:37gunfacethe small sokutions of others hurt like a bitch though :P
03:38noprompti've never done any of those.
03:39gunfacethey seem good, the elementary ones are well, elementary but the later questions are good and have a code-golf thing in that so yeah a lot of map, reduce and functional stuff
03:39caulagiantares_:, noprompt: I will look at Luminus and pedestal, thanks
03:39nopromptbtw Raynes, if you use the vim-clojure-static files it has awesome regexp highlighting ;)
03:39RaynesI do.
03:40ejacksonRaynes got married ?
03:40nopromptRaynes: we didn't fuck around https://github.com/guns/vim-clojure-static/blob/master/syntax/clojure.vim#L78-L113
03:40RaynesDon't link me to viml man.
03:41noprompthttps://github.com/guns/vim-clojure-static/blob/master/clj/test/syntax_test.clj
03:41nopromptthat guy guns was pretty cool though coming up with a way to test the syntax files though.
03:41nopromptpretty clever.
03:41nopromptviml is nasty though...
03:43nopromptmy guess is that doing syntax highlighting in emacs is much better.
03:44noprompt*my guess*
03:48Raynesnoprompt: https://github.com/tpope/vim-fireplace/commit/77444275fda8e20ac2b92541398543fdd0fa2614 This is sad.
03:48RaynesI had to manually revert that .format() change to get it working.
03:48caulaginoprompt: does pedestal have templating? I.e. HTML is separate from Clojure?
03:50RaynesI hope not.
03:50RaynesThere are lots of good libraries for doing that.
03:50RaynesI'd hope that pedestal is flexible enough to let you use any of them.
03:50nopromptman that's a bummer.
03:50RaynesSee: laser, enlive, hiccup, clabango
03:50nopromptyou know i should give fireplace another chance.
03:50Raynesstencil
03:51nopromptcaulagi: yeah i dunno about html templating. with what's available, as Raynes just mentioned, it seems like a step backward.
03:52nopromptcaulagi: the consensus seems to be geared toward composing your application from the pieces you want to use. not an all inclusive monolithic framework.
03:53nopromptbtw laser is an awesome name and uses zippers which are way out rad stuff. :)
03:53caulaginoprompt: sure. But I don't want my Clojure code to generate HTML. I am just starting Clojure but it is much easier for me when the HTML is separate
03:54caulagiso what should I use?
03:54Ember-enlive maybe
03:54Ember-or well, you're just starting clojure...
03:54Ember-could be kinda a big leap then
03:54nopromptcaulagi: if you're just starting clojure then definitely do hiccup anyway.
03:54RaynesI prefer laser myself.
03:54Raynes<_<
03:54Raynes>_>
03:54Ember-it's purely functional, needs a bit of mind twisting to get around (enlive that is)
03:54noprompt:)
03:54Ember-Raynes: I wonder why ;)
03:55nopromptcaulagi: you can put your hiccup templates in a separate namespace.
03:55caulaginoprompt: by template, I mean a HTML file
03:56nopromptyes i understand that. i'm suggesting this as a thought expirement.
03:56RaynesClabango is probably most approachable option. I think the consensus is that laser and enlive are the coolest solutions.
03:56caulagiRaynes: Let me look at laser and enlive
03:56RaynesThey're also coincidentally the hardest to understand solutions.
03:57Ember-for a guy coming from oop world
03:57RaynesI have a guide, but Enlive has jack squat to help you understand how it works.
03:57Ember-not for a guy coming from the functional world
03:57RaynesNot that I'm promising miracles with my guide.
03:57Ember-an yeah, enlive is indeed lacking in documentation
03:57Ember-+d
03:57RaynesEmber-: Really? I started programming with Haskell and I couldn't figure Enlive out for a very long time.
03:57Glenjaminare there guidelines for handling error states in laser/enlive world - wouldn't you have to display all the errors on the page, and then have clojure turn them off?
03:57Ember-Raynes: :)
03:58RaynesGlenjamin: Or just conditionally display them.
03:58Glenjaminbut then where do you put them?
03:58RaynesYou probably can't do that easily in Enlive, but you can in Laser.
03:58RaynesLook at refheap.
03:58Glenjaminisn't the idea that a pure frontend person could build the templates, and then laser magically makes them dynamic?
03:58RaynesGlenjamin: https://github.com/Raynes/refheap/blob/master/src/refheap/views/paste.clj#L31
03:59caulagiRaynes: I still think Laser uses Clojure to generate HTML. Is that correct?
03:59Raynescaulagi: No.
03:59RaynesIt takes HTML and then transforms that HTML and spits it back out.
03:59RaynesI mean, there is only so much you can do.
03:59antares_Laser uses the power of unicorns. You can't expect less from Raynes.
03:59RaynesIf you want a dynamic website, you have to let your code touch your html.
03:59RaynesHi antares_
03:59Raynes:D
04:00Glenjaminsay for example i wanted to put inline errors next to form fields, i'd have to build my html as if everything had gone wrong, and then have laser hide them?
04:00nopromptRaynes: you know, after looking at enlive and laser i've wondered about CSS a bit more.
04:01nopromptof course CSS comes with a whole wonderful treasure trove of horse crap to deal with....
04:01noprompthtml is the only part of the front-end webstack that isn't totally fucked.
04:02Glenjaminactually https://github.com/Raynes/refheap/blob/master/src/refheap/views/paste.clj#L64 is a good example - this bit of content creation is hidden from the template author
04:04RaynesGlenjamin: There are really two options. You can either conditionally generate that HTML in your Clojure and put it in there, or you can put all of the cases in your HTML and then conditionally remove the pieces you don't need in the transformation.
04:04nopromptRaynes: are you guys hand authoring all the css?
04:04Raynesnoprompt: Yes.
04:05caulagiRaynes: what are the other pieces needed with laser?
04:05Glenjaminmm, i suppose the question i'm really asking is: is the goal to allow pure-frontend people to write the templates
04:05Glenjaminnoprompt: as opposed to with a pre-processor?
04:05RaynesGlenjamin: Yes.
04:05nopromptGlenjamin: yah
04:05Raynescaulagi: I mean remove the unnecessary pieces of HTML with the laser transformation.
04:06caulagiRaynes: I got that. I meant, what other libraries should I use? laser is only the html part, right? What about routing and stuff
04:06Raynescompojure is a good option
04:07RaynesYou should look at luminus. It'd help you get up and running pretty quickly.
04:07nopromptcompojure's the bomb.
04:07Raynes$google luminus web
04:07lazybot[Luminus - A Clojure Web Framework] http://www.luminusweb.net/
04:07Glenjaminso you'd either have a bunch of stuff to conditionally remove, or some stuff frontend guys can't change - I wonder if something funky could be done with clojurescript to provide state previews
04:07RaynesGlenjamin: Yes. You'd have this problem in any templating solution though.
04:08RaynesGlenjamin: I mean, there is a third option. You can have it as a separate template.
04:08RaynesBut template files with 1 line in them?
04:08RaynesBLEH
04:08Glenjaminyeah, but normally you'd throw logic into the template, so at least they can edit stuff - even if logic in templates is awful
04:08Glenjaminit's the balance between offline-preview and actually working online i guess
04:09Glenjaminanyway, i plan to have a proper go with laser once i've got my unstyled working beta deployed :)
04:11nopromptRaynes: would you be open to garden stylesheets once it's out of alpha?
04:11Raynesnoprompt: I don't really like doing that sort of thing in Clojure.
04:12RaynesHOWEVER!
04:12RaynesApparently my disdain for that is irrational.
04:12Raynescallen was complaining about duplication in my css file.
04:12nopromptwell there's always sass + compass, but that can get slow.
04:12Raynesnoprompt: I'd be open to it under the condition that it generate to a file and not just serve random magic.
04:12RaynesAs in, generate to a file on startup.
04:13RaynesAnd that you add it in and not me. :P
04:13Glenjaminnoprompt: do you have some notes for benefits over sass?
04:13nopromptRaynes: yeah that's how i do it now.
04:13Glenjaminor is it just speed?
04:13RaynesGlenjamin: Benefits? You do it in Clojure dude.
04:13nopromptGlenjamin: the benefits, imho, are not just speed.
04:13RaynesThat's the benefit.
04:14Glenjaminall css pre-processors are basically functional/declarative
04:14nopromptthe main benefit is consistency, which css lacks.
04:14nopromptand thus, sass lacks.
04:14nopromptor whatever preprocessor out there you use lacks.
04:15Glenjamininteresting, so you actually abstract away from raw CSS syntax?
04:15Glenjamininstead of being a superset
04:15nopromptto a degree yes. but i'm still working on it.
04:15nopromptit's got a decent base at the moment.
04:15nopromptand clear semantics.
04:16Glenjamini suspect the issue will be, how well does it fit the existing mental model people have of how css works
04:16noprompti've been working with CSS for almost 10 years now.
04:16Glenjaminthe current generation of pre-processors all lightly wrap CSS, i suspect thats because people don't want to learn something completely different
04:17noprompti'd say if you know it well enough, a mild shift in thinking is appropriate.
04:17nopromptas with lisp you have to slightly shift your thinking.
04:17Glenjaminmy current stance is that CSS is excellent for text formatting, awful for layout - and I'm interested to see if a tool can somehow fix that :p
04:18nopromptit's actually not that bad.
04:18noprompttoday i wrote a functional grid system.
04:19Glenjamini'm certainly intrigued
04:19nopromptso you provide the grid settings and you get back a grid function (a map) for which you can use to do layou
04:19nopromptie. [:section.main (grid :container)]
04:20noprompt[:.row (grid :row)]
04:20Glenjaminpresumably you have to retain calling order, rather than being declarative?
04:20nopromptwhat do you mean?
04:21nopromptby calling order? (a little tired)
04:21Glenjaminone of the things that bugs me about sass is if i define media queries next to the elements they apply to, it's not smart enough to group them all together by breakpoint
04:21nopromptoh righ.
04:21noprompt*right
04:21Glenjaminso they get scattered across the generated file, duplicating the breakpoint definition
04:21nopromptwell that's one of the thigns i'm thinking about.
04:22nopromptso my thinking is that when you compile the stylesheet it clearly separates "normal" rules and groups media queries as you would expect.
04:22nopromptnormal rules take precedence of course.
04:22Glenjaminmm, seems sensible
04:22nopromptin the future i want to be able to mark rules like this.
04:23noprompt^:screen [:div.row ...]
04:23Glenjaminreferencing other element's properties might be cool, not sure if needing that is a good thing though
04:23nopromptand then compile @media screen { div.row { ...
04:23nopromptwell why would you?
04:23nopromptyou don't need to because you're using clojure.
04:24nopromptjust call a function or use a def in some place
04:24Glenjamin[:div.main {:width (- 100 (ref :div.sidebar :width))}]
04:24nopromptah i see.
04:24noprompthmm... i need to think about that one.
04:24Glenjaminunsure if thats useful when you have grids
04:24nopromptbecause you could say (def sidebar-width (px whatever))
04:25nopromptand then [:div.main {:width (px- sidebar-width 100)}]
04:25nopromptgarden units automatically convert (when possible)
04:26nopromptbut still i think that's an interesting thought.
04:27nopromptone thing i'm kinda debating right now, and Glenjamin_ let me know your thoughts here, is a lone :& selector.
04:27nopromptit'd basically be like a mixing but w/o bs defmixin etc.
04:28noprompt*mixin
04:29nopromptRaynes: lemme tell you about the worst thing that ever happened in my recent life.
04:30RaynesExciting.
04:30nopromptthe company i worked for blocked the IRC ports...
04:30RaynesOh my goodness.
04:30nopromptyeah and what's worse is that i'd have to use some shitty irc client in the browser.
04:31nopromptneedless to say i've vanished from irc during the day.
04:31nopromptand it's been oh so sad.
04:31nopromptoh and they blocked most of the chat protocols too.
04:31RaynesI could fix that for you if you wanted to break company rules.
04:31RaynesIf they really just block IRC ports.
04:31noprompti'm all ears.
04:31RaynesI have a bouncer that runs on port 7776.
04:32RaynesIf they don't block that then I can give you an account on it and you can connect via it.
04:32nopromptthey really did, and they blocked the ssl ports as well.
04:32nopromptyeah it's blocked...
04:32Raynes7776?
04:32RaynesWow.
04:32nopromptthey've only left open the standard ports needed for existence like 22.
04:32RaynesQuit your job, man.
04:33nopromptif you know a place where i can go, please let me know.
04:33noprompti had to write a huge letter asking for the port to be reopened AT MY DESK.
04:33RaynesIf we blocked IRC ports at work I'd actually get work done.
04:34nopromptdude, i work for a newspaper company that can't get their shit together.
04:34iamdrwhowdy everybody, quick question — what is the idiomatic way of converting json to clojure map from clojurescript? as I understand clojure.data.json doesn't work there
04:34RaynesThis channel is publicly logged btw, noprompt.
04:34nopromptpoint being?
04:35noprompt;)
04:35RaynesYour company hatred is now google searchable. :p
04:35nopromptthat's ok. they don't understand the internets. :P
04:35RaynesHeh
04:35nopromptand for the record, i don't actually hate the company.
04:36noprompti work with great people. it's just that they have some weird approaches to solving problems.
04:37nopromptiamdrw: not sure. i guess i'd do (.toJSON (clj->js map))
04:37nopromptor whatever the method is in javascript to convert an object to json.
04:43iamdrwI want to convert json to hash map, there is a js->cli, but it's not actualy what I want
04:44iamdrwlike (json/read-str "{\"a\":1,\"b\":2}"
04:44iamdrw :key-fn keyword)
04:44iamdrwfrom clojure.data.json
04:45iamdrwbut I can't use it from clojure script :(
04:46nopromptright. hmm. but i thought javascript had a json parser.
04:46nopromptas in from a string.
04:47nopromptsorry it's been a little bit since i messed with cljs, or even js.
04:47noprompthttps://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/JSON/parse
04:48iamdrwno parsing json is not a problem, but that gives me a js object
04:48iamdrwand I want that js object to be converted to clojure map
04:48mpenet(js->clj x)
04:48nopromptand (js->clj obj) doesn't work?
04:49iamdrwit works, but I want to have keys be a keywords instead of strings
04:49iamdrwand I don't wan't to do conversion two times
04:50nopromptin that case you may have to.
04:51nopromptbut it makes sense to have them be strings. since this is valid json {"first name": "bob"}
04:51iamdrwmaybe I'll stick with that
04:52iamdrwbecause parsing whole object is a bit slow for big objects
04:52abpHell-o
04:52nopromptyeah, but you'd still have the same issue in raw js to btw.
04:52nopromptobj["first name"]
04:53nopromptbut most of the js engines are pretty fast. you'd have to have a really large js obj for it to be slow.
04:54noprompthave you tried to mimic clojure.data.json?
04:54nopromptwith stuff like :key-fn?
04:54iamdrwthe problem is that I don't have a clojure server, yet
04:55iamdrwit's a pure clojurescript app
04:56noprompthave you used vagrant before?
04:56nopromptyou could try it out on a fake server and get a feel for it.
04:57nopromptsometimes you have to do things twice. if there's a performance bottleneck then you worry.
04:58nopromptjust brainstorming here.
04:58mpenetiamdrw: you can have the keys as keywords if you use (js->clj x :keywordize-keys)
04:59mpenetiamdrw: (js->clj x :keywordize-keys true)
05:01nopromptah, good to know. wasn't aware of that.
05:01nopromptmpenet: but what about when the keys contain spaces?
05:01nopromptor worse symbols like @ or %
05:01mpenet,(keyword "foo bar")
05:01iamdrwthe json doesn't contain spaces
05:01clojurebot:foo bar
05:01mpenetyou need to be careful
05:02noprompt,(keyword "e@mail")
05:02clojurebot:e@mail
05:02nopromptwhoa.
05:03nopromptoh, i'm thinking of symbols as being problematic.
05:03iamdrw@mpenet — that's exactly what I want
05:03mpenetnoprompt: they arent I think, you have an example in mind?
05:04nopromptwell i'm not completely sure but i know having the % and @ characters and even the : character in symbols can cause the clojure reader to complain
05:05iamdrw@noprompt in general it's a problem, but in my case I have json of defined structure returned by api
05:06noprompthmm... well maybe not. i think that was a 1.4.0 problem
05:06nopromptseems to work fine in 1.5.0+
05:06Zerker,(keyword ":::")
05:06clojurebot::::
05:07noprompt,:::
05:07clojurebot#<RuntimeException java.lang.RuntimeException: Invalid token: :::>
05:07noprompt,:::
05:07noprompt,:::
05:07noprompt,:::
05:07noprompt,:::
05:07clojurebot#<RuntimeException java.lang.RuntimeException: Invalid token: :::>
05:07clojurebot#<RuntimeException java.lang.RuntimeException: Invalid token: :::>
05:07clojurebot#<RuntimeException java.lang.RuntimeException: Invalid token: :::>
05:07noprompt,:::
05:07clojurebot#<RuntimeException java.lang.RuntimeException: Invalid token: :::>
05:07clojurebot#<RuntimeException java.lang.RuntimeException: Invalid token: :::>
05:07noprompt,:::
05:07clojurebot#<RuntimeException java.lang.RuntimeException: Invalid token: :::>
05:07Zerker,(:::)
05:07clojurebot#<RuntimeException java.lang.RuntimeException: Invalid token: :::>
05:07noprompt,:::
05:07clojurebot#<RuntimeException java.lang.RuntimeException: Invalid token: :::>
05:08noprompt,:::
05:08clojurebot#<RuntimeException java.lang.RuntimeException: Invalid token: :::>
05:08nopromptsorry
05:08Zerker,(::)
05:08clojurebot#<RuntimeException java.lang.RuntimeException: Invalid token: ::>
05:08nopromptholy crap, i'm really sorry
05:08Zerker,'(::)
05:08clojurebot#<RuntimeException java.lang.RuntimeException: Invalid token: ::>
05:08nopromptevil-mode fail.......
05:08Zerker,(list (keyword ":"))
05:08clojurebot(::)
05:09nopromptreminds me of ruby
05:09nopromptwhere you can do stuff like "::".to_symbol but not ::
05:10Zerker,(eval '(list ::))
05:10clojurebot#<RuntimeException java.lang.RuntimeException: Invalid token: ::>
05:10nopromptok i think i'm gonna turn off evil-mode in erc
05:10Zerker,(quote (keyword ":"))
05:10clojurebot(keyword ":")
05:11Zerker,(eval (cons 'quote (keyword ":"))
05:11clojurebot#<RuntimeException java.lang.RuntimeException: EOF while reading>
05:12ZerkerZerker: (eval (cons 'quote (keyword ":"))
05:12nopromptwell that one actually makes sense
05:12Zerker,(eval (cons 'quote (keyword ":")))
05:12clojurebot#<Exception java.lang.Exception: SANBOX DENIED>
05:12Zerker'(eval 1)
05:13Zerker,(eval 1)
05:13clojurebot#<Exception java.lang.Exception: SANBOX DENIED>
05:13nopromptoh man, i think i broke it.
05:13noprompt(dec noprompt)
05:13lazybotYou can't adjust your own karma.
05:13Zerker,(cons (keyword ":") (keyword "::"))
05:13clojurebot#<IllegalArgumentException java.lang.IllegalArgumentException: Don't know how to create ISeq from: clojure.lang.Keyword>
05:14nopromptwhen i tried (eval (cons 'quote (keyword ":")))
05:14noprompti got: IllegalArgumentException Don't know how to create ISeq from: clojure.lang.Keyword clojure.lang.RT.seqFrom (RT.java:505)
05:14noprompt
05:14Zerker,(cons (keyword ":") '())
05:14clojurebot(::)
05:14nopromptweird
05:15ZerkerI think evals are just prohibited, same as defs
05:18nopromptmakes sense.
05:24nopromptweavejester: why is html a macro in hiccup?
05:24Raynesnoprompt: Optimization purposes mostly, IIRC.
05:24Raynesnoprompt: It generates as much of your HTML at compile-time as possible.
05:26nopromptinteresting. that makes sense. i switched garden.core/css to a function today because i wasn't sure if i needed ito be a macro at this point.
05:26noprompti'm not that advanced yet.
05:27noprompti'm still trying to comprehend much of the hiccup source.
05:32nopromptwell i'm out for the night.
05:32RaynesNight
05:32noprompt:)
05:32nopromptlaters.
05:50ordnungswidrigre
05:52abpAny suggestions on how to store a ring app's configuration? I've got different environments like dev, test, staging, live. So I'm leaning towards having dev as a map of the basic configuration, merging in specific settings per environment. What environment the app is started in would be determined via an environment variable. (No set variable raises an error)
05:52weavejesterabp: I tend to use environ
05:57abpweavejester: Yea, already seen environ. That seems more basic than what I need. Probably combined with carica I could do everything I think off.
05:57abpweavejester: Also, your clojure-toolbox is missing a config section. ;)
05:59RaynesOh, I guess...
05:59Raynesweavejester: https://github.com/Raynes/leasdt
05:59RaynesEr.
05:59Raynesweavejester: https://github.com/Raynes/least
05:59RaynesHighly doubt you have a category for that one.
05:59RaynesBut there it is nonetheless.
06:00abpRaynes: Web API Clients, your tentacles are in there. :P
06:00Raynesorly
06:00RaynesWell, that works then.
06:17Raynes$lfmassoc RaynesFM
06:17lazybotAssociated your username.
06:17Raynes$last
06:17lazybotRaynesFM is listening to: Fall Out Boy - The Phoenix [Save Rock And Roll]
06:18RaynesWelp, that was about 4 hours of work.
06:18RaynesIt's 3:17AM. I can't believe I stayed up this late working on that.
06:18RaynesI have to go to work in the morning.
06:18clgvRaynes: that's called passion ;)
06:18RaynesIt's called stupidity.
06:18RaynesI just traded my well being tomorrow for a moment of pleasure tonight. :P
06:18clgvThats what the unpassionate say ;)
06:19RaynesSad part is that at least 2 of those 4 hours was fighting with vim-fireplace (found a couple of bugs).
06:19clgvthat sucks
06:22RaynesWell. I'm going to sleep. Hard.
06:22RaynesGoodnight #clojure.
06:27filippobohi there
06:27filippoboI have a seq of sets like: (def in '(#{1 6} #{3 4} #{2 5}))
06:28filippobohow can I get something like (def out '(1 6 3 4 2 5)) ?
06:29clgvgood night raynes
06:29clgv,(reduce into [] '(#{1 6} #{3 4} #{2 5}))
06:29clojurebot[1 6 3 4 2 ...]
06:30filippobointo is the key!
06:30clgvno guarantees on order though
06:30hyPiRionyeah
06:30filippobothanks clgv ;-)
06:31filippobook... the sets are actually ordered-set
06:31hyPiRion,(= (set (range -20 20)) (set (range 19 -21 -1)))
06:31clojurebottrue
06:31clgvwell, then you have a guarantee ;)
06:31filippobosorted-set
06:31hyPiRion,(= (seq (set (range -20 20))) (seq (set (range 19 -21 -1))))
06:31clojurebotfalse
06:44clgv,(= (seq (sorted-set (range -20 20))) (seq (sorted-set (range 19 -21 -1))))
06:44clojurebotfalse
06:45hyPiRion,(= (sorted-set (range -20 20)) (sorted-set (range 19 -21 -1)))
06:45clojurebot#<ClassCastException java.lang.ClassCastException: clojure.lang.LazySeq cannot be cast to java.lang.Comparable>
06:45hyPiRionaha!
06:46hyPiRion,(= (apply sorted-set (range -20 20)) (apply sorted-set (range 19 -21 -1)))
06:46clojurebottrue
06:48clgvah damn. there was an asymmetrie...
06:49hyPiRionwell
06:49hyPiRionset != hash-set
06:57ambrosebshyPiRion: whats the difference?
07:01hyPiRion,(set (range 5))
07:01clojurebot#{0 1 2 3 4}
07:02hyPiRion,(hash-set (range 5))
07:02clojurebot#{(0 1 2 3 4)}
07:02hyPiRionambrosebs: I was talking about the functions, not the specific classes :)
07:02ambrosebsGot it :)
07:15samratRaynes: I'm getting a "Invalid method signature supplied" error in least while trying the `write` example in the readme
07:26naegwhat's the reader sugar behind #"regex"?
07:27hyPiRionnaeg: what do you ask?
07:28hyPiRion,#"\d+"
07:28clojurebot#"\d+"
07:28naeghyPiRion: actually I want to make a regex out of a normal string
07:28hyPiRion,(re-find "1234 12421" #"\d+")
07:28clojurebot#<ClassCastException java.lang.ClassCastException: java.lang.String cannot be cast to java.util.regex.Pattern>
07:28hyPiRionwhoops.
07:28hyPiRionnaeg: oh, in that case you should probably use Pattern.
07:29naeghyPiRion: btw, I found out what was wrong with my alpha-beta algorithm
07:30hyPiRion,(java.util.regex.Pattern/compile "\\d+") ;; from string
07:30clojurebot#"\d+"
07:30hyPiRionoh?
07:30naeg(take-while cond (reductions ...)) doesn't work since
07:30naeg,(last (take-while #(< % 100) [20 40 100 30]))
07:30clojurebot40
07:30naegwon't return the 100, which I actually wanted
07:30naeghad to use reduce/reduced now
07:31hyPiRionoh
07:32Zerker,(first (take-while #(>= % 100) [20 40 100 30]))
07:32clojurebotnil
07:33Zerker,(doc take-until)
07:33clojurebotCool story bro.
07:33hyPiRionheheh
07:33hyPiRiondrop-while
07:34hyPiRion,(drop-while #(< % 100) [20 40 100 30])
07:34clojurebot(100 30)
07:34Zerkernaeg: ^?
07:34naegZerker: but can't use drop-while either, since that will realize the calls returned by (reductions ...)
07:35naegwere I put numbers in that example, there are actually function calls which where not realized yet, and should not be realized more than needed
07:35Zerkerdrop-while isn't lazy?
07:36naegit is, but still the 30 is realized when you do
07:36naeg,(first (drop-while #(< % 100) [20 40 100 30]))
07:36clojurebot100
07:36naeg...I think
07:36naegchecking...
07:38hyPiRionZerker: it's the common issue
07:38hyPiRion,(take 1 (map #(do (pr \.) 0) (range)))
07:38clojurebot#<ArityException clojure.lang.ArityException: Wrong number of args (1) passed to: sandbox$eval35$fn>
07:38hyPiRion,(take 1 (map #(do (pr \.) %) (range)))
07:38clojurebot(\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.0)
07:38hyPiRionit's semilazy
07:40naeg,(drop-while #(< % 100) (reductions #(do (println %) (inc %2)) [98 99 100 101]))
07:40clojurebot(98\n100\n100 101\n101 102)
07:40naegsee, the call with 101 as arg is realized too
08:49gdevgood morning fellow clojurist for whom the hour is indeed morning, else good afternoon or evening
08:56gdev, ((comparator >) 1/3 0.3333333333333333)
08:56clojurebot0
08:56gdev, ((comparator >) 1/3 0.333333333333333)
08:56clojurebot-1
08:57namespace(Please note, I have no way of evaluating the strength of this code, so I'm assuming it's bad.)
08:57namespacehttp://pastebin.com/WQPsDwJj
08:58namespaceI'm trying to print every line that ends with a question mark, and then print every line before it until one starts with an upper case letter.
08:59namespaceThe error message I get is "ClassCastException java.lang.Long cannot be cast to clojure.lang.IFn " which I read means I can't cast a long to a function.
09:00dnolennamespace: it means you're trying to invoke a number as a function
09:00dnolen,(1 'foo)
09:00clojurebot#<ClassCastException java.lang.ClassCastException: java.lang.Long cannot be cast to clojure.lang.IFn>
09:00namespaceRight.
09:00namespaceI don't see where I'm doing that.
09:05dnolennamespace: might be easier to see what's going if you provided the inputs you're using
09:06namespaceThat's the problem.
09:06namespaceThey're probably under copyright.
09:06namespace-_-
09:06dnolennamespace: I'm sure you can come up w/ sample inputs that don't infringe
09:06namespaceOkay.
09:08clgvnamespace: you should definitely lean about "let"
09:08clgv*learn
09:08namespaceclgv: Noted.
09:09clgvthere are far too many repetitions in your code snippet
09:09namespaceI know about it, but don't know how it would help here.
09:09clgvnamespace: better code is easier to understand by other
09:09namespaceI'm sure when you point it out I'll go "Oh, I see, I'm dumb.".
09:10dnolennamespace: you have a lot of code duplication, (first ln) (last ln)
09:10dnolennamespace: https://gist.github.com/swannodette/5420253
09:11namespaceSo that's how I'm supposed to indent it.
09:12dnolennamespace: update to remove all repeated (get vec f). that's how I would indent it anyways.
09:12clgv(get vec f) should also be calculated only once ^^
09:12namespacehttp://pastebin.com/5Bndgr0x Sample input
09:13dnolennamespace: but what parameter is that, your function takes two arguments
09:14namespacevec
09:14dnolennamespace: and what is the first argument?
09:14dnolennamespace: can't test your fn w/o know both
09:14dnolenknowing
09:14namespaceRight.
09:14namespace(0 1)
09:16dnolennamespace: do you mean '(0 1) ?
09:16namespaceSo it should print everything except "And in other news..."
09:16namespaceMaybe.
09:17noncomso i'm like trying to include a simple jar (not anywhere on clojars or sonatype but local) into a lein project
09:17dnolennamespace: yes or no? if you're inputing (0 1) that's the source of your error right there.
09:17dnolen,(0 1)
09:17clojurebot#<ClassCastException java.lang.ClassCastException: java.lang.Long cannot be cast to clojure.lang.IFn>
09:17namespaceI don't know.
09:18noncomand in lein deps it says that it cannot get it since there is a typo in :dependencies or network issue
09:18namespaceAnd thinking about it, yes.
09:18dnolennamespace: well I can't help you if you don't know :)
09:18namespaceIt's definitely the problem.
09:18namespaceThank you.
09:18noncomi followed this guide : http://www.pgrs.net/2011/10/30/using-local-jars-with-leiningen/
09:18dnolennamespace: you're also going to get null pointer exceptions in your code
09:18dnolennamespace: ((print x) (questions (cons (inc l) l) vec))
09:19dnolenprint returns nil
09:19namespaceOh.
09:19dnolenand then you try to invoke it
09:19dnolenyou probably want:
09:19dnolen(do (print x) (questions (cons (inc l) l) vec))
09:19namespaceYes, yes I do.
09:21namespaceNotes for the future: 1. Look up how to indent. 2. Use let to shorten things I do more than once. 3. Use do. 4. Provide input along with the function. Did I get everything?
09:23dnolennamespace: the purpose of the ln parameter seems a bit convoluted. I'd look into eliminating it
09:23namespaceOh right.
09:23namespaceI took that as a given.
09:25dnolennamespace: also on large enough inputs your program will probably stackoverflow. it appears it will do that anyway as I don't see a terminal condition and every branch recursively calls questions again.
09:26namespaceThe terminal condition is "the program crashes". It's standalone.
09:27noncomso anyone knows how to link not maven-enabled jars to a lein project?
09:27joegallononcom: mvn install them
09:29joegalloFAQ #4 https://github.com/technomancy/leiningen/blob/master/doc/FAQ.md
09:32clgvnoncom:better do not - it is easy to add them to clojars. I have done that twice
09:36noncommvn install or lein install gives errors... andidk how to push to clojars since it is a java lib
09:37noncomif you point to an instruction, i think it will help
09:37clgvnoncom: just write a minimal pom and "scp" the jar with he pom to clojars
09:37noncomi did this: "mvn install:install-file -Dfile=jaad-0.8.3.jar -DartifactId=jaad -Dversion=0.8.3 -DgroupId=jaad -Dpackaging=jar -DlocalRepositoryPath=maven_repository" and maven created a pom
09:38noncomso there is one. does it have to be in the same folder as the jar?
09:39joegalloyes
09:39joegalloit's doesn't just know where random jar files are on your machine
09:40clgvnoncom: just do "scp jaad.pom jaad-0.8.3.jar clojars@clojars.org" provided you have an account at clojars and your user accoutns public ssh key is registered there
09:40noncomwell it created the folder structure itself so i presumed it knew where all things are
09:40clgvnoncom: https://github.com/ato/clojars-web/wiki/Pushing#ssh
09:41clgvoops pom.xml it is ;)
09:41noncomjoegallo: whatever i do, even putting both the jar and the pom into the same dir, now, mvn install yields this: [ERROR] The goal you specified requires a project to execute but there is no POM in this directory
09:42noncomclgv: i'll try that! first i have to register on clojars and get the ssh though )))
09:42noncomi'm rather new to clojure so nothing is ready yet
09:43clgvnoncom: are you on a linux machine?
09:44noncomclgv: nope) it'swin7
09:44noncomhere is the pom that it generated: http://pastebin.com/UJBvRTBn, the library is named minim-2.1.0.jar
09:44noncomtheyre in the same folder...
09:45noncomehh... intended to be simple, but still lots of convolute things
09:45noncommaybe there is some definite instruction on that.. there should be some standard way of deadling with this, no?
09:47noncomi'll also try the ssh way now, i know how to make it work on windows, i did it before
09:48clgv:)
09:48noncombut why so hard...
09:48joegallobecause you're doing something out of the ordinary
09:49noncomsure, i trust you, but i can't believe that using arbitrary java jars in my project on java machine is not ordinary :D
09:50joegalloyou're right, i tell lies to newbies on the internet just for fun
09:50noncom:DDD
09:52joegallohttps://gist.github.com/anonymous/aa0556dd7dbacd1e0a7e/raw/76ed293ad6b658cff154878e813d7c2d763895d2/gistfile1.txt
09:52joegalloi dunno what to tell ya, buddy, it works fine here
09:59noncomjoegallo: ok i did that the last time and it created the pom. now i did it again with your command (like removing .0 in the version which is like insignificant)... and the report is the same as yours - all success, but lein deps gives errors. here is the pastebin with the lein error and my project.clj file: http://pastebin.com/D7Jytnjx
10:02namespaceAnother stupid question: Is there a lib I need to load at runtime to get the clojure interop?
10:02clgvnoncom: if you install it only locally I hope you have only one development machine and it's a private project ;)
10:03borkdudenamespace interop from java or what?
10:23noncomTimMc: yeah, agree. just have to accustomize myself with the system. see i'm coming from a stone age when jars were plugged-in manually. hey i used sbt for scala but there are not problems like that..
10:23noncominternet repository i consider a major good since it helps centralization and is a result of evolution
10:25TimMcMore importantly, it helps with repeatability.
10:25TimMc~repeatability
10:25clojurebotrepeatability is crucial for builds, see https://github.com/technomancy/leiningen/wiki/Repeatability
10:27noncomooh!)
10:27mefestois there a definitive index of ClojureScript libraries?
10:50mefestoin clojurescript, is there a built-in function for converting a NodeList to a seq or vector?
10:53gdevis there a schedule for the google hangout sessions? I always see those posted after they're over.
11:00dnolenmefesto: no but you can easily extend NodeList to ISeq, ILookup etc yourself.
11:00ppppaulwhen would i use reverse over rseq?
11:00mefestodnolen: ok thanks
11:01noncomwhat is the idiomatic way in clojure to name variables whose names collide with standard ones. like i have a fn argument named "name"
11:02dnolenppppaul: reverse calls rseq
11:02mpenetnoncom: in most case I wouldn't bother, unless you need clj.core/name in your fn
11:08ppppaulon clojuredocs the source says otherwise
11:08ppppaulmaybe this has changed past 1.3
11:08noncom_mpenet: yeah, i mostly don't but this is the case.. so ok, i just make some prefix i think
11:13tmcivernoncom_: the way to exclude a name is like this: http://clojuredocs.org/clojure_core/1.2.0/clojure.core/refer-clojure
11:14noncom_yeah...
11:20naeghow to [0 1 2 3] => [[0 1] [2 3]]?
11:20naegit's so simple, but can't remember...
11:20ucb,(doc partition)
11:20clojurebot"([n coll] [n step coll] [n step pad coll]); Returns a lazy sequence of lists of n items each, at offsets step apart. If step is not supplied, defaults to n, i.e. the partitions do not overlap. If a pad collection is supplied, use its elements as necessary to complete last partition upto n items. In case there are not enough padding elements, return a partition with less than n items."
11:20ucbnaeg: ^^^
11:20naegucb: thanks! I remember now...
11:29AndChat718256,(doc seq)
11:29clojurebot"([coll]); Returns a seq on the collection. If the collection is empty, returns nil. (seq nil) returns nil. seq also works on Strings, native Java arrays (of reference types) and any objects that implement Iterable."
11:33joegalloucb: ##(seq (apply hash-map [0 1 2 3])) ; the subtle bugs this would result in would so amazingly devious
11:33lazybot⇒ ([0 1] [2 3])
11:34ucbheh - nice joegallo
11:34joegallowe really need an evil bot to answer questions with misleading code that happens to work for their simple answer
11:34ucbisn't there a findfn thing that'll do something like that already?
11:34joegallowell, it give non-evil answers, too
11:35ucbyeah
11:38TimMcjoegallo: ##(trampoline + 2 3)
11:38lazybot⇒ 5
12:04technomancyjoegallo: lazybot answers a bunch of questions in the negative; that could be considered evil
12:11gunfaceIs there anyway to connect privately to the clojurebot so that everyone doesn't see my error messages? :P
12:11gdevyeah, hit ctrl+alt + t, type lein repl, hit enter
12:11hiredmanit's called "a repl" you can even run it on your computer
12:13tpopeRaynes: pong (already rolled back the problematic commit)
12:21TimMcgunface: Private-message it.
12:22TimMcBut yes, `lein repl` also works surprisingly well as a repl. :-P
12:22technomancyeh; it's all right I guess
12:24rkhHehehe.
12:24gunfaceYeah but I am on my android far away from lein :P
12:24gdevtheres an android repl app
12:25gunfaceThere is :O
12:25gdevhttps://play.google.com/store/apps/details?id=com.sattvik.clojure_repl&amp;hl=en
12:27gdevDaniel Solano Gomez also did a talk about getting clojure on android which is on youtube
12:29gunfacegdev you just made my commutes so much more fun :)
12:29gunfaceThanks a lot
12:29gunfaceAnd yeah will check that talk
12:31luxbockI'm learning Clojure (and programming in general) by creating an application for analyzing poker hands
12:32luxbockatm I'm working on interpreting handranges (for example: AK, ATs would be a range that includes all combinations of Ace King, and Ace Ten suited)
12:32luxbockhere are the full list of hand range macros I have in mind: https://www.refheap.com/paste/13773
12:33ToBeReplacedi just did my first clojars release! https://github.com/ToBeReplaced/jdbc-format ... high-fives?
12:33luxbockso these are all strings that then get translated to the proper card data type representation (they are just vectors)
12:34luxbockI figured that before I jump to the task at hand, I should ask here about what's the best way to go about implementing it
12:34luxbockshould I just use regex or are there alternatives to that?
12:35nzluxbock: last night I saw a presentation on how to do poker hand detection using core.logic https://github.com/PasiHeikkinen/poker
12:35luxbockoh cool
12:35nzluxbock: which is not the way to go if you need any kind of speed
12:36TimMcToBeReplaced: Sweet! Did you sign it?
12:37luxbockyeah speed is definitely an issue further down the road
12:38nzluxbock: some links: http://spaz.ca/poker/ http://poker.cs.ualberta.ca/
12:39luxbockyep, I've read their stuff before
12:40luxbockthough now my focus is more on how to learn how to program and less on how to play poker :)
12:40ToBeReplacedTimMc: no i didn't; can you link me somewhere to learn about that?
12:43rboydluxbock: so this is for classifying holdem starting hands/hole cards?
12:43luxbockyep
12:43rboydluxbock: there's https://github.com/jamesmacaulay/poker-hands for ranking 5 card hands. also a pr in there from me on finding the best 5 of 7
12:43rboydnot exactly what you're trying to do but maybe useful later
12:45luxbockthanks
12:45TimMcToBeReplaced: `lein help gpg`, or https://github.com/technomancy/leiningen/blob/stable/doc/GPG.md
12:45TimMcBasically, create a GPG keypair and use lein deploy. (This is all lein 2.)
12:46TimMcOnce everything is set up it is easy-peasy.
12:47ToBeReplacedi guess it auto-signs on lein deploy clojars?
12:49ToBeReplacedis there a way to sign a version already uploaded?
12:49xeqiToBeReplaced: yep, trying to make it easy
12:49xeqiand no, but would you really want to sign a jar that was on the internet
12:50ToBeReplacedgood point
12:50xeqithough atm you do have to assume we're not messing with the jars to use the ecosystem :p
12:51TimMcToBeReplaced: The easiest thing to do is make another commit bumping the version number at the patch level ("bugfix: jar was not signed") and then lein deploy that.
12:51ToBeReplacedwhere can you see whether or not something was signed? i had filled out my ssh public key prior to deploy
12:52TimMcxeqi: I can see a potential problem here for people who are doing their first signing.
12:52xeqithere is a .asc file in the repo, I really should add some sorta flair to the artifact page for signed / releases repo stuff
12:53TimMcTry to deploy; signing fails; can't re-deploy over artifact; bump the version; try to deploy the new version; signing fails for another and exciting reason...
12:54xeqiTimMc: the signing happens before the push to the server
12:54xeqiall the server does is save the files, all the logic is client side
12:54technomancyTimMc: you don't have to bump the version number ATM
12:54technomancywe're just discussing making that change; hasn't happened yet
12:55technomancyyou can just redeploy currently
12:59ToBeReplacedhm... so i definitely didn't add a gpg key before deploying... but it is showing up as signed with lein deps :verify; if i filled out ssh public key, does that count as a signature?
13:00xeqiToBeReplaced: no, that just lets you deploy wit hssh, which used to be the normal way to do it
13:00technomancyToBeReplaced: whether it's signed is different from whether clojars can verify the signature server-side
13:00technomancyToBeReplaced: for Clojars to verify, it needs your gpg key to be added to your profile
13:00technomancybut it will happily serve a signature you deploy without verifying it
13:00xeqiit appears that you did sign it https://clojars.org/repo/jdbc-format/jdbc-format/0.1.0/
13:03ToBeReplacedso i assume that since i already had a gpg pair, lein deploy clojars signed the jar... then when i added my pub key to my clojars profile, it was able to verify?
13:04TimMctechnomancy: But once overwriting is prevented, this could become an issue.
13:05technomancyindeed
13:05TimMcI guess if you can prevent the deploy if signing fails, it's all good.
13:07ToBeReplacedis there a thread where i can read about the decision for clojars to use gpg?
13:08augustlanyone got some favorite clojure swag webshops? :)
13:09technomancyToBeReplaced: all the infrastructure around Maven assumes GPG, and it has hands-down the best tooling for this kind of thing
13:10technomancyToBeReplaced: do you mean GPG vs another signing mechanism, or do you mean the decision to encourage signing in general?
13:10ToBeReplacedboth? i'm not sure what i'm asking... i don't know what factors come into play
13:11ToBeReplacedi'm just kinda surprised by me having signed something without knowing it
13:14technomancyit didn't prompt you for your passphrase?
13:14technomancybut yeah, I think the output could be clearer
13:15TimMcToBeReplaced: I didn't like it using my regular GPG key for software signing, so I added a key selection patch. It was a bit startling.
13:15ToBeReplacedtechnomancy: it did, you're right
13:16technomancyit could definitely be clearer about why it's asking
13:17ToBeReplacedyou know, i think i was just confused; it all seems to make sense now
13:18technomancythere's kind of a lot going on
13:19technomancyI wonder if we could de-emphasise the SSH pubkey section of the profile
13:19billy_bodaciousim using lein ring uberjar but it throws a classnotfound exception regarding a require in a ns, where as lein uberjar works fine, anyone have a clue as to why
13:19ToBeReplacedi got confused because of the combination of ssh and gpg
13:19technomancyToBeReplaced: SSH is legacy
13:20weavejesterbilly_bodacious: lein uberjar doesn't necessarily compile anything, but lein ring uberjar currently works using an AOT-compiled servlet class
13:20ToBeReplacedi probably glossed over the gpg thinking it was ssh -- is there any reason to keep an ssh pub key in my clojars profile now?
13:20ToBeReplacedsince no scp etc.
13:20weavejesterReally it should probably use a static java class that calls the Clojure code, but I haven't got around to writing that
13:20TimMclein 1
13:20billy_bodaciousweavejester: so how do i start to fix this?
13:22billy_bodaciousweavejester: i can run lein repl and require it.. it even works fine with lein ring server
13:22tieTYT2hi weavejester: maybe you can help me with my issue: http://stackoverflow.com/questions/16094439/is-it-possible-to-build-a-ring-webapp-in-an-already-existing-javaee-project
13:22technomancyToBeReplaced: we don't want to remove scp for people who are currently using it
13:23weavejesterbilly_bodacious: I'd have to see the full error
13:23technomancyToBeReplaced: but we could move it to an "advanced" section or something
13:24weavejestertieTYT2: No idea I'm afraid. I know servlets pretty well, but little beyond that in the Java web development stack.
13:24tieTYT2aw :( ok
13:26tieTYT2since I can't use compojure at work, I'm thinking of cheating and making a library called clojersey that converts compojure-like code into jersey resources
13:26billy_bodaciousweavejester: http://pastebin.com/NBees1gW
13:28weavejesterbilly_bodacious: Hm, doesn't really have much useful information there… Have you tried a "lein clean"? Perhaps there's some old servlet class file screwing things up.
13:28xeqitechnomancy: agreed re: demphasizing ssh key. want to make an issue?
13:28billy_bodaciousweavejester: yes i have
13:30weavejesterbilly_bodacious: Hum, no idea what the issue is. It's strange that the NPE is triggered by the compiler… What does your project file look like?
13:32billy_bodaciousweavejester: http://pastebin.com/Lemfxzqv
13:32weavejesterbilly_bodacious: There's no lein-ring plugin in that project file...
13:32billy_bodaciousits in my global profile
13:33billy_bodaciousdoes it need to be in the project file?
13:33weavejesterbilly_bodacious: Well, it's possible to put it in the global profile, but it doesn't make much sense to do so
13:34weavejesterbilly_bodacious: Presumably you've also put the lein-ring configuration for your project in your global profile as well?
13:34billy_bodaciousweavejester: no additional configuration in there
13:35weavejesterbilly_bodacious: So where's your :ring {:handler my.app.blah/handler} ?
13:35billy_bodaciousoh the last line got cutoff in the past
13:35billy_bodaciousit's: :ring {:handler overdue-invoices.core/handler})
13:36billy_bodaciousi added ring to the plugins but still got the same error
13:37weavejesterbilly_bodacious: You could try adding lein-ring to the project.clj file. I can't think why that would make a difference, but it's worth reducing the number of unusual elements.
13:37weavejesterbilly_bodacious: What version are you using? 0.8.3?
13:38billy_bodaciousweavejester: yea
13:38weavejesterTry removing it from your global profile and putting it in your project.clj.
13:39billy_bodaciousjust a second
13:40billy_bodacioussame error
13:41billy_bodaciousjust doing lein compile overdue-invoices.core gives the same error, so i guess its not related to the ring plugin
13:41weavejesterbilly_bodacious: Ahh, that would explain things.
13:42weavejesterWell, at least why lein-ring can't compile it
13:52gdevToBeReplaced:) I'm working on a small clojure project that hits a relational database so I'll try out your jdbc-format library.
14:00technomancyxeqi: ah, you created it; thanks
14:03ToBeReplacedgdev: that would be cool! i'd appreciate the feedback
14:03clojure-newhello
14:03clojure-new,(pmap (fn [_] (println "Downloading ")) (range 3))
14:03clojurebot#<SecurityException java.lang.SecurityException: no threads please>
14:03clojure-new&(pmap (fn [_] (println "Downloading ")) (range 3))
14:03lazybotjava.lang.SecurityException: You tripped the alarm! pmap is bad!
14:04billy_bodaciousweavejester: i think i have fixed it, but now uberwar just seems to hang forver, it almost looks like its running my project..
14:04rasmustolazybot: pmap isn't necessarily bad always
14:04clojure-newanyway, why does println in pman doesn't insert newlines like it does without pmap?
14:04weavejesterbilly_bodacious: One of your source files probably blocks when it's evaluated.
14:05weavejesterbilly_bodacious: When Clojure compiles things, it evaluates the whole namespace
14:05clojure-newit inserts it in random way.
14:05clojure-newfor example
14:05clojure-new(pmap (fn [_] (println "a")) (range 3)) => aaa\n\n\n
14:05clojure-newor
14:05clojure-new(pmap (fn [_] (println "a")) (range 3)) => aa\na\n\n
14:06clojure-newhow can i print something inside pmap?
14:06Glenjaminyou probably need a thread-safe output stream of some sort
14:06Glenjaminwhy do you need to print in a pmap?
14:07weavejesterclojure-new: pmap runs things from multiple threads. When multiple threads are writing to stdout, they can overlap.
14:07clojure-newweavejester: oh, i see, thanks.
14:07clojure-newGlenjamin: just info messages about how well my functions are doing their job.
14:08jjidotrying to understand how it works maybe
14:08clojure-newis there any thread safe println in clojure?
14:08weavejesterNot to my knowledge. Nor in Java. It's not something that people typically need.
14:09Glenjaminlogging frameworks usually would be
14:09jjidologging
14:09weavejesterOh, that's true
14:09Glenjaminhttp://stackoverflow.com/questions/565893/best-practices-for-java-logging-from-multiple-threads
14:10clojure-newGlenjamin: thanks@
14:10clojure-new!
14:11amalloyhaha guys, andy's tickets-needing-work email introduced me to a neat bug:
14:11amalloy&[do 1 2 3 4]
14:11lazybot⇒ 4
14:11Glenjamini'm not very familiar with the clojure logging options, but that page describes the general idea
14:12technomancywhoa
14:12Glenjaminthats weird o.O
14:12Glenjamini guess that's only with do?
14:12technomancyoh!
14:12technomancybecause of the gilardi scenario workaround
14:12technomancythat's bonkers; I love it
14:12amalloytechnomancy: what workaround?
14:13technomancyamalloy: the reason (do (require 'clojure.set) clojure.set/join) doesn't asplode
14:13technomancydo is special-cased by eval to split it apart and doseq over evaling each part individually
14:17jjidois this only in eval scenario ?
14:17technomancyjjido: yeah
14:18technomancyalso only works with top-level do
14:26TimMctechnomancy: But it doesn't need to work with sets and vectors, right?
14:26technomancyTimMc: yeah, looks like that's accidental
14:27TimMc&#{(println "of") do (do :z/h283r (println "order")) (do :b121 (println "out"))} ;; amalloy
14:27lazybot⇒ out of order nil
14:27TimMc(keywords are there to make the hashes order properly)
14:28technomancyhah; nicely done
14:33TimMc&(let [_ :_] #{[-1] [[1]] do}) ;; and you're right, it's onlt at the top level
14:33lazybotjava.lang.RuntimeException: Unable to resolve symbol: do in this context
14:33TimMc&'(let [_ :_] #{[-1] [[1]] do})
14:33lazybot⇒ (let [_ :_] #{do [-1] [[1]]})
14:34Raynestpope: Pingsies.
14:36TimMcWow, the Conj is going to be in DC!
14:36TimMcFreaking finally.
14:37RaynesDC scares me.
14:37RaynesI don't like things that are both not a country and not a US state at the same time.
14:37TimMcLike Puerto Rico?
14:37mynomotowhat's the best way to setup autotests in clojure? I'm using inotify with 'lein test' but it's slow.
14:37TimMcHow about Antarctica?
14:38mefestolol
14:38mefestowhat a funny discussion to drop in on
14:39technomancymynomoto: most people do it from within the editor/ide
14:39technomancyin emacs you can hook up an after-save-hook
14:40mynomototechnomancy: but the hook will call 'lein test'?
14:41technomancymynomoto: no, you'd trigger it over nrepl
14:41technomancyso it doesn't have to start a new JVM
14:41technomancymynomoto: the biggest problem is there's no way to reliably tell given a changed file which tests need to run
14:42technomancy(which is not in any way specific to clojure)
14:42mynomototechnomancy: but it reloads every file to rerun the tests?
14:44technomancymynomoto: it's up to you; you can write the hook however you like
14:45technomancytypically you'd try to determine a test namespace; load it with :reload-all, and run its tests
14:46wjlroeIf a library depends on an old clojure in its project.clj, and you depend on it - do you have to specify a exclusion for that dep in your project so as to use the version of clojure you want?
14:47mynomototechnomancy: thanks, I will try that.
14:54technomancywjlroe: unless a dependency defines a version range you will be fine
14:54technomancywjlroe: if you're having trouble figuring out what's going on, the lein-pedantic plugin is helpful there
14:55wjlroetechnomancy: oh ok brilliant. It just so happens I'm using quickbeam in something
14:55technomancywjlroe: oh dear... that was a rather hurried hack =)
14:55technomancydon't set your expectations too high
14:56wjlroetechnomancy: it seems to be the only clojure lib for accessing git though - but it's simple enough to extend it to support more of JGit, my needs are modest anyway, just want listing branches/tags and reading files in different branches like that
14:57technomancythere's another one IIRC
14:57technomancywhich has had more than 2 hours of work put into it =)
14:57technomancybut happy to take pull requests if you'd like to extend it further
14:58wjlroethe problem of googling for "clojure git" is that the results are utterly meaningless :)
15:00wjlroeoh ok just found https://github.com/clj-jgit/clj-jgit
15:05jweissi have a forward declaration in my namespace. trying to compile it fails (as expected), but (require 'my-ns) works, even on a fresh repl
15:05jweissoh wait, i get it
15:05jweissit bails out of the forward decl the first time but the 2nd time it exists
15:06jweissno.. wait, it still couldn't evaluate the thing that it is missing
15:06SegFaultAXThis is way offtopic, but I have to share it: http://boingboing.net/2013/04/18/what-happens-when-you-wring-ou.html
15:07jweisshow is it nrepl-compiling fails but require works
15:07jweissit partially loaded it the first time so require thinks nothing more needs to be done?
15:11ppppauli love memoize
15:14tpopeRaynes: sup
15:16gdevRaynes:) Reply from tpope: bytes=32 time=3 hours TTL=4ever
15:18tpopeI am replying to his ping from less than an hour ago
15:18tpopebut thanks peanut gallery
15:25gdevtpope:) it was just a joke, no need to go and insult the whole gallery like that
15:35antares_Welle 1.5 is released: http://blog.clojurewerkz.org/blog/2013/04/19/welle-1-dot-5-0-is-released/
15:46mefestoclojurescript is so cool :)
15:47mefestodo most people stick with the gclosure libs or use jquery and other things with cljs?
15:48mefestoobviously you could do either but im just wanted to get a feel for what the pros are doing
15:48mpenetmefesto: a bit of both, some use angular too, there is no rule really
15:48mpenetclosure is easy to reach, there is that.
15:48mefestompenet: any best practices emerging yet that you know of?
15:49mpenetI don't think so.
15:49mpenetthere are some "neutral" libs that are good in any context I think, such as hiccup like templating and stuff like that
15:50mpenetbut this is very subjective, some prefer other ways
15:59mynomotoSomeone know why this does't work? (clojure.java.shell/sh "inotifywait -qq -r -e modify,moved_to,create src test")
15:59tgoossensI don't know how rich hickey manages it but for a month now i've been experimenting with static methods all in my project (annoying a lot of people of my team). And by now i get the feeling that after all it is still a bad idea to use static methods frequently
15:59asteve(map symbol ["?value_id" "?value_ts" "?timestamp"]); I need the result to ?value_id ?value_ts ?timestamp
15:59astevebut map symbol … returns a list with the symbols
16:01lynaghkmynomoto: you need to pass each argument as a separate string: (clojure.java.shell/sh "inotifywait" "-qq" "-r" ...)
16:02mynomotolynaghk: Ok, thank you. I will try.
16:03weavejesterDoes anyone happen to know if a "unchecked" macro exists that substitutes forms like (+ 1 1) for (unchecked-add 1 1)?
16:04mynomotolynaghk: It works. Do you know why can't be just a string?
16:05astevehow can I, given a vector, return each element separated by a space but not in a list or vector?
16:05asteve["a" "b" "c"] becomes a b c
16:05lynaghkmynomoto: because you are passing a bunch of different arguments to a command. Typically your shell (i.e., bash) will split everything up for you automatically, but in this case you're not going through bash so you need to split the args apart yourself
16:06lynaghkmynomoto: that's my understanding, anyway. I'm not a big unix hacker =)
16:06joegalloasteve: in a string? or in a code form?
16:06astevecode form
16:06astevein this case a b c are symbols
16:06joegallo~@
16:06clojurebot@ is what
16:06joegalloheh
16:07astevejoegallo: that is only if they're quoted?
16:07TimMcclojurebot: forget what |is| @
16:07clojurebotI forgot that what is @
16:07TimMc~@
16:07clojurebot@ is like the macro version of apply
16:07joegalloneat
16:07joegalloasteve: i don't understand the question
16:08joegalloyou can magic up a list of things, manipulate the crap out of them, and then ~@ them in
16:08joegalloif you're not in a quoted context, then i'm afraid i don't understand what you're doing at all -- perhaps a gist or something might help
16:08astevejoegallo: are you familiar with cascalog?
16:09joegallono, i'm not
16:09weavejesterHm, actually unchecked math doesn't seem to have a huge speedup. I won't bother with it until I really need it.
16:09mynomotolynaghk: I'm not either, just curious. Thanks.
16:10TimMcasteve: Are you writing a macro?
16:10asteveI have a vector containing strings that I need to convert to symbols and then splice them into a function; (func-name [] (call-other-func "something here") (mapv symbol ["?a" "?b" "?c"]))
16:10asteveTimMc: I know of it but not well enough to use it
16:11TimMc"splice them into a function" sounds like syntax generation (macros)
16:13llasramasteve: I use Cascalog frequently. What's your goal in Cascalog terms?
16:13joegallo,(apply + [1 2 3])
16:13clojurebot6
16:13joegallo(+ 1 2 3)
16:13clojurebot*suffusion of yellow*
16:13joegallo,(+ 1 2 3)
16:13clojurebot6
16:13joegalloif it's just a function, then why can't you use apply?
16:14llasramasteve: There's also #cascalog, although in my experience it is infrequently populated
16:14astevellasram: heh, to understand how a project that is written in a very poor manner is currently working; it's very simple, I want to read in 3 fields from a file and spit them out into another file but use the proper aggr queries
16:14llasramSpeaking of...
16:14astevellasram: I've been asking in there and that brought me here to solve the vector -> splice problem
16:14astevewhich may be the completely wrong way to do everything
16:16lynaghkmynomoto: no worries
16:16llasramasteve: Yeah, I'm afraid I'm not quite following. You have a text file input, and you want to parse three fields out of it, to then deal with as their query variables w/in a query?
16:16astevellasram: here's the pastie http://pastie.org/7665272
16:17asteveI believe the reason it does not work is because (map symbol ["?blah..) is returning (?value_id ?value_ts…) not ?value_id ?value_ts
16:18llasramWell, no
16:18llasramSo, there's two things going on
16:19llasramIt's kind of confusing, but in places where you need to use generated field names, you use strings, not Clojure symbols
16:19llasramSo you could do e.g.: (let [outfields ["?a" "?b"]] (<- outfields <rest of query>))
16:20llasramThe bigger issue: why do you need generated field names?
16:20SegFaultAXWhat does <- do?
16:20astevecreate a cascalog query
16:20llasramSegFaultAX: It's part of the Cascalog API. It generates a query
16:20SegFaultAXAh.
16:21astevellasram: I need generated field names because the actual code builds these dynamically and mk-values-view is a macro
16:23llasramasteve: Well. Two approaches. (a) You don't actually need a macro, because you can programatically construct almost any query just using what Cascalog provides. For this approach, You solve your "I need `?a ?b`, not `(?a ?b)`" problem by using a sequence of strings to *replace* the field list, not *inside* the field list
16:24llasramasteve: (b) If you really need a macro, it sounds like you want quote-splice: ~@
16:24TimMcsplicing-unquote
16:24llasram,(let [x '[a b c]] `(example ~@x))
16:25clojurebot(sandbox/example a b c)
16:25llasramTimMc: Right
16:25llasramWhat he said, name-wise
16:25gfredericks,'~@foo
16:25clojurebot(clojure.core/unquote-splicing foo)
16:25TimMc,'~@_
16:25clojurebot(clojure.core/unquote-splicing _)
16:25astevewell the good news is ~@ does not fix the source tap error
16:25TimMc:-(
16:25asteveso that means the problem is somewhere else
16:25llasramasteve: Wait
16:26llasramasteve: So, you're trying to pass `mk-values-view` directly to `?-`, but in your pastie, that's a function, not a query
16:32jweissi am getting 'cant recur from non tail position' on line 15, but i can't figure out how it is NOT in the tail position. https://www.refheap.com/paste/13778
16:33dnolen__jweiss: you put a recur in a doseq
16:33llasramjweiss: Check what `doseq` expands to. Probably wouldn't do what you wanted, even if it complied
16:34jweissah yes, the doseq still has to be evaluated even though it returns nil
16:34astevellasram: http://pastie.org/7666703 am I doing something stupid here?
16:35jweissok... so what am i missing here, i want to do tail recursion and i am keeping track of the stack myself so that should be possible
16:37llasramasteve: Your macro is splicing the `outargs` symbols into the body of the query, where the Cascalog `<-` macro expects sequences
16:37llasramasteve: Sorry, not the `outargs` splicing -- the second use
16:37astevellasram: the strange thing is that `(<- [~@outargs] was taken directly from the working code
16:38llasramYeah, that part is "fine"
16:38asteveright, ok :)
16:38llasramBut I will reiterate -- there's probably no reason to use a macro here
16:39asteveyou are most certainly right, I really need to understand the running code before I recreate it
16:39llasramgotcha
16:39amalloyjweiss: not related to your question, but the if on line 13 will always be truthy
16:39Raynestpope: Ohai.
16:40Raynestpope: I was going to ask if there is a way to change how fireplace invokes lein but then I realized I was dumb and that it doesn't.
16:40jweissamalloy: yeah i noticed that, should be (seq fields-to-create) right
16:41jweisslet's see i guess i have to pass a list of entites to create instead of just one
16:41Raynestpope: Other thing was I just wanted to say grrrrr about https://github.com/tpope/vim-fireplace/issues/48#issuecomment-16643219, though I'm sure you've already seen it and are entirely baffled.
16:43tpopeRaynes: vim can be ... unpredictable when it comes to redrawing the screen
16:43RaynesHeh
16:43tpopeRaynes: but the location list shouldn't be auto-opening anymore
16:43RaynesAs of when? I have the latest.
16:44astevellasram: ok, this is enough for the week; thank you for your help
16:44llasramasteve: np. good luck sorting it out
16:44tpopewell I'll be
16:45tpopemaybe I forgot to push or something
16:46tpopebut that was well before the rename
17:03stuartsierraIs Nicolo Mometto here?
17:03stuartsierra* Nicola Mometto
17:07stuartsierraBronsa: hello?
17:08Bronsastuartsierra: yes?
17:08stuartsierraHi
17:08Bronsahi =)
17:09stuartsierraBronsa: I'm working on Clojure Hudson releases.
17:09Bronsayeah, I saw that on github
17:09stuartsierraYou were trying to release tools.reader 0.7.4 earlier right?
17:10Bronsalast I tried was a few days
17:10Bronsaago*
17:10Bronsabut yeah
17:10stuartsierraI've nearly got Hudson reconfigured. With your permission, I'd like to use tools.reader as my test case.
17:10Bronsasure.
17:10stuartsierraOK.
17:11stuartsierraI'll push some minor updates to the pom.xml file, then edit the Hudson config & try to release it.
17:11Bronsaright, do whatever you need
17:11Raynestpope: Looks like it fixed my issue as well.
17:11tpopeperfect
17:12Raynestpope: Is there a leader command or something for :%Eval?
17:12RaynesI hate having to define those things. I never know what to use. Always stepping on something's toes. :p
17:12tpopeRaynes: no, but cpr does (require ... :reload)
17:12RaynesOh, I see.
17:14Raynestpope: Is the namespace the same as the file I'm in?
17:14tpopeRaynes: it looks for a ns declaration
17:14RaynesMan, that's a terrible nickname, namespace. You're going to get soooooooooooo many spurious pings.
17:15stuartsierraBronsa: Here it goes...
17:15Raynestpope: This is all very amazing, what you've done here. It's like you have a perversely vast knowledge of viml that borders on mental illness or something.
17:15TimMc(Raynes org.timmc.thing (:require [clojure.string :as str]))
17:15TimMcoh, sorry about that
17:15TimMcIt's my new Clojure variant.
17:16tpopeno bordering about it
17:17hyPiRionTimMc: What kind of class is Raynes?
17:17Bronsastuartsierra: damn :/
17:17hyPiRionOr was the outher paren a non-language paren?
17:18stuartsierraBronsa: The weird part is, it worked.
17:18Bronsamh.
17:18stuartsierraThere's just some failure in parsing the response from Nexus.
17:18Bronsaoh.
17:19stuartsierraI'm going to try upgrading the plugin.
17:19Bronsastuartsierra: that might be a problem though, since clojure-build didn't bump pom.xml & git tag'ed
17:19stuartsierrayeah
17:20stuartsierraSo now we have a release of tools.reader 0.7.4 in a repository but no tag in Git.
17:20stuartsierraI can log in to the Hudson server and fix this manually.
17:22Raynestpope: God, Tim. "I wish I had Clojure interaction in Vim. Oh, there's something by Tim Pope. Hmm, sure wish I had git integ… oh, Tim. Well, I could use some markdown highl OH COME ON."
17:23technomancyRaynes: that's why they let him wear the big hat
17:23amalloyquick, Raynes, ask for a pony
17:23RaynesThat sure is a good looking hat.
17:25tpopeRaynes: that's not entirely unlike my interior monologue
17:26RaynesStaging individual hunks confuses me though.
17:26tpopeit's a bit awkward
17:26tpopeI still do git add -p a lot
17:26Raynestpope: In Emacs's magit, I can stage a specific region (highlighted with my mouse).
17:27RaynesWith this I can only stage the entire hunks.
17:27RaynesAs far as I can discern anyways.
17:27tpopeRaynes: after highlighting you can do :diffput
17:27technomancyRaynes: there's a darcs mode that lets you edit in the status buffer so you can stage stuff that's never actually existed on disk
17:27technomancyit's kinda bonkers
17:27Raynestpope: Really? I thought I tried that.
17:27technomancyactually I think gitsum does that too
17:27tpopeyou can do that with fugitive too
17:27tpopeedit the stage directly
17:27RaynesI can edit the stage?
17:27RaynesSee, it'd help if I understood how git works.
17:27Bronsastuartsierra: thanks
17:27stuartsierraBronsa: OK, I've manually pushed the tags and master branch to tools.reader.
17:28Bronsaheh.
17:28tpopeRaynes: yeah, if you switch to the diff buffer, you can edit it
17:28tpopeand writing it writes to the index
17:28stuartsierraNow back to work on making this work.
17:28technomancybrings me back: http://chneukirchen.org/blog/archive/2008/02/introducing-gitsum.html
17:29Raynestpope: So :Gdiff and then edit the one on the left?
17:29tpopeyep
17:29RaynesNice.
17:29tpopeor just :Gsplit or whatever if you don't want that painful diff highlighting
17:31amalloytechnomancy: bonkers? it's not terribly hard to stage stuff that never existed on disk, using just the git command-line
17:32technomancyamalloy: bonkers that the tool goes out of its way to support it
17:32amalloyit's useful! manually editing hunks is handy
17:42Raynestechnomancy: amalloy has taken git commit trees and turned them into art. He has broken it down to a science. We sometimes print his network graphs and display them on the wall.
17:42amalloycool, another item for my collection of Things That Never Happened
17:44weavejesterAre we talking more sophisticated than "git add -p"?
17:45weavejesterBecause that's about as magical as I get :)
17:46amalloyweavejester: well, i was talking about selecting the 'e' option for a hunk with git-add -p
17:46Raynesweavejester: He can rebase a tree onto mars without killing it.
17:46RaynesThey're planning to let him terraform it with this method.
17:46amalloyhahaha
17:47technomancyrebase onto the two trees of valinor
17:48RaynesWhoosh.
17:49RaynesI can't talk to technomancy for longer than 3 references or I start to feel inadequate.
17:49amalloybut Raynes, with http://xkcd.com/903/ you can sound just as smart as he does
17:49technomancyonto the white tree of Gondor?
17:50Glenjamin'e' in git-add -p is mental
17:50RaynesWell, I've seen the Lord of the Rings movies.
17:50RaynesI couldn't get past the first chapter of the first book in that series.
17:50RaynesFelt like reading the bible.
17:50Derander_rebase on to the world tree.
17:50technomancydid you start with the Silmarillion?
17:51RaynesLord of the Rings novels.
17:51amalloyRaynes: i found the hobbit a lot more approachable than the LotR series proper
17:51Derander_the Silmarillion is literally the bible
17:51RaynesI was thinking of reading that at some point.
17:51technomancyRaynes: you can cheat with https://en.wikipedia.org/wiki/Nightfall_in_Middle-Earth
17:51technomancy(which is absolutely amazing btw)
17:51hyPiRionRaynes: Silmarillion is the only book I've stopped reading because it was too dense
17:51callenRaynes: the LOTR books are boring.
17:51callenRaynes: the Hobbit is okay.
17:51Raynescallen: That's what I gathered from the first LOTR book.
17:52RaynesI *wanted* to like it because I liked the movie.
17:52Glenjaminthere was a really interesting article on Christopher Tolkien recently
17:52RaynesBut I would fall asleep if I tried to read it.
17:52hyPiRionRaynes: Great, now you know what to do when you can't get to sleep
17:52technomancyNightfall on Middle Earth is like a tl;dr for people who couldn't even sit through the films.
17:52Glenjaminhttp://badassdigest.com/2013/01/09/why-jrr-tolkiens-son-hates-what-peter-jackson-has-done/
17:53GlenjaminTolkien's son has spent his life trying to guess what his dad would have written, and then writing that
17:54callenGlenjamin: Christopher is just mad that he's not a real writer like his father or someone capable of propagating his father's work to millions like Jackson :P
17:54technomancycallen: wait, isn't that Brian Herbert?
17:54callentechnomancy: no that's the case there too, but it wasn't really his writing.
17:55callentechnomancy: Herbert was working with KA I thought.
17:55tieTYT2has anyone ever used the clojure-maven plugin? I'm getting this error: Exception in thread "main" java.io.FileNotFoundException: Could not locate foo/poc__init.class or foo/poc.clj on classpath: What is causing this? It's obviously finding something or else it wouldn't have reported this path in the exception
17:55callentechnomancy: also the writing in the Brian novels was killing me, but I wanted to know more so badly I stomached it.
17:55nopromptjohn lennon's son has the same problem.
17:55Glenjaminbah, just read the FAQ and discovered i've been pronoucing leiningen all wrong
17:55RaynesNo, nobody in the history of Clojure has ever used the clojure-maven plugin.
17:55technomancycallen: I had to take a break from Dune for like seven years before I could go back to the original and actually enjoy it
17:56tieTYT2Raynes: :P Do you know what i'm getting that exception?
17:56Glenjaminyou have a require, but not a file
17:56tieTYT2i don't have a require
17:56tieTYT2i only have one file called poc.clj
17:57tieTYT2here are its contents: (ns foo.poc) (defn f [x] (println fn))
17:57Glenjaminwell something is trying to require foo.poc
17:57callentechnomancy: I've been thinking about rereading the original but after like 10,000 pages of Dune I don't think my soul can take it.
17:57Glenjaminis it in a folder called foo?
17:57tieTYT2yes
17:57callentechnomancy: also have you seen clojure-control?
17:57Glenjaminthen i've reached my limit of helpfullness in this case i'm afraid
17:57callentechnomancy: I've been tinkering with it. Neat stuff. Handy for provisioning machines.
17:57technomancycallen: I don't believe I have
17:58tieTYT2:T thanks anyway
17:58GlenjamintieTYT2: try lein classpath
17:58Glenjaminand see if foo/poc.clj is valid in any of the paths listed
17:58Glenjaminif not, thats the problem
17:58callentechnomancy: well. take a look. I'd love to hear what somebody else that does dev-ops has to say.
17:59tieTYT2ohh there's a compile error
17:59tieTYT2i should have said: (defn f [x] (println f))
17:59tieTYT2but I said (defn f [x] (println fn))
17:59technomancycallen: I don't really do dev-ops actually
17:59callentechnomancy: really?
17:59callentechnomancy: well take a look anyway. '(please)
17:59technomancycallen: syme is about the extent of how I provision machines
18:00Glenjaminis the current leiningen profile available to the running process?
18:01Glenjamineg. when I do with-profile production, how do I check that in my app?
18:01amalloyGlenjamin: no
18:03TimMchyPiRion: No, he's a compiler special.
18:04technomancyGlenjamin: typically you'd place a key in the environment or on the classpath
18:04technomancyusing environ or carica
18:04Glenjaminah ok, so PROD=1 lein with-profile production ...
18:04technomancyGlenjamin: no, environ lets you put env vars in your profile
18:05Glenjaminaha, i see
18:05Glenjaminright, makes sense now
18:05Glenjamincheers
18:06hyPiRionTimMc: ah I see
18:18papachanis there a library in clojure to parse json files?
18:19dakronepapachan: there are two, https://github.com/dakrone/cheshire and https://github.com/clojure/data.json
18:20papachandakrone: oh thank you.
18:23amalloyjust two!?
18:24amalloythere are like ninety
18:24amalloybut i don't think anyone uses clj-json anymore
18:38tieTYT2is there a way to define annotations on a gen-class?
18:39tieTYT2this says no, but it was answered in 2011: http://stackoverflow.com/questions/7703467/attaching-metadata-to-a-clojure-gen-class
18:39hiredmanthe one answer is really horrible
18:40hiredmanlike "I don't know clojure and I will cobble together something by cutting and pasting in to the browser's input box" bad
18:41hiredman(ns genclass.example (:gen-class ^{:doc "example class"})) is just not valid in anyway
18:41tieTYT2ok well can you help me?
18:41hiredmanso certainly not a test case for gen-class supporting annotations
18:41tieTYT2i might ask the question again just so the answer is more up to date
18:42hiredmanthat answer is not out of date
18:42hiredmanit is just flat out complete nonsense
18:42hiredman"not even wrong"
18:43hiredmanhttps://groups.google.com/forum/?fromgroups=#!topic/clojure/3q17KuyGsic has some example code annotating a gen-classed class
18:44tieTYT2thank you
18:44hiredmanbut that mailing list post is out of date, you can now also annotate constructors
18:44amalloyaw, hiredman, that answer isn't *wrong*. he says a number of true things, of the form: "i don't know how to answer your question, but here is some code that doesn't compile"
18:45hiredman(I think I wrote that patch)
18:45hiredmanamalloy: right, not even wrong
18:46tieTYT2oh waht I was asking about is annotations on the class it generates, not the methods
18:46tieTYT2is that possible?
18:47cemerickare people using .edn for explicit data files these days?
18:48hiredmantieTYT2: doesn't look like it
18:48tieTYT2hiredman: what about this: https://github.com/clojure/clojure/blob/master/test/clojure/test_clojure/genclass/examples.clj
18:48tieTYT2is that what the clojure.test_clojure.genclass.examples.ExampleAnnotationClass is doing?
18:48hiredmancemerick: I recently changed a data file in our codebase to .edn because we have a test that complains .clj files have lines over 80 characters
18:49cemerickhiredman: yeah, similar reason for my asking
18:49Raynescemerick: You can use .titties. Clojure doesn't care.
18:50cemerickI know, just wondering if it's breached into "common practice" for some definition.
18:50hiredmantieTYT2: that does look like it, I dunno, try it, I was skimming the gen-class source so maybe I missed it
18:50cemerickRaynes: .titties?!
18:50cemerickMan, a few weeks in LA, and it's all downhill :-P
18:51RaynesTwo and a half months, man.
18:51gdevsome guy is going to be googling for titties in a week and this log is going to show up in his search results and blow his mind
18:51amalloywe haven't seen him for days, cemerick. he's just been "working" on his laptop from a strip club
18:52tieTYT2hiredman: eyah it works, nice
18:54cemerickamalloy: that's what I figure
18:54cemerickRaynes: Sorry, wasn't tracking your calendar closely
18:55Raynescemerick, amalloy: The twist is that the strip club is the office and amalloy is the one stripping.
18:55amalloywat
18:55cemerickwhoa
18:55cemerickNow I need to drink.
18:56filippoboHey guys, s it possible to create a "assoc-in!"
18:56namespaceHow do I print a range of characters from a string?
18:56filippobo?
18:56namespaceLike say I had the string "Hello" being able to print characters 1 through 3
18:57filippoborange by index?
18:57namespace(Keeping in mind that strings are zero indexed.)
18:57Bronsause subs and then println
18:58namespaceSub?
18:58callenfilippobo: sure why not
18:58Bronsa,(subs "hello" 1 4)
18:58clojurebot"ell"
18:58namespacecallen: Thank you.
18:59SexyTattoos96im looking for someone to help me with my website
18:59gdev,(.substrnig "hello" 0 4)
18:59clojurebot#<IllegalArgumentException java.lang.IllegalArgumentException: No matching method found: substrnig for class java.lang.String>
19:00gdev,(.substring "hello" 0 4)
19:00clojurebot"hell"
19:01filippobocallen: I tried adapting the implementation of assoc-in using assoc! https://github.com/clojure/clojure/blob/c6756a8bab137128c8119add29a25b0a88509900/src/clj/clojure/core.clj#L5565
19:01callenfilippobo: why?
19:01filippobobut I get Exception in thread "main" java.lang.ClassCastException: clojure.lang.PersistentVector$TransientVector cannot be cast to clojure.lang.IPersistentCollection
19:01filippobobecause there is no assoc-in! :-)
19:17FoxboronHelluw. So i am messing with lein-daemon, it dosnt start and i get a Nullpointer exception in the log file. Anyone able to help?
19:30amalloy~helpme
19:30clojurebotA bug report (or other request for help) has three parts: What you did; what you expected to happen; what happened instead. If any of those three are missing, it's awfully hard to help you.
20:07tieTYT2oh i figured out that filenotfound issue I had before
20:07tieTYT2stupid intellij creates dashes as dashes in filenames
20:17tieTYT2is there a way to define a gen-class' methods step by step or outside of the gen-class call?
20:17tieTYT2i can't figure out a way to do that
20:19tieTYT2what I want to do is have a compojure-like api that generates a java jersey class. But I can't figure out how to make (GET "mypath") create a method named -mypath and a method signature named "mypath" inside the gen-class from one call
20:20namespaceOkay, I get an unbounded function error with this code for fpunct.
20:20namespacehttp://pastebin.com/Wfk6wWcM
20:21namespaceSample input:
20:21namespacehttp://pastebin.com/gTbm49yj
21:05mynomotonamespace: what's the error message?
21:14namespacemynomoto: IllegalStateException Attempting to call unbound fn: #'user/fpunct
21:19mynomotonamespace: is that when you try to call the funcion?
21:19namespaceYes.
21:19namespaceIn any context.
21:22mynomotonamespace: example of call please.
21:39n_bHow bad would having a git submodule in your lein checkouts folder be on a scale of "really" to "not even once"?
21:41namespacemynomoto: (fpunct "Hello my name is bob, how are you? In other news I finished the program. This is a filler statement between the next question! I'm the next question?" 0 1)
21:42namespaceIt's really not a big deal anymore, I ended up doing it in python.
22:08technomancyn_b: if you adjust your expectations it could be somewhat reasonable
22:20rasmustotpope: There are probably all sorts of problems with this: https://gist.github.com/rasmusto/5424432 but it seems to let me :Gedit some old rev and cpp functions. It probably breaks on windows and if filenames change around in git history
22:58amalloynamespace: i think the only time you can get that exception is some kind of java-interop scenario, where you're using a java "main" program to call into your clojure function without first require'ing the file it's defined in
23:41robear1i have a clojurescript question. it relates to the js->clj function. if i don't pass :keywordize-keys true as an option, the function works fine. if i add that option, i get an error - clojure.lang is undefined - var map__10179__10181 = cljs.core.seq_QMARK_.call(null, map__10179__10180) ? clojure.lang.PersistentHashMap.create.call(null, cljs.core.seq.call(null, map__10179__10180)) : map__10179__10180;
23:41robear1any idea where i should look to figure out what is going on?
23:48tieTYTin a precondition, what's the most concise way to check that an argument is not null?
23:50tieTYTi think this works: {:pre [(x)]}
23:51capcrunchtieTYT what that does means ?
23:51tieTYToops, I mean this: {:pre [x]}