#clojure log - Oct 24 2011

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

0:22 scottj: why does str have to be namespaced in https://github.com/clojure/clojurescript/compare/bfc2f32c53...3c83c62d97 but when-not doesn't?

1:00 amalloy: scottj: i don't understand the subtleties of cljs macros, but it looks like it's because when-not is in clj and str is in cljs

1:01 ie, it can put clojure.core/when-not in there, because clojure will be expanding it itself. but it can't put its "own" reference to str in, because it's supposed to be executed in a cljs context

2:18 daaku: is there a syntax for destructuring to bind the "rest" args at head instead of the tail?

2:39 scottj: amalloy_: that made sense for the when outside the syntax quote but the when-not inside the syntax quote confused me. is it something about the str being inside the throw that makes it different?

3:26 Blkt: good morning everyone

3:29 Raynes: jodaro: Ping.

3:32 michaelr525: Blkt: morning!

3:33 Blkt: :D

4:09 tsdh: Is there a way to silence a given reflection warning? I want *warn-on-reflection* to be true, but there are some java calls in my code that cannot be silenced with type hints and are not performance critical anyhow.

4:14 patchwork: Suddenly when I try to load my project I get a mysterious "Unable to resolve symbol print-doc in this context". java.lang.RuntimeException?

4:14 I'm sure I'm not calling print-doc anywhere

4:14 where do I begin to debug this?

4:15 hiredman: you have a (doc ...) somewhere

4:15 patchwork: The stacktrace just shows a deep nesting of compiler calls

4:15 hiredman: not in my project?

4:16 yeah, just grepped the whole thing

4:16 I don't have a single occurrence of the string "doc"

4:16 anywhere

4:16 So it is in one of my dependencies then?

4:20 could something like this cause it?

4:20 (ns #^{:author "Roman Scherer" :doc "Rails-like inflections for Clojure."}

4:20 This is the only doc I see in the library

4:43 Yeah it is definitely when I try to require this library:

4:43 [geocoder-clj "0.0.3-SNAPSHOT"]

4:45 Raynes: patchwork: In Clojure 1.3, print-doc was moved to clojure.repl and made private. Sounds like geocoder hasn't been updated.

4:46 Huh. I guess it was.

4:46 patchwork: So, what do I do? Tell the owner I get a print-doc error? I am looking through his code and I don't see any reference to doc of any kind. Strange.

4:46 Raynes: patchwork: Could you gist the whole stacktrace?

4:47 That'll be really helpful.

4:47 patchwork: I would just fix it myself

4:47 Raynes: sure

4:48 Here you go: https://gist.github.com/1308615

4:49 this is kind of a related question, but what is the best way to debug these things? Sometimes I get these stacktraces which are entirely from the compiler, and it tells me it finds an error, but doesn't tell me in what file!

4:49 Is there an accepted way to scry into these?

4:50 Raynes: patchwork: If you look through it, you'll see a line that starts with "geocoder" and shows the line that this occurs.

4:50 It appears to happen when it loads infections. Infections might be the culprit.

4:50 I'm checking.

4:50 clgv: patchwork: printing only the lines of the stacktrace with clj-files in gives a good overview.

4:50 patchwork: So, this line?

4:51 64: inflections.core$eval7491$loading__4505__auto____7492.invoke(core.clj:1)

4:51 65: inflections.core$eval7491.invoke(core.clj:1)

4:51 Raynes: Yes.

4:51 patchwork: So that is in line 1 of core.clj

4:51 alright

4:51 Raynes: Yes, the 'ns' declaration.

4:51 patchwork: which means probably when it is requiring yet another library

4:52 Raynes: inflections* haha, infections.

4:52 patchwork: I know, I just let it go : )

4:52 It could be considered an infection I guess

4:52 inflections, taking over our systems

4:53 Raynes: Apparently.

4:53 Looks like it's on 1.3 as well.

4:53 patchwork: pluralizing singular things

4:53 Yeah, that is what I thought

4:53 the code seems fine

4:53 who is calling print-doc here?

4:54 could it be swank somehow?

4:54 I am calling through swank

4:54 Raynes: I don't know. Does this happen outide of slime?

4:54 patchwork: I'll try just the repl

4:54 Raynes: Yeah, I noticed.

4:54 Heh, you're a quarter inch ahead of everything I say.

4:54 patchwork: happens in the repl too

4:55 Raynes: Is the trace the same?

4:55 patchwork: Yep

4:55 CompilerException java.lang.RuntimeException: Unable to resolve symbol: print-doc in this context, compiling:(clojure/contrib/ns_utils.clj:67)

4:55 Raynes: Aha!

4:55 Something is using clojure-contrib.

4:55 patchwork: looks like it is calling contrib?

4:55 oh man

4:55 Raynes: Find that and you've found the problem.

4:56 patchwork: Well, how do I find that?

4:58 Raynes: I'm not sure. Doesn't look like any of these projects use contrib.

4:58 patchwork: You sure you don't have contrib being pulled in? Even by one of your deps? The way to check would be to look in lib/ for clojure-contrib.

4:59 But the ns that is requiring it in the first place should be in the stacktrace.

4:59 * Raynes has got to take off.

4:59 Raynes: Good luck.

5:00 patchwork: Yep, thanks Raynes

5:01 Aha, clojure.contrib is in there

5:01 sneaky bastard

5:28 fbru02: Hi all , how can i tie in -> with a fn like re-seq?

5:30 Raynes: fbru02: You'd like to thread the seq in, but the argument order doesn't match up?

5:30 If possible, use ->>. It threads it as the last argument in each form.

5:30 If that isn't possible, you should probably consider not using either of these forms at all, or using them in a different way.

5:31 fbru02: Raynes: nice !!! thanks

5:31 Raynes: s/seq/string/

5:56 AWizzArd2: How do I get the docstring of a NS?

5:59 Ah okay: (clojure.repl/find-doc "my.ns")

6:00 raek: AWizzArd2: there's also (print-namespace-doc 'my.ns)

6:01 AWizzArd2: Ah nice, didn't know that one.

6:01 In what NS do I find this fn?

6:01 raek: in clojure 1.2 it's in clojure.core

6:01 Raynes: AWizzArd2: Just plain clojure.repl/doc is supposed to work for namespaces.

6:05 AWizzArd2: Raynes: I tried doc, but that didn't work for me.

6:05 ,(clojure.repl/doc clojure.repl)

6:05 clojurebot: #<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.lang.ClassNotFoundException: clojure.repl>

6:05 AWizzArd2: $(clojure.repl/doc clojure.repl)

6:06 Raynes: &(clojure.repl/doc clojure.repl)

6:06 lazybot: java.lang.ClassNotFoundException: clojure.repl

6:06 Raynes: Duh. I forgot -- replaced the doc macro with my own.

6:06 AWizzArd2: http://clojuredocs.org/clojure_core/clojure.repl/doc Look at the source.

6:06 AWizzArd2: Anyway, try that in your local repl, it will not work there too.

6:07 Raynes: It works fine.

6:07 Just tried it.

6:08 AWizzArd2: Raynes: I get the same error message that the clojurebot gave.

6:08 For {:major 1, :minor 3, :incremental 0, :qualifier nil}.

