#clojure logs

2012-03-09

00:00uvtctechnomancy, Ah. Will read the docs for gen-class. Thanks!
00:00uvtctechnomancy, Is clojars a "maven repository"?
00:02technomancyyeah
00:02uvtcI think I read on the lein site that it uses the maven java lib under the hood.
00:02uvtcIs that changing in lein 2?
00:05uvtcs/lein site/lein github page/
00:08jodarohuh
00:08jodarohttp://elixir-lang.org/
00:08jodarocool
00:11uvtcPerhaps I'm missing something obvious ... is there a way to get the source code for a given lib at Clojars?
00:12dnolenhuh how do you install swank-clojure w/ lein2?
00:12devnuvtc: you already have it
00:13devnopen the jar and take a look
00:14devnyo bro im using clojure to emit clojurescript that emits elixir
00:17jodaroheh
00:17devnthat's cool though
00:17devnthanks for sharing that
00:17jodarodoes the elixir emit erlang?
00:17jodaroand the erlang, like, C?
00:18romanandregis there a way to obtain the IJavaScript results from the cljs.closure/build function?
00:18romanandregI tried calling directly cljs.closure/-compile but that causes some issues
00:18uvtcdevn, huh. Hadn't seen that before. I'd checked one or two jars, but IIRC they contained only class files...
00:18uvtcdevn, thanks.
00:18dnolenromanandreg: like grabbing the generated JS?
00:18devnuvtc: glad i could help :)
00:19uvtcdevn, maybe the jars I'd looked at were generated from Java, rather than from Clojure source...
00:19devnuvtc: totally plausible
00:19romanandregdnolen: yeah
00:19devnit doesn't always work, but for most libs i am able to just open them up
00:20romanandregdnolen: the one that has the info with provides, requires etc
00:21devnromanandreg: are you talking about file output?
00:21devn(cljsc/build "foo.cljs" {:optimizations :advanced :output-to "foo.js"})
00:21devn(read-generated-js *1)
00:23romanandregdevn: I'm talking about the actual compiled files...
00:23romanandreghttps://github.com/clojure/clojurescript/blob/master/src/clj/cljs/closure.clj#L860
00:23romanandregthis guys
00:23yoklovis there a shorter way to represent (keyword "`")
00:23yoklovwithout it being a syntax error
00:24romanandregI'm compiling and after that, I want to get all the different namespaces that are provided to generate a google.require with each of them
00:24romanandregiterating over the compiled types calling :provides on each of them
00:24romanandreghowever, when calling build and then -compile, the compiler gets all fucked up
00:24romanandreg:-)
00:24technomancydnolen: it's [lein-swank "1.4.3"]; gotta get that readme updated
00:30dnolenromanandreg: what are you trying to do that requires this?
00:31romanandregdnolen: :-)… Having a server handler that every times that receives a request, compiles the cljs, and then tries to get all the provided modules and add them in a script tag after compilation…
00:31romanandregdnolen: don't know if that is a good or a bad idea yet
00:34ibdknoxromanandreg: you probably don't want to try and require things dynamically
00:34ibdknoxthat will just make you sad in the long run
00:35ibdknoxromanandreg: noir-cljs might be of some interest as an example, though it explicitly doesn't beam new dependencies up
00:36romanandregibdknox: well is getting me to drink with the compiler barfing back at me with "Can't recur here" exceptions
00:36romanandregibdknox: going to check that out
00:36ibdknoxromanandreg: ah, you've AOT'd the compiler
00:36ibdknoxromanandreg: rm -rf classes/cljs/
00:40romanandregibdknox: like noir-cljs so far
00:40romanandregibdknox: checking out watchtower… are you using inotify for that one? :o
00:54romanandregdnolen, ibdknox: thanks for the help/feedback
01:11muhoo#noir is quiet, so maybe i'll ask here instead:
01:11muhoohttp://francesco-cek.com/uploading-a-file-to-amazon-s3-using-clojure-and-noir-2/
01:11clojurebotc'est bon!
01:12muhoois that still current or is there better tutorial on using the s3 api in noir?
01:12muhooi just need a simple example that works, then i can take it from there.
01:19muhooRaynes: i'll tell you one of the features i wish that refheap had.
01:20muhoothe greatest thing about mailing lists is that you can google say an error message, and find a mailing list discussion or forum that has the answer to what the problem was.
01:20muhoobut when i google say a kernel error message, and i get a fucking pastebin, that's worse than useless. because, that's not an answer. it's just a log with the error.
01:21muhoowhereas if the question was asked on a ml, there'd be an answer already there.
01:21muhooit'd be nice if refheap could somehow keep track of discussions in channels that reference the refheap paste. like a trackback/pingback
01:22tomojhmm
01:22tomojhow do you signal a resolution?
01:23Raynesmuhoo: So, tags?
01:23Raynesmuhoo: The problem with what you suggest is getting people to use it and use it reliably.
01:24RaynesIf I were to add a channel thing like hpaste, would anybody use it? If I set it to a default channel, will they change it if it is incorrect? If I add tags, will anyone take the time to tag it?
01:24muhoothat's the problem, yes.
01:24RaynesThere are a lot of problems with it.
01:24tomojit would be an interesting project to try to do this with no participation
01:25RaynesOh, wait, discussions.
01:25RaynesI read that wrong.
01:25muhooyeah, it's like, you'd have to scrape logs of channels, looking for mentions of the refheap paste
01:25RaynesThat's pretty insane.
01:25Raynes:p
01:25muhooand then archiving the discussion around it.
01:25muhoowell, maybe datomic could do it :-P
01:25tomojbut if you just take the next/prev N lines..
01:26RaynesYeah, but actually finding them.
01:26RaynesWhere are the logs for a Haskell paste?
01:26RaynesThere are 4 or more Haskell channels.
01:26RaynesAnd when do I scrape the logs? If I do it immediately, the user wont have time to link his paste.
01:26tomojguess people have to ask the bot to join their channel if they want it
01:26muhooit causes a lot of problems, yes. but internet archive has been around for over a decade now, and everybody thought they were insane when they started that too.
01:27RaynesHeh
01:27RaynesIt's a decent idea, but it sounds like a lot of work for not a lot of payoff.
01:27muhooyep. and i solved my noir/s3 problem by googling the error.
01:27muhooand got a mailing list discussion that told me, basically " don't use noir/s3" :-)
01:27RaynesHeh
01:28muhoolooks like it's unmaintained.
01:31ibdknoxyou should use weavejester's
01:31ibdknoxI'm going to remove noir.util.s3 in 1.3
01:31ibdknoxmuhoo: https://github.com/weavejester/clj-aws-s3
01:33muhooyep, found it
01:37muhooit works!
01:46devnmuhoo: mario, is that you?
01:48devnhttp://www.youtube.com/watch?v=TBx-8jqiGfA
01:49gfredericksI think this is the first time I have seen #clojure at 1AM, so by induction it must always be mario-themed at this time.
01:55devngfredericks: i like where your head is at
01:57LajlaSuch drastic meassurements
01:57Lajlanot at all necessary
01:57devnLajla: it was at one point
01:57devntrust me.
01:57LajlaJesus once said 'Vote republican'
01:57LajlaTrue story.
01:57LajlaWhy, what did I do?
01:58devnJust being generally disagreeable for what could only be seen as doing so for the sake of it.
01:58devn"let me steamroll you for the next hour..."
01:58LajlaI'm just misunderstood
01:59devnLajla: or you're completely understood
01:59devntake your pick
01:59LajlaLike Hitler, Stalin, Mao Zedong and Ché Guevarra
01:59dreenlol
01:59gfredericksa surprisingly frank place as well; at least with a 2 year lag
01:59devnyour mother's name is frank.
01:59LajlaBesides
01:59LajlaSonic > Mario
01:59LajlaNo doubt about that.
02:00LajlaSonic was in every way superior to the mario games of its generation, the Genesis had superior hardware anyway and sonic took full advangtage of it.
02:00devntotally bro
02:00LajlaRight on
02:00devnLeft off
02:00dreenrofl, u guys arguing about sonic and mario?
02:00devnnope.
02:00Lajlaprogrammed by the finest programmers on the world, save for myself and the Microsoft Chief Software Architect
02:00LajlaNo
02:00Lajlawe agree that sonic was better
02:00LajlaI don't see how you can call Mario better.
02:01devnTHIS IS AN OUTRAGE
02:01devnIT IS CLEAR THAT MARIO WAS BETTER
02:01devnHOW DARE YOU
02:01LajlaSonic was just better, the levels were more extensive, it was actually 2D, mario was basically 1D, you couldn't really go up and down like you could in sonic.
02:01ibdknox(╯°□°)╯︵ ┻━┻
02:01LajlaIn mario, if you fell down you were dead, in sonic, you landed on an 'unoptimal route' but at the same time it was much harder to not fall.
02:02LajlaTHereby raising the skill ceiling of the game's time runs.
02:02devnLajla: this is why you're "misundertood"
02:02dreenin depth knowledge
02:02devnthese are the rantings of a mad man
02:02LajlaIn sonic, you had to make platforming combinations to say stay on the best route, in mario you could just pause and take your time to do anything.
02:02LajlaNo, this all true.
02:02LajlaYou cannot deny this.
02:02devnwrite this in your memoirs
02:02devnand i absolutely can
02:02devnand i have
02:02LajlaNot famous enough
02:03LajlaThe Microsoft Chief Software architect is though
02:03devnIs that a subtle 1984 reference or something?
02:03LajlaNo, that's bill gates.
02:03devnWhat are you talking about?
02:03LajlaI don't know, one of the first things I ever said here was 'I'm the best programmer in the world save only the Microsoft Chief Software Architect'
02:03devnIt's like slashdot circa 1995 polluted you and left you for dead.
02:04LajlaEhh, Bill Gates, that's his position at Microsoft.
02:04LajlaChief Software Architect
02:04ibdknoxno
02:04LajlaNot Chief Exectutive Officer
02:04ibdknoxthat *was* his position
02:04LajlaNowai
02:04LajlaHe left us.
02:04ibdknoxhe hasn't held that for a long time
02:04devnibdknox: don't feed the...
02:04ibdknoxdevn: ;)
02:04LajlaWho will give us the new version of DirectX now
02:04LajlaWhat's he doing now then?
02:04devnhe's drinking apricot tee with his mum
02:05ibdknoxchilling. You know how it is
02:05devntea*
02:05devntee would be interesting though
02:05Lajladevn, I'm not that mad am I?
02:05LajlaI mean, I am diagnosed with paranoid schizophrenia
02:05dreentea from tees'
02:05devnLajla: you're pretty mad, all things considered
02:05Lajlabut honestly, psychiatrists are just out to get me.
02:05devnyeah...totally
02:06LajlaTo discredit my reputation driven by their alien overlords.
02:06devnit must be nice to have a leg up on everyone you ever interact with
02:06muhooomg, what happened here?
02:06Lajlamuhoo, sonic or mario?
02:06devnmuhoo: i engaged Lajla -- the worst mistake ever
02:06LajlaPicard Engages warp speed
02:06muhooo noes.
02:07LajlaWell, he tells LaForge to engage it.
02:07LajlaAnd then LaForge does it.
02:07devnLajla: good job on the fine detail there
02:07LajlaSo he engages it by proxy.
02:07LajlaHonestly, I never was a fan of TNG.
02:07devnreally important to get star trek references completely accurate
02:07LajlaI don't know, the characters all feel a little bit too 'perfect'
02:07LajlaI was more a Niner.
02:07devnLajla: have you ever written a show?>
02:08devnscripts i mean
02:08devnhave you ever done that?
02:08LajlaNahhh, I once had to for an art project write a praemise
02:08muhoomy roomate was a freak for those star treks. i was anti. i'd call it the "captain!" show
02:08devni'd love to read your immaculate work. i bet it's fantastic
02:08dreenperhaps people enjoy tng cos they desire to be more perfect, perhaps u enjoy niner cos you already are perfect...
02:08LajlaGot a pretty good grade for it, it was kind of original and weird though.
02:08devnyeah kind of shitty
02:08devnerm, original and weird
02:08muhoobecause, i knew it was on, because there was always someone intoning "but, captain!" in a worried, concerned tone
02:08Lajladreen, TNG probably got popular because it told people what they wanted to hear to some extend
02:08Lajlahumans, morally infallible beings crusading the galaxy against all evil.
02:09LajlaWhereas DS9 was more like 'Humans, fallible creatures in a universe where right and wrong are complicated and very opague'
02:09devnopague...
02:09devntotally.
02:09LajlaIs that opaque?
02:09LajlaIt's opaque isn't it?
02:09dreenyes, humans bar any real progress excepting that of technology
02:09LajlaI wirte opague because I pronounce it with a g for some reason
02:10LajlaI did like the addition of Section 31.
02:10devnso anyway, topic
02:10devnclojure
02:10LajlaClojure is poison to the mind.
02:10devnLajla: so what is the right thing
02:10LajlaSomeone in #schem called it 'a degenerate liso', but those guys are soooo fucking elitist.
02:10devnplease...everyone needs to know what you're thinkin
02:10devnyou set the bar for all of us
02:10LajlaLike, some guy comes there asking for help and lets it slip through that though he likes scheme, he fears it has no industry potential
02:11Lajlaand they start raging at him
02:11LajlaAnd completely scare him away
02:11LajlaWhat is that
02:11devnpar
02:11devnunfortunately...par.
02:11dreenperhaps its a fear of theirs
02:11devnlispers are ancient neck-bearded hipsters
02:11LajlaTHey just justify every stereotype of scheme programmers being out of touch people with their Ph.D. up their arse who can't accept that their pet language isn't popular.
02:12LajlaBut then again, here people's minds are already poisoned from no TCO.
02:12devnLajla: that's just angry, stupid grad students
02:12Lajladevn, will you dance with me?
02:12devnLajla: why not?
02:12LajlaOn the Mondscheinsonata?
02:12LajlaNahhh
02:13devnIM A GRAD STUDENT AND I KNOW JAVA SO THIS WHOLE SCHEME THING IS NOT UP MY ALLEY
02:13LajlaDo the Große Fuge
02:13LajlaIt suits my mind more.
02:13dreensometimes i wish i were a grad student
02:13devnkids in school, man. smart guys, but often a very limited perspective
02:13devndreen: i wished that. then i did it.
02:14devnthen i didn't ever want to do that again.
02:14dreenyes, power to u!
02:14Lajladevn, so it's the Große Fuge?
02:14devnFugue?
02:14LajlaFrom Beethoven
02:14devnFugue.
02:14LajlaOnly good piece he ever wrote honestly.
02:14LajlaNo, Fuge
02:14LajlaGerman
02:14LajlaFuge is German for Fugue
02:14devnWhy mix languages. You're typing english.
02:14devnKeep your colors within the lines.
02:14LajlaYou know it?
02:15LajlaWell, I will call it the Great Fugue then
02:15devnfair play. yeah, I've heard it. You're telling me to "do it"?
02:15devnWhat the hell does that mean?
02:17LajlaNo
02:17Lajladance on me with that.
02:17dreeni wish to interact with good programmers, so that i may pick up some info here and there
02:17LajlaHow could you ever ignore me, we are having so much love between us already.
02:18LajlaI am the best in the business save for the microsoft CSA
02:18LajlaInteract with me.
02:18dreenyes, i realise that now
02:18LajlaI am like Eliza, I respond.
02:18Lajlarealize*
02:18Lajlarealise is an abomination
02:18LajlaTHe OED condemns it and for good reason
02:18dreeni am not American..!
02:18LajlaIt's a 60-year old or so misspelling.
02:18LajlaDoesn't matter.
02:18LajlaIt's silly
02:18dreenits zilly!
02:19Lajlait derives from a mistaken idea that since 'analyse' et cetera is British (and etymologically correct) then 'realise' should also be British
02:19devnLajla: I want to help you, man.
02:19devnYou are like: "Gotta watch Wapner"
02:19Lajlathat's where it's wrong, because it's only half a century old and there is no etymological reason for the s there whatsoever.
02:19LajlaIt is pronounced with a /z/ and etymologically it derives from the Greak zeta in the form.
02:19devnYou need to settle down.
02:19Lajladevn, what's that?
02:19devnYou're hyper.
02:19dreenah, well in that case i will be sure to inform my fellow countrymen
02:20devnManic even.
02:20LajlaNo I'm not
02:20LajlaI'm quite stoic emotionally
02:20Lajlait comes with the paranoid schizophrenia
02:20devnEmotional stoicism does not make a stoic.
02:20devnQuite the opposite.
02:20dreeni was stoic once, in Ultima Online
02:21devnoh god...bringin' up UO
02:21devnthere goes the party
02:21devnI played UO like a fiend for 3 years
02:21devnuntil I got banned for duping gold
02:21dreenlol
02:21Lajladreen, good
02:21LajlaYou carry on the torch for etymological perfection
02:21LajlaOr should I say
02:21Lajlaoetymological perfection
02:22LajlaYEEES
02:22LajlaI should.
02:22devnLajla: it's awkward to congratulate yourself.
02:22LajlaOh wait, I shouldn't
02:22LajlaI wonder where I got that from.
02:22devnim not trying to be a jerk, but you should know that's weird
02:22LajlaI am going to spell it like oeconomy henceforth
02:22Lajlaaeternal
02:22Lajlaaequality
02:22LajlaYES
02:22LajlaPerfection
02:22Lajlapaedantic
02:22devn=> false
02:23devnyou are ego stroking
02:23devnit's onanistic ridiculosity
02:23Lajlaaequal relates to similarity, equal relates to horses.
02:23LajlaI like it.
02:23LajlaYES
02:23LajlaPerfection
02:23dreenhow does one know if ones code is crappy when one does not have anyone else to review it?
02:23LajlaSweet sweet etymological perfection
02:23Lajladreen, gimme.
02:24devnLajla: I'm glad we had this talk, but you have to go back to ignore. Your self-absorption is without equal. You ruin conversations by "enhancing" then, and worst of all you think it comes from a good place.
02:24devnLajla: See you in the future maybe
02:24Lajlaaequal*
02:24LajlaJoin me in my quaeste
02:24Lajlafor etymological perfection
02:25Lajlaunrivalled paedentry shall be hours.
02:25Lajlaours*
02:25devnquiet.
02:25LajlaI should spell dwarf like dwargh
02:25LajlaYES
02:25devnnice.
02:25devndreen: by shipping it
02:25dreenhmm, i'm afraid it's not Clojure...
02:26devni'm afraid this is the clojure channel
02:27dreenindeed it is, which is why i made the previous statement
02:27devndrewr: if you want a review post a gist
02:27devneerrr dreen*
02:28dreenmmh, yes good idea
02:33dreenyou guys do Clojure for a living?
02:37muhoothis is probably the ugliest code around, but it makes me so happy https://refheap.com/paste/988
02:38dreenI wish i could rewrite my current in Clojure immediately
02:38dreen*project
02:40raekmuhoo: you can have :when clauses in the for to eliminate the call to filter
02:41muhooah, of course, thanks!
02:41raek(for [o [(:objects (s3/list-objects cred "yeah-uhhuh"))] :let [f (:key o)] :when (= "m4v" (last (.split #"\." %))] ...)
02:42raeksorry, remove the square sparens around (:objects ...)
02:46muhoointeresting, the :let.
02:46muhooi ended up with (for [f (map :key (:objects (s3/list-objects cred "yeah-uhhuh"))) :when (= "m4v" (last (.split #"\." f)))] f)
03:02devndreen: do rewrite it in clojure, and then show people how nice it is.
03:03dreenyes, i would love to, but i dont think my skills would allow me to do it in a decent amount of time
03:04dreeni have had to struggle for a long time just to create my current version
03:49muhoohmm, there doesn't appear to be a way in clj-aws-s3 to make the thing i put be public ACL
03:49muhooor to set its mime type
04:01muhooand i'm sure this has already been done https://refheap.com/paste/989
04:03muhooi decided i do not like (-> ) anymore
04:03muhoomakes it too hard to debug stuff.
04:04muhooi'd rather have (stuff (like (this instead)))
04:06dreen-> makes my ears bleed
04:06muhooit's nice in dealing with java, i found
04:06muhoobecause of all the (-> Foo. .bar Baz. .doh) crap
04:07dreeni c
04:07muhoobut for clj, i'd rather have parens, thankyouverymuc
04:08muhooin the repl, if i build stuff like (foo (bar baz)), it makes it easier to copy out just (bar baz) and see what that does, then try (foo (bar baz)) and find where it breaks
04:11muhoomy single, sad, pathetic, but still wildly successful (to me) first useful clojure program: https://refheap.com/paste/990
04:12dreenah to make a useful program@
04:13muhooit only took me 4 hours :-)
04:13vijaykiranmuhoo: instead of two br use CSS :P
04:13muhoooh gawd, you're making me deal with css too? :-)
04:13vijaykiransooner or later - you need to :)
05:12y3diwow reading clojure code is not hard at all, as long as its indented properly
05:14luciany3di: that's part of why i'm torn between my hatred for reader macros and my love for python's beautiful syntax
05:22y3diis there a place where I can see the reason of why vectors were used instead of lists in certain language/syntatical constructs?
05:23y3disuch as with let and def
05:23y3dior fn args
05:24lucianfor things that aren't function calls, generally
05:24lucianin clojure you can be pretty confident that in (foo 1 2), foo is a function-like thing (function, macro, etc.) called with 1 and 2 as arguments
05:24llasramy3di: or things which aren't "function call like," although the convention is arguably not entirely consistent
05:25lucianso in (let [a 1]) it's clear that a isn't being called with 1 as an argument
05:25luciansome use [ ] in scheme for the same effect, but there it's just synonymous with ( )
05:26llasramAnd in `ns' forms most people use lists for the (:require) etc components, because although it isn't actually function call itself, it evokes the effect of calling the analogous (require) etc functions
05:27y3diinteresting, so essentially its just to emphasize that the first element of a [] is not a function-like entity
05:28lucianbasically, yeah
05:28lucianand also, the language has a bunch of literals, why not use them?
05:28lucianjust like { } is used for metadata, etc
05:28y3dithats fair, now that i understand the reasoning, it makes sense
05:29y3dii think it increases readability too
05:29lucianit does
05:29lucianat least for me, i'm not coming from lisp
05:34kennethhey there, having some trouble
05:35kennethi'm translating a ruby ML algo to clojure, for practice, and it's spitting out funky values… but i can't figure out where i fucked up. https://gist.github.com/599518c1ca241ddfbafe … ideas?
05:36kennethoutput is -1655912.1029067077, expected 2.4
05:36kennethproblem seems to be in the gradient-descent function
05:37kennethall other functions when tested with the same args in ruby and clj seem to return correct values, but gradient descent spits out random thetas
05:37ejacksonkenneth: try to factorise it and test small sections
05:40kennethokay, will try that tomorrow morning. think i'm gonna head to bed now
05:41kennethgotta wake up hella early tomorrow, shouldn't be awake atm
05:44y3diso as i try to wrap my head around how clojure (and in extension lisp) works I come across some questions. such as:
05:46y3diwhen you bind a function with let, inside another function, wouldnt that be slower than say, defining the function outside the other function and then just calling it in the function
05:46y3dithat way youre not constantly creating the first fn everytime you call the outer function. or am i misunderstanding how lisp works
05:49raeky3di: the cost of creating a function value is quite low
05:49raekshould be in the same order of magnutide as boxing a number
05:49raekthe function is only compiled once, so you don't end up analyzing the code each time you evaluate a (fn ...) expression
05:51raekif the function does not use any free variables, then only one instance of it is needed. I don't know wheter the clojure compiler performs that optimization
05:52llasramIn the JVM implementation there's a class defined at compile time for each lexical location your code defines a function. At runtime to create a particular instance of that function, it just instantiates the class. So it has the same performance implications of using any other objects
05:55y3diword, thanks guys
06:03y3diis there/how do you do block level commenting? i.e. /* */
06:04TEttingery3di, I use (comment .......)
06:04TEttingerbut there is probably a better way
06:05llasramThe `comment' form isn't really ideal, because what's inside the form still does need to parse (parens balance, etc)
06:06llasramSo you can comment out code with it, provide code examples, etc, but can't really make *comments* with it
06:06llasramFor "block comments," you just comment every line in your comment
06:07llasramSame situation as in Python, Ruby, etc
06:15y3dipython has the """ """ hack tho
06:17llasramYeah, but you typically only use it for docstrings in practice. In Clojure you just use the regular string syntax for docstrings, with the minor annoyance of needing to escape '"' characters
06:18zamaterianDoes anyone know when Clojure Programming Rough cuts version get updated to the final version =
06:18zamaterians/=/?
06:46zamateriany3di, (comment ... ) returns nil, another way is to use the #_ then the reader ignores the following for ex: (prn "test" #_(str 3434 dfdf))
07:11tscheiblcool.. now I can remove some more Java interop from my projects :)
07:42dfgdfgdfgis there a image manipulation library in clojure or any interface for imagemagick?
07:43dan_b'"... I knowm, I'll use imagemagick". Now they have two problems'
07:43dan_b(sorry)
07:43nachtalp:)
07:45dan_b(no, I can't actually answer your question. but my Ruby experience with imagemagick has left me reluctant to go anywhere near it)
08:00NoICEbindy: hi
08:01llasramdfgdfgdfg: Java has a bunch of basic image-manipulation stuff in the standard library. Depending on what you're doing, might be enough
08:15dfgdfgdfgllasram: yup, I am using Jmagick for java..just wanted to check if there is something specifically in clojure for that
08:15llasramAh, gotcha
08:18tscheiblIt's always nice when you don't have to use Java interop :)
08:21llasramBeats doing Java interop in Java :-)
08:26TEttingercan anyone recommend a nice-looking GUI framework for Clojure (preferably written in Clojure, not Java, but I'm not picky)? HTML as markup would be OK too
08:26TEttingerThere's Substance/Insubstantial LaF for Swing
08:29TEttingerhonestly I would be OK with just an easy-to-use rich-text-display widget in some GUI framework...
08:29lucianTEttinger: there's seesaw
08:30lucianalternatively, you could use a webview
08:30TEttingerlucian, I saw seesaw, it looks good but I don't know how stable it is
08:30TEttingerlucian, webview?
08:30lucianTEttinger: the component browsers use for rendering web pages
08:30lucianyou could even just use a browser
08:31lucianand seesaw looks actively developed
08:31TEttingerlucian, I don't have access to a good server, so browser seems sub-optimal
08:31lucianfucking xchat
08:31TEttingerI use Floe IRC on windows :-)
08:32lucianxchat is the least crappy i've found that isn't LimeChat. and limechat is osx-only
08:32TEttingerbut yeah if seesaw is decent I can use Substance (maybe Insubstantial now), which makes Swing look pretty excellent
08:33nachtalplucian: i've used xchat for years without problems...
08:34luciannachtalp: that doesn't make it not crap :)
08:35nachtalplucian: if it doesn't cause problems the crap can't be that bad imho :)
08:36lucianthe UI is terrible, it forgets things, doesn't automatically remember joined channels ...
08:36luciani've started writing my own, but it's not usable yet
08:36nachtalplucian: ic, i just use it as a frontend for dircproxy...
08:37luciani've considered using it as a frontend for znc, but it wouldn't solve the many UI issues
08:37zamaterianlucian, is it on github ?
08:38lucianzamaterian: bitbucket, but it's really useless atm
08:38TEttingerhttp://insubstantial.posterous.com/insubstantial-71-release so can lein pull in these maven jars without much trouble?
08:38luciani had to take a detour in fixing gtk3/twisted bugs
08:38nachtalplucian: there's always ircII to fall back on ;)
08:39TEttingerI am not really sure how to use lein in an eclipse project with CCW
08:39lucianzamaterian: if you wish to check it out later when it at least does something, https://bitbucket.org/lucian1900/irk
08:40zamaterianthx
08:46TEttingerhmm, does the netbeans clojure plugin have integration with lein?
08:49raekTEttinger: I think CCW got support for lein projects in a very recent version (or in a version that will be released after some days from now)
08:50TEttingerraek, great
08:50raekbefore that I think people used to create a lein project, run lein deps, create a ccw project and include the jars in lib/
08:55ejacksonblame the French !
08:55ejackson:P
09:43dnolendoes lein-cljsbuild work with lein2 yet?
10:00`foguspjstadig: Thanks for hitting 1.4 hard lately. It's helping a ton
10:06pjstadig`fogus: no problem :)
10:06pjstadigjust need to get some patches applied ;)
10:10TimMcI don't understand why people would migrate their codebase to an unreleased Clojure.
10:11TimMcUnless it is out of the goodness of their hearts? (To find clj bugs before release.)
10:11gtuckerkelloggI have a data structure that I was intending to be a ref to a vector of atoms. Now I realize I may need to grow the vector on both ends, and I *think* I should change the whole structure to a sorted map with integer keys. Does that sound reasonable?
10:11dnolenTimMc: because they were already migrating to 1.3?
10:12gtrak`gtuckerkellogg, maybe an ArrayDeque is what you want?
10:13gtrak`dunno if clojure has an analogue
10:14gtuckerkelloggi think sorted map may be the thing.
10:15gtuckerkelloggi have to be able to modify the atoms at any position, and occasionally grow the beast on both ends
10:15gtrak`interesting post: http://stackoverflow.com/questions/4238973/writing-datastructures-requiring-pointers-references-in-clojure
10:15gtrak`he recommends a zipper in place of a doubly-linked list
10:16gtuckerkelloggahh, that may be it
10:17mefestoI'm guessing `stencil.core/render-file` only works for files on the classpath. Is this true and if so why not support files outside of the classpath?
10:18TimMcdnolen: So why not migrate to 1.3, which has known bugs, instead of 1.4, which has unknown bugs (and is still moving).
10:18dnolenTimMc: because 1.4 has critical patches for people who were trying to move to 1.3
10:18TimMcAh, OK.
10:18TimMcNo 1.3.1?
10:19TimMcOr might that be produced after 1.4 is released?
10:19gtrak`we haven't ever had backports yet, have we?
10:20dnolengtrak`: 1.2.1 I think
10:20gtrak`oh really? i thought that came out before 1.3
10:23gtrak`9/23 on 1.3, and before april for 1.2.1
10:23TimMcSo, not a backport?
10:23gtrak`maybe they pulled some stuff in from master before 1.3 was actually released?
10:33stuartsierra1.2.1 was not a backport but a fix to critical 1.2.0 bugs.
10:41pjstadigmoving to 1.3 would be about the same work as moving to 1.4, but 1.3 has some showstopper bugs for us, like the hashing, and RTE wrapping bugs
10:42pjstadig1.2.1 was mostly about the Keyword.intern stack overflow bug
10:42pjstadigat least that mostly what I wanted when I brought the topic up, but some other stuff got in there too
10:47zamaterianpjstadig, is this the hashing bug ? http://dev.clojure.org/jira/browse/CLJ-829
10:48hiredmanno
10:48hiredmanequality was changedin clojure collections
10:48hiredmanand hashing wasn't changed to match
10:49zamaterianthx
10:51stuartsierra1.4.0 is already beta, will hit final release Real Soon Now
10:51hiredmanhttp://dev.clojure.org/jira/browse/CLJ-948 would really make dakrone happy
10:52hiredman(speaking of dakrone)
10:52stuartsierrahiredman: feature enhancement, not going to make it in 1.4
10:52gtrak`cool story bro
10:53hiredman:/
10:53hiredmanI understand
11:01randomnamehereHi there
11:02randomnamehere,(apply (fn [x & y] (= nil (get y x) )) :a {:a nil :b 2}))
11:02clojurebottrue
11:02pjstadigzamaterian: http://dev.clojure.org/jira/browse/CLJ-861
11:02hiredman,(apply (fn [x & [y]] (= nil (get y x) )) :a {:a nil :b 2}))
11:02clojurebottrue
11:02randomnamehere,(apply (fn [x & y] (= nil (get y x) )) :b {:a nil :b 2}))
11:02clojurebottrue
11:03randomnamehere,(apply (fn [x [y]] (= nil (get y x) )) :b {:a nil :b 2}))
11:03clojurebot#<ArityException clojure.lang.ArityException: Wrong number of args (3) passed to: sandbox$eval117$fn>
11:03hiredman,(apply (fn [x & y] y) :a {:a nil :b 2}))
11:03clojurebot([:a nil] [:b 2])
11:03hiredman,(apply (fn [x & [y]] y) :a {:a nil :b 2}))
11:03clojurebot[:a nil]
11:03hiredmanoh, of course apply
11:03randomnamehere& [y] ?
11:03lazybotjava.lang.RuntimeException: Unable to resolve symbol: y in this context
11:03TimMcrandomnamehere: Destructuring.
11:04`fogus,(apply (fn [x & y] (= :FUZZ (get y x :FUZZ) )) :b {:a nil :b 2})
11:04clojurebottrue
11:05randomnamehere,(apply (fn [x & [y]] (= nil (get y x) )) {:a nil :b 2})
11:05clojurebottrue
11:05mr_rmis anyone using vsclojure plugin? my clojure project does not produce an executable (it's a console app) and i'm not sure if this is expected. it just puts the clj file in bin/Debug
11:05randomnamehere,(apply (fn [x & [y]] (= nil (get y x) )) a: {:a nil :b 2})
11:05clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: Invalid token: a:>
11:06randomnameheremhh
11:06randomnamehere,(apply (fn [x & [y]] (= nil (get y x) )) :a {:a nil :b 2})
11:06clojurebottrue
11:06`fogusIs this random program mutation?
11:07randomnamehereno ;)
11:07`fogusOnly the fittest code shall survive!
11:07randomnamehere,(apply (fn [x & [y]] (= nil (get y x) )) b: {:a nil :b 2})
11:07clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: Invalid token: b:>
11:07hiredmanrandomnamehere: stop using apply there
11:07randomnamehere,(apply (fn [x & [y]] (= nil (get y x) )) :b {:a nil :b 2})
11:07clojurebottrue
11:07hiredmanyou know what apply does?
11:07randomnameherewhy hiredman ?
11:07randomnamehereapply the fn to ...
11:07hiredmanbecause apply expects the last argument to be a seq
11:08hiredmanso you will never get the map
11:08randomnamehereahh damn! THX
11:08randomnameherepitfall
11:08hiredman(apply (fn [x] x) {:a 1})
11:08hiredman,(apply (fn [x] x) {:a 1})
11:08clojurebot[:a 1]
11:08TimMcrandomnamehere: Not a pitfall, you just didn't read the docs.
11:09TimMcI mean, the docs for apply are *dense*, but it says what it does.
11:09randomnamehereTimMc: Usage: (apply f args)
11:09TimMc&(doc apply)
11:09lazybot⇒ "([f args] [f x args] [f x y args] [f x y z args] [f a b c d & args]); Applies fn f to the argument list formed by prepending intervening arguments to args."
11:09randomnamehereHow should I know that it cand be callled with a map?
11:09randomnameherecause args are not [args] ?
11:10Bronsa,(apply + [1 2])
11:10clojurebot3
11:10Bronsathis is what apply does
11:10mr_rmis there a better place to ask about vsclojure behavior? there is no #vsclojure
11:11TimMc&(apply + 1 2 3 [4 5 6]) ; randomnamehere
11:11lazybot⇒ 21
11:11`fogus,(apply (fn [x & [y]] (= 2 (get y x :FUZZ) )) :b [{:a nil :b 2}])
11:11clojurebottrue
11:12Vinzentrandomnamehere, (apply f [1 2 3]) <=> (f 1 2 3). But the doc is incorrect (more precisely, arglist is incorrect). I remember I wanted to file an issue about that but then forget :(
11:13amalloymr_rm: i think they have a mailing list
11:13mr_rmthx amalloy
11:14TimMc,(meta #'apply)
11:14clojurebot{:ns #<Namespace clojure.core>, :name apply, :arglists ([f args] [f x args] [f x y args] [f x y z args] [f a b c d ...]), :added "1.0", :static true, ...}
11:14TimMcVinzent: Arglists look fine to me.
11:14gtrak`anyone found a good office-hammock?
11:14randomnamehereSo how to get the map in my fn ?
11:15randomnamehereand how to call fn on :b {:a nil :b 2} without apply?
11:15TimMcJust... call it. It's a function, just like apply and +.
11:15`fogus,(:b {:a 1 :b 2})
11:15clojurebot2
11:15hiredmanrandomnamehere: clojure is a lisp-1
11:15VinzentTimMc, it was changed in 1.3 and become incorrect. Let me grep my logs to find that conversation...
11:16hiredmanthere is no function-call
11:16`fogusand no spoon
11:17randomnamehereI am doing the #4clojure A nil key task
11:17randomnamehereso I cant
11:17randomnameherechange the (()))
11:17TimMcrandomnamehere: In (+ 1 2 3), + is a function. The entire (fn [a b] (* a b)) statement is *also* a function.
11:17lucianrandomnamehere: perhaps you should read a book first
11:18randomnamehereI've read programming clojure
11:22zamateriangtrak, http://www.fatboy.com/gb/shop/product/the-headdemock-black
11:29randomnamehereSolved it, but still wondering about apply don't getting maps
11:30hiredman,(doc apply)
11:30clojurebot"([f args] [f x args] [f x y args] [f x y z args] [f a b c d ...]); Applies fn f to the argument list formed by prepending intervening arguments to args."
11:31hiredman(cons :b {:b nil :a 1})
11:31hiredman,(cons :b {:b nil :a 1})
11:31clojurebot(:b [:a 1] [:b nil])
11:31VinzentTimMc, here it is https://refheap.com/paste/1000 (see mostly end of the paste)
11:32Vinzentrandomnamehere, why it don't? ##(apply (fn [one-map another-map] (merge one-map another-map)) [{:a 1} {:b 2}])
11:32lazybot⇒ {:b 2, :a 1}
11:33randomnamehereVinzent: but only if the map is in a seq?!
11:33randomnamehereso it destructs the seq?!
11:35Vinzentrandomnamehere, hm, that's what apply is for. It applies a function to a seq of args. You can pass a map too, then it'd be treated as a seq of key-value pairs: ##(apply (fn [x y] x) {:a 1 :b 2})
11:35lazybot⇒ [:a 1]
11:38randomnamehereahhhh!
11:38randomnamehereTHX Vinzent
11:38Vinzentrandomnamehere, you're welcome
11:38randomnameherethen it'd be treated as a seq of key-value pairs << hard to guess when you are new to clojure
11:40TimMcVinzent: Ah, tricky.
11:40Vinzentrandomnamehere, don't guess, find a good article about seq abstraction! :)
11:58dnolenwhoa lein-cljsbuild ROCKS
12:04loopsspeaking of lein.. i'm following some instructions that say to use lein plugin install.. but it doesn't work and "lein help" doesn't even list plugin as a subcommand :o(
12:05loopsokay.. i meant to phrase that as a question, not a bitch ;o)
12:06loops"lein version" --> Leiningen 2.0.0-preview2 on Java 1.6.0_22 OpenJDK 64-Bit Server VM
12:09loopsHmmm.. was remove by Phil Hagelberg without a reason given in the git log.. this is problem with following instructions on da web, always out of date
12:10Vinzentloops, I guess it's replaced by :plugins in your project.clj. Although, I thought it'd be an alternative to lein plugin install, not a complete replacement.
12:11loopsVinzent, yeah, i just discovered #leiningen, so i'll ask in there. The unfort thing is they didn't remove it from the Zsh command completion so i was tricked to think it should still exist
12:11randomnamehereIs there a list of what is new in lein2 ?
12:15TimMcloops: File a ticket, I guess.
12:17dnolenGSoC 2012 application submitted, fingers crossed
12:17ejacksondnolen: good luck!
12:18loopsGood luck, hope it's accepted
12:18dnolenhey well good luck to us all, could get some really neat projects out of it.
12:33wjcHi
12:33wjcI've got a quick question and I can't seem to find the right google search to answer it
12:34wjcI don't get why the two elements of the array aren't the same; (let [[f & a] '(* 5 3)] [(apply * '(5 3)) (apply f a)])
12:37dgrnbrgWhat is the fastest, easiest way to transfer lists and maps of strings between python and clojure over a socket?
12:37dgrnbrgI have a clojure daemon that needs to respond to queries from a python client
12:37dgrnbrgor is it easy enough to make a project w/ 1 lein, 2 clj backends?
12:39nachtalpwjc: interestingly, this seems to work: (let [[f & a] [* 5 3]] [(apply * '(5 3)) (apply f a)])
12:40seancorfield,(float 1234567890)
12:40clojurebot1.23456794E9
12:41AimHere,(double 1234567890)
12:41clojurebot1.23456789E9
12:41amalloywjc: * is not '*
12:41mfexHi all, in emacs in the slime-repl; how can I clear the line, for instance after putting the previous expr there with C-p?
12:42amalloyC-a C-k? there's probably a shorter way, but i just use the simple stuff
12:42nachtalpmfex: C-c C-u works for me
12:44mfexamalloy, nachtalp: thanks, those work
12:45muhoosirc
12:45muhoothat's it, clojure is now my sysadmin tool of choice: (reduce + (map (comp :content-length :metadata) objs))
12:45ibdknoxdnolen, crap I forgot. Is it too late for me to still add a couple projects to the list?
12:46dnolenibdknox: no you can add projects whenever you want :)
12:46ibdknoxawesome
12:46ibdknoxI've got a couple of good ones I think
12:46ibdknoxapplying korma to other datastores, noir-static, more on the game editor I built
12:48muhoothat game editor will have kids climbing over themselves to work on
12:48Bronsalol
12:49seancorfieldnice, zachary has fixed the auto-suggest search box on clojuredocs.org!
12:51muhooibdknox: in fact, i'd suggest that the folks at scratch.mit.edu will eventually pick up on it.
12:51tmciverI've been trying to figure out wjc's problem above but can't figure it out. Why doesn't this work: ##(let [[f & a] '(* 5 3)] (apply f a))
12:51lazybot⇒ 3
12:51`fogusseancorfield: If it suggests something other than juxt then it's still broken
12:51muhooit's the kind of thing i could imagine the media lab at MIT going all in for.
12:52Bronsatmciver: you are applying the symbol + not the function +
12:52ibdknoxmuhoo: I came up with some ideas for it that would probably really blow people away. It's possible to flip the editor around and move the projection to edit the code :D
12:52ibdknox`fogus: lol, well done :p
12:52`fogusTimMc: Symbol looks itself up in 5, can't find it and returns 3
12:52muhooibdknox: that's fantastic. and why wouldn't it? a recorder tool.
12:52Bronsa,(let [[f & a] (list * 5 3)] (apply f a))
12:52clojurebot15
12:53ibdknoxyou could also theoretically draw the path you want
12:53ibdknoxand have it work it out backwards
12:53ibdknoxwithin reason
12:53muhooyou'll have written macromedia multimedia studio. in clojurescript
12:53muhoodidn't victor demo that?
12:53muhoowhere he made that leaf fall?
12:53tmciver`fogus: I'm not sure I understand you. symbol looks itself up in 5?
12:53Iceland_jackHas there been any Lisp that is homoiconic w.r.t. something other than lists?
12:53ibdknoxI'm not sure that that translated to code
12:53Iceland_jack*have
12:54technomancyIceland_jack: maybe dylan?
12:54`fogustimciver: Symbol looks itself up in 5, can't find it and returns 3 (sorry wrong name last time)
12:54Iceland_jacktechnomancy: hm, Dylan isn't really homoiconic
12:54muhooibdknox: good point. but yes, i see how it could.
12:54technomancyforth/factor are supposed to be homoiconic too
12:54ibdknoxmuhoo: that's literally recording a set of positions, this is something a bit different, and unfortunately much harder lol
12:54zamateriantmciver, (let [[f & a] '(* 5 3)] [(apply * [5 3]) (apply (eval f) a)] )
12:54Iceland_jacke.g. {:fn * :bdy [10 15]} ⇒ 150
12:54muhooibdknox: well, you could sidle up alongside it, by stuff like starting with ability to record x,y positions
12:55muhooeventually it could evolve
12:55`fogus##(let [[f & a] `(~* 5 3)] (apply f a))
12:55lazybot⇒ 15
12:55muhooibdknox: i teach a class for kids in programming using scratch. so this stuff is very interestng to me.
12:55tmciverzamaterian: interesting.
12:56ibdknoxmuhoo: cool :)
12:56muhooibdknox: lately i've started teaching the more advanced students javascript, since they've kinda outgrown scratch. but they'd love that game editor
12:56muhooproblem is, i can't teach them clojurescript until i LEARN clojurescript :-)
12:57ibdknoxwell, it would be relatively straightforward to build it in JS
12:57amalloystudents - extra credit: teach muhoo clojurescript
12:57ibdknoxthough to do it "right" you'd need a parser
12:57ibdknoxto determine the outermost scope that needs to be re-evaluated
12:57tmciver`fogus: why does this work: (let [[f & a] [* 5 3] ] (apply f a)) but not (let [[f & a] '(* 5 3)] (apply f a))?
12:58muhooamalloy: hehe. the kids keep me on my toes. the 7th graders doing javascript discovered recursion on their own :-)
12:58tmciver`fogus: what is f bound to in the latter case?
12:58amalloytmciver: for the same reason like three people have given
12:58amalloyf is bound to '*
12:58`fogustimciver: quote suppresses evaluation, so f is bound to the *symbol* * not the function clojure.core.*
12:58amalloyand not to *
12:58`foguswhat amalloy said
12:59tmciverOK, it's starting to sink in.
12:59zamateriantmciver, (type '*) vs (type *)
12:59amalloyright. compare: ##(list * 5 3) and ##'(* 5 3)
12:59lazybot(list * 5 3) ⇒ (#<core$_STAR_ clojure.core$_STAR_@d2e2a4> 5 3)
12:59lazybot(quote (* 5 3)) ⇒ (* 5 3)
12:59tmcivertmciver: that's why (eval f) works in the quoted list case. I see.
12:59TimMcTalkin' to yourself again?
12:59`fogustmciver: Symbols are functions too. They look themselves up in whatever they are given as their first arg. If they cannot do that then they return their second arg
12:59tmciverha! yup
13:00Iceland_jackthis might be equivalent to: {:bdy {:fn map :bdy {:fn partial :body [* 5] [2 3]} :fn *}
13:00muhooibdknox: well it's a fascinating project. and i think you may really have another startup on your hands if you wanted one.
13:00tmciver`fogus: Ah! now your earlier statment makes sense.
13:01`fogus##((symbol a) {'a 42})
13:01lazybotjava.lang.RuntimeException: Unable to resolve symbol: a in this context
13:01ibdknoxmuhoo: haha well I'm just starting one right now :p Unfortunately, it's on a very different subject :)
13:01`fogus##('a {'a 42})
13:01lazybot⇒ 42
13:01`fogus##('a {'zz 42} :not-found)
13:01lazybot⇒ :not-found
13:02tmciver##('a {'a 42} :not-found)
13:02lazybot⇒ 42
13:02tmciverOK.
13:02muhooibdknox: that's ok. someone will do it. or it'll be an open source project, especially if you can get it into GSoC.
13:02tmciverThanks all for humoring me.
13:02`fogustmciver: keywords do the same thing
13:03ibdknoxI'd definitely love to really work on it
13:03tmciver`fogus: Yeah, I'm very familiar with the keyword case, but symbols are used infrequently for that kind of thing I completely missed it.
13:03ibdknoxUltimately, I'd like to go down a similar path to what Bret did. I'm all about interfaces and enablement more than anything.
13:03tmciver`fogus: I do recall reading about once now though.
13:04muhooibdknox: i did a little research into game engines for js. i didn't find any that would have worked for what we were trying to do.
13:05muhooa lot of them were very expensive, so there is a market for it.
13:06muhoo(well, very expensive for a public school district, which macroexpands out to "not free")
13:06randomnamehereleaving, thx for your help
13:09dnolenibdknox: man lein-cljsbuild is crazy, just started really looking at it today
13:10`fogusdnolen: crazy awesome or crazy crazy?
13:10dnolen`fogus: crazy awesome
13:10ibdknoxdnolen: he's done a good job with it :) You should check out noir-cljs too, it has the instant compilation stuff that lets you do my game thing from emacs/vim
13:10ibdknoxdnolen: we're at the point now where the acquisition story is in a good place
13:11ibdknoxstill some weirdness with the compiler when it gets AOT'd, but otherwise things seem ok
13:11dnolenibdknox: cool, I will. I was pretty sure lein was flexible enough to be a general solution for CLJS dev, lein-cljsbuild is proof
13:11muhoois that like "barbarians at the gate"?
13:11dnolenibdknox: no one should use the clojurescript jar directly
13:11ibdknoxmuhoo: just being able to get cljs working on your machine with other libraries
13:12ibdknoxdnolen: except for people like me doing noir-cljs ;)
13:12dnolenibdknox: yeah :)
13:12muhoowhat's wrong with using the clojurescript jar?
13:12dnolenibdknox: so lein-cljsbuild jar will package up your cljs and macros conveniently?
13:14dnolenmuhoo: same problems you encounter with using the clojure.jar directly.
13:16ibdknoxdnolen: I haven't looked at that yet. Just generally you can use lein jar to package cljs projects. That's what I do now
13:16muhooi haven't had problems using the clojure.jar directly. though i use lein repl almost exclusively lately.
13:17dnolenmuhoo: yes, it works for simple things.
13:21ibdknoxdnolen: any thoughts on where the game editor should go in the list?
13:21dnolenibdknox: feel to create a new section
13:37ibdknoxlol
13:37ibdknoxseveral of my ideas have a "Skill level: medium to insane"
13:38hiredmanclojurebot: clojure hermitage is when you take a year of hammock time after cashing in on your startup
13:38clojurebotRoger.
13:39ibdknoxI need to get in on that bandwagon
13:40ibdknoxdnolen: k, ideas added
13:41dnolenibdknox: thx!
14:21mstumphow can I convert two vectors into a vector of tuples [:a :b :c] [1 2
14:21mstump 3] => [[:a 1] [:b 2] [:c 3]]
14:22ibdknox,(map vector [:a :b :c] [1 2 3])
14:22clojurebot([:a 1] [:b 2] [:c 3])
14:22TimMcaka transpose
14:23ibdknox,(doc transpose)
14:23clojurebotPardon?
14:24Vinzentmstump, are you sure you don't want zipmap?
14:24mstumpoh, that was simple enough
14:24mstumpi don't want a map, i'm feeding values into a function
14:25mstumpthanks for the answer
14:26TimMcclojurebot: transpose is <reply>(def transpose (partial map vector))
14:26clojurebotIk begrijp
14:27amalloy~zip
14:27clojurebotzip is not necessary in clojure, because map can walk over multiple sequences, acting as a zipWith. For example, (map list '(1 2 3) '(a b c)) yields ((1 a) (2 b) (3 c))
14:30ckirkendallanyone have any pointers on debugging macros in clojurescript?
14:30gfredericksckirkendall: can't you macroexpand them like a clojure macro?
14:31ckirkendallI can in clojure just fine but when the form comes in from clojurescript I am trying to see diffrences.
14:32ckirkendallIn particular I don't no how to get the namespace of symbols in the form
14:34ckirkendallanyone have any ideas how to tell the namespace of a symbol inside a ClojureScript macro?
14:37zamaterianckirkendall, can you use meta ?
14:39ckirkendallzamaterian: haven't tried that but will now
14:41hiredmanckirkendall: if a symbol has a nemspace component you can call namepsace on it
14:42hiredman,(map namepsace '(a a/b))
14:42clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: namepsace in this context, compiling:(NO_SOURCE_PATH:0)>
14:42ckirkendalleven if the form is being passed in from clojurescript?
14:42hiredman,(map namespace '(a a/b))
14:42clojurebot(nil "a")
14:42hiredman"passed in from clojurescript" means what?
14:43hiredmanclojurescript doesn't have macros, you write macros in clojure, which the clojurescript compiler expands before emitting javascript
14:43ckirkendallhiredman: passed in from the clojurescript compiler.
14:43hiredmanit is a regular clojure symbol
14:44hiredmanif the symbol has a namespace component you can get it
14:45hiredmanI suspect you are operating under the mistaken impression that all symbols "live" in a namespace and some how you can retrieve that
14:45ckirkendallhiredman: that is how I under stand it.
14:45hiredmansymbols do not live in a namespace
14:45ibdknoxckirkendall: in cljs you have to fully qualify all of your symbols
14:45hiredmansymbols are just names and they may or may not have a namespace component as a sort of prefix
14:45ckirkendallhiredman: no I am not under that impression
14:46hiredmanah, mistunderstood your "that is how I under stand it."
14:46hiredmanok
14:46hiredmanwell, carry on then
14:46ckirkendallibdknox: hiredman: here is really the issue I can't print out from inside my macro so I am not sure if what I am passing contains certain information.
14:47hiredmanhow can you not print out from inside your macro?
14:48ckirkendallhiredman: well that is my issue. The macroexpander in clojurescript is slightly diffrent than the one in clojure.
14:48hiredmanckirkendall: Oh
14:48hiredmansure, the compiler is just spitting in to *out* like a jerk
14:49ckirkendallhiredman: so debugging a problem is a bit more complicated because it seems the system.out is high-jacked by the compiler and I can't set break points.
14:49hiredmanyou can spit to a file from the macro
14:49ckirkendallhiredman: that is great idea!!
14:49ckirkendallhiredman: thanks
14:50hiredmanI do one a day, and today has been a slow day so far
14:50ibdknoxlol
14:50ckirkendalllol
14:53technomancylol
14:55amalloyone great idea a day? where can i buy shares?
14:56technomancythree-lol combo... not bad
14:57ibdknoxI'm convinced you guys were lol'ing at me lol'ing
14:58ibdknoxI'm pretty sure we nearly created a blackhole there.
14:58ibdknoxgotta be careful
15:06dgrnbrgI have a jar file, and I want to enumerate all the symbols in it. How can I do this?
15:06dgrnbrgis there a good way to do so in clojure?
15:07ckirkendallhiredman: it doesn't look like there is meta data on the symbols coming in.
15:07ibdknoxdgrnbrg: https://github.com/clojure/tools.namespace
15:08dnolenckirkendall: you want to examine the ns of symbols during macro-expansion?
15:08ckirkendalldnolen: Do you have any idea how to get the namespace of a symbol in clojurescript from inside a macro?
15:08ckirkendalldnolen: yep
15:08dgrnbrgibdknox: docs?
15:09dgrnbrgibdknox: actually, i need it to understand javascript
15:09ibdknox...
15:09dgrnbrgsorry, jaav
15:09ibdknoxoh
15:09ibdknoxlol
15:09dnolenckirkendall: the standard functions should just work far as I know.
15:09dgrnbrglike, i have apache commons math
15:09ckirkendalldnolen: trying to mock a function using a macro and having very little luck.
15:09dgrnbrgand I want to get all the classes, methods, and fields, given the jar
15:09ckirkendalldnolen: mock as in using goog.testing to mock a function.
15:10dnolenckirkendall: sure, but again, vars resolve in the usual way as far as know. if they don't it's a bug.
15:11dgrnbrgibdknox: do you know if the clojure runtime classpath patching allows loaded classes to be seen via class.forName?
15:12ckirkendalldnolen: not sure I follow?
15:12ibdknoxno idea, I haven't ventured into Java land much from Clojure directly
15:13ckirkendalldnolen: inside the macro I need to return the following (.createMethodMock ns sym) I was hoping to pull the namespace off the sym.
15:13ibdknoxns flows weirdly through the compiler
15:14ibdknoxin my experience
15:14ckirkendalldnolen: I may have to rethink what I am doing to push more into clojurescript and less in the macro.
15:14dnolenckirkendall: you want the macro to expand to contain the current namespace?
15:15dgrnbrgDoes clojure include asm3 or asm4 on the classpath?
15:15ibdknoxif it's just the current you can use *ns*, but I think he wants it for arbitrary symbols
15:15ckirkendalldnolen: I want symbols defined in the form being passed to have namespace data attached.
15:16dnolenckirkendall: you have to be more clear. that information is there at macro expand time - do you need it at CLJS runtime?
15:17ckirkendalldnolen: ok I am confused? how I do I get the namespace of a symbol inside a form being passed to the macro.
15:17dnolenckirkendall: in the standard way
15:17ibdknoxckirkendall: can you put up your code? That would frame the question better
15:20darqHello. Can someone tell me why this macro works when I call it directly but fails when using a bound value. P.S (that's my first macro:) https://refheap.com/paste/1004
15:21ckirkendalldnolen: when I call namespace on cljs symbol being passed to the macro I get nil
15:22ibdknoxdarq: mlist is a symbol
15:22ckirkendalldnolen: I will try to simplify the test case and post a gist but its going to take a bit
15:23ibdknoxdarq: in your second example, you're doing the equivalent of (for [tcn 'a] ..)
15:23dnolenckirkendall: ah this might be true - but yes make a simple test case and open a ticket.
15:24ckirkendalldnolen: ok, will do - in the mean time I will change my approach.
15:25ibdknoxdnolen: fwiw, my screwing around seemed to indicate ns metadata wasn't being utilized
15:25dnolenibdknox: well ns metadata can't survive so it's all stored in a namespaces atom - it's there just not on the vars (which don't exist at runtime)
15:26ibdknoxright
15:26ibdknoxok, so my understanding is correct then
15:29RaynesYay. RefHeap got its 1000th paste last night.
15:32mrBliss,(let [prim-v (vector-of :long 1 2 3 4), v (vector 1 2 3 4)] (time (dotimes [_ 1e7] (get prim-v 3))) (time (dotimes [_ 1e7] (get v 3))))
15:32clojurebot"Elapsed time: 4401.492 msecs"
15:32clojurebot"Elapsed time: 3302.558 msecs"
15:33mrBliss,(let [prim-v (vector-of :long 1 2 3 4)] (time (dotimes [_ 1e7] (get prim-v 3))))
15:33clojurebot"Elapsed time: 5073.192 msecs"
15:33mrBliss,(let [v (vector 1 2 3 4)] (time (dotimes [_ 1e7] (get v 3))))
15:33clojurebot"Elapsed time: 1778.927 msecs"
15:34canderaHow do I reify a nested interface?
15:34canderaI've got interface IFoo { interface IBar { int apply(int device) } }
15:34mrBliss^ I expected the vector of primitives to be faster than the regular vector. What am I doing wrong?
15:34canderaI want to reify IBar and implment apply.
15:35canderamrBliss: Try aget instead?
15:35TimMcvector-of isn't an array
15:35canderaSorry - just realized I'm probably jumping in without reading the whole question.
15:36mrBlisscandera: for a nested class you have to use Outer$Inner, maybe it works with interfaces too
15:36canderaI did try that. No love.
15:36Raynesamalloy: Holy crap. A Clojure mailing list question about clojail.
15:37canderaCompilerException java.lang.IllegalArgumentException: Can't define method not in interfaces: apply, compiling:(NO_SOURCE_PATH:46)
15:37canderaWhich at least is better than the ClassNotFound exception I was getting before
15:38mrBlisscandera: have a look at clojure.lang.IFn to find out which methods you need to implement (applyTo(..) in your case).
15:38amalloycandera: IFoo$IBar is correct, you probably have the general reify syntax wrong now rather than the specific inner-class syntax
15:38TimMccandera: Can you pastebin your reify form?
15:39RaynesTimMc: You are dying without a verb for refheap, aren't you?
15:39TimMcI am.
15:39TimMcRaynes: If you don't give me a good verb, I'm going to switch to saying pastebin.com as a verb.
15:39jodarocan't you just use refheap as a verb
15:39jodaroas is?
15:39jodaro"can you refheap it?"
15:39RaynesI've had a few ideas. "heap it" "ref it", but I never found one everyone liked.
15:40mrBlissthrow it on the RefHeap
15:40Raynestoss it on the heap
15:40Raynes:P
15:40RaynesToss it on the (ref)heap.
15:40TimMcpile that shit
15:40jodaroheap this
15:40jodarodon't heap me, bro
15:40canderaDuh. Forgot the this pointer. Amazing how asking the question suddenly makes the idiocy jump out.
15:41TimMccandera: Ah, the explicit "this", yeah.
15:41canderamrBliss, amalloy, TimMc: thanks!
15:41RaynesIdiocy? :\
15:41canderaMy idiocy at forgetting it.
15:41RaynesYou're not an idiot, man. <3
15:41RaynesYou're human.
15:42canderaThose are not mutually exclusive in my case. ;) But I thank you.
15:42RaynesIt isn't your fault you didn't sprout from our pod.
15:43mrBliss,(let [prim-v (vector-of :long 1 2 3 4), v (vector 1 2 3 4)] (time
15:43mrBliss (dotimes [_ 1e7] (get prim-v 3))) (time (dotimes [_ 1e7] (get v
15:43mrBliss 3))))
15:43clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: EOF while reading>
15:43mrBlisssorry
15:43mrBliss,(let [prim-v (vector-of :long 1 2 3 4), v (vector 1 2 3 4)] (time (dotimes [_ 1e7] (get prim-v 3))) (time (dotimes [_ 1e7] (get v 3))))
15:43clojurebot"Elapsed time: 5163.396 msecs"
15:43clojurebot"Elapsed time: 3186.653 msecs"
15:43RaynesThat is a fairly unreliable way of testing time.
15:44TimMcUsing an eval bot? Yeah.
15:44mrBlisson my machine the primitive vector is 5x slower than the regular one
15:44TimMcmrBliss: I got the same results locally, running multiple times.
15:44TimMc3-4 runs for one, then 3-4 of the other
15:45mrBlissI thought a vector of primitives would beat the regular one in speed
15:45mrBlissUsing a profiler I found out that most time is spent in clojure.core.Vec.arrayFor and clojure.lang.RT.longCast
15:46mrBlissbut why is it being cast?
15:47TimMcmrBliss: Is vector-of a documented feature?
15:47TimMcI remember discovering it recently and being surprised.
15:47mrBliss,(doc vector-of)
15:47clojurebot"([t] [t & elements]); Creates a new vector of a single primitive type t, where t is one of :int :long :float :double :byte :short :char or :boolean. The resulting vector complies with the interface of vectors in general, but stores the values unboxed internally. Optionally takes one or more elements to populate the vector."
15:47mrBlisssince 1.2
15:48TimMcHuh.
15:48mefestoAnyone know why `stencil.core/render-file` only supports files on the classpath instead of any file? Hoping to avoid having to slurp the file and use `render-string` instead which won't be cached?
15:50zamateriandarq, did you solve you problem ? (defmacro testm [mlist] `(for [tcn# ~mlist] (println tcn#)))
15:53amalloyi believe vector-of is intended to improve size, not speed
15:53mrBlissamalloy: ok, makes sense
15:55mrBlissin my small test a regular vector is 4 times slower than an array and a primitive vector is 20 times slower than an array.
15:56mrBlissI'll just use an array for this (both speed and space are a concern).
16:02TimMcmrBliss: I guess the boxing is happening at retrieval time.
16:03TimMcPulls a prim out of the store, boxes it for return.
16:04darqzamaterian: yes, but thx:)
16:06mrBlissmakes sense. Can you prove it by tweaking my test to run in ~ the same time as the test of the regular vector? ;-)
16:06TimMcnope
16:10chouser(let [x (range 5)] (take 1 x) (realized? x))
16:10chouser,(let [x (range 5)] (take 1 x) (realized? x))
16:10clojurebotfalse
16:10chouser,(let [x (range 5)] (first x) (realized? x))
16:10clojurebottrue
16:12TimMc,(let [x (range 5)] (first x) (realized? (rest x)))
16:12clojurebot#<ClassCastException java.lang.ClassCastException: clojure.lang.ChunkedCons cannot be cast to clojure.lang.IPending>
16:17chouserhuh. unfortunate.
16:20amalloychouser: realized? is allegedly for use with lazy seqs, but really it's no good except for promises
16:21amalloyer, delays? not promises, i guess
16:22amalloyokay, futures, delays, and promises. but for lazy-seqs it is a mess
16:27arohneralexbaranosky: is there a way to print the name of a fact in an around? it would help some debugging
16:29RaynesWow.
16:29RaynesThat sentence was nuts.
16:29RaynesImagine how that would look to someone who doesn't know midje.
16:30arohnerGood thing I'm talking to someone who knows midje :-p
16:40dnolenwow rhickey keynoting RailsConf
16:40gtrak`yea, what's that about?
16:41gtrak`maybe they all want clojure? :-)
16:42TimMcwtf
16:43TimMcI hope he doesn't talk about TDD at all.
16:43gtrak`haha
16:45gtrak`are folks still sore about strange loop?
16:46TimMcDunno, but that bit did make me uncomfortable.
16:48ibdknoxTimMc: you a TDD'er?
16:49TimMcNot exactly.
16:49TimMcBut I do advocate for thorough testing of code.
16:49TimMcI find the primary benefit is that it forces me to do better case analysis. :-)
16:51ibdknoxit's true
16:51dnolenibdknox: on a different note - I think the avoiding arguments for arity display will require less work then I thought. Google Closure is pretty smart, we won't have to make many changes.
16:51ibdknoxdnolen: sweet
16:53ibdknoxdnolen: it's always nice to find out something isn't as hard as you thought it would be :)
16:54dnolenibdknox: yep
16:54gtrak`i like to think of tests as enforcing a contract
16:54ibdknoxdnolen: I haven't looked into it at all yet. Applying for YC, finishing up here at RFZ, and preparing for ClojureWest has kept me busy
16:55jbroI have a leiningen question -- but a warning -- I may be retarded
16:55jbroI'm on Mac OS, installed clojure 1.3.0 from ports and can run clj and get a REPL
16:56dnolenibdknox: that's cool about YC! More Clojuring in your future I hope :)
16:57tremolojbro: that wasn't a question :)
16:57jbroI downloaded the leon script, chmod +x, on path etc, but when I try any leon command I get a NullPointerException: see http://pastebin.com/WBhd4Je9
16:57ibdknoxdnolen: lots :) A lot of work in CLJS too I think - doing stuff for tablets
16:57jbroDo I somehow need to tell leon where my clojure.jar is?
16:57technomancyjbro: try 2.0.0-preview2 instead; that's been fixed
16:57dnolenibdknox: sweeeeet
16:57jbrook, I will give it a shot
16:58technomancyjbro: where did you get the lein script you're currently using?
16:58jbrotechno: from your repo: version 1.7.0
16:58technomancyjbro: that's not version 1.7.0
16:59jbrotechno: stable branch isn't 1.7.0?
17:00jbroI am downloading from the master branch right now.
17:00technomancythe stable branch is 1.7.0, but the error you pasted only happens in 2.0.0-preview1
17:00jbroThat's odd
17:01ibdknoxtechnomancy: I'm using heroku in my training :)
17:01technomancyibdknox: o/
17:01jbroyou committed preview2 today?
17:01technomancylast night
17:02technomancypossibly today, depending on your time zone =)
17:02jbrotechno: I see, checking I see that it was preview1 that was in my /usr/local/bin
17:02jbroI thought I had copied in 1.7.0, but I must have spaced. preview2 is working
17:02jbrothank you.
17:03jbronow my hair won't catch on fire.
17:03technomancysweet
17:03technomancythat's the goal
17:03jbroone more question: with clojure 1.3.0, do I now have to include individual namespaces that used to be in clojure-contrib?
17:04ibdknoxyes
17:04technomancyclojurebot: what happened to contrib?
17:04clojurebotWell... it's a long story: http://dev.clojure.org/display/design/Where+Did+Clojure.Contrib+Go
17:05jbroright, i see the new namespace mappings, so say I want clojure.math.combinatorics. How do I get it?
17:05jbrocan lein install these namespaces?
17:06weavejesterjbro: Namespaces of libraries are usually contained in jar files, which can be included in your project.clj file as dependencies.
17:07jbroright, got that, what is the best way to obtain said jars?
17:07jbroclone the repo and build?
17:07jbrolein?
17:07clojurebotlein is http://github.com/technomancy/leiningen
17:07tmciverjbro: you put [org.clojure/math.combinatorics "0.0.2"] in your project.clj file on the :dependencies line.
17:07raekjbro: let lein handle it for you
17:08weavejesterThen run "lein deps" to download the jars to your project's lib directory
17:08raekno need to build the projects yourself
17:08jbroraek: that sounds good, does that mean I always have to be in the context of some project so I can reference its project.clj?
17:08weavejesterBut I believe "lein deps" is automatically triggered by most Lein commands nowadays
17:08technomancyweavejester: it's true; running "lein deps" manually hasn't been necessary since May of 2010
17:09raekjbro: yes, most things in lein need a project
17:09jbroI see, so that suggests I need some type of "scratch" project to noodle about, no?
17:09raekit's common to do something like "lein new tinkering" and use that project for "project less" stuff
17:09jbroraek: ok
17:09raekyou can also use the lein-oneoff plugin
17:10jbrocan I tell lein/clojure a class path so I can download the jars I need and always have them available, whether through lein repl or clj?
17:11technomancyclojurebot: clj?
17:11clojurebotCool story bro.
17:11technomancycome on clojurebot; I know you have a factiod for that. =\
17:11technomancyjbro: generally clj scripts are best avoided
17:11jbrotechno, sorry clj is simply a shell script that launches the clojure repl with rlwrap, that's how macports packages clojure.
17:11technomancythey're just something your distro packager threw together because they didn't realize that clojure is a library rather than a end-user application
17:12ibdknoxjbro: yeah, don't use it
17:12jbroI don't really intend to, except for perhaps quick one-off tests
17:12jbroI intend to actually use Emacs/Slime as that is what I use for my lisp development
17:14raekjbro: when you get to setting up slime, only follow the official swank-clojure docs
17:14raekhttps://github.com/technomancy/swank-clojure
17:15jbroraek: ok, that's sounds good, one of my frustrations with clojure in the distant past was that there were many conflicting instructions on how to get SLIME running
17:15weavejesterDo people think wrepl or wepl is a better name for a web-based REPL?
17:15weavejesterI'm leaning toward wrepl...
17:15jbroI never did get it working in a way that didn't nuke my Lisp setup
17:15weavejesterAs it's akin to nrepl
17:16ibdknoxI like wrepl lol
17:16TimMcinterepl
17:16raekjbro: the first result on google is known to be outdated and misleading
17:16ibdknoxweavejester: what's the goal?
17:16tmciverI second wrepl.
17:16technomancyCL compatibility hasn't really gotten any better
17:16jbroraek: thanks I'll stick to the official swank-clojure docs
17:16jbrotechno: that's too bad
17:16technomancyI like "wepl" because it sounds like something Elmer Fudd would sy.
17:16technomancysay
17:17weavejesteribdknox: A web-based REPL using XHR to nREPL, with the Ace editor as the prompt
17:17TimMcweavejester: Pronounced "repple" or "dub-repple"?
17:17weavejesterTimMc: repple, I think.
17:17ibdknoxweavejester: you should take a look at codemirror, I think it has better clojure support
17:18technomancyalso "wrepl" is 150% more syllables than "wepl"
17:18TimMctechnomancy: That depends, now doesn't it?
17:18weavejesteribdknox: Ah, interrresting!
17:18ibdknoxweavejester: it's also worlds easier to use
17:18technomancyTimMc: oh, I guess so
17:18ibdknoxweavejester: I've used it for all my stuff
17:18TimMctechnomancy: double-you, dubya, and dub
17:19weavejesteribdknox: I should have asked sooner. I'd just gotten ace to auto-expand
17:19ibdknoxhaha
17:19ibdknoxace is a monster :(
17:19weavejesteribdknox: … Codemirror does everything for me...
17:19ibdknox:)
17:19weavejesteribdknox: Why have I not heard of this library?
17:20ibdknoxweavejester: people are pretty dogmatic about ace
17:20ibdknoxwhich is unforunate
17:20ibdknoxunfortunate*
17:20ibdknoxit's easy to extend too
17:21ibdknoxand quite active
17:21weavejesteribdknox: Does it have a read-only mode, do you know?
17:21ibdknoxhm, that I'm not sure about
17:21ibdknoxyou might want to look into the repl stuff that tryclj.com uses
17:22weavejesteribdknox: Ah yes, it does
17:22raekjbro: btw, here's the rationale for why leiningen doesn't use the "stuff all your jars in this directory manually" approach: https://github.com/technomancy/leiningen/wiki/Repeatability
17:23dnolenibdknox: being able to package up cljs files in jars is actually kinda sweet, already a way more sane workflow then what I normal do which is copy and paste files around.
17:23weavejesteribdknox: I think tryclj.com just uses jquery.console
17:23ibdknoxdnolen: definitely, the projects will work with lein checkouts too
17:23dnolenibdknox: this is awesome
17:23weavejesteribdknox: I don't think that supports a "real" editor.
17:23ibdknoxweavejester: ah, probably not
17:24jbroraek: ok, that makes sense. I can live with a "test" project that has my most commonly used namespaces
17:24stuartsierraBy the way, it was very useful to us on ClojureScript One projects to be able to add arbitrary elements to the classpath.
17:24weavejesteribdknox: Codemirror does support readonly. I'll switch over to it.
17:25ibdknoxstuartsierra: do lein checkouts solve the same problem? Or is there something specific you can get that way?
17:25technomancyClojars users: please log into the web UI to re-hash your passwords: https://groups.google.com/group/clojure/browse_thread/thread/5e0d48d2b82df39b
17:25stuartsierraSpecifically, we used a custom Lein plugin to check out sources from Git at specific commit numbers.
17:26ibdknoxweavejester: are you just going to have a bunch of editors? It doesn't look like it supports read-only regions
17:26stuartsierraThen :extra-classpaths in project.clj to add those directories to the classpath.
17:26ibdknoxstuartsierra: ah, I think you can do the same without the extra-classpaths bit if you use checkouts
17:26weavejesteribdknox: It does have a readOnly option in the manual
17:26stuartsierraibdknox: cool. Even pin to specific commits?
17:27ibdknoxweavejester: yeah for the entire editor
17:27weavejesteribdknox: I figure setting each editor to read-only would be easier than recreating the output as a static div.
17:28ibdknoxstuartsierra: yeah, basically whatever you put in there. So if you cloned that specific commit into checkouts, it should just work :)
17:28stuartsierragreat
17:28raektechnomancy: if I successfully logged in, is it done?
17:28technomancyraek: yep
17:28ibdknoxweavejester: yeah, I didn't know if you were trying to do that in a single editor
17:28weavejesteribdknox: Oh yeah. So I have an auto-expanding editor as the prompt. When the user submits the code, it gets set to readOnly, and the output and a new editor are added to the bottom.
17:28raekok, great!
17:28ibdknoxgot it
17:28ibdknoxweavejester: the VS editor would allow you to set certain regions as readonly, it'd be cool to do something similar in codemirror. You would only need one then :)
17:29weavejesteribdknox: Well, the return value from the REPL doesn't have to be text in a web-based REPL.
17:29ibdknoxalso true
17:29weavejesteribdknox: And I think it would be tricky to embed images and things in an editor...
17:29ibdknoxweavejester: the VS editor supported anything renderable ;)
17:30ibdknoxweavejester: probably in this case
17:30weavejesteribdknox: VS?
17:30ibdknoxVisual Studio
17:30weavejesteribdknox: oh, right
17:30weavejesterI also wanted to have outputs that auto-update.
17:30ibdknoxooo
17:30weavejesterLike an atom might be [atom 1]
17:31weavejesterAnd then update as it's changed, like a watch
17:31ibdknoxsounds bret victor-ish
17:31weavejesterYou could then connect that to a graph, and have something update in real time.
17:31ibdknoxyep
17:31weavejesterI was playing around with the idea of being able to drag a REPL output to a side bar, to double as a watch
17:31ibdknoxI'm doing something similar with CLJS
17:31ibdknoxminus the pretty interface you're about to describe
17:32TimMcThis somehow puts me in mind of my cascade lib...
17:32weavejesteribdknox: Maybe I should write said interface in Clojurescript, and have it independent of the back end.
17:32ibdknoxTimMc: hm?
17:32TimMcwhich maintains a pending-mutation DAG
17:32ibdknoxweavejester: :)
17:33TimMcI don't even know how to describe it properly. You tell it "this depends on that, and here's how to recompute it"
17:33weavejesterI could also write it in Javascript or Coffeescript, and have it entirely independent, but I'm not sure I need go that far.
17:33TimMcibdknox: Don't worry about it, that wasn't a well-formed thought.
17:34ibdknoxTimMc: I remember the first pass at the docs for the editor, they tried to explain some concepts as "it's a directed acylcic graph"
17:34ibdknoxI laughed
17:34ibdknoxand immediately rewrote them
17:36ibdknoxas a percentage of the programming population, very few know what a DAG is haha
17:36ibdknoxTimMc: is that code somewhere? it sounds like it'd be useful
17:40TimMcibdknox: Looking... it's embedded in one of my projects. ALso needs a rewrite, I think?
17:40TimMcibdknox: https://github.com/timmc/CS4300-HW3/blob/master/src/timmcHW3/cascade.clj
17:40TimMcHah, looks like I marked it as GPL. That can be changed.
17:42TimMc"clean" should be renamed "clean!" I guess.
17:43TimMcI also have absolutely no idea why (:gen-class) is in there.
17:48dnolenibdknox: hmm, lein-cljsbuild doesn't seem to pick up cljs in jars that are included via project.clj, does this just work for you?
17:54ibdknoxdnolen: yeah it does, you just need to restart
17:56ibdknoxTimMc: interesting
18:01TimMcibdknox: I'll probably pull that code out this weekend and relicense it. It was *really* useful for the GUI app it's embedded in.
18:01ibdknoxcool :)
18:02TimMcibdknox: The only irritating thing is that the cascade map needs to be stored in a ref or something...
18:03TimMcOh hell, I should have stored it in an atom -- then I could use swap!. Maybe it doesn't need a rewrite.
18:03ibdknoxan atom makes more sense to me
18:03TimMcYeah, I don't think I knew how to use atoms at the time I wrote it. :-P
18:04Raynesamalloy has forced proper usage of atoms down my throat.
18:05RaynesAt the very least, I'm terrified enough of using them incorrectly that I always ask him if I'm doin it rite
18:05amalloyhaha
18:05TimMcRaynes: Proper usage, in that you should use them instead of refs when possible, or that you actually should have been using refs?
18:06ibdknoxyeah, what are the rules of atom-club?
18:07technomancyhuh; leiningen has three atoms in it, two of which are never modified outside user code.
18:07ibdknoxI only use refs when coordination matters
18:07RaynesI've had at least 10 atom-based solutions that resulted in non-atomic reads and writes.
18:07technomancyand no other c.l.IRefs apart from vars
18:07Raynesamalloy has called me out on all of them.
18:07technomancyactually all the atoms are modified in user code
18:08ibdknoxNoir uses a few for stately thing
18:08ibdknoxs
18:08TimMcHmm, wonder if I can dual-license that code GPL/EPL.
18:08amalloystately, huh?
18:08TimMcI need to read up on dual-licensing at some point.
18:08ibdknoxamalloy: yes, they attend dinners and such at the whitehouse
18:08ibdknox~rimshot
18:08clojurebotBadum, *tish*
18:09raekGPL and EPL are incompatible, so using it through the GPL licence would be hard, since most libs are EPL
18:09raekor more accurately: GPL does not want to be mixed with EPL
18:09TimMcI believe it doesn't rely on anything except Clojure.
18:10raekwas this an application or a library?
18:10TimMclib
18:10TimMcDunno if anyone out there actually GPL-licenses Clojure apps or libs.
18:10raekok, then I can't use your GPL lib in my EPL project...
18:11raeksince the GPL places certain demands on the code that it is combined with
18:11TimMcraek: And you can't use a dual-licensed GPL/EPL lib in an EPL project?
18:11raekthat you should be able to do
18:11raeksince you can use the EPL "version"
18:11TimMcInteresting. Well, I'll have to read up on this stuff.
18:14ibdknoxlicensing sucks
18:16Raynesibdknox: We should create the grangerpl.
18:16ibdknoxhttp://en.wikipedia.org/wiki/WTFPL
18:16RaynesWhere you may only distribute code that has harry potter references in the comments.
18:16TimMcEvery time you create a new license, a lawyer eats a kitten.
18:18ibdknoxgoogle is weird
18:18ibdknoxapparently this was searched for 11 times: "fetch and ajax chris granger"
18:18RaynesHey, eye bee dee knocks.
18:18ibdknoxwhy that exact wording?
18:18ibdknoxlol
18:19Raynesibdknox: I sometimes pronounce your nick 'ehbidknocks'
18:19clojurebotNo entiendo
18:19TimMcibid knocks
18:19ibdknoxRaynes: sometimes I do too, but don't tell anyone
18:19ibdknoxib'd knocks
18:21Scriptoribn knocks
18:21RaynesI just pronounce it 'Hermione' sometimes.
18:27tsallywhy cant I do (require 'clojure.data.xml) from a swank-clojure repl?
18:28tsallydo I need to do an additional step to set a library path or something?
18:29tsallynevermind, got it
18:34technomancywindows users: is this still a problem? https://github.com/ato/clojars-web/issues/14
18:41technomancycourage, gfredericks!
18:41qbggfredericks: Take these with you: ( )
18:41technomancyqbg: "it's dangerous to go alone"
18:41gfredericksare these identical?
18:42gfrederickswho knew a right paren was just a left paren turned around
18:42qbgDon't cross the sexps
18:42gfredericksokay so I need to go download the el file and add a require and hook into clojure mode and all that?
18:42gfredericksall the googlings about the topic just lead to presumably outdated docs
18:44technomancyM-x package-install paredit
18:44ibdknoxgfredericks: I just dropped paredit.vim in bundle directory ;)
18:44gfredericksibdknox: hush
18:44technomancythen (add-hook 'clojure-mode 'paredit-mode)
18:44ibdknoxin my*
18:45gfrederickstechnomancy: what do I install to make package-install work? :)
18:45technomancygfredericks: oh, that's emacs 24; if you're on 23 then it's maybe easier to install by hand?
18:46gfredericksman I haven't even heard of emacs 24
18:46technomancyit's the best!
18:46technomancyit's at least 4.3% better than 23
18:46gfredericksdang I was about to try to compute that myself
18:47gfredericks&(format "%.2d%%" (* 100.0 (- (/ 24 23) 1)))
18:47lazybotjava.util.IllegalFormatPrecisionException: 2
18:47justicefriesI just need to switch from vim to emacs.
18:47gfredericks&(format "%.2f%%" (* 100.0 (- (/ 24 23) 1)))
18:47lazybot⇒ "4.35%"
18:47justicefriesbrain -> vim
18:48gfredericksdec'ing a float seems weird
18:48justicefriesI love Vim.
18:48justicefriesactually I've been told to harass you about efficient vim with Clojure.
18:49RaynesHeh.
18:49RaynesMy setup is just crazy simple. I don't have a REPL in my editor because I don't use that part of VimClojure. I might once the nrepl stuff is done, but I'm good with a regular `lein repl`.
18:50RaynesMy Clojure setup is just the vim part of VimClojure with fuzzy indent turned on and paredit.vim.
18:50Raynesevil-mode for Emacs is pretty cool.
18:51justicefriesHMM. I'm using VimClojure, is fuzzy indent and paredit.vim turned on by default?
18:51Raynesparedit.vim is separate and fuzzy indent is off by default for God knows why.
18:51gfredericksokay here goes...
18:52gfredericksmaybe it isn't working
18:52gfredericksI typed a left-paren and got only that
18:52Raynesjusticefries: https://refheap.com/paste/1006
18:52technomancygfredericks: add-hook only affects new activations of clojure-mode; it's not retroactive
18:52technomancyso M-x paredit-mode in existing buffers
18:53gfrederickstechnomancy: yeah I closed my buffers for that reason
18:53gfredericksoh hmm
18:53gfredericksdoing the M-x the second time seems to have had a different effect
18:53gfredericksprobably I messed up reloading my .emacs somehow
18:54gfredericksah now it's on
18:55justicefriesnice.
18:55justicefriesnothing else ever seems terribly useful.
18:56justicefriesre: VimClojure at least.
18:58gfredericksholy crap look at that thing delete
18:58gfredericksthis is like org-mode table editing for s-expressions
18:59technomancycongratulations gfredericks! http://24.media.tumblr.com/tumblr_ls919rY3Kh1qjtesgo1_500.jpg
19:00gfrederickstechnomancy is the guy at the end of the level who congradulates you and gives you your next mission
19:02technomancyare you asking for a mission?
19:02technomancybecause I can totally delegate
19:02justicefrieshaah
19:02gfrederickswhat mission comes after learning paredit?
19:02technomancywrite a leiningen plugin that makes it easy to sign jars
19:03amalloyNPCs ask you to collect various parentheses they left scattered about the landscape
19:03gfredericksis that the extent of the requirements so far?
19:03technomancypretty much
19:04justicefriesanyone mind referring me to ClojureWest?
19:04technomancygfredericks: bonus points for uploading the signature to repositories during deployment
19:04amalloyjusticefries: you should go to clojure/west, ddue
19:04technomancythough you'd have to set up a local nexus/archiva to test against
19:04justicefriesI'm intending to, amalloy
19:04justicefriesI'm using clojure in production now.
19:04amalloyi was just taking your request for a referral too literally, see
19:04justicefriesooh no
19:05justicefriesthere's the "friend of attendee"
19:05justicefriesthat gives $50 off
19:06justicefriesoomph that's an expensive flight.
19:07Raynesamalloy: Are you guys going to C/W?
19:07amalloyno
19:07RaynesGood. I'm not alone.
19:07amalloywe're not going to alabama either, man
19:07amalloyyou are alone
19:07romanandregcan someone help me here with cljsbuild and repl-listen, for some reason it doesn't seem to work for me
19:07RaynesHeh
19:07romanandreg?
19:08justicefriesehh, the videos will be posted pretty quickly.
19:08justicefriesmaybe I'll hold off.
19:08romanandregThe cljs repl seems to start with the browser environment
19:08tremoloalabama happens to be a bubbling font of clojure activity, within our company anyway :)
19:09romanandregand I have the xpc from cljs.repl.browser in the browser running
19:09romanandregonce I hit (js/alert "hello") on the cljs repl, it just hangs and doesn't do anything else
19:13ckirkendallromanandreg, what browser are you running
19:13romanandregFF 10
19:13romanandregckirkendall: 10.0.2
19:14ckirkendallromanandreg, do you have firebug installed
19:14romanandregckirkendall: I'm using the new developer tools from FF
19:14romanandregI can see there are requests done to localhost:9000
19:15ckirkendallromanandreg, if you do (.log js/console "test") does it go to the logs
19:15romanandregckirkendall: nope, it just hangs the cljs repl…
19:16ckirkendallromanandreg, ok so the browser doesn't seem to be connected.
19:17romanandregckirkendall: https://skitch.com/romanandreg2/8e3x1/fullscreen
19:18romanandregI started trying with google chrome now,
19:19ckirkendallromanandreg, hmmm
19:20ckirkendallromanandreg, I have the same version of firefox. let me try. I haven't tried with firefox.
19:21romanandregckirkendall: thanks for the help :-)
19:21_ulisesevening
19:24jkkramertechnomancy: would you like a patch to show download progress for the maven index?
19:24technomancyjkkramer: yeah, sure thing
19:24jkkramertechnomancy: is a dependency on clj-http ok?
19:24technomancyjkkramer: yeah, I think it's already pulled in by repl
19:24technomancyreply
19:24jkkramerok. pull request coming...
19:26ckirkendallromanandreg, did you have any luck with chrome?
19:27technomancyexcellent
19:27romanandregckirkendall: no… sadly, I'm running the cljs repl both from cljsbuild repl-listen, and doing it directly on clj repl as instructed in the clojurescript wiki and no luck so far
19:28romanandregwhich is pretty weird
19:28romanandregckirkendall: wait… I made it work running it from the repl directly
19:28romanandregso I might think is something from cljsbuild
19:28romanandreg?
19:28romanandregneed to play a bit more
19:29ckirkendallromanandreg, I think so because I am see the same thing
19:29ckirkendallromanandreg, it hangs when I go through cljsbuild
19:29romanandregckirkendall: funny thing, clj repl version is hanging on second instruction
19:29romanandreg:-
19:30romanandreg:-/
19:31romanandregpardon me, it is working
19:31romanandregfor some reason the repl get's all sketchy when running from lein2 repl
19:31romanandregcljs repl get's all sketchy
19:46FrozenlockWhat's the correct way to exit a Slime session? I want it to close java when I quit.
19:53tomojFrozenlock: ,s TAB RET
19:54tmciverFrozenlock: or , quit RET
19:55Frozenlocktomoj: thank you!
20:13tacoman:vsplit
20:13tacomaner... >_> wrong buffer
20:15qbgtacoman: I know how that happens...
20:15tacomanI'm coding my senior project in Emacs + Evil mode so that I can adapt to Emacs itself before doing much heavy stuff in Clojure
20:15tacomanbut uh, it ends out that Evil doesn't work in things like erc, so I'm in this sort of hybrid state of mind...
20:16Frozenlocktacoman: free yourself, go 100% emacs
20:16tacomanFrozenlock: it's not quite as efficient for editing multi-line stuff for me. emacs keybindings are great for things like shell or other single-line stuff, Vim-style for anything longer imo
20:17qbgDoesn't Emacs have brainwashing built in at this point?
20:18tacomanM-x you-love-emacs-yes-you-do
20:18qbgCombine with M-x butterfly
20:18tacomansilly me, I don't really want to use Vim bindingz
20:18tacoman*bindings, not trying to use X-treme Z's
20:27tacomanI will say that setting Emacs up for Clojure was a lot easier than dealing with VimClojure
20:47tacomananyone have any recommendations for Git integration?
20:47tacoman(in Emacs, not Clojure)
20:48qbgansi-term works well :p
20:48Frozenlocktacoman: Never tried it, but Magit has a great reputation.
20:48arohnermagit works great
20:49tacomanqbg: can I play Nethack in ansi-term? :P but in all seriousness, awesome Git integration was something I was missing from Vim
20:49qbgYou can run vi inside emacs inside emacs using ansi term
20:50qbgEmacs inside emacs is a danger when using ansi-term
20:50ferdhey, anybody using swank-clojure-1.4.0 ?
20:51ferdautocompletion of symbols (meta-TAB) doesn't work for me (it does nothing)
20:52qbgferd: At the repl?
20:52ferdand the minibuffer doesn't show the funcion signatures as I type
20:52ferdEmacs 24
20:52ferdclojure-jack-in
20:52qbgYou have namespace loaded?
20:52ferdI did "C-c C-l"
20:52ferd(load file)
20:53ferdand C-c C-k
20:53ferdjust in case
20:54arohnerferd: sometimes it doesn't work for me if there's an exception up (*sldb...*)
20:54ferdqbg: it does work in the slime-repl buffer
20:55qbgAt you repl it is C-c Tab
20:55ferdarohner: thanks... but I re-started the session multiple times
20:55qbgferd: You can always fall back to M-\
20:56arohnerferd: is your clojure buffer in slime-mode?
20:56ferdboth C-c Tab and M-tab seem to be bound at my repl, and they work
20:56arohneryou should see Slime in the list of minor modes at the bottom
20:56ferdarohner: yes... status shows "Slime[clojure]"
20:58ferdok... I found one of them: M-tab on the buffer is bound to complete-symbol instead of slime-complete-symbol
20:58ferd(don't know why)
20:59ferdthe minibuffer still doesn't show signatures :-(
21:02ferdqbg: I guess you meant M-/ ?
21:03qbgYeah
21:04qbgTo be fair, it is muscle memory, and I type Dvorak on a Qwerty keyboard :p
21:09muhooi have a stupid destructuring question. if i have data like [[1,2], [3,4]] etc, and i want to convert it to [1,3] [2,4], how do i do that?
21:09gfredericksqbg: it gets real confusing when you start learning to do that by sight
21:09gfredericksi.e., hunt-and-peck
21:09muhooactually it's a lazy seq, so it's ([1,2] [3,4]), and i need to get it into (1 3) (2 4)
21:09qbggfredericks: It is actually how I got good at touch typing
21:10gfredericksmuhoo: (map vector stuff) I think?
21:10gfredericksno wait
21:10gfredericks(map vector stuff1 stuff2)
21:10amalloy~zip
21:10clojurebotzip is not necessary in clojure, because map can walk over multiple sequences, acting as a zipWith. For example, (map list '(1 2 3) '(a b c)) yields ((1 a) (2 b) (3 c))
21:10gfrederickswhy don't I just do it with the bot
21:10muhoozip. got it.
21:10gfredericksHA
21:10muhooi KNEW there was a way to do it. alzheimer's kickin in early.
21:11muhooso i need to unzip, but i think it's in there
21:11gfredericks&(apply map vector '([1 2] [3 4]))
21:11lazybot⇒ ([1 3] [2 4])
21:11muhoogfredericks: actually, that'll work too
21:11amalloy~transpose
21:11clojurebot(def transpose (partial map vector))
21:11muhoogood christ. there are tons of ways to do it :-/
21:12amalloythose are the same way really
21:12gfredericksno there's only been one mentioned so far
21:12gfredericksamalloy: how many dang bot triggers have you memorized?
21:12amalloywell, i taught him the ones i was tired of answering
21:12qbgWork smart, not hard
21:12amalloyand someone (TimMc?) taught him transpose earlier today, much to my dismay since i already taught him zip
21:12amalloy~juxt
21:12clojurebotjuxt is a little hard to grok but it's the best thing ever
21:13muhoowhere is transpose?
21:13gfredericks~grok
21:13clojurebotgrok is a little hard to juxt but it's the best thing ever
21:13muhooheh
21:13gfredericksmuhoo: it's not anywhere
21:13muhoobut, it's in clojurebot/lazybot?
21:13gfredericks(def transpose (partial map vector)) is a suggested implementation you could use
21:13qbgSee the clojurebot answer for the def
21:13amalloyit was inside you all along
21:13muhooi see
21:14amalloybut i think the transpose definition is trash really
21:14amalloyyou want (partial apply map vector) for sure, because you'll usually have a list-of-lists, not N lists
21:15gfredericksprojecteuler.com is a big let-down
21:16tacomanwhat's wrong with project euler? it seems like the entire Internet has nothing but good things to say about it
21:16gfredericksnothing's wrong with project euler
21:17gfredericksnot that I know of at least
21:17qbgPE is the one use case that the 1.3 numeric changes aren't optimized for
21:18qbgCan't think of anything else
21:23muhoothis is what i ended up with. i suck. but it works: https://refheap.com/paste/1007
21:24muhoodoh, sorry, this https://refheap.com/paste/1008
21:26muhoook, so i'm writing scheme code in clojure. it's the best i can do right now :-)
21:27muhooincanter is wonderfully easy to use though. very nice.
21:27qbgYou box r just to unbox it again?
21:29muhooi used to work at UPS
21:29muhooboxing, unboxing, all day long
21:29qbglol
21:29muhooi honestly don't know what you mean by boxing
21:29RaynesDey see me boxin', dey hatin'
21:29qbg(map first all) is just (range 10000 100000 1000)
21:30qbgAnd then ys is (map vout xs)
21:30muhoooh! good point.
21:30muhooyeah, it is kind of circular. thanks.
21:33muhoothanks https://refheap.com/paste/1009
21:35qbgAny reason why you are using for for ys?
21:36muhoooh, good call. map'd work
21:36qbgYou can also get rid of letfn, and move vout into the let
21:43gfredericks(defmacro cout [_ s] `(print ~s)) ;; usage: (cout << "foo")
21:49muhooholy crap. https://refheap.com/paste/1010
21:50muhoothat just snuck up on me and worked! and i was shocked that it actually worked.
21:52TimMcclojurebot: forget transpose |is| <reply>(def transpose (partial map vector))
21:52clojurebotI forgot that transpose is <reply>(def transpose (partial map vector))
21:52TimMc~transpose
21:52clojurebot(def transpose (partial apply map vector))
21:52TimMcamalloy: Better?
21:52amalloysure
21:53amalloyIME people who want this usually don't realize what they want is transpose (fair; i don't either)
22:56TimMcibdknox: I extracted the cascade lib: https://github.com/timmc/cascade
23:30y3di(def ^:dynamic v 1) -- what does the ^:dynamic mean?
23:30y3dii know :string is an interned string, and represents metadata?
23:30TimMcy3di: It means the var can be rebound with (binding ...)
23:31TimMcy3di: What's this about :string?
23:32y3diwait so ^:dynamic makes v dynamic? (which means it can be rebound?)
23:32TimMcright
23:33TimMcy3di: ^:dynamic is short for ^{:dynamic true}, which attaches that metadata map to the symbol "v" for the compiler to see.
23:33TimMcand when it see :dynamic in the map, it knows not to perform certain optimizations on that var.
23:33y3diah
23:34y3diso metadata can be applied to any var?
23:37qbgMetadata can be applied to many data structures coming from Clojure