#clojure logs

2012-01-18

00:03amalloyespringe: i don't use paredit in the repl, and i don't know if i recommend it
00:04amalloyif your input is always a valid s-expression, the repl will have a tough time knowing whether RET means "i'm done, eval it" or "insert a newline, i'm editing"
00:05espringeYeah, i noticed the RET was a bid dodgy :(
00:05espringeIt seemed like a good idea at the time though
00:10dybaworking through the clojure koans and looking to see if anyone can give me a nudge in the right direction.
00:10dybathe topic is recursion: https://gist.github.com/1618486
00:11dybai've got the first meditation passing, but the second one fails
00:11adiabaticSeems like a weird problem to use recursion for…
00:12RaynesNot really. You can use mutual recursion to implement even? and odd?. It's pretty cool, if slightly insane.
00:12dybaadiabatic: i don't know why they use =
00:12dybaI've done a similar problem but not using =
00:13dybaRaynes: mutual recursion? I'll have to look that up.
00:13adiabaticdyba: f calls g which calls f which calls g which calls…
00:14Raynesa psychiatrist.
00:14Raynesdyba: But you can't look it up on wikipedia!!!1!
00:14Raynes(unless you disable Javascript)
00:14dybaRaynes: haha, no I'm reading a book called Clojure in Action
00:14airolsonyeah, I'm disappointed with wikipedia's "black-out"
00:15Raynesairolson: There was a bug in the first few minutes where clicking on the 'learn more' link would take you to another blacked out page.
00:15dybaairolson: that's going on today? I thought they were starting tomorrow
00:15RaynesIt was pretty hilarious.
00:15Raynesdyba: From 17 minutes ago until this time tomorrow.
00:15amalloydyba: it's tomorrow now
00:16amalloyif you're on the US east coast
00:16dybaamalloy: west coast
00:16Raynesamalloy: His timezone is the only one that matters.
00:16RaynesObviously.
00:16amalloyevidently
00:16dyba:P
00:16RaynesOh man. We better call wikipedia. dyba is on the west coast, they need to wait two hours!
00:16dybahar har
00:17Raynes:)
00:17airolsongoodnight folks
00:17dybag'nite
00:17RaynesGoodnight, kind sir.
00:17amalloydon't let Raynes offend you. he doesn't even know how many hours are between EST and PST
00:17Raynesamalloy: Three.
00:17dybaRaynes: see ya! Thanks for the lead
00:17dybait's all in good fun
00:17Raynesamalloy: I counted backwards relative to my timezone.
00:18Raynesdyba: I wasn't trying to encourage you to use mutual recursion. That's rarely (never?) the optimal way to solve a problem.
00:18RaynesI was just pointing out that it is possible.
00:19dybaRaynes: well, I was going to see what it's all about anyway
00:19RaynesYeah, it's pretty cool in any case.
00:21dybathe problem would make sense if you were checking for modulo 2, that's how I would do it
00:22dyban mod 2 equals 0 that is
00:22adiabaticok good, I'm not the only sane one here
00:22amalloythat's...the same as testing even-ness, right?
00:23dybathe entire time it will decrement n! weird...
00:36espringeLooking at someone elses code, I see he has:
00:36espringe(fn [n] (map first (reductions (fn [[a b] _] ......
00:36espringeWhat does the _ mean?
00:37dnolenespringe: an ignored argument
00:37espringeAh, thanks
00:37espringeIs that a convention, or a language feature?
00:37amalloyconvention
00:37amalloybut it's easy for you to prove that yourself :P
00:37dnolen,((fn [_] _) 1)
00:38clojurebot1
00:38amalloy&((fn [x _] (+ x _)) 1 2)
00:38lazybot⇒ 3
00:38espringeThanks :)
00:39espringe,((fn [_ _ _] _) 1 2 3
00:39clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: EOF while reading>
00:39dnolen,((fn [_ _ _] _) 1 2 3)
00:39clojurebot3
00:39espringe,((fn [_ _ _] _) 1 2 3)
00:39clojurebot3
00:39dnolen,((fn [a a a] a) 1 2 3)
00:39clojurebot3
00:43dybaonly save the last value it looks like
01:51seancorfi'm playing with clojurescript... are there some basic dom manipulation functions available in the base installation?
01:52seancorfi.e., are there some bundled namespaces i can just require?
01:52scottjmaybe under clojure.browser, I think domina is what cljs1 is recommending though
01:53seancorfguess i need to go dig in the cljs docs then...
01:55chewbrancaanyone have any recommendations for processing posted json data in noir?
02:02seancorfscottj: clojure.browser.dom has a few things i need but not all - domina does look more useful but it's not clear to me how to use it separate from clojurescript one
02:04seancorfi haven't figured out the way libraries are handled in cljs :(
03:38Blktgood morning everyone
03:39ordnungswidrighi
05:07cromiehello
05:07cromiewhat is -> macro called?
05:07arbschtthread
05:07cromieI'm trying to find documentation on it but it's ungoogleable
05:09ivanhttp://clojuredocs.org/search?x=0&amp;y=0&amp;q=-%3E
05:09cromiewhoa didnt know there were so many -> macros
05:13cromieby the way is there a way to google non-alphanum characters like -> ?
05:20ivancromie: no
05:20ivanbut you can configure your browser bar to let you search more than Google via bookmark keywords
05:25cromieok thanks for help
10:10ordnungswidrighttps://gist.github.com/1633445
10:11ordnungswidrigCan't you use (->RecordName) in the record declaration?
10:28llasramordnungswidrig: `defrecord' creates a ->RecordName function
10:28llasramSo ->FooImpl should exist, not ->Foo
10:29llasramBut wait. What are you trying to do?
10:29ordnungswidrigllasram: yes, but only after deftyping, thus when giving a protocol implementation within the defrecord the function bodies cannot access ->Foo yet
10:29llasramThere is no ->Foo
10:29ordnungswidrigllasram: ah, sorry. the paste is wrong
10:30TimMcThat'll do it.
10:30llasramAnd... The `foo' implementation for FooImpl will only be called if `foo' is called with a FooImpl type object
10:30ordnungswidrigno, ->FooImpl is not yet defined.
10:30ordnungswidrigtrie the updated gist
10:30ordnungswidrigs/ie /y /
10:31llasramInteresting. That is potentially confusing.
10:32ordnungswidrigllasram: you can fall back to (new FooImpl) or (FooImpl.) of course. that works fine.
10:32llasramRight
10:32llasramOr use `extend-protocol' or `extend-type'
10:32ordnungswidrigllasram: I guess reordering the expression generated by defrecord would be sufficient.
10:33jkkramerordnungswidrig: or (declare ->FooImpl) above deftype perhaps?
10:33ordnungswidrigjkkramer: or like that
10:34llasramAh, or have `defrecord' do that (`declare' the constructors). I don't think you can implement constructors before creating the type -- chicken and egg there
10:34llasramBut `declare' should work around it
10:34ordnungswidrigjkkramer: not trivial though after having looked into core_deftype.clj
10:44solussddoes anyone know how to add a path, at runtime, to jna.library.path (i.e. not replace the default system path, but add a second)
10:46llasramsolussd: System/setProperty ?
10:47solussdllasram: that seems to replace whatever is already there. :/
10:47TimMcI don't know if you *can* adjust PATH in a running JVM.
10:47llasramSystem/getProperty + System/setProperty :-)
10:48llasramI've used System/setProperty to successfully modify the jna.library.path after the JVM starts but before loading JNA
10:48TimMcOK, cool.
10:48llasramAfter JNA fails to find a library once though, you may be screwed
10:57solussdcool, thanks guys
11:04arkhhow would a person turn off syntax highlighting in clojure-mode / emacs?
11:06llasramTurn... off?
11:06llasramDo you still want to be using clojure-mode, just without syntax highlighting?
11:06RaynesMind blown.
11:07llasramIf that's the case, try M-x font-lock-mode
11:07arkhI would still like to use clojure-mode and have the ability to turn coloring on/off
11:08arkhllasram: that does the trick, thank you
11:09LicenserI wonder about this code: https://refheap.com/paste/343
11:09Licenserthe algoritm is not the best (I know) it was just a quick example for someone entirely new for programming but I am really surprised pmap actually shows the whole thing down
11:10Licenseryes Raynes I use refheap only for you :P
11:10RaynesHeh
11:11Licensereven so I would have expected more from you :P
11:11Licenseryou seriousely disappointed me :.(
11:12LicenserI was so thrilled about what you made when you were making us all excited and then it is a pastbin :P I was looking for something like 'hey I found a way to calculate prime numbers in constant time'
11:13RaynesHahaha
11:13RaynesBut it's such a nice pastebin. :p
11:13Licenseralso is that your reptile that supports refheap?
11:13Licenseryes it is
11:13Licenserbut it is 'just' a pastbin
11:13Licenserbeen there, done that
11:13LicenserI'd hoped for something revolutionary
11:13Licenseralso is there a emacs integration :P
11:13TimMcIguana!
11:13Licenserexactly
11:13TimMcThere's an iguana!
11:13TimMc<3 Raynes
11:14RaynesOne of my coworkers is an animal shelter guy.
11:14Licenserthat makes it kind of revolutionary so
11:14RaynesThat's his picture.
11:14TimMcOh, you don't have an iguana?
11:14RaynesNo.
11:14TimMc/shun
11:14RaynesI wanted to replace it with a picture of stuartsierra's hair, but I was worried about licensing.
11:15stuartsierraoh? :)
11:15Licenserhaha
11:15qmxROFL
11:15Licenserstuartsierra does your hair look like an iguana?
11:15RaynesTimMc: That used to say "… and the cries of children the world over.". Alex decided that was too depressing and put the Iguana picture link there.
11:15stuartsierraI am not qualified to answer that query.
11:16LicenserRaynes a few unique features would be: show past as .pdf, .png for example
11:17Licenserthat'd kind of be nice
11:17LicenserI think
11:17RaynesScreenshot the pastebox. :P
11:17LicenserRaynes that is not a feature that is work
11:17Licenserwork for me, which makes it even worst
11:18Licenseradmit taht being able to say https://refheap.com/paste/343.png would be cool
11:18RaynesSure.
11:18Licensersee that'd be a unique feature
11:19Licenseror https://refheap.com/paste/343.pdf
11:19RaynesIt'd be like, totally rad. dood.
11:20Licenserrad?
11:20Licensernow I must admit I am a german again :(
11:20RaynesHeh.
11:21cemerickRaynes: there's gotta be a catch with this browserid thing, yah?
11:21Raynescemerick: Every time you sign in, they kill a kitten?
11:21Licensercan't they kill puppies again? I'd write a script to sign in and out for that
11:21cemerickprobably
11:22Licensera long time ago I got a plan, I made a catch all account for my domain now I always use something like browserid@licenser.net or whatever site I am in and, in the case I get spam from the side I just forward that email to the abuse@browserid.com address
11:23RaynesWell, that certainly isn't a catch.
11:23cemerickThe actual browserid.org site is really light on details.
11:24Raynescemerick: Click that 'developer' link.
11:24Licensercemerick they will propably seel your browsing behaviour to google or something
11:25Raynescemerick: https://github.com/mozilla/browserid/wiki shortcut
11:25cemerickRaynes: Yeah, I'm on it now. Looks like I need to grok this verified email protocol.
11:25cemerickSo far, it just sounds like a centralized authentication mechanism.
11:25RaynesIt isn't centralized.
11:26cemerick*sounds* :-)
11:26cemerickanyway, it's in the TODO tab group
11:26LicenserRaynes another neat feature: allow users to choose their own code layout
11:28Licenserperhaps stuartsierra does not like the dark dim colors but rather would prefare keywords be purple and strings bright green
11:28RaynesYou mean highlighting themes? We plan to settle on a few themes based around a single theme. This is my first draft of a tomorrow-night-bright style color theme, but eventually you'll be able to switch between a dark theme, a light theme, a low contrast dark theme, and a high contrast dark theme.
11:29LicenserRaynes allow users to make their own?
11:29TimMcLicenser: You can do that with Stylish.
11:30RaynesIt's a pastebin and that isn't a useful feature. It would unnecessarily complicate things by introducing more decisions.
11:30LicenserTimMc of cause I also can write a own dom visualisation library if I am very boored :P
11:30LicenserRaynes you have a point so
11:30LicenserTimMc sorry for the sarcask ;)
11:31RaynesYou aren't meant to edit code on refheap -- you just paste code there for others to take a look at. If they are so terribly cross with the highlighting/theme that they can't bear to look at it for more than second, they can copy it to their editor.
11:31RaynesThat said, this particular theme is just what I have right now. It will almost certainly change.
11:32LicenserRaynes I don't have any objectsions to the theme ^^ Just tossing ideas around
11:33Licenseralso you made me look at EMACS themes, now I can't decide :P
11:33Licensergreat
11:34RaynesTomorrow Night is a fantastic set of themes.
11:34RaynesHighly recommended.
11:34RaynesI use tomorrow night in Emacs, Vim, and my terminal.
11:36Licenserhmm it isn't part of the standard themes, where are they hiding?
11:36Licenserfound them :)
11:40Licenserhmm the background is too blue for me
11:59mpenetRaynes: tryclj is down in case you didn't notice. Protesting SOPA :) ?
12:00RaynesNo, but maybe Heroku is.
12:00Raynes;)
12:01RaynesI'll pretend that I am and that I did this purposely.
12:02mpenetOne of my (non-coder) coworkers was using it, now I need to guide him through setting up leiningen and run a repl
12:03Raynesmpenet: It's back up, btw.
12:03mpenetThanks
12:04Raynesmpenet: I'm still working on getting memory settings right. It occasionally goes down because of GC overhead issues.
12:04RaynesI haven't set up any sort of monitoring though. I think that'd be the most important thing I could do right now.
12:04mpenetYep, it is not easy to get right
12:06jsabeaudryI've been profiling my trivial web app that uses aleph (thus netty) and it would seem that 65% of the CPU is used by SelectorUtil.select(). Anyone has has similar experience?
12:09mpenetI have some long running web apps based on aleph, cpu is almost always flat/low. ztellman is doing some work on lamina performance though
12:10jsabeaudrympenet: Does any of you webapps use streaming?
12:10mpenetnope, lots of long polling
12:11mpenet well one of them (not a web app) consumes twitter streams all day long, so yes
12:13jsabeaudrympenet: I don't know if consuming it is different, but with Jetty I can reach the limit of my ethernet (around 10MB/s) but with JettyI have trouble reaching 3MB/s...
12:16jsabeaudryOh wow, the second JEtty is Netty
12:17mpenetouch, it doesn't sound good. It is probablly worth reporting, maybe ztellman is aware of the underlying issue and can help you with that.
12:17jsabeaudrympenet: Are you aware of any alternatives to aleph that I could try?
12:19mpenetnothing that you could use with ring handlers directly like with aleph, there are alternatives in the java world I guess
12:19mpenetor maybe the latest jetty, I am not sure though
12:30jaleyhello! my company are about to use Clojure for a new project and I was wondering if anyone has advice on dealing with native libraries in leiningen? Our existing product is a native lib with a JNI wrapper already in place - we want to use it from Clojure. Any recommendations? Is there a "right way" to pull in native deps from a repository or something?
12:32technomancyRaynes: does the tryclj actually crash, or does it just get into a wedged state?
12:33Raynestechnomancy: Wedged state.
12:33technomancyoh, bummer
12:33technomancyjaley: you can publish a jar with a certain directory structure that will get expanded and put on the java.library.path when deps get run.
12:33RaynesIf it actually crashed, Heroku would fix it.
12:34technomancydocs are scarce, but maybe you can crib from one of the existing libs.
12:34Licenserthere is no crashage
12:34Raynestechnomancy: That only works after my fix, which hasn't been released yet, right?
12:34technomancyRaynes: the native extraction stuff?
12:35RaynesNo, the setting library path stuff.
12:35RaynesYou were setting java-library-path instead of java.library.path, remember?
12:35technomancyoh snap.
12:35technomancyyes, this is true.
12:35chewbrancaanyone have any recommendations for building a json api with noir? I'm not having much luck actually getting the raw (or parsed) json data from the body of the request
12:35jaleytechnomancy: ah ok cool. is the code for that actually in lein? I'll just read the code - cheers!
12:35RaynesSo he'll need the 1.x branch, I think.
12:36technomancyjaley: yeah, you will need to either use 1.7.0-SNAPSHOT from git or 1.6.1 unfortunately
12:37jaleytechnomancy: ok, thanks
12:37Raynestechnomancy: Did I fix that in lein 2?
12:37technomancyjaley: to find a sample from which to work you could take a look at one of these libraries at the bottom: http://p.hagelb.org/find-native.clj.html
12:38technomancyRaynes: yeah, we're clear in the master branch
12:39jaleytechnomancy: got it, thanks
12:41devthIs there something like `or` that will treat an empty list as false and take the other value? e.g. (or '() "use this!")
12:41hiredmanyou don't need to quote the empty list
12:41hiredman,()
12:41clojurebot()
12:42hiredman,(seq ())
12:42clojurebotnil
12:43devthhiredman: perfect, thanks!
12:54gfredericksOkay, I've successfully switched to emacs. Now what do I need to do to stop using `lein repl`?
12:55technomancygfredericks: "lein plugin install swank-clojure 1.3.4" in the shell; M-x clojure-jack-in from an emacs buffer for any file in your project.
12:55gfredericksdoes "install clojure-mode" go at the beginning?
12:56gfredericksoh wait I did that already
12:56gfredericksokay here I go.
12:57gfrederickswelp, it opened an emacs buffer with a backtrace in it. Says it cannot resolve the symbol 'pst'
12:58technomancygfredericks: get rid of the out-of-date clj-stacktrace
12:58gfredericksoh 'pst-elem-str' actually
12:58gfredericksit must be and indirect dep of my project?
12:58technomancyyeah
12:59technomancyor put an explicit dep on the latest version
13:00solussdis it possible to include a c library in a jar?
13:00gfrederickshmm; `mvn dependency:tree` doesn't mention it
13:00technomancygfredericks: it could be a dev-dependency or pulled in by another user-level plugin; maybe lein-difftest or some such
13:01technomancygo with the explicit dep if you can't find it; simpler that way
13:01gfredericksah I do have difftest I think; no dev deps
13:01gfredericksokay
13:03gfredericksI think I figured out how to upgrade difftest, so I'll try that, since that would solve it for all projects
13:05gfredericksooh I think it worked!
13:07technomancywoo!
13:11clj_newbfor a hashmap where the values are known to be distinct, is there an idiomatic way to "invert" the hashmap? i.e. swap the key/values?
13:13clj_newbthe best I have is:
13:13jodarohrm
13:14jodaroi'm using aleph to deal with an http post request
13:14clj_newb(apply hash-map (concat (map (fn [x] [ (last x) (first x)]) key_map))) ; but calling it ugly would be an understatement
13:14TimMcclj_newb: (zipmap (vals h) (keys h))
13:16jodaroanyway yeah
13:16jodaroif the body is small its a BigEndianHeapChannelByteBuffer or whatever
13:16jodarobut at some point
13:16jodaroif it gets bigger, it becomes a lamina channel
13:17jodaroi guess i can just check the type and see
13:17jodarobut it would be cool if there was some way to have it always be the same type
13:17jodarodonde esta senor tellman
13:19rplevyare there any plans for an official clojurescript jar in a maven repo? lein-clojurescript is using its own packaged clojurescript jar in the clojars repo, and clojurescriptone is including the cljs compiler in the source, etc...
13:19TimMcjodaro: There's probably an abstraction you're supposed to use over those.
13:20clj_newbTimMc: thanks
13:20TimMcrplevy: Packaging is still in the works, but planned, i believe.
13:20jodaroyeah i think so
13:20rplevyTimMc: ok cool
13:20jodaroif it was always a lamina channel that'd be fine
13:20jodarochannels are the bomb
13:21technomancyrplevy: there are rumors; as usual nothing is clear.
13:21jodarobut this bigendianholycrapthisisalongclassname thing is less awesome
13:22rplevyok, I'll stay tuned then
13:22TimMcBigEndianHeapChannelByteBuffer$UnspecifiedException$Factory$Bean$FuckMyLife$ThisIsMore$Than80Columns
13:22jodaroyeah
13:23jodaroorg.jboss.netty.buffer.BigEndianHeapChannelBuffer
13:23jodarosorry, thats what it is
13:23jodarono Byte
13:23Raynesrplevy: Everybody is currently trying to convince core that cljs should be in maven. They don't want it there.
13:23rplevyRaynes: why not?
13:23Raynesrplevy: I recommend you black out your clojure projects in protest.
13:23Bronsalol
13:23rplevyhaha
13:23Raynesrplevy: I'm not sure they've given an actual reason.
13:24Raynes*shrug*
13:24rplevy:)
13:24pdkis that when you set your font color to black
13:24jodaro(defmacro blacken ...
13:24jodaroyou can just wrap all of your code with that macro
13:24jodaroand instead of running, everything just turns black
13:26TimMcRaynes: Why, are they going for a less modern distribution channel, like CDs in magazines?
13:26pjstadigRaynes: i think the reason is that clojurescript is not a java project
13:26cemerickRaynes: from everybody. I think most have just tuned out.
13:26cemericks/far/far from
13:26RaynesTimMc: Shell scripts, apparently.
13:26TimMchot
13:27Raynespjstadig: I'm still not sure what the idea is. Roll another dependency management solution specifically for ClojureScript?
13:27RaynesNot that I've never reinvented wheels.
13:27pjstadigyeah
13:27pjstadigi don't think i've heard what alternative there may be
13:27stuartsierraNo one is against having ClojureScript bundled into JARs and deployed to Maven repositories.
13:27pjstadigjust that they don't want maven because cljs is not a java project
13:28pjstadigstuartsierra: i thought stuart halloway pretty much said that
13:28RaynesI'm pretty sure he did.
13:28stuartsierraI think Stuart Halloway meant we don't want that to be the ONLY deployment strategy.
13:29RaynesI wish he'd say what he means then.
13:29pjstadig"I am opposed. Leiningen + Maven is a big dependency to bring in for a language that is not part of the Java ecosystem."
13:30cemerickTalk about mvn artifacts is moot if releases (whatever the numbering / messaging) aren't in the cards.
13:30stuartsierraStu H. said that in response to the suggestion that we *replace* the shell scripts in CLJS with Leiningen.
13:30stuartsierraStu does not want Leiningen to be the only way to use CLJS.
13:31RaynesIf that's the case, it sounds like he needs to clarify his position in more than one sentence.
13:31stuartsierraAlso from Stu H. in that thread: "You should not need Maven to develop or distribute ClojureScript libraries. That said, you should of course be *able* to use Maven for these purposes if that is already part of your workflow."
13:32gfrederickstechnomancy: oh man it's so nice to be able to use backspace again. Thank you sir.
13:38rplevyit seems not entirely accurate to say cljs is not part of the jvm ecosystem though. don't you need java to compile clojurescript?
13:39emezeskerplevy: not only that, but clojurescript macros are written in clojure
13:39cemerickAnd usage in conjunction with a Clojure backend is probably the most common practical use case as an initial adoption vector.
13:39cemerickBut, this is all known.
13:41stuartsierraLet me put it this way. We WILL have ClojureScript JARs in Maven repositories at some point in the near future. We MAY ALSO have some other dependency, probably based on Git repositories.
13:42stuartsierras/dependency/dependency management system/
13:44cemerickcrap, I should have put money on it somewhere :-P
13:47stuartsierraThe best objection to Maven repositories I've heard is the disconnect between "release" versions and version control history.
13:47pjstadigeh
13:47pjstadigi'm unconvinced by that line of argumentation
13:48technomancy<pom><scm><connection>scm:git:git://github.com/technomancy/leiningen.git</connection> [...]
13:48stuartsierratechnomancy: Yes but there is no link between a particular release number and a particular git commit.
13:49technomancyso the objection is that some people suck at using tags?
13:49pjstadigfor instance, I think there are several flaws with the argumentation here https://github.com/brentonashworth/one/wiki/Dependencies
13:50stuartsierraThe objection is that it is not easy to pinpoint a particular Git commit, possibly on a non-master branch, without explicitly creating a release for that commit.
13:50jsabeaudry_Anyone has experimented by returning an infite ISeq as :body for a ring response? It seems that ring just keeps pumping data even if the client has disconnected
13:50pjstadigi think that use case is actually orthogonal to releases
13:51cemerickpjstadig: huh, hadn't seen that before, thanks
13:54JorejiHey guys, why is this code: (take 1 (map (fn [_] (print ".")) (range))) printing out 32 dots? I thought being lazy meant that only so much is evaluated as is needed?
13:54stuartsierraJoreji: chunked sequences
13:54dakroneJoreji: lazy-seqs are chunked in sets of 32
13:55JorejiAny way I can work around this?
13:55Joreji(actually that explains a lot of interesting problems I had in the past, lol)
13:56cemerick(mapcat list (range)) will get you what you want; lists aren't chunked
13:56dakroneJoreji: http://p.draines.com/13269131007646223b829.txt
13:56Jorejidakrone: Cool thank you :)
13:57Jorejicemerick: Good to know. Tough for my purposes I'll try dakrone's solution first :-)
13:57cemerickeh, I've done the submodules-as-dependencies thing. Horrid, especially given transitive dependencies/submodules.
13:58technomancygit submodules are the best arguments I've seen so far to start using mercurial.
13:59cemerickisn't it easier to just not use submodules? ;-)
13:59technomancyalso acceptable
13:59Jorejidakrone: How should I use the unchunk fn? Simply applying it to the above example yields the same result.
14:01Jorejidakrone: Aha, figured it out. It has to be applied to the innermost seq.
14:03dnolenJoreji: though it's important to note, if your code depends on the actual "amount" of laziness, then your code relies on side-effects.
14:04Jorejidnolen: Yes. Printing out progress as the lazy-seq gets realized is the side effect.
14:10dnolenJoreji: then why not (dotimes [_ 1] (print ".")) ?
14:11pjstadigdnolen: eh...we've run into problems where our lazy sequences caused OOMEs because they were getting chunked
14:11pjstadigi guess that's a side-effect
14:12pjstadigbut probably the weakest form, no one really expects that their program has an infinite amount of memory to compute
14:12raekpjstadig: also note that another source of problems is when you nest laziness, like (concat (concat (concat (concat ...))))
14:12raeke.g. when you combine concat and reduce
14:13dnolenraek: that's a different problem, right? stack overflow.
14:13raekyeah
14:14raekthat problem has a pretty easy solution though: just wrap each layer of concat in a doall
14:15Jorejidnolen: This really was just a simplified example to illustrate my problem :-)
14:17pjstadigraek: we hit that at work too
14:17pjstadigwhich is why I think I'm qualified to talk about clojure's laziness constructs at Clojure/West :)
14:22Raynespjstadig: To get your point across, you should just get up there and not talk at all. When people ask you why, tell them you're being lazy.
14:24technomancyno you should just stop halfway through your talk and wait for someone to ask a question
14:24technomancyand use it as an explanation of chunking
14:24RaynesExcellent.
14:25pjstadigi'll need a plant in the audience to ask the question "(take 1)?"
14:25pjstadigthen i'll continue for 32 more minutes
14:26technomancyI'd volunteer, but your talk is right after mine and I might need to take a breather.
14:26RaynesI would totally do that if I were there.
14:27technomancy*the only talk
14:27jodaroahh, ok
14:27jodaroFor a chunked response, the response :body should be a channel.
14:29cemericktechnomancy: surely you'll be more of a facilitator though?
14:29technomancycemerick: yeah, it just feels weird. =)
14:29cemerickIt'll be way too big of a crowd to do anything else while hacking.
14:30RaynesI think I spent most of the last two days of the Conj trying to write code and listen to the talks at the same time.
14:30RaynesI've probably got a commit somewhere that is just a subconscious transcription of someone's talk.
14:31RaynesWell, I mostly slept during your talk.
14:31technomancycemerick: it's OK we can promise to stop making fun of you for using the mouse
14:31RaynesI keep forgetting that I have a mouse since I started using Vim.
14:31cemerickRaynes: you're better off for it :-)
14:31cemericksleeping, that is
14:32cemericktechnomancy: can't say I use it much at all
14:32cemerickMostly only when browser-ing
14:32TimMcpjstadig: After the last Clojure meetup here in Boston, some of us went out to a restaurant and debated whether to pay our bill lazily. (Try to leave, and pay when asked.)
14:32technomancycemerick: ah, I was just trying to stereotype IDE users. joke fail.
14:32Raynescemerick: I hate admitting it though, really. I was having significant trouble staying awake through most of the talks. I'm surprised nobody slapped me out of my seat. I guess I'm just not made for the conference nightlife. I should have just slept more.
14:33technomancyanyway, that's the thing I love about the thinkpad trackpoint; you can just pluck the thing out and be done with it
14:33TimMctechnomancy: That's illegal in some countries.
14:33cemerickIf there was a decent tiling window manager for OS X, I'd be able to swear it off entirely.
14:33Raynescemerick: Man!
14:33Raynescemerick: I was so disappointed to find out that there weren't any decent tiling wms for OS X.
14:34cemerickyup
14:34pjstadigtechnomancy: rotentio vegetarian?
14:34RaynesJust crappy hacks that don't work well.
14:34technomancysure there are; you just have to run everything in X
14:34cemerickcouple of sorta sad shareware-y things that mostly suck
14:34cemericktechnomancy: hush
14:34cemericktwm ftw, eh?
14:35pjstadigthere's actually some great tiling window managers for OS X
14:35Raynescemerick: So what are you giving me for my birthday?
14:35oakwiseRaynes: have you seen divvy?
14:35pjstadigyou just have to install Linux first to access them
14:35pjstadig:-p
14:35oakwisehah
14:35Raynespjstadig: Hurrrrr hur.
14:36technomancypjstadig: would have worked better if you said "for Macs"
14:36pjstadigi thought about it
14:36cemerickI have an ubuntu ISO ready to go if and when apple goes stupid with its app store / locked-down general-purpose computation B.S.
14:36pjstadigbut that's not what cemerick said
14:36pjstadigmeh
14:37pjstadigcemerick: hehe. well Unity isn't much better these days
14:37technomancythe best thing about unity is how easy it is to replace
14:38cemerickIs there a distro that will run on macs that has support, so I can not bother learning how to recompile my kernel to get wifi to work?
14:38RaynesI've been wishing for some Linux lately, but I'm too scared to dual boot on a macbook pro.
14:39RaynesIt's a good way to quickly destroy your computer, and I don't exactly have a bunch of them.
14:39technomancycemerick: usually depends how old the macbook is. brand-new stuff is sometimes sketchy; the older the better generally.
14:39technomancycemerick: bonus points for Intel graphics
14:39cemericktechnomancy: *not* the most rousing endorsement
14:39technomancycemerick: anyway you can always test it out with a livecd; no commitment.
14:39TimMcRaynes: destroy?
14:40cemerickThe 5 minute test is easy; it's the one 103 days in when the f'n printer won't work because CUPS wasn't compiled with the whateveritis.
14:41TimMcor when you can't connect to wireless at the coffee shop you spend 10 hours/week at.
14:41RaynesTimMc: The instructions for all the distros I looked at used very aggressive wording like 'destroy' and phrases like "BACK UP OR DIE"
14:41technomancycemerick: admittedly I've only stuck with thinkpads, but I haven't had to manually configure any hardware since 2007.
14:41pjstadigstrawmen all of these arguments
14:41TimMcRaynes: Ah, that's just data. You have tested backups, right?
14:41pjstadigi've had good success with ubuntu for many years
14:41RaynesTimMc: I was using that as an example.
14:41JanxSpiritRaynes: I got a System76 - Ubuntu out of the box - very nice
14:41pjstadigand not once had to recompile the kernel or CUPS's whateveritis
14:42TimMcUbuntu is starting to really piss me off with their "relaxed" view of bugfixes and upgrades.
14:42JanxSpiritbigger than a MacBook Pro, but also way more horsepower
14:42TimMc"Ah, you'll just want to dist-upgrade, that'll fix it..."
14:42technomancyTimMc: yeah, I'm happy to be on Debian stable. very conservative.
14:43RaynesJanxSpirit: Never heard of those.
14:43TimMcJanxSpirit: I gave up on System76 when they started shipping terrible keyboards. (Otherwise great company.) Now I have a ThinkPad that came with no OS. :-)
14:43TimMcNote: I am fairly picky about keyboards.
14:44cemerickpjstadig: just citing from prior experience on *commodity* hardware.
14:44JanxSpirityeah I've heard good things RE thinkpads - the keyboard on mine is a total MacBook clone
14:44JanxSpiritchicklets
14:44solussdJanxSpirit: what does it have? I've got a quad core i7 @ 2.3GHz macbook pro w/ 8gb of ram and a 1GB radeon 6750 (free upgrade from apple-- thanks!)
14:44TimMcJanxSpirit: and there's a BIOS switch to put the Ctrl key back on the lower-left corner.
14:44JanxSpiritsolussd: OK it's right about there - 12G of RAM though
14:44solussddidn't think they were cramming much more than that into notebooks these days
14:45solussdnice
14:45solussdsupposedly I can go to 16GB. Might- the price is finally right
14:45JanxSpiritI think 16 GB was an option, but that's where it got very pricey
14:45TimMcTHe ThinkLight is where it's at -- no more using my cellphone as a keyboard light when typong my password in in the dark.
14:46TimMcTo hell with speed.
14:46JanxSpiritit's been a mostly very good experience
14:46solussdyeah, 16GB of crucial value ram @ 1333MHz is going for ~ $170 on amazon right now
14:46pjstadigTimMc: i've actually found the illiminated keyboard on my new Dell to be better than the ThinkLight on my old ThinkPad
14:46JanxSpiritstarted a new job - everyone on MacBooks of course - I've never used Mac in my life and been on Linux for 10+ years, so I gave the System76 a try
14:46technomancythe problem with keyboard backlights is that they make drainage systems impossible
14:46technomancyone of those appearance vs functionality choices
14:46pjstadigtechnomancy: there's a driphole on the bottom of my Dell
14:47pjstadig...and besides just don't spill things on your laptop
14:47technomancypjstadig: I know you have kids dude; you can't pull that. =)
14:47technomancythat's cool if they've figured out how to do both though.
14:47cemerick"drainage systems"? :-O
14:48technomancycemerick: http://www.youtube.com/watch?v=8Q9ugshAO58
14:48pjstadigcemerick: never had to use one myself, but good to know its there
14:49cemerickhah
14:50RaynesJanxSpirit: Those Lemur Ultra ones look nice. Affordable too.
14:50RaynesI might get one of those in a couple thousand years.
14:51pjstadigRaynes: with compound interest you could buy the solar system in a couple thousand years
14:51gfredericksthat will be economically awkward
14:52JanxSpirityeah those look a bit closer to Mac form factor
14:52kephalei'll sell you the solar system now
14:52JanxSpiritI got a Serval - definitely big but it's a very nice screen
14:52RaynesJanxSpirit: I could care less about the size. I just want something nice that I actually have a chance of buying
14:53gfredericksI have one of the netbooks. It's crazy-slow but at least it's little.
14:53gfredericksI probably should have paid for an SSD
14:53technomancyan SSD is the last upgrade you can buy that will make a noticeable performance difference
14:53technomancysavour it while you can!
14:53hiredman:/
14:53technomancyafter that every upgrade is just adjusting to a new set of compromises.
14:53pjstadigSSD++
14:54gfredericksI will upgrade my SoundBlaster
14:54TimMchaha
14:54pjstadigto 16-bits????
14:54TimMcOh man, Win 3.1 was the best.
14:54hiredmanI have an ssd, but am still using a core 2 duo, I hear the core chips are nice
14:54pjstadigno way!
14:54technomancyhiredman: meh
14:55hiredmantechnomancy: look, I rarely poop all over your dreams
14:55kephaletechnomancy: an accurate E*G input device might speed up a different type of performance
14:55technomancyI went back to a core 2 duo when I sent back my lenovo server and I don't really notice
14:55technomancyhiredman: then again, I'm not running the same tests you are =)
14:55technomancykephale: yeah, looking forward to the direct neural interface stuff for sure. =)
14:58gfredericksoh man it will be weird when your subconcious is capable of executing programs against your will
14:58TimMcThat already happens to me sometimes.
14:58gfredericks"I find the weirdest stuff set up in cron..."
14:59TimMcHave you ever started typing something and something else comes out this one day I was^W^W^W^W^W?
14:59gfredericks"Tips for keeping your subconcious from discovering your root password."
14:59gfredericksTimMc: at least you're there to supervise it
15:01TimMcHasn't happened to me in like a decade, but there was a span of about 3 years where that happened occasionally. My mind would wander while I was typing and... wtf?
15:01TimMcClearly, messages from aliens. :-P
15:26gfrederickshow do I access previous entries in the slime repl?
15:27stuartsierraM-p
15:27gfredericksstuartsierra: very good, thanks!
15:27adamspghM-p works for generic shells in Emacs s well
15:28tmcivergfredericks: also C-'up arrow'
15:28adamspghC-'up arrow' is captured by OSX (at least on Lion)… makes me crazy.
15:29gfredericksC-lots-of-things are captured for me in linux, unless I use the X version
15:29jkkramer7l ,6hy['/nuilwøπ§¶…øøøøøøøøøøøøøøøøøøøøøøøøøøøøøt6t7y2wxz6 65a|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||<<<<<<<<<<<<<
15:29gfredericksjkkramer: that password must take forever to type
15:29amalloyi assume he's sending it to #clojure so he has a handy place to copy/paste it from in future
15:30gfredericksError: password must have at least 75 consecutive pipes
15:36scgilardiadamspgh: that's configurable in the keyboard system preference. uncheck a couple of boxes and Lion will pass ctrl- uparrow and downarrow to the app
15:37Raynesscgilardi: Psh! OS X users can't be expected to *configure* things!!
15:38RaynesIt should read our minds and do what we want out of the box.
15:41adamspghscgilardi: cool! I had not figured that out. thanks!
15:42scgilardiadamspgh: you're welcome :)
15:52clj_newbCan anyone here offer me terms to google for "converting a java graphics 2D environment to a PDF file" in clojure? I want to output _vector_ graphics, not bitmapped
15:52solussdso, map->MyRecordType will add keyvals to a record even if that record doesn't have the keys?
15:53clj_newbCurrent situation: I have a Java Graphics2D environment. I draw vector stuff to it. I want to output the Graphics2D environment as a _pdf_. I'm doing this in clojure. Suggestions on what to use?
15:55jkkramersorry for flooding. cat on keyboard
15:55jsabeaudry_Let's say my App depends on LibA and LibA depends on LibB, is there a way for me to force LibA to use a more recent version of LibB without touching LibA's project file?
15:55amalloyget a different Graphics2D instance, one that is intended for drawing to a pdf
15:57amalloyclj_newb: eg, use http://docs.oracle.com/javase/tutorial/2d/printing/index.html and a PDF "printer"
15:58cemerickclj_newb: you're never drawing "vector stuff" to the graphics context. Just because there's lines and arcs and paths doesn't mean it's vector-based. All the defaults use rasters.
15:59cemerickiText is one of the more commonly-used PDF generation libs in JVM-land.
16:02technomancyjsabeaudry_: as long as LibB didn't declare a ranged dependency it should work fine
16:03jsabeaudry_technomancy: So I just specify the more recent dependency in my App project file?
16:03technomancyright
16:04jsabeaudry_technomancy: Sweet, thanks for your help
16:05technomancysure
16:05clj_newbamalloy: nice; thanks; I have a feature request for Clojure 1.4.0 -- (apropos "foo") queries Amallory
16:15TimMcclj_newb: You're asking for an 'apropos command?
16:16TimMc&(do (require 'clojure.repl) (clojure.repl/apropos "shift"))
16:16lazybot⇒ (bit-shift-left bit-shift-right)
16:16amalloyTimMc: i think he's "enhancing" it so that it sends me a message
16:16TimMcAh! I see.
16:16TimMcor Amallory, whoever that is. :-P
16:16amalloyyeah, poor guy
16:17TimMcI've seen him mentioned a lot, but we've never met.
16:17amalloyheh
16:17amalloymy family has a long tradition of being called mallory for no particular reason. i would have thought that's a first name, not last
16:18emezeskewasn't mallory a character in that cheesy show "sliders"?
16:18emezeskeit's his fault!
16:19technomancyis "Calm down Ken" on the mailing list a reference to Ken Wesson?
16:19technomancybecause if so, <3
16:21amalloytechnomancy: yeah, i loved that
16:21amalloyever notice you've never seen the two of them in the same room...?
16:21technomancywhat happened to Ken anyway? I killfiled him; did he wander off to harass some other community?
16:21amalloytechnomancy: dunno. he hasn't been posting for months
16:22technomancyalso, I love how this thread basically confirms my decision to plonk Cedric.
16:22cemerickdunno, that was a killer quote re: everest. :-P
16:22amalloytechnomancy: glad to see i'm not the only one who thinks he's a <censored>
16:23technomancycemerick: he's pretty... frothy
16:23cemerickI haven't kept up with the latest personalities.
16:23stuartsierracemerick: You'll always be a <censored> to me.
16:23technomancyhttp://www.harkavagrant.com/index.php?id=273 <- panel 3
16:24cemerickstuartsierra: more heat than light of late, huh?
16:25TimMctechnomancy: 3rd strip, you mean?
16:25technomancyTimMc: oh; yes.
16:25stuartsierraThe vibrancy of the Clojure community warms my heart to a state of crispy deliciousness.
16:26rplevyRegarding https://github.com/brentonashworth/one/wiki/Dependencies mentioned earlier, listed among the things that have not been easy to do: "try our projects with changes made to a library". The "checkouts" feature of leiningen makes this pretty easy to do.
16:26Raynestechnomancy: Cedric bothers me.
16:26RaynesSignificantly.
16:27TimMcRaynes: With less than 5% probability of chance?
16:27TimMcWHAT P-VALUE ARE WE DEALING WITH HERE?
16:27TimMcahem
16:27amalloyTimMc: SIX SIGMA
16:27TimMc*gasp*
16:27technomancyRaynes: /ignore works for email too you know.
16:28jkkramergoogle groups needs a killfile feature
16:30technomancyrplevy: that's what I thought too; apparently either there is some confusion about it or ...? https://github.com/brentonashworth/one/issues/64
16:32rplevytechnomancy: oh I didn't see that
16:38rplevytechnomancy: interesting discussion, I'm not sure I fully understand the point of a git repository being a dependency, it seems better to have versioned releases
16:39cemerickRaynes: FYI, lazybot logs aren't escaping many HTML entities
16:39technomancyrplevy: afaict no one outside relevance understands it
16:40Raynescemerick: I'm aware.
16:40RaynesIt's a damn shame.
16:40cemerickThe world will go on, I'm sure. :-)
16:44amalloy<script type="text/javascript" src="http://www.cornify.com/js/cornify.js&quot;&gt;&lt;/script&gt;
16:44amalloyhm. XSS didn't work
16:45Raynesamalloy: Does it send the logs as HTML?
16:47amalloysorta. i think we just need to wrap the actual log data in CDATA
16:47TimMcI bet tags are being stripped.
16:47TimMc]]><b>HA!</b><[CDATA[
16:47amalloyTimMc: no, they're not. look at the inspector on the log page
16:48cemerickTimMc: no, there's a <pom> in there
16:48TimMcWhoops, that worked.
16:49amalloy<![CDATA[ <b> this shouldn't be bold</b>
16:49amalloy]]>
16:49TimMcnothing
16:50amalloyyeah, weird
16:50TimMc(Play along at home: <http://lazybot.org/logs/#clojure/2012-01-18&gt;)
16:50TimMcOooh, and a <censored> or two.
16:51TimMclazybot didn't even... <blink>
16:54TimMcamalloy: Cornify loaded.
16:54amalloyreally? it didn't for me
16:54TimMcNo, I mean cornify.js
16:54TimMcIt's not doing anything.
17:00TimMcamalloy: Cornify is failing to add its div, or maybe the reload script is killing it.
17:00TimMcalso, </blink>
17:01RaynesTimMc: You don't get out much, do you?
17:01TimMcI don't know what would make you say such a thing.
17:04RaynesTimMc: The blink tag is an ill-conceived weak-ass piece of shit anyway, so... whatever.
17:12TimMcRaynes: Oh, ha! I was wondering why that piece of vitriol sounded so familiar! :-D
17:12RaynesI was afraid I had missed my chance.
17:30benares_98anyone attending clojure west?
17:30RaynesI imagine lots of people.
17:30emezeskebenares_98: I plan to!
17:31pjstadigno
17:31pjstadigno one is going
17:35jeremyheilerim thinking about going. gotta figure out how much it'll cost to get across country, though.
17:36amalloyjust walk it. head out now
17:37jeremyheilermaybe on the way I can gather a following and even sponerships
17:37jeremyheilersponserships*
18:02clj_newbthe following code hangs: paste.lisp.org/display/127157 -- why? (even when I print to pdf rather than printer)
18:02clj_newbthe following code hangs: paste.lisp.org/display/127157 -- why? (even when I print to pdf rather than printer) ; btw, I don't even get a courtsey exception -- it just hangs
18:03hiredmanclj_newb: you already said that
18:03hiredmantechnomancy: have you seen http://skife.org/java/2012/01/10/posix_from_java.html
18:04clj_newbhiredman: I fixed it too
18:04technomancyhiredman: no, but with an URL like that I'm bound to like it
18:04clj_newbnow, part 2: Graphics2D.drawString( ... ) ends up producing ugly text (not antialiased and all that). How do I get JavaGraphics to do the most expensive, most intense, most visually appealing vector graphics / text rendering?
18:05clj_newbI'm talking stuff that takes Google's cluster to render half a page
18:06hiredmannow that I have passed it on I can finally close this tab
18:06clj_newbI think I want rendering hints. What do you think?
18:09clj_newbwoot
18:09clj_newbantialiasing working now
18:09clj_newbmy PDFS are beautiful
18:11choffsteinAnyone have any idea how I can go about fixing a "Caused by: java.lang.RuntimeException: Unable to resolve symbol: pst-elem-str in this context" from `lein swank` if I have no idea what library is causing it?
18:12technomancychoffstein: you have an old version of clj-stacktrace somewhere. see the Troubleshooting section of the swank-clojure readme
18:12technomancyclojurebot: Unable to resolve symbol: pst-elem-str |is| you have an old version of clj-stacktrace somewhere. see the Troubleshooting section of the swank-clojure readme.
18:12clojurebotOk.
18:12choffsteinYeah, I read it. I couldn't seem to resolve where clj-stacktrace was sneaking baout
18:13choffstein*about
18:13technomancyyou could force a dependency on the most recent clj-stacktrace explicitly
18:14technomancya patch to get swank-clojure to gracefully fall back or issue a more comprehensible warning in that case would be super
18:25amalloytechnomancy: clojurebot doesn't like . in his factoids iirc
18:26amalloyi don't recall correctly, apparently
18:44bloopI have an implementation question: why is the branching factor for maps 32? did Rich test other sizes and find them wanting? is 32 words a good page size for caches in a 32bit architecture?
18:46arohnerbloop: it fits in a java int
18:47bloopthat's why the has is 32 bits, sure, but (and correct me if I'm wrong) why is the node a 32 pointer array?
18:47bloops/has/hash
18:48bloopit's even kind of awkward taking 5 bits at a time off the 32 bit hash. a 16 word node is more intuitive to me, since you wouldn't have those "leftover" bits taking 4 bits off at a time...
18:49arohnerbloop: http://blog.higher-order.net/2009/02/01/understanding-clojures-persistentvector-implementation/
18:53arohnerbloop: also, http://blog.higher-order.net/2009/09/08/understanding-clojures-persistenthashmap-deftwice/
19:00blooparohner: this... doesn't really explain why 32 is the branching factor. You could just as easily have it be 16 and then take 4 bits at a time, couldn't you?
19:06metajackbloop: you want he branching factor to be as large as possible in order to make the tree shallow i assumed.
19:07bloopmetajack: well there's clearly a tradeoff though: assoc on a small map means a bigger node to copy...
19:09amalloyit has been claimed that 32 is good because it fits in a cache line
19:11metajackbloop: i was under the impression that small maps got stored in more efficient structures too. but my knowledge is somewhat limited since I haven't looked at the implementation so I should stop talking.
19:11bloopamalloy: that makes sense. is that just something that Phil Bagwell says, or is there data somewhere where they tested different sizes?
19:11bloopmetajack: I think that's what defstruct is for
19:13amalloybloop: dunno. also, metajack, defstruct is for throwing in the garbage. if you want convenience use plain maps; if you badly want that last bit of performance you can use defrecord, which is a much more efficient store
19:13metajackSince I saw various different things when doing (class some-map) i figured there were multiple implementations and it promoted based on the tradeoffs.
19:14amalloyanyway, maps smaller than ten are generally array-maps (where every lookup involves just scanning all the keys); larger than that an actual hashmap is used
19:14metajackamalloy: array maps were what i was thinking of
19:14bloopamalloy: oh! neat.
19:48robinkraftis there an idiomatic way to check equality floats that are meaningfully the same for a given precision?
19:48robinkraftI'm looking for something like (nearly-same? precision n1 n2) that returns true for (nearly-same? 7 1.0 1.000000000018)
19:54robinkraft(Float/compare 1.0 1.0000000000018) does the trick
20:34technomancydoes the LA clojure group meet on the first thurs. of the month?
20:36amalloytechnomancy: it generally meets the same time as seattle (and SF), but has been a bit unpredictable recently
20:36technomancyamalloy: I may be down in socal for march
20:37technomancysomeone on the Heroku Java team said they got invited to speak at la-clj and forwarded it on to me.
20:37amalloywant to give a presentation? i don't think there's anything lined up
20:38technomancybit too early to commit, but I'd like to.
20:38technomancydo you help with scheduling it?
20:39amalloyno, not at all
20:40truyshi =)
20:41amalloytechnomancy: it sounds like you have contact info for the guy who does schedule it, but let me know if i can help with something
20:48technomancyyeah just curious about timing; thanks
21:29TimMc,~5
21:29clojurebot#<IllegalStateException java.lang.IllegalStateException: Attempting to call unbound fn: #'clojure.core/unquote>
21:30TimMcOh, never mind.
22:57_carlos_hi!
22:59_carlos_I am looking into multimethods, and I don't quite get the magic. how is the multimethod supposed to guess which implementation to call just based on the arguments?
23:01brehaut_carlos_: when you define a defmulti you pass it a function
23:01brehaut_carlos_: when you call a multi, that function is called on the arguments first, then its result is checked against the values defined in the defmethods for that multi
23:03_carlos_brehaut: its result? where is the result computed?
23:03brehaut_carlos_: by the function you supply to defmulti
23:03bobhopeIs it appropriate to post a link to a blog post I wrote about clojure promises and futures?
23:04brehaut_carlos_: (defmulti foo (fn [x] (count x))) (defmethod foo 1 [x] "one") (defmethod foo 2 [x] "two") (defmethod foo :default [x] (str (count x)))
23:05brehaut_carlos_: in that defmulti, (fn [x] (count x)) is where the dispatch is calculated
23:05brehaut_carlos_: there are three definitions of foo, one when (fn [x] (count x)) returns 1, one for two and a default for anything else
23:06_carlos_brehaut: hahaha.. got it. the book I am reading used a keyword as function. really forgot keywords are functions, so it was blowing my mind with so much magic!
23:06brehautaha
23:06brehautbobhope: why not
23:06_carlos_brehaut: thank you for the helpful example
23:11_carlos_is there any cheatsheet of use cases and feature of language that should be used? I forgot to start building mine as reading this book
23:12brehaut_carlos_: theres http://cemerick.com/2011/07/05/flowchart-for-choosing-the-right-clojure-type-definition-form/
23:12brehaut_carlos_: its only concerned with type related features though
23:13bobhopeI wrote this post about promises and futures: http://dgrnbrg.tumblr.com/post/16099937741/promises-and-futures-in-clojure
23:13bobhopeI think I covered some details that aren't immediately available
23:13_carlos_brehaut: not quite my short-term use case, but for sure will be in the future, thanks.
23:15_carlos_I can build this use case by reading a second book to ciment the concepts
23:15brehautbobhope: i suspect that if someone doesnt know what a promise is, they are unlikely to know what a count down latch is either ;)
23:23bobhopebrehaut, really?
23:23bobhopeI think that coming from not-clojure, they might not
23:23bobhopeAlso, it brings into stark relief what behavior to expect
23:23bobhopei.e. your current thread sleeps on the delivery
23:28amalloybrehaut: i knew what a count-down latch was but not a promise, fwiw
23:28brehautamalloy: you have some amount of java background?
23:28amalloyyes
23:29amalloythough i'm not really sure what context i learned about that in
23:29brehautid never heard of a CDL outside of JVM, but ive encountered promises many times
23:29technomancyseancorfield: is there a plan to support c.j.jdbc connection objects outside with-connection?
23:29amalloywell, you came from haskell, where promises are relevant
23:30brehautamalloy: also python and javascript
23:30technomancythe one-connection-per-thread model is not always what you want
23:32_carlos_now that I am a little used to this no-syntax language, I find a little silly and hard to remember the grammatical constructs of non-lisp languages. quite defeats the point of having grammar at all
23:36seancorfieldtechnomancy: can you elaborate on the c.j.jdbdc question?
23:38technomancyseancorfield: I'm just reaching in and calling clojure.java.sql.internal/get-connection and alter-var-rooting *db* because I've got a bajillion small inserts coming in off the wire from netty, so I can't use binding
23:39seancorfieldi'll merge the internal ns into the main one soon - you'd like get-connection to be public?
23:39technomancyfeels a bit gross; was wondering if get-connection should be part of the public API, and if the functions that rely on *db* being bound could have alternate versions that would accept a connection arg
23:39technomancyget-connection on its own isn't quite enough; you need to be able to pass it to the functions that need it
23:40technomancyunfortunately since most of them take varargs that might be nontrivial
23:40technomancybut you see what I'm getting at?
23:40seancorfieldyes, part of the 0.2.0 API overhaul is to rewrite everything to accept a connection argument
23:40seancorfieldand then rewrite the old API in terms of the new one
23:41technomancyexcellent
23:41technomancyI'm ok with my workaround for now; just wanted to know if that was on your radar
23:43seancorfieldyeah, the clojure/core feedback about a 1.0 release was very valuable
23:43seancorfieldi don't like the current API... it works but it's a pain to use in some ways
23:44seancorfieldi've written a wrapper around it for world singles
23:45seancorfieldwe're a bit slammed at work so i'm not sure when i'll get time to work on it... but my wife is away at cat shows several weekends in march and april so that might be my opportunity
23:45seancorfieldi'd like to get a first cut done before clojure/west but i doubt i'll have the time
23:45technomancyonce clojurewest isn't hanging over your head? =)
23:46seancorfieldyeah :)
23:46seancorfieldi need to get a talk together before then ya know!
23:47technomancysame here