6:08 raek: ,(require 'clojure.repl)

6:08 clojurebot: nil

6:08 AWizzArd2: find-doc works though

6:08 raek: ,(clojure.repl/doc clojure.repl)

6:08 clojurebot: #<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.lang.ClassNotFoundException: clojure.repl>

6:09 AWizzArd2: raek: in 1.3 this is not in clojure.core anymore.

6:09 This print-namespace-doc I mean.

6:09 ,(clojure.repl/doc clojure.core)

6:09 clojurebot: #<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.lang.ClassNotFoundException: clojure.core>

6:09 AWizzArd2: ,(clojure.repl/find-doc clojure.core)

6:09 clojurebot: #<CompilerException java.lang.RuntimeException: java.lang.ClassNotFoundException: clojure.core, compiling:(NO_SOURCE_PATH:0)>

6:10 AWizzArd2: ,(clojure.repl/find-doc "clojure.core")

6:10 clojurebot: -------------------------

6:10 clojure.core/extend-protocol

6:10 ([p & specs])

6:10 Macro

6:10 Useful when you want to provide several implementations of the same

6:10 protocol all at once. Takes a single protocol and the implementation

6:10 of that protocol for one or more types. Expands into calls to

6:10 extend-type:

6:10 (extend-protocol Protocol

6:10 AType

6:10 (foo [x] ...)

6:10 (bar [x y] ...)

6:10 BType

6:10 (foo [x]...

6:10 Raynes: And this is why you don't let bots send a message for each line of output.

6:11 AWizzArd2: ;-)

6:11 At least it was so nice to stop, and didn't print out all docstrings *g*

6:11 Raynes: Also, I had a clojure 1.2.1 repl open, so disregard what I said.

6:11 AWizzArd2: In 1.2.x I also used plain doc.

7:02 $seen rhickey

7:02 lazybot: rhickey was last seen quitting 1 week and 2 days ago.

9:20 fasta: Suppose I have N modules and I change a definition in one of them, how long do I have to wait before I can use that definition?

9:20 etnt`: anyone knows of any Minecraft plugins that has been written in Clojure?

9:21 fasta: E.g. vanilla Scheme used 'load' for its modules, which also doesn't scale to large system development.

9:22 In Smalltalk, a change is applied in the order of microseconds if not less.

9:23 Does Clojure does something 'smart' or is it working in some naive way?

9:23 do*

9:35 morphling: fasta: definition of what?

9:35 fasta: morphling: of some new function.

9:37 morphling: fasta: you have to recompile and load it (like C-c C-c in slime) and it gets used everywhere immediately. I'm pretty sure clojure does not inline functions per default

9:37 fasta: morphling: but how much is recompiled?

9:38 morphling: fasta: whatever you tell it to compile

9:39 fasta: morphling: but don't you get the problem then that you have to keep track of what it already has compiled and what not?

9:39 morphling: CL has that problem, which is why the Racket people came up with a different solution./

9:40 morphling: fasta: I don't get it. If you recompile the whole namespace it recompiles the whole namespace, but you don't have to. is that what you're asking?

9:41 fasta: if you change a macro btw you have to recompile all its users, there is no magic going on there that recompiles them for you

9:42 michaelr525: i think what he is asking is whether the loading of all the stuff that's been recompiled is performed atomically?

9:43 or that's what i am asking :)

9:44 mrsipan: have anyone tried to use vimclojure with clojurescript repl?

9:45 has*

9:46 fasta: morphling: how long does compiling a namespace generally take? Milliseconds?

9:46 kzar: Any ideas how I can get requests for "/" to render "/index.html" using Noir, static redirection works fine if I type the file name in. I tried to do (defpage "/" [] (render [:get "/index.html"])) but no joy

9:46 duck1123: michaelr525: require has a :reload and :reload-all flag that you can use to reload the required namespaces. Is that what you're asking?

9:46 fasta: I just want to know how fast it is.

9:46 E.g. C++ compilation is extremely slow because of linking too.

9:46 duck1123: fasta: that's highly dependant on what you're loading

9:47 morphling: michaelr525: I don't know, but i would guess it's not

9:48 fasta: duck1123: in a good implementation it is O(number of changes).

9:48 Or perhaps O(number of changes * lg n)

9:49 michaelr525: well, i imagined loading new code into a running system but maybe it's beyond the subject of this discussion :)

9:49 kzar: (defpage "/" [] (redirect "/index.html")) works but it's makes the URL ugly

9:55 fasta: michaelr525: I would be interested in the semantics of that also.

9:57 duck1123: fasta: Assuming that all of your required namespaces are loaded, reloading the namespace should be as fast as evaling every form in that file

9:57 which should be pretty fast

9:57 morphling: fasta: clojure does not focus on compilation speed, there is ahead of time compilation, but it is mostly used for interop purposes and strongly discouraged. it also does not track changes as far as i know. interactive development is fast because you don't need to recompile every use site of a funtion, just eval the new (defn ...) in the running image and you're good to go

9:58 cark: i don't see why it would be strongly discouraged

9:58 you may do interactive developement then do AOT compiling to get an end-product

10:00 morphling: cark: because it does not work accross clojure versions. ok let me rephrase: it is strongly descouraged for almost everything besides end-user deployment

10:01 cark: so "everything" means development i guess ?

10:01 sorry i'm nitpicking

10:02 morphling: cark: especially libraries you want others to use, or reuse yourself

10:02 cark: but i wouldn't want people to get the wrong impression about clojure "not being fit for compilation"

10:02 well, when i get a clojar, it's compiled

10:02 duck1123: The only time you should really need to AOT compile is when you need to genclass for use within a java app

10:03 morphling: cark: it should not be

10:03 cark: you can load source code from jar files

10:04 cark: my workflow is this : play in slime doing interactive development, then once in a while check that everything works well with AOT compilation, then i have this build process for distribution to the end-user, he gets the AOT compiled jar, without source

10:06 if you go mostly without AOT, you may have some bad surprises

10:06 duck1123: aot is good for checking everything. I keep a commented out aot line in my project

10:06 cark: i remember trying to use one of those nice matching libraries, it was doing fine in the repl, and breaking when AOT compiled

10:07 though i believe the author was working on fixing that =)

10:09 morphling: cark: what can you do that breaks aot compilation?

10:09 cark: it was something with protocols he said

10:11 extend-protocol or something like it

10:11 morphling: ah, I don't think I've used AOT since protocols were added

10:11 cark: or extend itself, can't remember

11:34 choffstein: is there any way to get .clj files out of a .jar made with lein uberjar?

11:37 Sorry if I double ask this question -- sometimes I can't tell if my irc client sent the message. Anyone know if there is a way to get the .clj files out of .jars made with `lein uberjar`? I only want the compiled source in the .jar if possible.

11:42 terom: choffstein: .jar files are basically just compressed files (zip I guess) which you can uncompress with your favourite tool, so you can retrieve compiled files (classes) from it.

11:42 choffstein: terom: I know. I more meant -- how do I make sure my .clj files are NOT included in the .jar

11:48 terom: choffstein: ah, ok. Well, I don't have so much experience with that. Does it include both compiled classes and source .clj files currently?

11:48 choffstein: terom: yes, it does

11:48 jkkramer: choffstein: there's an :omit-source option for project.clj

11:49 choffstein: beautiful.

11:49 jkkramer: see https://github.com/technomancy/leiningen/blob/1.x/sample.project.clj

11:49 choffstein: thanks

11:50 terom: Ah, so easy.

11:57 sirn: is there any macro similar to (and) but evaluate all exprs even if any expr returns false?e

11:57 cemerick: technomancy: so what is the workaround for that $PATH issue you mentioned a few days ago?

11:58 I ended up always starting emacs from the command line (didn't find the real fix after a little googling).

12:30 iwillig: is it crazy to have a protocol extend another protocol... is that a bad design choice ?

12:33 technomancy: cemerick: the real fix involves editing a plist.xml file. =(

12:34 cemerick: bummer

12:35 technomancy: don't you have this issue with other programs on OS X though?

12:35 cemerick: Hrm.

12:35 I don't think so.

12:36 technomancy: or I guess with eclipse you use a plugin rather than searching the $PATH?

12:36 cemerick: Eclipse always figures out things like e.g. where the git binary is, and TM bundles find awk without a problem.

12:36 The plugin can use the java git impl or shell out to the local git.

12:36 technomancy: interesting. I wonder how they do it.

12:37 cemerick: I've generally done the latter, just because the java git impl lags a bit.

12:37 I'm guessing they keep a set of common paths somewhere, and go looking.

12:37 so is aquamacs really that evil?

12:37 technomancy: ... well ...

12:38 cemerick: I can't imagine how long it would take me to get keybindings set up well enough that I wouldn't go nuts.

12:38 technomancy: the main problem is that it breaks compatibility in unpredictable ways and that it's not portable

12:38 so there's really no way for maintainers to test against its quirks without buying a mac

12:40 cemerick: Huh. That's not really intuitive. Isn't it just a bunch of chrome and .emacs defaults?

12:40 technomancy: apparently there's more to it

12:40 I've never tried it.

12:40 cemerick: That's what I used the last time I gave emacs an honest try.

12:40 technomancy: but there's only so much you can do to trick people into thinking it's mac-native

12:41 it's always going to be deep in uncanny-valley territory

12:41 cemerick: I installed emacs 24 straight this time just so I could safely use the swank-clojure tutorial, etc., but it was…uncomfortable. :-)

12:41 technomancy: oh, also it bundles its own version of slime that is newer than what Clojure needs, but older than what the latest CL stuff needs.

12:42 cemerick: well, the thing about Clojure users is they're more likely to acknowledge that elegance and familiarity are orthogonal. =)

12:43 cemerick: AI think that applies well to code and abstractions and such. I remain firmly unconvinced about that w.r.t. user interfaces.

12:43 Assembly is elegant too.

12:43 technomancy: well, familiarity is always relative

12:43 cemerick: indeed

12:43 technomancy: I always feel like I'm working with mittens on when you place me in front of a mac

12:44 cemerick: heh

12:45 You should have seen me trying to figure out how to tab around buffers.

12:46 kzar: I've started to get used to working on a Mac but I've still found no way to disable all the Mac hotkeys when working in a terminal - drives me crazy when the window closes instead of the region yanked

12:47 cemerick: hrm, no familiarity is not always relative. That was the driving thesis behind GUIs: graphical metaphors provide interaction affordances that text commands cannot match.

12:47 hiredman: ah, well don't use command as meta?

12:47 (works for me)

12:48 cemerick: but the thing is, as programmers we work with lots and lots of text

12:48 kzar: hiredman: I just wish there was a "disable every bloody hotkey when a terminal window is active" option, would be so nice

12:48 technomancy: cemerick: I think that just means it's less relative.

12:49 within the subset of the population that's likely to use this program, the chances are higher that it resonates with some experience they can relate to.

12:49 maybe it's pedantic, but I don't think there's much in UI that can be truly universally intuitive.

12:50 s/maybe//?

12:50 cemerick: yeah, it's population-dependent

12:51 but, graphical buttons and tabs and sliders and knobs are hard to beat if your population is, say, anyone that's used a computer in the past 30 years

12:52 Maybe purely textual UIs can be made to approach the same level of accessibility, but I've never seen one that's really tried.

12:52 technomancy: the other thing is that often discoverability and efficiency are in conflict

12:53 so I can see something I've never used and know exactly how it works and still be frustrated because it's cumbersome compared to what I'm used to

12:53 because efficiency actually can be objective.

12:53 (for a given task)

12:54 cemerick: can't there be keybindings and corresponding discoverable UI elements available simultaneously?

12:55 hiredman: do you not have ido-mode and smex?

12:55 cemerick: hiredman: I have no idea what those are; but, as someone that recently followed the getting-started tutorial, no.

12:56 technomancy: cemerick: not if efficiency factors in maximizing the amount of available screen space. =) but you can certainly make trade-offs that adjust as the user levels up.

12:56 cemerick: or, I should say, I don't think I have them :-P

12:58 technomancy: ido is built-in; you can do M-x ido-mode to enable it.

12:58 it probably should be turned on by default; emacs is not very pleasant without it.

12:58 * technomancy will never find himself defending Emacs default behaviour

12:58 cemerick: gawd, shouldn't that be an indication that something is wrong?

12:59 hiredman: smex makes things pretty discoverable, M-x and then type something and it will list possible completions as it goes

12:59 cemerick: has anyone ever told you to use bare emacs?

12:59 cemerick: hiredman: oh, yeah, that happens. Definitely *not* what I would consider "discoverable".

13:00 technomancy: cemerick: definitely stuff is wrong with the development process. it's all political.

13:00 hiredman: cemerick: what would you consider discoverable?

13:00 cemerick: hiredman: I just have the emacs starter kit + swank-clojure. (per http://dev.clojure.org/display/doc/Getting+Started+with+Emacs)

13:00 technomancy: the emacs-devel list makes our "what happened to numerics in 1.3!?!?" threads look like high tea. =)

13:00 hiredman: eclipse is not

13:01 technomancy: so... is there any way to make a request against a self-signed https server from Clojure?

13:01 hiredman: I installed eclipse while trying to write an andriod widget, it could be called "discoverable" if you think "discoverable" means "point and guess"

13:01 technomancy: yes

13:02 technomancy: does it involve reifying your own trustmanager? =(

13:02 TimMc: curl

13:02 technomancy: haha

13:02 hiredman: yes

13:02 https://gist.github.com/1309519

13:02 cemerick: technomancy: via system properties, IIRC

13:03 technomancy: hiredman: oh that's not so bad; thanks.

13:03 cemerick: I think that requires you know the cert up-front, which I'd rather avoid

13:03 TimMc: hiredman: mangers and bash, eh?

13:04 technomancy: would be nice to have that in clj-http, but I can fall back to clojure-http-client for this.

13:04 pjstadig: technomancy: you want to hear about 1.3 numerics, i'll tell you about 1.3 numerics...

13:04 * TimMc popcorn

13:04 cemerick: hiredman: except that you can "point and guess" two or three times, and end up finding the behaviour you want. "Discoverable" doesn't mean "the tool reads your mind", but it does include being able to easily find actions within a reasonable category, actions related to other atctions, etc.

13:04 hiredman: technomancy: should work for clj-http I think

13:04 technomancy: pjstadig: but what do you think about setting cua-mode by default for new users; that's what I want to know.

13:05 pjstadig: hehe

13:05 technomancy: hiredman: oh? cool.

13:05 hiredman: cemerick: all the emacs slime commands start with 'slime-'

13:05 dakrone: technomancy: patches welcome :)

13:05 hiredman: technomancy: I think so

13:05 technomancy: dakrone: fer sure

13:06 cemerick: hiredman: 'slime-' being the obvious prefix for the lisp or clojure interaction facility ;-)

13:06 hiredman: cemerick: it is the obvious prefix for slime

13:06 given there are other possible modes of interaction

13:07 * technomancy lulz at the capitalization of HttpsURLConnection

13:07 cemerick: hiredman: and the immovable encounters the unstoppable :-)

13:14 * hugod encounters smex for the first time

13:33 cch1: Anybody familiar with clj-logging-config? I'm getting "Unable to resolve symbol: Log in this context" when requiring or using version 1.7.0

13:38 amalloy: iwillig: i'm not sure whether it's crazy; it's certainly something i've wanted to do. but i don't believe it's possible

13:38 sirn: you don't need a macro for that, it's just a function: ##(every? identity [true false (prn 1)])

13:38 lazybot: ⇒ 1 false

13:42 sirn: amalloy: thanks, that's exactly what I'm looking for

14:11 kylpo: Anyone have a REST clojure server tutorial they can link me?

14:12 drewr: kylpo: I'm pretty sure any REST tutorial would apply to clojure without too much impedance mismatch

14:16 kylpo: Sure. I am just fishing for the perfect match to the project I want to undertake. :)

14:22 fdaoud: kylpo: do you mean like Compojure?

14:23 kylpo: fdaoud: Yeah, I'm checking out Compojure right now, actually.

14:23 drewr: kylpo: if you're new to the clojure ecosystem and you're just looking for REST-capable libraries, check out compojure like fdaoud mentioned or just ring itself (which compojure wraps)

14:23 or any of the myriad java options

14:24 kylpo: drewr: Cool, thanks.

14:29 Just want to throw this out for clojure newbies like me. This intro to Clojure syntax is really well done: http://www.moxleystratton.com/article/clojure/for-non-lisp-programmers

14:32 fdaoud: kylpo: here is a REST/Ring tutorial: http://mmcgrana.github.com/2010/08/clojure-rest-api.html

14:33 as drewr mentioned, it's worth understanding some Ring because Compojure builds on it

14:33 drewr: he'll have to anyway because compojure doesn't try to hide ring at all

14:34 it's convenience functions, not an abstraction

14:37 kylpo: Thanks fdaoud, that looks promising.

14:43 jcromartie: how do you decide where to put dosync calls?

14:44 when designing an API

14:46 fdaoud: true drewr

14:53 drewr: jcromartie: as close as possible to the ref

14:53 ref(s)

14:53 disclaimer though: I've actually hardly used the STM

14:55 amalloy: drewr: the problem, of course, is the "but no closer" implied second half :P

14:56 drewr: I figured I'd stop short and let those with more experience take over the advice :-)

14:56 technomancy: I think it depends on whether refs are an implementation detail or exposed to the user.

14:56 amalloy: i think the preferred ideal is to not have your API have dosyncs at all

14:57 drewr: right. abstract the concept of state away if you can.

14:57 s/concept of//

14:58 jcromartie: drewr good idea

14:58 amalloy: drewr: my point was more that, if you do have to have state, it's the user's job to set up transactions, not yours. just tell them "hey, i'm a stateful object, you can't use me except in a dosync"

14:58 jcromartie: if the API has to use a ref, you're doing it wrong :P

14:58 TimMc: maybe

14:58 Depends on the service.

14:58 jcromartie: yeah

14:59 specifically a friend had written some code in C# that provided a queue that producers could push onto, and consumers could pop off of

14:59 and the pop operation blocke

14:59 blocked

14:59 a

14:59 anyway half the code was concurrency-juggling

14:59 and it was pretty much the minimum necessary

15:00 so I was interested in a comparison in Clojure, but I'm not sure I even have the right functionality.... blocking on pop is weird

15:00 blocking on pop when the queue is empty, that is

15:00 amalloy: jcromartie: blocking on pop is fine

15:02 the problem is trying to write this at all. just write an infinite lazy sequence of calls to .pop on the same mutable object that producers .push to

15:03 for which you need a blocking .pop primitive, and you'd use something like http://download.oracle.com/javase/6/docs/api/java/util/concurrent/LinkedBlockingQueue.html

15:04 jcromartie: :P amalloy brings it home

15:04 awesome

15:06 amalloy: &(doc seque) is an example you can check out: it uses LBQ from clojure, and i imagine you could copy most of the code

15:06 lazybot: ⇒ "([s] [n-or-q s]); Create a queued eq on another (pre umably lazy) eq . The queued\n eq will produce a concrete eq in the background, and can get up to\n n item ahead of the con umer. n-or-q can be an integer n buffer\n ize, or an in tance of java.util.c... https://gist.github.com/1309838

15:06 headius: why did that line beep forme?

15:07 is there a ^G in there or something?

15:07 amalloy: hahaha. Raynes, did you somehow make doc drop all the 's' chars instead of \s chars?

15:12 &(doc seque) ;; headius, does it still do that?

15:12 lazybot: ⇒ "([s] [n-or-q s]); Creates a queued seq on another (presumably lazy) seq s. The queued seq will produce a concrete seq in the background, and can get up to n items ahead of the consumer. n-or-q can be an integer n buffer size, or an instance of java.util.concurrent... https://gist.github.com/1309865

15:13 headius: lazybot: yes

15:13 er

15:13 something about that line beeps my client

15:16 amalloy: scottj: missed your message re: when-not till now. you around?

15:18 fdaoud: is this *the* headius?

15:18 as in Charles-O?

15:19 headius: fdaoud: one and the same

15:19 amalloy: yes, it still beeped

15:19 fdaoud: well it's an honor, sir :)

15:19 hiredman: ^- amazing what you can do with markov chains

15:19 headius: fdaoud: hah, I dunno about that, but thanks :)

15:21 fdaoud: headius: I was one of the reviewers for your jruby book with the prags - great job on that

15:22 headius: fdaoud: oh, thank you! yes, I think it turned out really well

15:23 fdaoud: headius: it sure did. the only thing I don't like about your book is that it's thicker than mine even though it has less pages. heh

15:23 amalloy: hm. i dunno what the problem is, then. the source file with that doc doesn't contain ^G, and i don't see one in lazybot's log of his output either

15:23 headius: fdaoud: we only use the most premium paper in the JRuby world

15:23 prag books always seem to use a really heavy weight of paper

15:23 fdaoud: headius: yeh either that or they switch to thinner paper past a certain number of pages

15:24 headius: that could be too...consistent thickness would be a weird goal but perhaps not a bad idea

15:25 or different types of books could mean different weights of paper, like pure reference books might use thinner paper

15:25 like the atom-thin paper they use in giant dictionaries

15:25 fdaoud: from the 15 or so books I have, it seems the threshold is around 350 pages past which they switch to the thinner paper

15:27 headius: ahhh

15:29 fdaoud: headius: did you enjoy your experience writing for the prags?

15:29 headius: I did, though it was really hard to focus on it when there was JRuby work to be done

15:30 without Ian the book never would have happened

15:30 fdaoud: heh, yet he is listed last

15:30 Raynes: amalloy: Did I? Really?

15:31 headius: fdaoud: I have no idea why I'm listed first...I think I wrote one appendix and revised some content

15:31 fdaoud: headius: because you are The Man

15:32 amalloy: Raynes: yes. i pushed a fix for you and reloaded

15:32 headius: fdaoud: yeah, but still! :)

15:32 fdaoud: marketing, marketing, marketing, it's all good

15:32 Raynes: Awesome.

15:33 fdaoud: headius: I hear ya, but it's like that, you know, like with "Foreword by <The Man>" even if it's one or two pages, just to put the name on the cover

15:33 headius: yeah I suppose that's true

15:33 fdaoud: headius: I got the creator of Stripes to write a few boxes in my book just so we could put his name on the cover :)

15:36 TimMc: headius: Was just rereading Dune, and there's a part early on where Paul is given the Orange Catholic Bible in a tiny format where electrostatic charge is used to separate pages -- the paper is so thin you can't touch it safely. :-)

15:38 fdaoud: TimMc: safely for you or for the paper?

15:38 TimMc: the paper

15:38 fdaoud: heh

15:38 TimMc: You select which pages to open, and it directs the charge to that pair.

15:38 headius: TimMc: yeah, I remember that part

15:38 TimMc: I had totally forgotten. It's a cute idea.

15:39 headius: I'm finally reading snow crash...bunch of wacky stuff like that in there too

15:40 fdaoud: headius: so tell me what Mr. JRuby/Mirah is doing in Clojure?

15:40 headius: I always idle here to keep clojurists honest

15:41 fdaoud: ?

15:41 headius: just in case they say something about jruby!

15:41 :)

15:41 TimMc: We're all in this VM together.

15:41 headius: no, I like clojure

15:41 fdaoud: like to tell them when they beep the terminal? stuff like that? ;)

15:41 headius: and scala, and mirah, and jython, and fantom

15:41 I don't like groovy, though :D

15:41 fdaoud: yeah, same here (minus scala, hate the syntax)

15:42 TimMc: testing... lazy queued concrete background integer buffer java.util.

15:43 Any beeps there?

15:43 fdaoud: clojurebot: jruby

15:43 clojurebot: Titim gan éirí ort.

15:43 fdaoud: eh?

15:44 May you fall without rising?

15:44 TimMc: I know someone who had "cat" on her IRC highlights list. It drove her nuts (category, cattle, ...) until she figured out what it was (and put \b around it.)

15:47 hiredman: ~clojurebot

15:47 clojurebot: clojurebot has a lot of features, most of which are broken

15:47 hiredman: ~clojurebot |has| a poetic soul

15:47 clojurebot: c'est bon!

15:47 hiredman: ~clojurebot

15:47 clojurebot: clojurebot is not a benchmarking platform

15:47 hiredman: ~clojurebot

15:47 clojurebot: clojurebot is not very good at indicating the difference between a return value and an exception

15:48 amalloy: hiredman: clojurebot factoid DoS here

15:48 hiredman: hmmm?

15:49 amalloy: hiredman: just funny that there were so many entries for clojurebot that you couldn't get him to repeat yours. sounds a little like a DoS, if you tilt your head and squint

15:50 hiredman: I was hoping for the "clojurebot is a cold heartless unfeeling mechanism"

15:50 ~clojurebot

15:50 clojurebot: clojurebot will become skynet

15:52 pjstadig: hiredman: i could say it for you, if you want...

15:53 TimMc: hiredman: It took me like 15 tries in /privmsg to get it.

15:53 Now it won't come around again for ages!

15:59 bhenry: technomancy: or anyone who knows: how can i add an extra-lib dir to the classpath so that i can have jars in there that aren't maintained by lein clean, deps, etc.?

16:01 hiredman: ,(macroexpand '`(~f ~arg))

16:01 clojurebot: (clojure.core/seq (clojure.core/concat (clojure.core/list f) (clojure.core/list arg)))

16:05 amalloy: hiredman: yes, i'm aware you can lose metadata on internal arguments sometimes when you syntax-quote. that's a problem that's rarer, but also harder to fix

16:06 ,(let [f 'inc, arg (with-meta '(inc 1) {:x 1})] (meta (second `(~f ~arg))))

16:06 clojurebot: {:x 1}

16:07 amalloy: eg, in this simple case it's not a problem, but it is if you do crazier stuff. my issue is that macros unintentionally discard meta on their &form, not because ` diesn't "do the right thing" but because they never look at it to begin with

16:08 hiredman: ah, yes, because the resulting form is rewritten away

16:09 amalloy: indeed

16:09 TimMc: bhenry: There's a sample project.clj somewhere...

16:09 hiredman: *shrug*

16:09 bhenry: i remember that. TimMc. i'm toying with the resources dir. this could work for me.

16:10 gah. nope

16:10 Bronsa: how can i find the position of the first non positive value in a vector?

16:10 amalloy: Bronsa: ##(doc keep-indexed)

16:10 lazybot: ⇒ "([f coll]); Returns a lazy sequence of the non-nil results of (f index item). Note, this means false return values will be included. f must be free of side-effects."

16:10 Bronsa: thanks amalloy

16:10 that was fast

16:10 hiredman: the solution to that is to have macroexpansion return an Expr with getJavaType (or whatever method) returning the right thing, but it makes things rather complicated with the compiler

16:11 amalloy: bhenry: technomancy frowns on (with good reason) having jars that aren't managed by maven. it leads to builds that can only be reproduced on a single machine

16:12 bhenry: amalloy: i have a jdbc driver jar that i downloaded from the vendor directly. it is not in clojars or what have you. how can i manage this?

16:12 amalloy: hiredman: it doesn't have to, does it? the compiler can just merge the meta returned by macroexpand with the meta attached to the original macro form itself

16:12 TimMc: bhenry: The resources dir really should work.

16:12 bhenry: There's also :extra-classpath-dirs

16:12 amalloy: bhenry: it's usually in maven central

16:12 hiredman: amalloy: but macros can return forms that don't support metadata

16:13 it could do a check I guess

16:13 amalloy: hiredman: right, which i point out as a problem in my original post

16:13 and suggest doing that check

16:13 tyson2: John McCarthy died last night

16:13 TimMc: bhenry: ...but :resources-path is intended for that.

16:14 hiredman: people keep saying that, but I have yet to see anything on the internet to confirm it outside of a wikipedia link

16:15 tyson2: I guess we'll have to wait for the cellphone video

16:15 TimMc: tyson2: Wiki talk page links to laughingsquid links to HN links to... WP.

16:16 I was just wondering last week if he was still around.

16:20 jcromartie: tyson2: so they say

16:26 semperos: I'm doing interop with a Java lib that takes, as a parameter to a method, a class to construct; if I pass in a Clojure record, it throws an InstantiationException

16:26 the lib first tries .getConstructor, followed by .newInstance if that fails

16:27 any thoughts on how I could make this work?

16:27 hiredman: records don't have 0 arg constructors

16:27 which .newInstance more or less requires (unless you are fiddling with this and that)

16:28 semperos: here's the Java lib's code

16:28 (method called instantiatePage): http://code.google.com/p/selenium/source/browse/trunk/java/client/src/org/openqa/selenium/support/PageFactory.java)

16:28 which does pass in a param to newInstance

16:29 hiredman: right, so you can't do that

16:30 semperos: so if I have a record defined (defrecord Foobar [foo])

16:30 hiredman: can't do that

16:30 semperos: what happens "under the covers" in terms of constructors?

16:30 right, I'm just trying to better understand how records work

16:31 hiredman: semperos: one plus the number of fields, more or less

16:32 actually, I take that back

16:32 it must just be the number of fields

16:32 so possibly [] might work

16:34 something is number of fields + 1, maybe it's fn constructors or something

16:34 semperos: ok

16:36 related question in my playing with classes

16:36 java.lang.Class cannot be cast to [Ljava.lang.Class;

16:36 what exactly is the [Ljava.lang.Class piece?

16:37 hiredman: [ means array, L means reference type

16:37 well, L...; means reference type, the bit in the middle is the name

16:37 semperos: ok, thanks

16:39 broquaint: I'm feeling quite slow - if I have a dependency declared in my lein project.clj and installed (via lein deps) how would I access it at the repl?

16:40 My naive attempt of (use 'fnparse) is failing with java.io.FileNotFoundException.

16:40 amalloy: hiredman: fields+1 for meta

16:40 semperos: broquaint: how are you starting your REPL?

16:41 mefesto: broquaint: did you restart the repl since performing lein deps?

16:41 TimMc: semperos: THe lib is expecting beany classes?

16:41 amalloy: fnparse is not the package name

16:41 broquaint: Aha, indeed, amalloy :)

16:41 hiredman: amalloy: sure, it definitely exposes a fields constructor

16:41 semperos: TimMc: just plain ol' classes

16:42 broquaint: Should've just followed the example instead of trying to be a clever dick :s http://brehaut.net/blog/2011/fnparse_introduction

16:43 brehaut: broquaint: if there are any real bugs in that let me know and i'll fix it

16:44 broquaint: Thanks, brehaut, will do :)

16:46 Raynes: jodaro: Ping.

16:46 amalloy: brehaut: does the garish yellow-orange count?

16:46 brehaut: amalloy: thats a feature

16:47 semperos: calling .getConstructor on a Clojure record that I've defined only allows passing java.lang.Object as the class of the parameter to the record's constructor

16:47 Raynes: brehaut: I actually had to nix your fnparse stuff in lazybot's Clojure plugin.

16:47 brehaut: Raynes: sad

16:47 semperos: even if I add the hint in the defrecord form for the class it should accept

16:47 brehaut: Raynes: was it breaking something?

16:47 Raynes: I was updating to 1.3, and since fnparse is all but abandoned, I figured it wasn't worth it to put effort forth to update it.

16:47 semperos: example: https://gist.github.com/1310181

16:47 brehaut: Raynes: ah :S

16:47 Raynes: Twas a hard decision.

16:47 semperos: that code throws:

16:48 user.MyPage.<init>(org.openqa.selenium.WebDriver)

16:48 [Thrown class java.lang.NoSuchMethodException]

16:48 Raynes: amalloy and I cried as we hit backspace.

16:48 brehaut: Raynes: when parsley has docs i guess i could try recreating it

16:48 jodaro: Raynes: pong

16:58 Raynes: brehaut: More docs than the README? Psh.

16:58 You should be able to get everything you need from a README. Even ones that aren't there. It just happens.

16:58 brehaut: Raynes: im only a simpleton

17:02 aaelony: Hi, I have a deeply nested structure that I'd like to apply destructuring to, but it only seems to work for the top levels. Essentially, for something like (def data {:a {:a1 1 :a2 2} :b {:b1 3 :b2 4 :b3 [{:name "foo" :newValue 5} {:name "bar" :newValue 6}] :b4 7}} )

17:02 I'd like to extract the contents of :b3 and deeper... Simplified example here http://pastie.org/2752755

17:03 any help appreciated..

17:03 I wonder if there is a :keys-in or something...

17:04 Raynes: That'd be too easy,

17:04 pierre1: hey

17:04 aaelony: ...fair enough...

17:04 jamiltron: fnparse is abandoned :( ?

17:04 mefesto: aaelony: (let [{:keys [name newValue]} (get-in data [:b :b3])] [name newValue]) ;; not good enough?

17:04 brehaut: aaelony: (let [{{c :a} :b} {:b {:a 1}}] c)

17:04 pierre1: am I missing the way to get a backtrace in the repl, with clojure 1.3.0?

17:04 Raynes: pierre1: (pst *e)

17:05 pierre1: Raynes++ thanks

17:05 TimMc: (inc Raynes)

17:05 lazybot: ⟹ 6

17:05 Raynes: o/

17:05 aaelony: mefesto, brehaut I'll experiment with those ideas, thanks, that might do it

17:08 brehaut: the parsley docs are way more complete than i recall them being

17:08 there goes the next weekend

17:08 Raynes: brehaut: :)

17:09 brehaut: You could always do this in the meantime: https://github.com/flatland/lazybot/issues/40

17:31 devn: RIP John McCarthy

17:32 Raynes: devn: Is it actually confirmed yet?

17:32 jcrossley3: http://techcrunch.com/2011/10/24/creator-of-lisp-john-mccarthy-dead-at-84/

17:32 Raynes: Well, son of a bitch.

17:33 Eh. They source the HN thread that sources wikipedia that sources HN.

17:33 brehaut: high quality reporting there

17:34 devn: they reference a portugese website on wikipedia

17:34 brehaut: http://g1.globo.com/tecnologia/noticia/2011/10/morre-john-mccarthy-pioneiro-da-inteligencia-artificial.html is the article that WP cites

17:34 devn: ^

17:35 technomancy: if only they had cyclic dependency detection

17:35 devn: The Talk page has friends of the family and a couple of journalists confirming.

17:36 "I spoke to the Associate Director of Communications at Stanford School of Engineering, and Dan Stober of Stanford News Service. Both have confirmed that Professor McCarthy passed away this weekend. They both said there were not a lot of details available at this time. An obituary will be issued by Stanford soon."

17:37 brehaut: that talk page really highlights how farcically anal retentive wikipedia can be

17:37 Raynes: I'm kind of on wikipedia's side here.

17:38 But it is looking good.

17:38 devn: brehaut: yeah it's sad

17:39 brehaut: I've tried to wage a couple of wars by opposing proposed article deletion for very relevant software projects that lots of people know about, but for which there is not a great deal of reporting in...say...the new york times

17:39 the standards for notability is are out of whack in that they dont consider software to be a creative work. i understand why this would be the case for people trying to pimp their crappy winamp clone, but for major projects I've seen deletion proposed and carried out

17:40 brehaut: devn: yeah :/ the best you can hope for is that a special interest group is established and you can point to that groups guidelines for notability rather than the defaults

17:40 devn: perhaps http://en.wikipedia.org/wiki/Wikipedia:WikiProject_Programming_languages ?

17:41 devn: Jobs, Ritchie, McCarthy

17:42 mdeboard: SQL inventor is next

17:43 Don Chamberlin, he's getting up there

17:43 brehaut: mdeboard: oh crap, that'll take out about 100 people

17:43 mdeboard: brehaut: lol

17:47 devn: http://i.imgur.com/Y02DM.jpg

17:48 technomancy: I had that printed out at my desk at my job a couple years ago

17:50 brehaut: i had http://i.imgur.com/1gF1j.jpg on the wall at my last job

17:51 technomancy: brehaut: I think that grid needsmore blank spaces for spots where one group is unaware of the existence of another.

17:52 brehaut: technomancy: thats true

17:52 devn: I just have a picture of Rich on my desk that says: "That is orthogonal."

17:52 not really-- just trying to fit in...

17:53 TimMc: brehaut: Cascading delete?

17:53 brehaut: TimMc: i was thinking design by committee, but sure :)

17:53 devn: lol

17:59 jcromartie: famous people die in clusters of three

17:59 amalloy: brehaut: nice. i'd only seen the version of that chart without lisp/haskell

17:59 brehaut: the terrified cat and the buy a vowel really make it eh

18:00 jamiltron: I don't get why Lisper's view Ruby as Sarah Palin with cleavage, but it certainly scares my coworkers when I start laughing so hard.

18:07 TimMc: Perhaps a sexier version of Java?

18:07 jodaro: that must be it

18:07 and

18:07 brehaut: i think thats the implication

18:07 jodaro: thats not really her cleavage, is it?

18:32 cemerick: holy crud, bad month

18:32 aaelony: I like anonymous map function syntax such as (map #(f %) coll), but am struggling to determine the right way to do 2 or more nested map calls, say for example if each % itself needed a map function applied to it. thanks for any ideas...

18:33 brehaut: aaelony: you cannot have nested #(…) fns, you have to use a (fn […] …) form

18:33 amalloy: aaelony: you probably want to use (for) instead of a map/fn pair anyway, especially if you're nesting

18:34 aaelony: brehaut: I want to learn fn syntax, but somehow can't grasp it. What is the % equivalent in fn syntax?

18:34 brehaut: ,(map (fn [xs] (map #(inc %) xs)) [[1 2 3] [2 3 4]])

18:34 clojurebot: ((2 3 4) (3 4 5))

18:35 brehaut: aaelony: you explicilty name the arguments like you would any other fn

18:35 aaelony: i don't know why that seemed so hard... thanks brehaut

18:35 brehaut: aaelony: and in a real program you would never do #(inc %); you'd just pass inc

18:35 aaelony: amalloy: you're likely right, but I think I need 3 map nestings and then a for (for this particular thing I need now)

18:36 brehaut: aaelony: id write it as (map (partial map inc) [[1 2 3] [2 3 4]]) probably

18:38 raek: aaelony: also consider 'for': ##(for [x (range 3)] (for [y (range 3)] {:x x, :y y}))

18:38 lazybot: ⇒ (({:x 0, :y 0} {:x 0, :y 1} {:x 0, :y 2}) ({:x 1, :y 0} {:x 1, :y 1} {:x 1, :y 2}) ({:x 2, :y 0} {:x 2, :y 1} {:x 2, :y 2}))

18:38 aaelony: using partial would be great... I can get what I want in a big let statement asking directly for a key at a time, but I'd like to grab a destructured vector of values from the keys... still getting there...

18:39 raek: I'll explore that more as wlel

18:39 well

18:39 raek: ,(let [{[a b] :foo} {:foo [1 2]}] [a b])

18:39 clojurebot: [1 2]

18:41 raek: aaelony: to do nested destructuring that includes maps, use the underlying destructuring syntax {a :a, b :b} instead of the shorthand {:keys [a b]}

18:41 aaelony: yeah, unfortunately :keys didn't work past the top level

18:41 raek: the symbols a and b in the first one can be replaced with other destructuring

18:42 aaelony: I've also got a vector of maps well into the 3rd nesting

18:42 raek: :keys is just a shorthand for when the thing you want to bind has the same name as the keyword

18:42 aaelony: yes

18:42 raek: which is not the cae if the thing you want to bind is a destructuring form

18:43 aaelony: yes

18:43 raek: if you are just interested in a single value, you can use get-in or ->

18:43 aaelony: actually I need a list of values

18:44 selected values (usually 2 or 3) from each nesting level

18:44 raek: you can also have multiple rows in a let to make this less messy

18:45 aaelony: ok

18:46 essentially I have a large amount of "records" which are the maps in a vector. Each "record" has the frightening amount of nested nestings. Anyways, it should be fun... ;)

18:54 jodaro: hah!

18:55 "i need to get the first of the first"

18:55 "theres a function for that! ffirst"

18:55 so rad

18:55 gfredericks: $findfn [[8 7] [3 4]] 8

18:55 lazybot: [clojure.core/ffirst]

18:55 amalloy: dang gfredericks, out-typed me

18:55 gfredericks: amalloy: you shouldn't have tried to do six-element lists

18:56 amalloy: gfredericks: i was going for infinite

18:56 gfredericks: yeah that takes a while

18:56 amalloy: $findfn (for [x (range)] (for [y (range)] y)) 0

18:56 lazybot: Execution timed out.

18:56 amalloy: haha ouch

18:57 gfredericks: hmmm

18:57 $findfn (repeat (iterate inc 0)) 0

18:57 lazybot: java.lang.OutOfMemoryError: Java heap space

18:57 gfredericks: golly

18:58 lazybot doesn't seem very lazy...

18:59 brehaut: gfredericks: thats trying every function in the lib, imagine seq or vec or something on that expression

18:59 gfredericks: brehaut: that there is a perfectly compelling explanation.

19:01 amalloy: brehaut: well, i think i changed the timeouts so that this is less of a problem

19:01 $findfn 0

19:01 lazybot: [clojure.core/+ clojure.core/+' clojure.core/release-pending-sends]

19:02 amalloy: hm. that's not a very instructive example of what i meant

19:03 anyway it's supposed to work out to each individual function only getting like 100ms, in addition to the whole thing getting only 10s. so in theory you can get findfn results for infinite sequences, as long as only a couple dozen functions fail to terminate

19:17 technomancy: I wonder if it would be possible to make a generic lazy-seq -> rest pagination library.

19:17 I guess the problem is that drop on a lazy seq causes all the dropped elements to be realized, whereas in pagination you truly want those elements simply skipped.

19:19 hiredman: IDrop

19:24 technomancy: somethnig like that

19:55 seancorfield: what is the current received wisdom on aquamacs vs regular emacs on os x?

19:55 brehaut: regular emacs i believe

19:55 technomancy: GNU Emacs is supported, forks are not.

19:55 brehaut: http://emacsformacosx.com/

19:55 hiredman: aquamacs is dumb

19:55 technomancy: reports of success remain unverified

19:56 dnolen: Aquamacs works fine last time I checked. Easier for newbies.

19:57 seancorfield: i thought i'd seen a couple of the clojure/core folks using aquamacs?

19:57 brehaut: seancorfield: emacsformacosx builds support cocoa, so have open dialogs and standard mac keys bound

19:57 seancorfield: ah, ok

19:57 technomancy: I've heard reports of aquamacs bundling an incompatible version of slime.

19:57 hiredman: brehaut: but missing the fullscreen patch

19:57 brehaut: hiredman: sadly :(

19:58 seancorfield: hiredman: so what do you think is the best version of emacs for os x?

19:58 brehaut: hiredman: im running emacs in fullscreen terminal in the interim

19:59 hiredman: seancorfield: emacsformacosx is fine, for the best you need to find a build with the fullscreen patch or build it your self

19:59 seancorfield: 'k

20:06 dnolen: seancorfield: rhickey uses it

20:10 scgilardi: I use terminal-based emacs 24 built infrequently from the development head with iTerm2 as the terminal. I also use cmd-key-happy to swap cmd and option for most functions, but preserve cmd-H as Hide iTerm.

20:11 brehaut: i have heard a rumour that homebrew has support for the fullscreen patch for cocoa emacs

20:12 but i dont use it myself

20:12 hiredman: they have a -- flag that does nothing

20:12 brehaut: fantastic

20:12 hiredman: like --with-fs-patch or something, but it doesn't do anything

20:20 jamiltron: I'm wondering if I can get some help with my lwjgl project. Specifically I want to figure out what I'm doing wrong that's making the animation so blurry: https://github.com/jamiltron/brickhit

20:21 I'm using slick-util to load a texture, but when I draw it using lwjgl its coming up all blurry. I realize I should probably ask on their forums but I was thinking I might try for someone who can read Clojure first.

20:24 devn: Building emacs 24 from source with the fullscreen patch is not too difficult

20:25 it takes a bit of googling to find the patch, but it has continued to apply cleanly without issue

20:26 jamiltron: im not sure I can be of help, but where am I looking in this repo?

20:27 Raynes: devn: Pretty sure the patch is in Emacs common now.

20:27 devn: Raynes: good to hear

20:27 Raynes: s/common/proper/

20:28 I'm not using it though -- I don't have it in me to pull the repo.

20:28 devn: heh -- yeah, it's exhausting making machines fetch ;)

20:29 * devn looks over cljs commits for the next hour starting...now

20:31 simard: is there a function like partial that would bind arguments from right to left instead of left to rigth ?

20:31 right

20:33 devn: simard: you could just grab the source and make your own reverse partial

20:33 simard: why do you need a reverse partial?

20:35 simard: devn: maybe it's just me, but I find that when using protocols, the function expecting to be passed the object as a first argument forces that

20:35 did that make sense ?

20:37 devn: simard: im not sure what you mean. Could you post a code example?

20:37 simard: devn: in the making

20:37 devn: (to gist.github.com or something)

20:37 brehaut: im sure you could use a horrific point free mess of comp partial, apply and reverse

20:37 jamiltron: devn: the util.clj draw function is a good start

20:37 brehaut: ,((comp (partial apply vector 1) reverse (fn [& args] args)) 1 2 3)

20:37 clojurebot: [1 3 2 1]

20:37 jamiltron: devn: sorry for the delay

20:38 devn: simard: does what brehaut posted help you out?

20:39 brehaut: i hope not :P

20:39 simard: I kinda have that same hope

20:39 wait a minute, I'm writing a sample

20:40 devn: brehaut: lol why do you say that?

20:41 brehaut: devn: you mean other than the attempt at todays greatest abuse of point free award (it'll only get runner up though; no juxt)?

20:41 devn: oh man -- dont get me started on juxting

20:41 juxting is some of the most fun a lad can have

20:41 (or lady for that matter)

20:41 * brehaut <3 pointfree

20:45 devn: ,((juxt + max min) 2 3 5 1 6 4)

20:45 clojurebot: [21 6 1]

20:46 devn: brehaut: i've always loved that one

20:47 amalloy: brehaut: earlier today i wrote (((partial juxt inc) dec) 5) to annoy someone: do i win a prize?

20:47 brehaut: ooh maybe

20:47 simard: https://github.com/gsimard/junk/blob/master/junk.clj

20:48 brehaut: devn: my favorite point free is main = interact $ show . head . (foldr1 $ \t b -> zipWith (+) t $ zipWith max b $ tail b) . (map $ (map read) . words) . lines

20:48 (project euler 18)

20:48 simard: ok, so that is what I needed, and I'm probably just at the corner of getting it right

20:48 devn: haskell is hard to read on IRC.

20:49 simard: although I'm more concerned about the very reason I need it, more than how to achieve it

20:49 devn: Although I think I once felt that way about clojure. lack of familiarity

20:49 brehaut: lets be honest, that one doesnt get much clearer out of irc

20:49 devn: heh

20:49 amalloy: brehaut tells it like it is

20:49 * devn trusts brehaut

20:50 amalloy: brehaut: what's this foldr1 thing?

20:50 brehaut: its a right fold

20:51 the 1 means that you dont pass the initial value, it takes it from the list

20:51 amalloy: ah

20:51 devn: foldr (+) 5 [1,2,3,4] => 15

20:51 brehaut: because variadic functions in haskell requires some serious work

20:51 devn: foldr1 (+) [1,2,3,4] => 10

20:51 amalloy: well now that i know what foldr1 is the whole snippet makes perfect sense...

20:53 zerokarmaleft: jamiltron: hmm, collision detection seems to be wonky sometimes

20:53 brehaut: amalloy: http://www.4clojure.com/problem/solutions/79 ;)

20:54 devn: I have 30 tabs open in chrome.

20:54 * devn boggles

20:54 jamiltron: zerokarmaleft: yeah, collision detection and edge detection are pretty crappy right now, I mostly was trying to get something working for proof-of-concept

20:55 amalloy: wow, my solution to that is terrible

20:55 jamiltron: zerokarmaleft: right now I'm mostly wondering if my GL11 functions are 'right'

20:58 technomancy: devn: http://i.imgur.com/utsSX.png

20:59 brehaut: gold

21:00 devn: technomancy: hahaha

21:00 Does anyone know if there's a chrome extension to force a limit to the number of tabs?

21:01 https://chrome.google.com/webstore/detail/kjecajkoiikaohhagojedcphegkcfobm

21:01 amalloy: sudo apt-get remove google-chrome

21:01 that would probably do it

21:03 devn: ha! how nice. as soon as you install "No More Tabs", it just removes a bunch of your tabs.

21:03 brehaut: blunt

22:00 seancorfield: technomancy: i'm trying to follow your starter-kit instructions...

22:01 i installed emacs 24.0.90

22:02 i edited ~/.emacs.d/init.el as shown on your github page https://github.com/technomancy/emacs-starter-kit

22:02 but when i try to do package-install, it says starter-kit has no match

22:02 what obvious step am i missing?

22:03 duck1123: seancorfield: try package-list-packages

22:03 simard: seancorfield: did you refresh ?

22:04 M-x package-refresh-contents

22:05 seancorfield: seems to take a long time to contact tromey.com:80

22:05 simard: seancorfield: you didn't evaluate the 3 other lines

22:05 seancorfield: ?

22:05 simard: the require, add-to-list and package-initialize

22:06 seancorfield: that's in init.el per technomancy's instructions

22:06 simard: should be evaluated, if you're not restarting emacs

22:06 seancorfield: i restarted emacs just to be sure

22:06 simard: evaluate them just to be sure then .. :)

22:08 seancorfield: done

22:08 simard: ie.: go at the end of their parenthesis, type C-x C-e, for all 3 lines

22:08 and then M-x refresh

22:08 and install

22:09 seancorfield: yup, done all that, several times

22:09 well, i'll be blowed... this time it actually worked!

22:10 now it's busy installing stuff and compiling it

22:10 bunch of warnings but it seemed to finish correctly

22:10 simard: well, there you go then

22:11 duck1123: you can pretty much ignore the warnings

22:18 seancorfield: to save me going insane, if you split a window horizontally, how do you unsplit it? so far figuring that out has defeated all my attempts :)

22:18 simard: C-x 0

22:18 seancorfield: ah...

22:18 simard: on the window you don't want to keep

22:19 duck1123: or C-x 1 if you want to get rid of them all

22:19 seancorfield: thank you!!! i couldn't find that anywhere!

22:19 c-x 1 i knew about (from the tutorial)

22:19 brehaut: seancorfield: you know about the terms window and frame in emacs lingo ?

22:19 simard: yeah, you're up for some learning curve there. but it's well worth it IMHO

22:19 seancorfield: delete-window... i never would have guessed... *sigh*

22:20 i haven't touched emacs for about 20 years

22:20 archaic: if you need to find something, usually c-h a will find it

22:20 ie c-h a 'window'

22:20 would find c-x 0

22:20 brehaut: seancorfield: i spent ages trying to find revert-buffer

22:21 seancorfield: one of my teammates has rejected eclipse + ccw and is trying all sorts of text editors... i have a little netbook (as well as my big imac) and eclipse is a bit bloaty on that so i'm giving emacs another try...

22:21 ok, off to watch TV and do stuff on the netbook

22:21 thank you!!

22:21 brehaut: seancorfield: its a good time to get back into emacs for clojure i think

22:23 brandel: I know I would benefit from using emacs, but I've been using vim for over 10 years.. suspect it would be difficult to get used to

22:24 simard: brandel: you know about viper-mode right ? :)

22:24 brandel: nope?

22:24 duck1123: brandel: it's well worth the investment

22:24 simard: it's a vi emulation layer for eamcs

22:24 emacs*

22:25 start emacs, M-x viper-mode

22:25 brandel: oh.. does it work reasonably well?

22:25 simard: no idea :)

22:25 you tell me

22:25 brandel: fair enough! I will investigate

22:25 brehaut: you too can migrate from one archaic editor to another ;)

22:25 brandel: cheers simard

22:25 hahah

22:25 duck1123: Although, using vim keybindings in emacs is kinda missing the point

22:26 simard: brehaut: what do you use youself ?

22:26 brehaut: the old shoggoth, emacs

22:26 and textmate (but not for clojure, yikes)

22:26 duck1123: an ancient, great power

22:26 brandel: duck1123: my brain is wired for vim, but I guess it's never too late to teach an old dog new tricks

22:26 brehaut: ive recently reverted

22:27 simard: http://brehaut.net/blog/2011/marcel

22:27 i do want to give eclipse and ccw 0.4 a crack

22:27 duck1123: lately, I've been loving how many of the emacs bindings work in the terminal

22:28 brehaut: duck1123: and work system wide in the mac

22:29 duck1123: don't get me started on the mac, too many lost windows when all I wanted to do was copy some text

22:30 brandel: I would be a lot happier with the mac if I could have something like xmonad/awesome

22:30 duck1123: I would settle for Compiz's put plugin

22:30 brehaut: brandel: emacs in a full screen terminal ;)

22:31 archaic: no, you dont want viper mode, you want emacs-evil mode i contendt that it is BETTER than vim at vim.. and I used vim for along time.. . repeat works flawlessly, visual blocks, macros etc everything is there + you get all emacs commands + you can create new modes pretty simply

22:31 brandel: hah yeah, my ghetto tiling wm emulation is screen in a full screen terminal

22:31 archaic: seriously

22:31 if you use vim..

22:31 duck1123: brehaut: that's how I work when I'm on the mac

22:31 archaic: you want that

22:31 brandel: how emacsy is that? there are two vim emulation modes? O.o

22:32 duck1123: I'm still upset there's no good WM in java that I can hook clojure up to. (ala. StumpWM)

22:32 brandel: but thank you archaic, that sounds excellent

22:32 jodaro: it does everything. even other editors.

22:32 brehaut: duck1123: just go learn rep and use sawfish ;)

22:33 sean_corfield: ok, on the netbook now so expect more emacs questions :)

22:34 brehaut: my burning emacs question is how do i step back through previous expressions in the swank repl?

22:34 slime?

22:34 clojurebot: slime-installer is http://github.com/technomancy/clojure-mode/blob/0f28b61de90ce8a09d75bf1668ef3f1c200f9c52/clojure-mode.el#L560

22:34 duck1123: M-p

22:35 brehaut: and M-n to go down i see.

22:35 (inc duck1123)

22:35 lazybot: ⟹ 2

22:36 duck1123: If you start typing an expression, then do M-p, it'll find expressions that match

22:36 brehaut: excellent

22:36 does C-r work similarly?

22:37 zerokarmaleft: what's the deal with paredit advancing out of the outermost sexp when closing a square bracket?

22:37 only happens when i'm in a slime buffer

22:38 duck1123: zerokarmaleft: so when it's done, is it still well-formed?

22:38 scottj: zerokarmaleft: you probably have ] bounded to paredit-close-parenthesis instead of paredit-close-square

22:39 duck1123: brehaut: C-r searches in the buffer, but if you enter on that line, it'll paste it

22:39 brehaut: duck1123: excellent, thanks :)

