#clojure log - Jan 18 2012

The Joy of Clojure
Main Clojure site
Google Group
IRC
List of all logged dates

0:03 amalloy: espringe: i don't use paredit in the repl, and i don't know if i recommend it

0:04 if 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"

0:05 espringe: Yeah, i noticed the RET was a bid dodgy :(

0:05 It seemed like a good idea at the time though

0:10 dyba: working through the clojure koans and looking to see if anyone can give me a nudge in the right direction.

0:10 the topic is recursion: https://gist.github.com/1618486

0:11 i've got the first meditation passing, but the second one fails

0:11 adiabatic: Seems like a weird problem to use recursion for…

0:12 Raynes: Not really. You can use mutual recursion to implement even? and odd?. It's pretty cool, if slightly insane.

0:12 dyba: adiabatic: i don't know why they use =

0:12 I've done a similar problem but not using =

0:13 Raynes: mutual recursion? I'll have to look that up.

0:13 adiabatic: dyba: f calls g which calls f which calls g which calls…

0:14 Raynes: a psychiatrist.

0:14 dyba: But you can't look it up on wikipedia!!!1!

0:14 (unless you disable Javascript)

0:14 dyba: Raynes: haha, no I'm reading a book called Clojure in Action

0:14 airolson: yeah, I'm disappointed with wikipedia's "black-out"

0:15 Raynes: airolson: There was a bug in the first few minutes where clicking on the 'learn more' link would take you to another blacked out page.

0:15 dyba: airolson: that's going on today? I thought they were starting tomorrow

0:15 Raynes: It was pretty hilarious.

0:15 dyba: From 17 minutes ago until this time tomorrow.

0:15 amalloy: dyba: it's tomorrow now

0:16 if you're on the US east coast

0:16 dyba: amalloy: west coast

0:16 Raynes: amalloy: His timezone is the only one that matters.

0:16 Obviously.

0:16 amalloy: evidently

0:16 dyba: :P

0:16 Raynes: Oh man. We better call wikipedia. dyba is on the west coast, they need to wait two hours!

0:16 dyba: har har

0:17 Raynes: :)

0:17 airolson: goodnight folks

0:17 dyba: g'nite

0:17 Raynes: Goodnight, kind sir.

0:17 amalloy: don't let Raynes offend you. he doesn't even know how many hours are between EST and PST

0:17 Raynes: amalloy: Three.

0:17 dyba: Raynes: see ya! Thanks for the lead

0:17 it's all in good fun

0:17 Raynes: amalloy: I counted backwards relative to my timezone.

0:18 dyba: I wasn't trying to encourage you to use mutual recursion. That's rarely (never?) the optimal way to solve a problem.

0:18 I was just pointing out that it is possible.

0:19 dyba: Raynes: well, I was going to see what it's all about anyway

0:19 Raynes: Yeah, it's pretty cool in any case.

0:21 dyba: the problem would make sense if you were checking for modulo 2, that's how I would do it

0:22 n mod 2 equals 0 that is

0:22 adiabatic: ok good, I'm not the only sane one here

0:22 amalloy: that's...the same as testing even-ness, right?

0:23 dyba: the entire time it will decrement n! weird...

0:36 espringe: Looking at someone elses code, I see he has:

0:36 (fn [n] (map first (reductions (fn [[a b] _] ......

0:36 What does the _ mean?

0:37 dnolen: espringe: an ignored argument

0:37 espringe: Ah, thanks

0:37 Is that a convention, or a language feature?

0:37 amalloy: convention

0:37 but it's easy for you to prove that yourself :P

0:37 dnolen: ,((fn [_] _) 1)

0:38 clojurebot: 1

0:38 amalloy: &((fn [x _] (+ x _)) 1 2)

0:38 lazybot: ⇒ 3

0:38 espringe: Thanks :)

0:39 ,((fn [_ _ _] _) 1 2 3

0:39 clojurebot: #<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: EOF while reading>

0:39 dnolen: ,((fn [_ _ _] _) 1 2 3)

0:39 clojurebot: 3

0:39 espringe: ,((fn [_ _ _] _) 1 2 3)

0:39 clojurebot: 3

0:39 dnolen: ,((fn [a a a] a) 1 2 3)

0:39 clojurebot: 3

0:43 dyba: only save the last value it looks like

1:51 seancorf: i'm playing with clojurescript... are there some basic dom manipulation functions available in the base installation?

1:52 i.e., are there some bundled namespaces i can just require?

1:52 scottj: maybe under clojure.browser, I think domina is what cljs1 is recommending though

1:53 seancorf: guess i need to go dig in the cljs docs then...

1:55 chewbranca: anyone have any recommendations for processing posted json data in noir?

2:02 seancorf: scottj: 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

2:04 i haven't figured out the way libraries are handled in cljs :(

3:38 Blkt: good morning everyone

3:39 ordnungswidrig: hi

5:07 cromie: hello

5:07 what is -> macro called?

5:07 arbscht: thread

5:07 cromie: I'm trying to find documentation on it but it's ungoogleable

5:09 ivan: http://clojuredocs.org/search?x=0&y=0&q=-%3E

5:09 cromie: whoa didnt know there were so many -> macros

5:13 by the way is there a way to google non-alphanum characters like -> ?

5:20 ivan: cromie: no

5:20 but you can configure your browser bar to let you search more than Google via bookmark keywords

5:25 cromie: ok thanks for help

10:10 ordnungswidrig: https://gist.github.com/1633445

10:11 Can't you use (->RecordName) in the record declaration?

10:28 llasram: ordnungswidrig: `defrecord' creates a ->RecordName function

10:28 So ->FooImpl should exist, not ->Foo

10:29 But wait. What are you trying to do?

10:29 ordnungswidrig: llasram: yes, but only after deftyping, thus when giving a protocol implementation within the defrecord the function bodies cannot access ->Foo yet

10:29 llasram: There is no ->Foo

10:29 ordnungswidrig: llasram: ah, sorry. the paste is wrong

10:30 TimMc: That'll do it.

10:30 llasram: And... The `foo' implementation for FooImpl will only be called if `foo' is called with a FooImpl type object

10:30 ordnungswidrig: no, ->FooImpl is not yet defined.

10:30 trie the updated gist

10:30 s/ie /y /

10:31 llasram: Interesting. That is potentially confusing.

10:32 ordnungswidrig: llasram: you can fall back to (new FooImpl) or (FooImpl.) of course. that works fine.

10:32 llasram: Right

10:32 Or use `extend-protocol' or `extend-type'

10:32 ordnungswidrig: llasram: I guess reordering the expression generated by defrecord would be sufficient.

10:33 jkkramer: ordnungswidrig: or (declare ->FooImpl) above deftype perhaps?

10:33 ordnungswidrig: jkkramer: or like that

10:34 llasram: Ah, 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:34 But `declare' should work around it

10:34 ordnungswidrig: jkkramer: not trivial though after having looked into core_deftype.clj

10:44 solussd: does 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:46 llasram: solussd: System/setProperty ?

10:47 solussd: llasram: that seems to replace whatever is already there. :/

10:47 TimMc: I don't know if you *can* adjust PATH in a running JVM.

10:47 llasram: System/getProperty + System/setProperty :-)

10:48 I've used System/setProperty to successfully modify the jna.library.path after the JVM starts but before loading JNA

10:48 TimMc: OK, cool.

10:48 llasram: After JNA fails to find a library once though, you may be screwed

10:57 solussd: cool, thanks guys

11:04 arkh: how would a person turn off syntax highlighting in clojure-mode / emacs?

11:06 llasram: Turn... off?

11:06 Do you still want to be using clojure-mode, just without syntax highlighting?

11:06 Raynes: Mind blown.

11:07 llasram: If that's the case, try M-x font-lock-mode

11:07 arkh: I would still like to use clojure-mode and have the ability to turn coloring on/off

11:08 llasram: that does the trick, thank you

11:09 Licenser: I wonder about this code: https://refheap.com/paste/343

11:09 the 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:10 yes Raynes I use refheap only for you :P

11:10 Raynes: Heh

11:11 Licenser: even so I would have expected more from you :P

11:11 you seriousely disappointed me :.(

11:11 * Licenser gives a cookie

11:12 Licenser: I 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:13 Raynes: Hahaha

11:13 But it's such a nice pastebin. :p

11:13 Licenser: also is that your reptile that supports refheap?

11:13 yes it is

11:13 but it is 'just' a pastbin

11:13 been there, done that

11:13 I'd hoped for something revolutionary

11:13 also is there a emacs integration :P

11:13 TimMc: Iguana!

11:13 Licenser: exactly

11:13 TimMc: There's an iguana!

11:13 <3 Raynes

11:14 Raynes: One of my coworkers is an animal shelter guy.

11:14 Licenser: that makes it kind of revolutionary so

11:14 Raynes: That's his picture.

11:14 TimMc: Oh, you don't have an iguana?

11:14 Raynes: No.

11:14 TimMc: /shun

11:14 Raynes: I wanted to replace it with a picture of stuartsierra's hair, but I was worried about licensing.

11:15 stuartsierra: oh? :)

11:15 Licenser: haha

11:15 qmx: ROFL

11:15 Licenser: stuartsierra does your hair look like an iguana?

11:15 Raynes: TimMc: 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:15 stuartsierra: I am not qualified to answer that query.

11:16 Licenser: Raynes a few unique features would be: show past as .pdf, .png for example

11:17 that'd kind of be nice

11:17 I think

11:17 Raynes: Screenshot the pastebox. :P

11:17 Licenser: Raynes that is not a feature that is work

11:17 work for me, which makes it even worst

11:18 admit taht being able to say https://refheap.com/paste/343.png would be cool

11:18 Raynes: Sure.

11:18 Licenser: see that'd be a unique feature

11:19 or https://refheap.com/paste/343.pdf

11:19 Raynes: It'd be like, totally rad. dood.

11:20 Licenser: rad?

11:20 now I must admit I am a german again :(

11:20 Raynes: Heh.

11:21 cemerick: Raynes: there's gotta be a catch with this browserid thing, yah?

11:21 Raynes: cemerick: Every time you sign in, they kill a kitten?

11:21 Licenser: can't they kill puppies again? I'd write a script to sign in and out for that

11:21 cemerick: probably

11:22 Licenser: a 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:23 Raynes: Well, that certainly isn't a catch.

11:23 cemerick: The actual browserid.org site is really light on details.

11:24 Raynes: cemerick: Click that 'developer' link.

11:24 Licenser: cemerick they will propably seel your browsing behaviour to google or something

11:25 Raynes: cemerick: https://github.com/mozilla/browserid/wiki shortcut

11:25 cemerick: Raynes: Yeah, I'm on it now. Looks like I need to grok this verified email protocol.

11:25 So far, it just sounds like a centralized authentication mechanism.

11:25 Raynes: It isn't centralized.

11:26 cemerick: *sounds* :-)

11:26 anyway, it's in the TODO tab group

11:26 Licenser: Raynes another neat feature: allow users to choose their own code layout

11:28 perhaps stuartsierra does not like the dark dim colors but rather would prefare keywords be purple and strings bright green

11:28 Raynes: You 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:29 Licenser: Raynes allow users to make their own?

11:29 TimMc: Licenser: You can do that with Stylish.

11:30 Raynes: It's a pastebin and that isn't a useful feature. It would unnecessarily complicate things by introducing more decisions.

11:30 Licenser: TimMc of cause I also can write a own dom visualisation library if I am very boored :P

11:30 Raynes you have a point so

11:30 TimMc sorry for the sarcask ;)

11:31 Raynes: You 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:31 That said, this particular theme is just what I have right now. It will almost certainly change.

11:32 Licenser: Raynes I don't have any objectsions to the theme ^^ Just tossing ideas around

11:33 also you made me look at EMACS themes, now I can't decide :P

11:33 great

11:34 Raynes: Tomorrow Night is a fantastic set of themes.

11:34 Highly recommended.

11:34 I use tomorrow night in Emacs, Vim, and my terminal.

11:36 Licenser: hmm it isn't part of the standard themes, where are they hiding?

11:36 found them :)

11:40 hmm the background is too blue for me

11:59 mpenet: Raynes: tryclj is down in case you didn't notice. Protesting SOPA :) ?

12:00 Raynes: No, but maybe Heroku is.

12:00 ;)

12:01 I'll pretend that I am and that I did this purposely.

12:02 mpenet: One of my (non-coder) coworkers was using it, now I need to guide him through setting up leiningen and run a repl

12:03 Raynes: mpenet: It's back up, btw.

12:03 mpenet: Thanks

12:04 Raynes: mpenet: I'm still working on getting memory settings right. It occasionally goes down because of GC overhead issues.

12:04 I haven't set up any sort of monitoring though. I think that'd be the most important thing I could do right now.

12:04 mpenet: Yep, it is not easy to get right

12:06 jsabeaudry: I'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:09 mpenet: I 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:10 jsabeaudry: mpenet: Does any of you webapps use streaming?

12:10 mpenet: nope, lots of long polling

12:11 well one of them (not a web app) consumes twitter streams all day long, so yes

12:13 jsabeaudry: mpenet: 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:16 Oh wow, the second JEtty is Netty

12:17 mpenet: ouch, 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:17 jsabeaudry: mpenet: Are you aware of any alternatives to aleph that I could try?

12:19 mpenet: nothing that you could use with ring handlers directly like with aleph, there are alternatives in the java world I guess

12:19 or maybe the latest jetty, I am not sure though

12:30 jaley: hello! 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:32 technomancy: Raynes: does the tryclj actually crash, or does it just get into a wedged state?

12:33 Raynes: technomancy: Wedged state.

12:33 technomancy: oh, bummer

12:33 jaley: 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:33 Raynes: If it actually crashed, Heroku would fix it.

12:34 technomancy: docs are scarce, but maybe you can crib from one of the existing libs.

12:34 Licenser: there is no crashage

12:34 Raynes: technomancy: That only works after my fix, which hasn't been released yet, right?

12:34 technomancy: Raynes: the native extraction stuff?

12:35 Raynes: No, the setting library path stuff.

12:35 You were setting java-library-path instead of java.library.path, remember?

12:35 technomancy: oh snap.

12:35 yes, this is true.

12:35 chewbranca: anyone 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:35 jaley: technomancy: ah ok cool. is the code for that actually in lein? I'll just read the code - cheers!

12:35 Raynes: So he'll need the 1.x branch, I think.

12:36 technomancy: jaley: yeah, you will need to either use 1.7.0-SNAPSHOT from git or 1.6.1 unfortunately

12:37 jaley: technomancy: ok, thanks

12:37 Raynes: technomancy: Did I fix that in lein 2?

12:37 technomancy: jaley: 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:38 Raynes: yeah, we're clear in the master branch

12:39 jaley: technomancy: got it, thanks

12:41 devth: Is there something like `or` that will treat an empty list as false and take the other value? e.g. (or '() "use this!")

12:41 hiredman: you don't need to quote the empty list

12:41 ,()

12:41 clojurebot: ()

12:42 hiredman: ,(seq ())

12:42 clojurebot: nil

12:43 devth: hiredman: perfect, thanks!

12:54 gfredericks: Okay, I've successfully switched to emacs. Now what do I need to do to stop using `lein repl`?

12:55 technomancy: gfredericks: "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:55 gfredericks: does "install clojure-mode" go at the beginning?

12:56 oh wait I did that already

12:56 okay here I go.

12:56 * gfredericks crosses fingers

12:57 gfredericks: welp, it opened an emacs buffer with a backtrace in it. Says it cannot resolve the symbol 'pst'

12:58 technomancy: gfredericks: get rid of the out-of-date clj-stacktrace

12:58 gfredericks: oh 'pst-elem-str' actually

12:58 it must be and indirect dep of my project?

12:58 technomancy: yeah

12:59 or put an explicit dep on the latest version

13:00 solussd: is it possible to include a c library in a jar?

13:00 gfredericks: hmm; `mvn dependency:tree` doesn't mention it

13:00 technomancy: gfredericks: it could be a dev-dependency or pulled in by another user-level plugin; maybe lein-difftest or some such

13:01 go with the explicit dep if you can't find it; simpler that way

13:01 gfredericks: ah I do have difftest I think; no dev deps

13:01 okay

13:03 I think I figured out how to upgrade difftest, so I'll try that, since that would solve it for all projects

13:05 ooh I think it worked!

13:07 technomancy: woo!

13:11 clj_newb: for 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:13 the best I have is:

13:13 jodaro: hrm

13:14 i'm using aleph to deal with an http post request

13:14 clj_newb: (apply hash-map (concat (map (fn [x] [ (last x) (first x)]) key_map))) ; but calling it ugly would be an understatement

13:14 TimMc: clj_newb: (zipmap (vals h) (keys h))

13:16 jodaro: anyway yeah

13:16 if the body is small its a BigEndianHeapChannelByteBuffer or whatever

13:16 but at some point

13:16 if it gets bigger, it becomes a lamina channel

13:17 i guess i can just check the type and see

13:17 but it would be cool if there was some way to have it always be the same type

13:17 donde esta senor tellman

13:19 rplevy: are 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:19 TimMc: jodaro: There's probably an abstraction you're supposed to use over those.

13:20 clj_newb: TimMc: thanks

13:20 TimMc: rplevy: Packaging is still in the works, but planned, i believe.

13:20 jodaro: yeah i think so

13:20 rplevy: TimMc: ok cool

13:20 jodaro: if it was always a lamina channel that'd be fine

13:20 channels are the bomb

13:21 technomancy: rplevy: there are rumors; as usual nothing is clear.

13:21 jodaro: but this bigendianholycrapthisisalongclassname thing is less awesome

13:22 rplevy: ok, I'll stay tuned then

13:22 TimMc: BigEndianHeapChannelByteBuffer$UnspecifiedException$Factory$Bean$FuckMyLife$ThisIsMore$Than80Columns

13:22 jodaro: yeah

13:23 org.jboss.netty.buffer.BigEndianHeapChannelBuffer

13:23 sorry, thats what it is

13:23 no Byte

13:23 Raynes: rplevy: Everybody is currently trying to convince core that cljs should be in maven. They don't want it there.

13:23 rplevy: Raynes: why not?

13:23 Raynes: rplevy: I recommend you black out your clojure projects in protest.

13:23 Bronsa: lol

13:23 rplevy: haha

13:23 Raynes: rplevy: I'm not sure they've given an actual reason.

13:24 *shrug*

13:24 rplevy: :)

13:24 pdk: is that when you set your font color to black

13:24 jodaro: (defmacro blacken ...

13:24 you can just wrap all of your code with that macro

13:24 and instead of running, everything just turns black

13:26 TimMc: Raynes: Why, are they going for a less modern distribution channel, like CDs in magazines?

13:26 pjstadig: Raynes: i think the reason is that clojurescript is not a java project

13:26 cemerick: Raynes: from everybody. I think most have just tuned out.

13:26 s/far/far from

13:26 Raynes: TimMc: Shell scripts, apparently.

13:26 TimMc: hot

13:27 Raynes: pjstadig: I'm still not sure what the idea is. Roll another dependency management solution specifically for ClojureScript?

13:27 Not that I've never reinvented wheels.

13:27 pjstadig: yeah

13:27 i don't think i've heard what alternative there may be

13:27 stuartsierra: No one is against having ClojureScript bundled into JARs and deployed to Maven repositories.

13:27 pjstadig: just that they don't want maven because cljs is not a java project

13:28 stuartsierra: i thought stuart halloway pretty much said that

13:28 Raynes: I'm pretty sure he did.

13:28 stuartsierra: I think Stuart Halloway meant we don't want that to be the ONLY deployment strategy.

13:29 Raynes: I wish he'd say what he means then.

13:29 pjstadig: "I am opposed. Leiningen + Maven is a big dependency to bring in for a language that is not part of the Java ecosystem."

13:30 cemerick: Talk about mvn artifacts is moot if releases (whatever the numbering / messaging) aren't in the cards.

13:30 stuartsierra: Stu H. said that in response to the suggestion that we *replace* the shell scripts in CLJS with Leiningen.

13:30 Stu does not want Leiningen to be the only way to use CLJS.

13:31 Raynes: If that's the case, it sounds like he needs to clarify his position in more than one sentence.

13:31 stuartsierra: Also 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:32 gfredericks: technomancy: oh man it's so nice to be able to use backspace again. Thank you sir.

13:38 rplevy: it seems not entirely accurate to say cljs is not part of the jvm ecosystem though. don't you need java to compile clojurescript?

13:39 emezeske: rplevy: not only that, but clojurescript macros are written in clojure

13:39 cemerick: And usage in conjunction with a Clojure backend is probably the most common practical use case as an initial adoption vector.

13:39 But, this is all known.

13:41 stuartsierra: Let 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:42 s/dependency/dependency management system/

13:44 cemerick: crap, I should have put money on it somewhere :-P

13:47 stuartsierra: The best objection to Maven repositories I've heard is the disconnect between "release" versions and version control history.

13:47 pjstadig: eh

13:47 i'm unconvinced by that line of argumentation

13:48 technomancy: <pom><scm><connection>scm:git:git://github.com/technomancy/leiningen.git</connection> [...]

13:48 stuartsierra: technomancy: Yes but there is no link between a particular release number and a particular git commit.

13:49 technomancy: so the objection is that some people suck at using tags?

13:49 pjstadig: for instance, I think there are several flaws with the argumentation here https://github.com/brentonashworth/one/wiki/Dependencies

13:50 stuartsierra: The 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:50 jsabeaudry_: 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:50 pjstadig: i think that use case is actually orthogonal to releases

13:51 cemerick: pjstadig: huh, hadn't seen that before, thanks

13:54 Joreji: Hey 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:54 stuartsierra: Joreji: chunked sequences

13:54 dakrone: Joreji: lazy-seqs are chunked in sets of 32

13:55 Joreji: Any way I can work around this?

13:55 (actually that explains a lot of interesting problems I had in the past, lol)

13:56 cemerick: (mapcat list (range)) will get you what you want; lists aren't chunked

13:56 dakrone: Joreji: http://p.draines.com/13269131007646223b829.txt

13:56 Joreji: dakrone: Cool thank you :)

13:57 cemerick: Good to know. Tough for my purposes I'll try dakrone's solution first :-)

13:57 cemerick: eh, I've done the submodules-as-dependencies thing. Horrid, especially given transitive dependencies/submodules.

13:58 technomancy: git submodules are the best arguments I've seen so far to start using mercurial.

13:59 cemerick: isn't it easier to just not use submodules? ;-)

13:59 technomancy: also acceptable

13:59 Joreji: dakrone: How should I use the unchunk fn? Simply applying it to the above example yields the same result.

14:01 dakrone: Aha, figured it out. It has to be applied to the innermost seq.

14:03 dnolen: Joreji: though it's important to note, if your code depends on the actual "amount" of laziness, then your code relies on side-effects.

14:04 Joreji: dnolen: Yes. Printing out progress as the lazy-seq gets realized is the side effect.

14:10 dnolen: Joreji: then why not (dotimes [_ 1] (print ".")) ?

14:11 pjstadig: dnolen: eh...we've run into problems where our lazy sequences caused OOMEs because they were getting chunked

14:11 i guess that's a side-effect

14:12 but probably the weakest form, no one really expects that their program has an infinite amount of memory to compute

14:12 raek: pjstadig: also note that another source of problems is when you nest laziness, like (concat (concat (concat (concat ...))))

14:12 e.g. when you combine concat and reduce

14:13 dnolen: raek: that's a different problem, right? stack overflow.

14:13 raek: yeah

14:14 that problem has a pretty easy solution though: just wrap each layer of concat in a doall

14:15 Joreji: dnolen: This really was just a simplified example to illustrate my problem :-)

14:17 pjstadig: raek: we hit that at work too

14:17 which is why I think I'm qualified to talk about clojure's laziness constructs at Clojure/West :)

14:22 Raynes: pjstadig: 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:24 technomancy: no you should just stop halfway through your talk and wait for someone to ask a question

14:24 and use it as an explanation of chunking

14:24 Raynes: Excellent.

14:25 pjstadig: i'll need a plant in the audience to ask the question "(take 1)?"

14:25 then i'll continue for 32 more minutes

14:26 technomancy: I'd volunteer, but your talk is right after mine and I might need to take a breather.

14:26 Raynes: I would totally do that if I were there.

14:27 * technomancy wonders how the heck he got the talk timed over multiple slots

14:27 technomancy: *the only talk

14:27 jodaro: ahh, ok

14:27 For a chunked response, the response :body should be a channel.

14:29 cemerick: technomancy: surely you'll be more of a facilitator though?

14:29 technomancy: cemerick: yeah, it just feels weird. =)

14:29 cemerick: It'll be way too big of a crowd to do anything else while hacking.

14:30 Raynes: I 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:30 I've probably got a commit somewhere that is just a subconscious transcription of someone's talk.

14:30 * cemerick can't code in public

14:31 Raynes: Well, I mostly slept during your talk.

14:31 technomancy: cemerick: it's OK we can promise to stop making fun of you for using the mouse

14:31 Raynes: I keep forgetting that I have a mouse since I started using Vim.

14:31 cemerick: Raynes: you're better off for it :-)

14:31 * technomancy is trying to get the term "mouse vegan" to catch on

14:31 cemerick: sleeping, that is

14:32 technomancy: can't say I use it much at all

14:32 Mostly only when browser-ing

14:32 TimMc: pjstadig: 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:32 technomancy: cemerick: ah, I was just trying to stereotype IDE users. joke fail.

14:32 Raynes: cemerick: 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:32 * cemerick breaking barriers, one at a time

14:33 technomancy: anyway, that's the thing I love about the thinkpad trackpoint; you can just pluck the thing out and be done with it

14:33 TimMc: technomancy: That's illegal in some countries.

14:33 cemerick: If there was a decent tiling window manager for OS X, I'd be able to swear it off entirely.

14:33 Raynes: cemerick: Man!

14:33 cemerick: I was so disappointed to find out that there weren't any decent tiling wms for OS X.

14:34 cemerick: yup

14:34 pjstadig: technomancy: rotentio vegetarian?

14:34 Raynes: Just crappy hacks that don't work well.

14:34 technomancy: sure there are; you just have to run everything in X

14:34 cemerick: couple of sorta sad shareware-y things that mostly suck

14:34 technomancy: hush

14:34 twm ftw, eh?

14:35 pjstadig: there's actually some great tiling window managers for OS X

14:35 Raynes: cemerick: So what are you giving me for my birthday?

14:35 oakwise: Raynes: have you seen divvy?

14:35 pjstadig: you just have to install Linux first to access them

14:35 :-p

14:35 oakwise: hah

14:35 Raynes: pjstadig: Hurrrrr hur.

14:36 technomancy: pjstadig: would have worked better if you said "for Macs"

14:36 pjstadig: i thought about it

14:36 cemerick: I 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:36 pjstadig: but that's not what cemerick said

14:36 meh

14:37 cemerick: hehe. well Unity isn't much better these days

14:37 technomancy: the best thing about unity is how easy it is to replace

14:38 cemerick: Is 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:38 Raynes: I've been wishing for some Linux lately, but I'm too scared to dual boot on a macbook pro.

14:39 It's a good way to quickly destroy your computer, and I don't exactly have a bunch of them.

14:39 technomancy: cemerick: usually depends how old the macbook is. brand-new stuff is sometimes sketchy; the older the better generally.

14:39 cemerick: bonus points for Intel graphics

14:39 cemerick: technomancy: *not* the most rousing endorsement

14:39 technomancy: cemerick: anyway you can always test it out with a livecd; no commitment.

14:39 TimMc: Raynes: destroy?

14:40 cemerick: The 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:41 TimMc: or when you can't connect to wireless at the coffee shop you spend 10 hours/week at.

14:41 Raynes: TimMc: The instructions for all the distros I looked at used very aggressive wording like 'destroy' and phrases like "BACK UP OR DIE"

14:41 technomancy: cemerick: admittedly I've only stuck with thinkpads, but I haven't had to manually configure any hardware since 2007.

14:41 pjstadig: strawmen all of these arguments

14:41 TimMc: Raynes: Ah, that's just data. You have tested backups, right?

14:41 pjstadig: i've had good success with ubuntu for many years

14:41 Raynes: TimMc: I was using that as an example.

14:41 JanxSpirit: Raynes: I got a System76 - Ubuntu out of the box - very nice

14:41 pjstadig: and not once had to recompile the kernel or CUPS's whateveritis

14:42 TimMc: Ubuntu is starting to really piss me off with their "relaxed" view of bugfixes and upgrades.

14:42 JanxSpirit: bigger than a MacBook Pro, but also way more horsepower

14:42 TimMc: "Ah, you'll just want to dist-upgrade, that'll fix it..."

14:42 technomancy: TimMc: yeah, I'm happy to be on Debian stable. very conservative.

14:43 Raynes: JanxSpirit: Never heard of those.

14:43 TimMc: JanxSpirit: 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:43 Note: I am fairly picky about keyboards.

14:44 cemerick: pjstadig: just citing from prior experience on *commodity* hardware.

14:44 JanxSpirit: yeah I've heard good things RE thinkpads - the keyboard on mine is a total MacBook clone

14:44 chicklets

14:44 solussd: JanxSpirit: 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:44 TimMc: JanxSpirit: and there's a BIOS switch to put the Ctrl key back on the lower-left corner.

14:44 JanxSpirit: solussd: OK it's right about there - 12G of RAM though

14:44 solussd: didn't think they were cramming much more than that into notebooks these days

14:45 nice

14:45 supposedly I can go to 16GB. Might- the price is finally right

14:45 JanxSpirit: I think 16 GB was an option, but that's where it got very pricey

14:45 TimMc: THe ThinkLight is where it's at -- no more using my cellphone as a keyboard light when typong my password in in the dark.

14:46 To hell with speed.

14:46 JanxSpirit: it's been a mostly very good experience

14:46 solussd: yeah, 16GB of crucial value ram @ 1333MHz is going for ~ $170 on amazon right now

14:46 pjstadig: TimMc: i've actually found the illiminated keyboard on my new Dell to be better than the ThinkLight on my old ThinkPad

14:46 JanxSpirit: started 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:46 technomancy: the problem with keyboard backlights is that they make drainage systems impossible

14:46 one of those appearance vs functionality choices

14:46 pjstadig: technomancy: there's a driphole on the bottom of my Dell

14:47 ...and besides just don't spill things on your laptop

14:47 technomancy: pjstadig: I know you have kids dude; you can't pull that. =)

14:47 that's cool if they've figured out how to do both though.

14:47 cemerick: "drainage systems"? :-O

14:48 technomancy: cemerick: http://www.youtube.com/watch?v=8Q9ugshAO58

14:48 pjstadig: cemerick: never had to use one myself, but good to know its there

14:49 cemerick: hah

14:50 Raynes: JanxSpirit: Those Lemur Ultra ones look nice. Affordable too.

14:50 I might get one of those in a couple thousand years.

14:51 pjstadig: Raynes: with compound interest you could buy the solar system in a couple thousand years

14:51 gfredericks: that will be economically awkward

14:52 JanxSpirit: yeah those look a bit closer to Mac form factor

14:52 kephale: i'll sell you the solar system now

14:52 JanxSpirit: I got a Serval - definitely big but it's a very nice screen

14:52 Raynes: JanxSpirit: I could care less about the size. I just want something nice that I actually have a chance of buying

14:53 gfredericks: I have one of the netbooks. It's crazy-slow but at least it's little.

14:53 I probably should have paid for an SSD

14:53 technomancy: an SSD is the last upgrade you can buy that will make a noticeable performance difference

14:53 savour it while you can!

14:53 hiredman: :/

14:53 technomancy: after that every upgrade is just adjusting to a new set of compromises.

14:53 pjstadig: SSD++

14:54 gfredericks: I will upgrade my SoundBlaster

14:54 TimMc: haha

14:54 pjstadig: to 16-bits????

14:54 TimMc: Oh man, Win 3.1 was the best.

14:54 hiredman: I have an ssd, but am still using a core 2 duo, I hear the core chips are nice

14:54 pjstadig: no way!

14:54 technomancy: hiredman: meh

14:55 hiredman: technomancy: look, I rarely poop all over your dreams

14:55 kephale: technomancy: an accurate E*G input device might speed up a different type of performance

14:55 technomancy: I went back to a core 2 duo when I sent back my lenovo server and I don't really notice

14:55 hiredman: then again, I'm not running the same tests you are =)

14:55 kephale: yeah, looking forward to the direct neural interface stuff for sure. =)

14:58 gfredericks: oh man it will be weird when your subconcious is capable of executing programs against your will

14:58 TimMc: That already happens to me sometimes.

14:58 gfredericks: "I find the weirdest stuff set up in cron..."

14:59 TimMc: Have you ever started typing something and something else comes out this one day I was^W^W^W^W^W?

14:59 gfredericks: "Tips for keeping your subconcious from discovering your root password."

14:59 TimMc: at least you're there to supervise it

15:01 TimMc: Hasn'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:01 Clearly, messages from aliens. :-P

15:26 gfredericks: how do I access previous entries in the slime repl?

15:27 stuartsierra: M-p

15:27 gfredericks: stuartsierra: very good, thanks!

15:27 adamspgh: M-p works for generic shells in Emacs s well

15:28 tmciver: gfredericks: also C-'up arrow'

15:28 adamspgh: C-'up arrow' is captured by OSX (at least on Lion)… makes me crazy.

15:29 gfredericks: C-lots-of-things are captured for me in linux, unless I use the X version

15:29 jkkramer: 7l ,6hy['/nuilwø𧶅øøøøøøøøøøøøøøøøøøøøøøøøøøøøøt6t7y2wxz6 65a|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||<<<<<<<<<<<<<

15:29 gfredericks: jkkramer: that password must take forever to type

15:29 amalloy: i assume he's sending it to #clojure so he has a handy place to copy/paste it from in future

15:30 gfredericks: Error: password must have at least 75 consecutive pipes

15:36 scgilardi: adamspgh: 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:37 Raynes: scgilardi: Psh! OS X users can't be expected to *configure* things!!

15:38 It should read our minds and do what we want out of the box.

15:41 adamspgh: scgilardi: cool! I had not figured that out. thanks!

15:42 scgilardi: adamspgh: you're welcome :)

15:52 clj_newb: Can 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:52 solussd: so, map->MyRecordType will add keyvals to a record even if that record doesn't have the keys?

15:53 clj_newb: Current 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:55 jkkramer: sorry for flooding. cat on keyboard

15:55 jsabeaudry_: 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:55 amalloy: get a different Graphics2D instance, one that is intended for drawing to a pdf

15:57 clj_newb: eg, use http://docs.oracle.com/javase/tutorial/2d/printing/index.html and a PDF "printer"

15:58 cemerick: clj_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:59 iText is one of the more commonly-used PDF generation libs in JVM-land.

16:02 technomancy: jsabeaudry_: as long as LibB didn't declare a ranged dependency it should work fine

16:03 jsabeaudry_: technomancy: So I just specify the more recent dependency in my App project file?

16:03 technomancy: right

16:04 jsabeaudry_: technomancy: Sweet, thanks for your help

16:05 technomancy: sure

16:05 clj_newb: amalloy: nice; thanks; I have a feature request for Clojure 1.4.0 -- (apropos "foo") queries Amallory

16:15 TimMc: clj_newb: You're asking for an 'apropos command?

16:16 &(do (require 'clojure.repl) (clojure.repl/apropos "shift"))

16:16 lazybot: ⇒ (bit-shift-left bit-shift-right)

16:16 amalloy: TimMc: i think he's "enhancing" it so that it sends me a message

16:16 TimMc: Ah! I see.

16:16 or Amallory, whoever that is. :-P

16:16 amalloy: yeah, poor guy

16:17 TimMc: I've seen him mentioned a lot, but we've never met.

16:17 amalloy: heh

16:17 my 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:18 emezeske: wasn't mallory a character in that cheesy show "sliders"?

16:18 it's his fault!

16:19 technomancy: is "Calm down Ken" on the mailing list a reference to Ken Wesson?

16:19 because if so, <3

16:21 amalloy: technomancy: yeah, i loved that

16:21 ever notice you've never seen the two of them in the same room...?

16:21 technomancy: what happened to Ken anyway? I killfiled him; did he wander off to harass some other community?

16:21 amalloy: technomancy: dunno. he hasn't been posting for months

16:22 technomancy: also, I love how this thread basically confirms my decision to plonk Cedric.

16:22 cemerick: dunno, that was a killer quote re: everest. :-P

16:22 amalloy: technomancy: glad to see i'm not the only one who thinks he's a <censored>

16:23 * cemerick realizes that perhaps he's a Ken to some :-O

16:23 technomancy: cemerick: he's pretty... frothy

16:23 cemerick: I haven't kept up with the latest personalities.

16:23 stuartsierra: cemerick: You'll always be a <censored> to me.

16:23 technomancy: http://www.harkavagrant.com/index.php?id=273 <- panel 3

16:24 cemerick: stuartsierra: more heat than light of late, huh?

16:25 TimMc: technomancy: 3rd strip, you mean?

16:25 technomancy: TimMc: oh; yes.

16:25 stuartsierra: The vibrancy of the Clojure community warms my heart to a state of crispy deliciousness.

16:26 rplevy: Regarding 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:26 Raynes: technomancy: Cedric bothers me.

16:26 Significantly.

16:27 TimMc: Raynes: With less than 5% probability of chance?

16:27 WHAT P-VALUE ARE WE DEALING WITH HERE?

16:27 ahem

16:27 amalloy: TimMc: SIX SIGMA

16:27 TimMc: *gasp*

16:27 technomancy: Raynes: /ignore works for email too you know.

16:28 jkkramer: google groups needs a killfile feature

16:30 technomancy: rplevy: that's what I thought too; apparently either there is some confusion about it or ...? https://github.com/brentonashworth/one/issues/64

16:32 rplevy: technomancy: oh I didn't see that

16:38 technomancy: 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:39 cemerick: Raynes: FYI, lazybot logs aren't escaping many HTML entities

16:39 technomancy: rplevy: afaict no one outside relevance understands it

16:40 Raynes: cemerick: I'm aware.

16:40 It's a damn shame.

16:40 cemerick: The world will go on, I'm sure. :-)

16:44 amalloy: <script type="text/javascript" src="http://www.cornify.com/js/cornify.js"></script>

16:44 hm. XSS didn't work

16:45 Raynes: amalloy: Does it send the logs as HTML?

16:47 amalloy: sorta. i think we just need to wrap the actual log data in CDATA

16:47 TimMc: I bet tags are being stripped.

16:47 ]]><b>HA!</b><[CDATA[

16:47 amalloy: TimMc: no, they're not. look at the inspector on the log page

16:48 cemerick: TimMc: no, there's a <pom> in there

16:48 TimMc: Whoops, that worked.

16:49 amalloy: <![CDATA[ <b> this shouldn't be bold</b>

16:49 ]]>

16:49 TimMc: nothing

16:50 amalloy: yeah, weird

16:50 TimMc: (Play along at home: <http://lazybot.org/logs/#clojure/2012-01-18>)

16:50 Oooh, and a <censored> or two.

16:51 lazybot didn't even... <blink>

16:54 amalloy: Cornify loaded.

16:54 amalloy: really? it didn't for me

16:54 TimMc: No, I mean cornify.js

16:54 It's not doing anything.

17:00 amalloy: Cornify is failing to add its div, or maybe the reload script is killing it.

17:00 also, </blink>

17:01 Raynes: TimMc: You don't get out much, do you?

17:01 TimMc: I don't know what would make you say such a thing.

17:04 Raynes: TimMc: The blink tag is an ill-conceived weak-ass piece of shit anyway, so... whatever.

17:12 TimMc: Raynes: Oh, ha! I was wondering why that piece of vitriol sounded so familiar! :-D

17:12 Raynes: I was afraid I had missed my chance.

17:30 benares_98: anyone attending clojure west?

17:30 Raynes: I imagine lots of people.

17:30 emezeske: benares_98: I plan to!

17:31 pjstadig: no

17:31 no one is going

17:35 jeremyheiler: im thinking about going. gotta figure out how much it'll cost to get across country, though.

17:36 amalloy: just walk it. head out now

17:37 jeremyheiler: maybe on the way I can gather a following and even sponerships

17:37 sponserships*

18:02 clj_newb: the following code hangs: paste.lisp.org/display/127157 -- why? (even when I print to pdf rather than printer)

18:02 the 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:03 hiredman: clj_newb: you already said that

18:03 technomancy: have you seen http://skife.org/java/2012/01/10/posix_from_java.html

18:04 clj_newb: hiredman: I fixed it too

18:04 technomancy: hiredman: no, but with an URL like that I'm bound to like it

18:04 clj_newb: now, 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:05 I'm talking stuff that takes Google's cluster to render half a page

18:06 hiredman: now that I have passed it on I can finally close this tab

18:06 clj_newb: I think I want rendering hints. What do you think?

18:09 woot

18:09 antialiasing working now

18:09 my PDFS are beautiful

18:11 choffstein: Anyone 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:12 technomancy: choffstein: you have an old version of clj-stacktrace somewhere. see the Troubleshooting section of the swank-clojure readme

18:12 clojurebot: 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:12 clojurebot: Ok.

18:12 choffstein: Yeah, I read it. I couldn't seem to resolve where clj-stacktrace was sneaking baout

18:13 *about

18:13 technomancy: you could force a dependency on the most recent clj-stacktrace explicitly

18:14 a patch to get swank-clojure to gracefully fall back or issue a more comprehensible warning in that case would be super

18:25 amalloy: technomancy: clojurebot doesn't like . in his factoids iirc

18:26 i don't recall correctly, apparently

18:44 bloop: I 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:46 arohner: bloop: it fits in a java int

18:47 bloop: that'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:47 s/has/hash

18:48 it'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:49 arohner: bloop: http://blog.higher-order.net/2009/02/01/understanding-clojures-persistentvector-implementation/

18:53 bloop: also, http://blog.higher-order.net/2009/09/08/understanding-clojures-persistenthashmap-deftwice/

19:00 bloop: arohner: 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:06 metajack: bloop: you want he branching factor to be as large as possible in order to make the tree shallow i assumed.

19:07 bloop: metajack: well there's clearly a tradeoff though: assoc on a small map means a bigger node to copy...

19:09 amalloy: it has been claimed that 32 is good because it fits in a cache line

19:11 metajack: bloop: 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:11 bloop: amalloy: that makes sense. is that just something that Phil Bagwell says, or is there data somewhere where they tested different sizes?

19:11 metajack: I think that's what defstruct is for

19:13 amalloy: bloop: 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:13 metajack: Since I saw various different things when doing (class some-map) i figured there were multiple implementations and it promoted based on the tradeoffs.

19:14 amalloy: anyway, 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:14 metajack: amalloy: array maps were what i was thinking of

19:14 bloop: amalloy: oh! neat.

19:48 robinkraft: is there an idiomatic way to check equality floats that are meaningfully the same for a given precision?

19:48 I'm looking for something like (nearly-same? precision n1 n2) that returns true for (nearly-same? 7 1.0 1.000000000018)

19:54 (Float/compare 1.0 1.0000000000018) does the trick

20:34 technomancy: does the LA clojure group meet on the first thurs. of the month?

20:36 amalloy: technomancy: it generally meets the same time as seattle (and SF), but has been a bit unpredictable recently

20:36 technomancy: amalloy: I may be down in socal for march

20:37 someone on the Heroku Java team said they got invited to speak at la-clj and forwarded it on to me.

20:37 amalloy: want to give a presentation? i don't think there's anything lined up

20:38 technomancy: bit too early to commit, but I'd like to.

20:38 do you help with scheduling it?

20:39 amalloy: no, not at all

20:40 truys: hi =)

20:41 amalloy: technomancy: 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:48 technomancy: yeah just curious about timing; thanks

21:29 TimMc: ,~5

21:29 clojurebot: #<IllegalStateException java.lang.IllegalStateException: Attempting to call unbound fn: #'clojure.core/unquote>

21:30 TimMc: Oh, never mind.

22:57 _carlos_: hi!

22:59 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:01 brehaut: _carlos_: when you define a defmulti you pass it a function

23:01 _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:03 brehaut: _carlos_: by the function you supply to defmulti

23:03 bobhope: Is it appropriate to post a link to a blog post I wrote about clojure promises and futures?

23:04 brehaut: _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:05 _carlos_: in that defmulti, (fn [x] (count x)) is where the dispatch is calculated

23:05 _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:06 brehaut: aha

23:06 bobhope: why not

23:06 _carlos_: brehaut: thank you for the helpful example

23:11 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:12 brehaut: _carlos_: theres http://cemerick.com/2011/07/05/flowchart-for-choosing-the-right-clojure-type-definition-form/

23:12 _carlos_: its only concerned with type related features though

23:13 bobhope: I wrote this post about promises and futures: http://dgrnbrg.tumblr.com/post/16099937741/promises-and-futures-in-clojure

23:13 I 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 I can build this use case by reading a second book to ciment the concepts

23:15 brehaut: bobhope: i suspect that if someone doesnt know what a promise is, they are unlikely to know what a count down latch is either ;)

23:23 bobhope: brehaut, really?

23:23 I think that coming from not-clojure, they might not

23:23 Also, it brings into stark relief what behavior to expect

23:23 i.e. your current thread sleeps on the delivery

23:28 amalloy: brehaut: i knew what a count-down latch was but not a promise, fwiw

23:28 brehaut: amalloy: you have some amount of java background?

23:28 amalloy: yes

23:29 though i'm not really sure what context i learned about that in

23:29 brehaut: id never heard of a CDL outside of JVM, but ive encountered promises many times

23:29 technomancy: seancorfield: is there a plan to support c.j.jdbc connection objects outside with-connection?

23:29 amalloy: well, you came from haskell, where promises are relevant

23:30 brehaut: amalloy: also python and javascript

23:30 technomancy: the 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:36 seancorfield: technomancy: can you elaborate on the c.j.jdbdc question?

23:38 technomancy: seancorfield: 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:39 seancorfield: i'll merge the internal ns into the main one soon - you'd like get-connection to be public?

23:39 technomancy: feels 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:39 get-connection on its own isn't quite enough; you need to be able to pass it to the functions that need it

23:40 unfortunately since most of them take varargs that might be nontrivial

23:40 but you see what I'm getting at?

23:40 seancorfield: yes, part of the 0.2.0 API overhaul is to rewrite everything to accept a connection argument

23:40 and then rewrite the old API in terms of the new one

23:41 technomancy: excellent

23:41 I'm ok with my workaround for now; just wanted to know if that was on your radar

23:43 seancorfield: yeah, the clojure/core feedback about a 1.0 release was very valuable

23:43 i don't like the current API... it works but it's a pain to use in some ways

23:44 i've written a wrapper around it for world singles

23:45 we'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:45 i'd like to get a first cut done before clojure/west but i doubt i'll have the time

23:45 technomancy: once clojurewest isn't hanging over your head? =)

23:46 seancorfield: yeah :)

23:46 i need to get a talk together before then ya know!

23:47 technomancy: same here

23:48 * Raynes wants to ask about cat shows, but decides that doing so might be rude.

Logging service provided by n01se.net