22:39 zerokarmaleft: duck1123: well no, e.g. (defn foo [x])

22:39 scottj: checking, i've been messing around with keybindings lately

22:40 duck1123: brehaut: didn't actually have a repl running yet...

22:40 zerokarmaleft: scottj: nope, only rebound the slurp and barf commands

22:41 scottj: zerokarmaleft: go into repl or wherever this is happening and do C-h k ]

22:41 zerokarmaleft: it's bound to paredit-close-square

22:43 scottj: but when you type ([] you get ([])| instead of ([]|)?

22:43 duck1123: zerokarmaleft: could you show what it looks like before and after

22:43 zerokarmaleft: scottj: right, except paredit fills in the closing paren before i start the square brackets

22:44 1. (|) 2. ([|]) 3. ([])|

22:45 duck1123: zerokarmaleft: same thing is happening to me

22:45 zerokarmaleft: works fine when i'm just editing a file buffer though

22:45 maybe i borked my slime hook

22:46 duck1123: I bet it has something to do with slime considering the expression complete

22:53 archaic: if there a function that does this?: apply function to the values of a map whos keys pass a predicate

22:55 sean_corfield: for emacs 24 on ubuntu, what's the recommended source?

22:55 duck1123`: archaic: you could use map and filter

22:55 brehaut: ,(keep (fn [[k v]] (when (odd? k) (name v))) {1 :a 2 :b 3 :c}) ; archaic ?

22:55 clojurebot: ("a" "c")

22:56 sean_corfield: i found damien cassou's PPA for emacs-snapshot

22:56 other emacs 24 options on ubuntu 11.10?

22:58 brehaut: ,(for [[k v] {1 "foo" 2 "bar" 3 "baz"} :when (odd? k)] (.toUpperCase v)) ; archaic, alternatively

22:58 clojurebot: ("FOO" "BAZ")

22:58 archaic: i was thinking more (fn.. {1 10 2 10 3 10} even? inc) -> {1 10 2 11 3 10} ill write it i guess

23:05 duck1123`: ,(into {} (map (fn [[k v]] [k (if (even? k) (inc v) v)]) {1 10 2 11 3 10}))

23:05 clojurebot: {1 10, 2 12, 3 10}

23:06 duck1123`: well, that would've worked better if I had the inputs right

23:08 amalloy: zerokarmaleft: i think the slime repl doesn't know about clojure's syntax by default, doesn't know ] is a close-paren

23:09 duck1123`: does paredit use language-specific rules

23:09 amalloy: i haven't put a great deal of effort into getting paredit in the repl, but you can give it the right syntax table with (add-hook 'slime-repl-mode-hook (lambda () (interactive) (set-syntax-table clojure-mode-syntax-table)))

23:10 archaic: duck: thx, what I came up with abeit later :)

23:30 sean_corfield: sorry for all the quit/joins... netbook needed a major update and now i have emacs 24.0.90 on ubuntu 11.10

23:31 semperos: I've defined record as follows: https://gist.github.com/1311216

23:32 I need to refer to the WindowHandle class directly at a later point, so I try to (:import clj_webdriver.window_handle), but to no avail

23:32 what am I doing wrong?

23:34 sean_corfield: hmm, that went a lot more smoothly on ubuntu than on os x... ok, now i have the starter kit installed, how do i tie into a repl? :)

23:35 archaic: using lein or cake?

23:35 brehaut: sean_corfield: open a buffer in a project and type M-x clojure-jack-in ?

23:35 duck1123`: semperos: try clj-webdriver.WindowHandle

23:35 sean_corfield: alternately, lein swank and M-x slime-connect

23:36 sean_corfield: lein

23:36 zerokarmaleft: amalloy: that works great, thanks!

23:36 sean_corfield: brehaut: no match on M-x clojure-jack-in

23:37 brehaut: sean_corfield: have you followed the instructions here https://github.com/technomancy/swank-clojure ?

23:37 sean_corfield: lein swank is not a task :)

23:37 brehaut: no, i just did the starter-kit stuff

23:37 brehaut: lein plugin install swank-clojure 1.3.3 :)

23:38 sean_corfield: thx

23:38 brehaut: (dont run the smily face on the command line)

23:38 spoon16: is there a way to kill a running command at the lein repl without killing the whole process?

23:39 sean_corfield: wow, that's a lot of reflection warnings (lein swank)

23:40 ok, i don't have slime-connect either in emacs

23:40 semperos: you tried M-x slime-connect ?

23:40 sean_corfield: so how do i get clojure-jack-in and/or slime-connect

23:41 i assumed the starter-kit would give me everything i needed since it was from technomancy :)

23:41 brehaut: do you have start-kit-lisp in your packages ?

23:41 err starter-kit-lisp

23:41 zerokarmaleft: spoon16: afaik, no...it's wise to set *print-length* and *print-level* to sane values

23:41 sean_corfield: brehaut: doesn't that get installed as part of the starter-kit?

23:41 it's no wonder folks get frustrated trying to set up emacs...

23:41 brehaut: sean_corfield: nope, each language has a sub starter kit that you set up explicitly

23:42 sean_corfield: to be fair, this stuff is in the readme for the starter kit v2

23:45 sean_corfield: ok, installed starter-kit-lisp and still no slime-connect so wtf do i get that? *frustrated*

23:45 brehaut: im confused now

23:45 cause i think thats all i did

23:47 archaic: can you do m-x clojure-mode?

23:48 sean_corfield: *sigh* no...

23:48 it looks like the lisp starter kit is NOT installed

23:49 jeez, this is a pain

23:49 mintsoup: if you're just trying to get clojure support in slime, why not just follow the instructions for swank-clojure? it's about as simple as it gets

23:49 technomancy: haha; holy crap.

23:49 brehaut: have you done a M-x package-refresh-contents ?

23:49 technomancy: clojurebot: forget slime-installer |is| http://github.com/technomancy/clojure-mode/blob/0f28b61de90ce8a09d75bf1668ef3f1c200f9c52/clojure-mode.el#L560

23:49 clojurebot: I forgot that slime-installer is http://github.com/technomancy/clojure-mode/blob/0f28b61de90ce8a09d75bf1668ef3f1c200f9c52/clojure-mode.el#L560

23:49 technomancy: seancorfield: on the elisp side all you need is clojure-mode; just one file.

23:49 * technomancy catches up

23:50 brehaut: technomancy disappears for an hour and #clojure becomes #emacs-cargo-cult

23:50 semperos: lol

23:51 I second mintsoup's suggestion to just follow the instructions here, if the rest is getting too complex: https://github.com/technomancy/swank-clojure

23:51 sean_corfield: technomancy: so i followed the instructions as best i could from your starter-kit

23:51 technomancy: brehaut: did cemerick start a trend? =)

23:51 sean_corfield: it wasn't clear that i needed to ALSO install the lisp starter-kit

23:51 brehaut: lol

23:51 sean_corfield: i thought i'd installed that but...

23:51 brehaut: technomancy: i switched to emacs before it was cool :P

23:52 technomancy: sean_corfield: hm; I'll see if I can make it clearer in the readme that the separate modules are installed on their own

23:52 zerokarmaleft: huh, didn't know about clojure-enable-paredit

23:52 sean_corfield: i followed your instructions for init.el but none of that code seems to execute

23:53 i added the code to set up starter-kit, starter-kit-lisp etc and it doesn't execte

23:54 technomancy: seancorfield: is it possible you have a ~/.emacs file? that takes precedence over ~/.emacs.d/init.el

23:54 sean_corfield: brehaut: i was using emacs 20 years ago... version 17 in fact... but i haven't touched it for nearly 20 years

23:54 (and now i remember why! :) )

23:54 brehaut: sean_corfield: lets be honest, emacs has never been cool ;)

23:54 so technically we are all using it before it was cool

23:55 sean_corfield: no, i have no .emacs file

23:55 just .emacs.d/init.el

23:55 daaku: is there an easy way to map over the values in a map while maintaing the keys? i'm already at (apply hash-map (flatten (map.. and it doesn't seem right

23:56 brehaut: (into {} (map … )

23:56 )

23:57 daaku: brehaut: ah, perfect

23:57 thanks

23:57 technomancy: sean_corfield: you can just do M-x package-install starter-kit-lisp

23:58 sean_corfield: let me try that...

23:58 ok, it complained that already exists...

23:58 spoon16: is the appropriate way to take from the front of a stinrg (apply str (take 3 "abcdefg"))?

23:59 brehaut: ,(.substring "abcdefg" 0 3)

23:59 clojurebot: "abc"

23:59 brehaut: or (subs "abcdefg" 0 3)

Logging service provided by n01se.net