#clojure logs

2011-10-24

00:22scottjwhy does str have to be namespaced in https://github.com/clojure/clojurescript/compare/bfc2f32c53...3c83c62d97 but when-not doesn't?
01:00amalloyscottj: 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
01:01amalloyie, 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
02:18daakuis there a syntax for destructuring to bind the "rest" args at head instead of the tail?
02:39scottjamalloy_: 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?
03:26Blktgood morning everyone
03:29Raynesjodaro: Ping.
03:32michaelr525Blkt: morning!
03:33Blkt:D
04:09tsdhIs 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.
04:14patchworkSuddenly when I try to load my project I get a mysterious "Unable to resolve symbol print-doc in this context". java.lang.RuntimeException?
04:14patchworkI'm sure I'm not calling print-doc anywhere
04:14patchworkwhere do I begin to debug this?
04:15hiredmanyou have a (doc ...) somewhere
04:15patchworkThe stacktrace just shows a deep nesting of compiler calls
04:15patchworkhiredman: not in my project?
04:16patchworkyeah, just grepped the whole thing
04:16patchworkI don't have a single occurrence of the string "doc"
04:16patchworkanywhere
04:16patchworkSo it is in one of my dependencies then?
04:20patchworkcould something like this cause it?
04:20patchwork(ns #^{:author "Roman Scherer" :doc "Rails-like inflections for Clojure."}
04:20patchworkThis is the only doc I see in the library
04:43patchworkYeah it is definitely when I try to require this library:
04:43patchwork[geocoder-clj "0.0.3-SNAPSHOT"]
04:45Raynespatchwork: In Clojure 1.3, print-doc was moved to clojure.repl and made private. Sounds like geocoder hasn't been updated.
04:46RaynesHuh. I guess it was.
04:46patchworkSo, 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.
04:46Raynespatchwork: Could you gist the whole stacktrace?
04:47RaynesThat'll be really helpful.
04:47patchworkI would just fix it myself
04:47patchworkRaynes: sure
04:48patchworkHere you go: https://gist.github.com/1308615
04:49patchworkthis 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!
04:49patchworkIs there an accepted way to scry into these?
04:50Raynespatchwork: If you look through it, you'll see a line that starts with "geocoder" and shows the line that this occurs.
04:50RaynesIt appears to happen when it loads infections. Infections might be the culprit.
04:50RaynesI'm checking.
04:50clgvpatchwork: printing only the lines of the stacktrace with clj-files in gives a good overview.
04:50patchworkSo, this line?
04:51patchwork64: inflections.core$eval7491$loading__4505__auto____7492.invoke(core.clj:1)
04:51patchwork 65: inflections.core$eval7491.invoke(core.clj:1)
04:51RaynesYes.
04:51patchworkSo that is in line 1 of core.clj
04:51patchworkalright
04:51RaynesYes, the 'ns' declaration.
04:51patchworkwhich means probably when it is requiring yet another library
04:52Raynesinflections* haha, infections.
04:52patchworkI know, I just let it go : )
04:52patchworkIt could be considered an infection I guess
04:52patchworkinflections, taking over our systems
04:53RaynesApparently.
04:53RaynesLooks like it's on 1.3 as well.
04:53patchworkpluralizing singular things
04:53patchworkYeah, that is what I thought
04:53patchworkthe code seems fine
04:53patchworkwho is calling print-doc here?
04:54patchworkcould it be swank somehow?
04:54patchworkI am calling through swank
04:54RaynesI don't know. Does this happen outide of slime?
04:54patchworkI'll try just the repl
04:54RaynesYeah, I noticed.
04:54RaynesHeh, you're a quarter inch ahead of everything I say.
04:54patchworkhappens in the repl too
04:55RaynesIs the trace the same?
04:55patchworkYep
04:55patchworkCompilerException java.lang.RuntimeException: Unable to resolve symbol: print-doc in this context, compiling:(clojure/contrib/ns_utils.clj:67)
04:55RaynesAha!
04:55RaynesSomething is using clojure-contrib.
04:55patchworklooks like it is calling contrib?
04:55patchworkoh man
04:55RaynesFind that and you've found the problem.
04:56patchworkWell, how do I find that?
04:58RaynesI'm not sure. Doesn't look like any of these projects use contrib.
04:58Raynespatchwork: 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.
04:59RaynesBut the ns that is requiring it in the first place should be in the stacktrace.
04:59RaynesGood luck.
05:00patchworkYep, thanks Raynes
05:01patchworkAha, clojure.contrib is in there
05:01patchworksneaky bastard
05:28fbru02Hi all , how can i tie in -> with a fn like re-seq?
05:30Raynesfbru02: You'd like to thread the seq in, but the argument order doesn't match up?
05:30RaynesIf possible, use ->>. It threads it as the last argument in each form.
05:30RaynesIf that isn't possible, you should probably consider not using either of these forms at all, or using them in a different way.
05:31fbru02Raynes: nice !!! thanks
05:31Rayness/seq/string/
05:56AWizzArd2How do I get the docstring of a NS?
05:59AWizzArd2Ah okay: (clojure.repl/find-doc "my.ns")
06:00raekAWizzArd2: there's also (print-namespace-doc 'my.ns)
06:01AWizzArd2Ah nice, didn't know that one.
06:01AWizzArd2In what NS do I find this fn?
06:01raekin clojure 1.2 it's in clojure.core
06:01RaynesAWizzArd2: Just plain clojure.repl/doc is supposed to work for namespaces.
06:05AWizzArd2Raynes: I tried doc, but that didn't work for me.
06:05AWizzArd2,(clojure.repl/doc clojure.repl)
06:05clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.lang.ClassNotFoundException: clojure.repl>
06:05AWizzArd2$(clojure.repl/doc clojure.repl)
06:06Raynes&(clojure.repl/doc clojure.repl)
06:06lazybotjava.lang.ClassNotFoundException: clojure.repl
06:06RaynesDuh. I forgot -- replaced the doc macro with my own.
06:06RaynesAWizzArd2: http://clojuredocs.org/clojure_core/clojure.repl/doc Look at the source.
06:06AWizzArd2Anyway, try that in your local repl, it will not work there too.
06:07RaynesIt works fine.
06:07RaynesJust tried it.
06:08AWizzArd2Raynes: I get the same error message that the clojurebot gave.
06:08AWizzArd2For {:major 1, :minor 3, :incremental 0, :qualifier nil}.
06:08raek,(require 'clojure.repl)
06:08clojurebotnil
06:08AWizzArd2find-doc works though
06:08raek,(clojure.repl/doc clojure.repl)
06:08clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.lang.ClassNotFoundException: clojure.repl>
06:09AWizzArd2raek: in 1.3 this is not in clojure.core anymore.
06:09AWizzArd2This print-namespace-doc I mean.
06:09AWizzArd2,(clojure.repl/doc clojure.core)
06:09clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.lang.ClassNotFoundException: clojure.core>
06:09AWizzArd2,(clojure.repl/find-doc clojure.core)
06:09clojurebot#<CompilerException java.lang.RuntimeException: java.lang.ClassNotFoundException: clojure.core, compiling:(NO_SOURCE_PATH:0)>
06:10AWizzArd2,(clojure.repl/find-doc "clojure.core")
06:10clojurebot-------------------------
06:10clojurebotclojure.core/extend-protocol
06:10clojurebot([p & specs])
06:10clojurebotMacro
06:10clojurebot Useful when you want to provide several implementations of the same
06:10clojurebot protocol all at once. Takes a single protocol and the implementation
06:10clojurebot of that protocol for one or more types. Expands into calls to
06:10clojurebot extend-type:
06:10clojurebot (extend-protocol Protocol
06:10clojurebot AType
06:10clojurebot (foo [x] ...)
06:10clojurebot (bar [x y] ...)
06:10clojurebot BType
06:10clojurebot (foo [x]...
06:10RaynesAnd this is why you don't let bots send a message for each line of output.
06:11AWizzArd2;-)
06:11AWizzArd2At least it was so nice to stop, and didn't print out all docstrings *g*
06:11RaynesAlso, I had a clojure 1.2.1 repl open, so disregard what I said.
06:11AWizzArd2In 1.2.x I also used plain doc.
07:02AWizzArd2$seen rhickey
07:02lazybotrhickey was last seen quitting 1 week and 2 days ago.
09:20fastaSuppose 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?
09:20etnt`anyone knows of any Minecraft plugins that has been written in Clojure?
09:21fastaE.g. vanilla Scheme used 'load' for its modules, which also doesn't scale to large system development.
09:22fastaIn Smalltalk, a change is applied in the order of microseconds if not less.
09:23fastaDoes Clojure does something 'smart' or is it working in some naive way?
09:23fastado*
09:35morphlingfasta: definition of what?
09:35fastamorphling: of some new function.
09:37morphlingfasta: 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
09:37fastamorphling: but how much is recompiled?
09:38morphlingfasta: whatever you tell it to compile
09:39fastamorphling: but don't you get the problem then that you have to keep track of what it already has compiled and what not?
09:39fastamorphling: CL has that problem, which is why the Racket people came up with a different solution./
09:40morphlingfasta: 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?
09:41morphlingfasta: 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
09:42michaelr525i think what he is asking is whether the loading of all the stuff that's been recompiled is performed atomically?
09:43michaelr525or that's what i am asking :)
09:44mrsipanhave anyone tried to use vimclojure with clojurescript repl?
09:45mrsipanhas*
09:46fastamorphling: how long does compiling a namespace generally take? Milliseconds?
09:46kzarAny 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
09:46duck1123michaelr525: require has a :reload and :reload-all flag that you can use to reload the required namespaces. Is that what you're asking?
09:46fastaI just want to know how fast it is.
09:46fastaE.g. C++ compilation is extremely slow because of linking too.
09:46duck1123fasta: that's highly dependant on what you're loading
09:47morphlingmichaelr525: I don't know, but i would guess it's not
09:48fastaduck1123: in a good implementation it is O(number of changes).
09:48fastaOr perhaps O(number of changes * lg n)
09:49michaelr525well, i imagined loading new code into a running system but maybe it's beyond the subject of this discussion :)
09:49kzar(defpage "/" [] (redirect "/index.html")) works but it's makes the URL ugly
09:55fastamichaelr525: I would be interested in the semantics of that also.
09:57duck1123fasta: Assuming that all of your required namespaces are loaded, reloading the namespace should be as fast as evaling every form in that file
09:57duck1123which should be pretty fast
09:57morphlingfasta: 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
09:58carki don't see why it would be strongly discouraged
09:58carkyou may do interactive developement then do AOT compiling to get an end-product
10:00morphlingcark: because it does not work accross clojure versions. ok let me rephrase: it is strongly descouraged for almost everything besides end-user deployment
10:01carkso "everything" means development i guess ?
10:01carksorry i'm nitpicking
10:02morphlingcark: especially libraries you want others to use, or reuse yourself
10:02carkbut i wouldn't want people to get the wrong impression about clojure "not being fit for compilation"
10:02carkwell, when i get a clojar, it's compiled
10:02duck1123The only time you should really need to AOT compile is when you need to genclass for use within a java app
10:03morphlingcark: it should not be
10:03morphlingcark: you can load source code from jar files
10:04carkmy 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:06carkif you go mostly without AOT, you may have some bad surprises
10:06duck1123aot is good for checking everything. I keep a commented out aot line in my project
10:06carki remember trying to use one of those nice matching libraries, it was doing fine in the repl, and breaking when AOT compiled
10:07carkthough i believe the author was working on fixing that =)
10:09morphlingcark: what can you do that breaks aot compilation?
10:09carkit was something with protocols he said
10:11carkextend-protocol or something like it
10:11morphlingah, I don't think I've used AOT since protocols were added
10:11carkor extend itself, can't remember
11:34choffsteinis there any way to get .clj files out of a .jar made with lein uberjar?
11:37choffsteinSorry 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:42teromchoffstein: .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:42choffsteinterom: I know. I more meant -- how do I make sure my .clj files are NOT included in the .jar
11:48teromchoffstein: ah, ok. Well, I don't have so much experience with that. Does it include both compiled classes and source .clj files currently?
11:48choffsteinterom: yes, it does
11:48jkkramerchoffstein: there's an :omit-source option for project.clj
11:49choffsteinbeautiful.
11:49jkkramersee https://github.com/technomancy/leiningen/blob/1.x/sample.project.clj
11:49choffsteinthanks
11:50teromAh, so easy.
11:57sirnis there any macro similar to (and) but evaluate all exprs even if any expr returns false?e
11:57cemericktechnomancy: so what is the workaround for that $PATH issue you mentioned a few days ago?
11:58cemerickI ended up always starting emacs from the command line (didn't find the real fix after a little googling).
12:30iwilligis it crazy to have a protocol extend another protocol... is that a bad design choice ?
12:33technomancycemerick: the real fix involves editing a plist.xml file. =(
12:34cemerickbummer
12:35technomancydon't you have this issue with other programs on OS X though?
12:35cemerickHrm.
12:35cemerickI don't think so.
12:36technomancyor I guess with eclipse you use a plugin rather than searching the $PATH?
12:36cemerickEclipse always figures out things like e.g. where the git binary is, and TM bundles find awk without a problem.
12:36cemerickThe plugin can use the java git impl or shell out to the local git.
12:36technomancyinteresting. I wonder how they do it.
12:37cemerickI've generally done the latter, just because the java git impl lags a bit.
12:37cemerickI'm guessing they keep a set of common paths somewhere, and go looking.
12:37cemerickso is aquamacs really that evil?
12:37technomancy... well ...
12:38cemerickI can't imagine how long it would take me to get keybindings set up well enough that I wouldn't go nuts.
12:38technomancythe main problem is that it breaks compatibility in unpredictable ways and that it's not portable
12:38technomancyso there's really no way for maintainers to test against its quirks without buying a mac
12:40cemerickHuh. That's not really intuitive. Isn't it just a bunch of chrome and .emacs defaults?
12:40technomancyapparently there's more to it
12:40technomancyI've never tried it.
12:40cemerickThat's what I used the last time I gave emacs an honest try.
12:40technomancybut there's only so much you can do to trick people into thinking it's mac-native
12:41technomancyit's always going to be deep in uncanny-valley territory
12:41cemerickI installed emacs 24 straight this time just so I could safely use the swank-clojure tutorial, etc., but it was…uncomfortable. :-)
12:41technomancyoh, 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:42technomancycemerick: well, the thing about Clojure users is they're more likely to acknowledge that elegance and familiarity are orthogonal. =)
12:43cemerickAI think that applies well to code and abstractions and such. I remain firmly unconvinced about that w.r.t. user interfaces.
12:43cemerickAssembly is elegant too.
12:43technomancywell, familiarity is always relative
12:43cemerickindeed
12:43technomancyI always feel like I'm working with mittens on when you place me in front of a mac
12:44cemerickheh
12:45cemerickYou should have seen me trying to figure out how to tab around buffers.
12:46kzarI'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:47cemerickhrm, no familiarity is not always relative. That was the driving thesis behind GUIs: graphical metaphors provide interaction affordances that text commands cannot match.
12:47hiredmanah, well don't use command as meta?
12:47hiredman(works for me)
12:48hiredmancemerick: but the thing is, as programmers we work with lots and lots of text
12:48kzarhiredman: I just wish there was a "disable every bloody hotkey when a terminal window is active" option, would be so nice
12:48technomancycemerick: I think that just means it's less relative.
12:49technomancywithin 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:49technomancymaybe it's pedantic, but I don't think there's much in UI that can be truly universally intuitive.
12:50technomancys/maybe//?
12:50cemerickyeah, it's population-dependent
12:51cemerickbut, 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:52cemerickMaybe purely textual UIs can be made to approach the same level of accessibility, but I've never seen one that's really tried.
12:52technomancythe other thing is that often discoverability and efficiency are in conflict
12:53technomancyso 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:53technomancybecause efficiency actually can be objective.
12:53technomancy(for a given task)
12:54cemerickcan't there be keybindings and corresponding discoverable UI elements available simultaneously?
12:55hiredmando you not have ido-mode and smex?
12:55cemerickhiredman: I have no idea what those are; but, as someone that recently followed the getting-started tutorial, no.
12:56technomancycemerick: 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:56cemerickor, I should say, I don't think I have them :-P
12:58technomancyido is built-in; you can do M-x ido-mode to enable it.
12:58technomancyit probably should be turned on by default; emacs is not very pleasant without it.
12:58cemerickgawd, shouldn't that be an indication that something is wrong?
12:59hiredmansmex makes things pretty discoverable, M-x and then type something and it will list possible completions as it goes
12:59hiredmancemerick: has anyone ever told you to use bare emacs?
12:59cemerickhiredman: oh, yeah, that happens. Definitely *not* what I would consider "discoverable".
13:00technomancycemerick: definitely stuff is wrong with the development process. it's all political.
13:00hiredmancemerick: what would you consider discoverable?
13:00cemerickhiredman: I just have the emacs starter kit + swank-clojure. (per http://dev.clojure.org/display/doc/Getting+Started+with+Emacs)
13:00technomancythe emacs-devel list makes our "what happened to numerics in 1.3!?!?" threads look like high tea. =)
13:00hiredmaneclipse is not
13:01technomancyso... is there any way to make a request against a self-signed https server from Clojure?
13:01hiredmanI installed eclipse while trying to write an andriod widget, it could be called "discoverable" if you think "discoverable" means "point and guess"
13:01hiredmantechnomancy: yes
13:02technomancydoes it involve reifying your own trustmanager? =(
13:02TimMccurl
13:02technomancyhaha
13:02hiredmanyes
13:02hiredmanhttps://gist.github.com/1309519
13:02cemericktechnomancy: via system properties, IIRC
13:03technomancyhiredman: oh that's not so bad; thanks.
13:03technomancycemerick: I think that requires you know the cert up-front, which I'd rather avoid
13:03TimMchiredman: mangers and bash, eh?
13:04technomancywould be nice to have that in clj-http, but I can fall back to clojure-http-client for this.
13:04pjstadigtechnomancy: you want to hear about 1.3 numerics, i'll tell you about 1.3 numerics...
13:04cemerickhiredman: 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:04hiredmantechnomancy: should work for clj-http I think
13:04technomancypjstadig: but what do you think about setting cua-mode by default for new users; that's what I want to know.
13:05pjstadighehe
13:05technomancyhiredman: oh? cool.
13:05hiredmancemerick: all the emacs slime commands start with 'slime-'
13:05dakronetechnomancy: patches welcome :)
13:05hiredmantechnomancy: I think so
13:05technomancydakrone: fer sure
13:06cemerickhiredman: 'slime-' being the obvious prefix for the lisp or clojure interaction facility ;-)
13:06hiredmancemerick: it is the obvious prefix for slime
13:06hiredmangiven there are other possible modes of interaction
13:07cemerickhiredman: and the immovable encounters the unstoppable :-)
13:33cch1Anybody 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:38amalloyiwillig: 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:38amalloysirn: you don't need a macro for that, it's just a function: ##(every? identity [true false (prn 1)])
13:38lazybot⇒ 1 false
13:42sirnamalloy: thanks, that's exactly what I'm looking for
14:11kylpoAnyone have a REST clojure server tutorial they can link me?
14:12drewrkylpo: I'm pretty sure any REST tutorial would apply to clojure without too much impedance mismatch
14:16kylpoSure. I am just fishing for the perfect match to the project I want to undertake. :)
14:22fdaoudkylpo: do you mean like Compojure?
14:23kylpofdaoud: Yeah, I'm checking out Compojure right now, actually.
14:23drewrkylpo: 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:23drewror any of the myriad java options
14:24kylpodrewr: Cool, thanks.
14:29kylpoJust 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:32fdaoudkylpo: here is a REST/Ring tutorial: http://mmcgrana.github.com/2010/08/clojure-rest-api.html
14:33fdaoudas drewr mentioned, it's worth understanding some Ring because Compojure builds on it
14:33drewrhe'll have to anyway because compojure doesn't try to hide ring at all
14:34drewrit's convenience functions, not an abstraction
14:37kylpoThanks fdaoud, that looks promising.
14:43jcromartiehow do you decide where to put dosync calls?
14:44jcromartiewhen designing an API
14:46fdaoudtrue drewr
14:53drewrjcromartie: as close as possible to the ref
14:53drewrref(s)
14:53drewrdisclaimer though: I've actually hardly used the STM
14:55amalloydrewr: the problem, of course, is the "but no closer" implied second half :P
14:56drewrI figured I'd stop short and let those with more experience take over the advice :-)
14:56technomancyI think it depends on whether refs are an implementation detail or exposed to the user.
14:56amalloyi think the preferred ideal is to not have your API have dosyncs at all
14:57drewrright. abstract the concept of state away if you can.
14:57drewrs/concept of//
14:58jcromartiedrewr good idea
14:58amalloydrewr: 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:58jcromartieif the API has to use a ref, you're doing it wrong :P
14:58TimMcmaybe
14:58TimMcDepends on the service.
14:58jcromartieyeah
14:59jcromartiespecifically a friend had written some code in C# that provided a queue that producers could push onto, and consumers could pop off of
14:59jcromartieand the pop operation blocke
14:59jcromartieblocked
14:59jcromartiea
14:59jcromartieanyway half the code was concurrency-juggling
14:59jcromartieand it was pretty much the minimum necessary
15:00jcromartieso 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:00jcromartieblocking on pop when the queue is empty, that is
15:00amalloyjcromartie: blocking on pop is fine
15:02amalloythe 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:03amalloyfor 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:04jcromartie:P amalloy brings it home
15:04jcromartieawesome
15:06amalloy&(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:06lazybot⇒ "([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:06headiuswhy did that line beep forme?
15:07headiusis there a ^G in there or something?
15:07amalloyhahaha. Raynes, did you somehow make doc drop all the 's' chars instead of \s chars?
15:12amalloy&(doc seque) ;; headius, does it still do that?
15:12lazybot⇒ "([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:13headiuslazybot: yes
15:13headiuser
15:13headiussomething about that line beeps my client
15:16amalloyscottj: missed your message re: when-not till now. you around?
15:18fdaoudis this *the* headius?
15:18fdaoudas in Charles-O?
15:19headiusfdaoud: one and the same
15:19headiusamalloy: yes, it still beeped
15:19fdaoudwell it's an honor, sir :)
15:19hiredman^- amazing what you can do with markov chains
15:19headiusfdaoud: hah, I dunno about that, but thanks :)
15:21fdaoudheadius: I was one of the reviewers for your jruby book with the prags - great job on that
15:22headiusfdaoud: oh, thank you! yes, I think it turned out really well
15:23fdaoudheadius: 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:23amalloyhm. 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:23headiusfdaoud: we only use the most premium paper in the JRuby world
15:23headiusprag books always seem to use a really heavy weight of paper
15:23fdaoudheadius: yeh either that or they switch to thinner paper past a certain number of pages
15:24headiusthat could be too...consistent thickness would be a weird goal but perhaps not a bad idea
15:25headiusor different types of books could mean different weights of paper, like pure reference books might use thinner paper
15:25headiuslike the atom-thin paper they use in giant dictionaries
15:25fdaoudfrom the 15 or so books I have, it seems the threshold is around 350 pages past which they switch to the thinner paper
15:27headiusahhh
15:29fdaoudheadius: did you enjoy your experience writing for the prags?
15:29headiusI did, though it was really hard to focus on it when there was JRuby work to be done
15:30headiuswithout Ian the book never would have happened
15:30fdaoudheh, yet he is listed last
15:30Raynesamalloy: Did I? Really?
15:31headiusfdaoud: I have no idea why I'm listed first...I think I wrote one appendix and revised some content
15:31fdaoudheadius: because you are The Man
15:32amalloyRaynes: yes. i pushed a fix for you and reloaded
15:32headiusfdaoud: yeah, but still! :)
15:32fdaoudmarketing, marketing, marketing, it's all good
15:32RaynesAwesome.
15:33fdaoudheadius: 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:33headiusyeah I suppose that's true
15:33fdaoudheadius: 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:36TimMcheadius: 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:38fdaoudTimMc: safely for you or for the paper?
15:38TimMcthe paper
15:38fdaoudheh
15:38TimMcYou select which pages to open, and it directs the charge to that pair.
15:38headiusTimMc: yeah, I remember that part
15:38TimMcI had totally forgotten. It's a cute idea.
15:39headiusI'm finally reading snow crash...bunch of wacky stuff like that in there too
15:40fdaoudheadius: so tell me what Mr. JRuby/Mirah is doing in Clojure?
15:40headiusI always idle here to keep clojurists honest
15:41fdaoud?
15:41headiusjust in case they say something about jruby!
15:41headius:)
15:41TimMcWe're all in this VM together.
15:41headiusno, I like clojure
15:41fdaoudlike to tell them when they beep the terminal? stuff like that? ;)
15:41headiusand scala, and mirah, and jython, and fantom
15:41headiusI don't like groovy, though :D
15:41fdaoudyeah, same here (minus scala, hate the syntax)
15:42TimMctesting... lazy queued concrete background integer buffer java.util.
15:43TimMcAny beeps there?
15:43fdaoudclojurebot: jruby
15:43clojurebotTitim gan éirí ort.
15:43fdaoudeh?
15:44fdaoudMay you fall without rising?
15:44TimMcI 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:47hiredman~clojurebot
15:47clojurebotclojurebot has a lot of features, most of which are broken
15:47hiredman~clojurebot |has| a poetic soul
15:47clojurebotc'est bon!
15:47hiredman~clojurebot
15:47clojurebotclojurebot is not a benchmarking platform
15:47hiredman~clojurebot
15:47clojurebotclojurebot is not very good at indicating the difference between a return value and an exception
15:48amalloyhiredman: clojurebot factoid DoS here
15:48hiredmanhmmm?
15:49amalloyhiredman: 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:50hiredmanI was hoping for the "clojurebot is a cold heartless unfeeling mechanism"
15:50hiredman~clojurebot
15:50clojurebotclojurebot will become skynet
15:52pjstadighiredman: i could say it for you, if you want...
15:53TimMchiredman: It took me like 15 tries in /privmsg to get it.
15:53TimMcNow it won't come around again for ages!
15:59bhenrytechnomancy: 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:01hiredman,(macroexpand '`(~f ~arg))
16:01clojurebot(clojure.core/seq (clojure.core/concat (clojure.core/list f) (clojure.core/list arg)))
16:05amalloyhiredman: 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:06amalloy,(let [f 'inc, arg (with-meta '(inc 1) {:x 1})] (meta (second `(~f ~arg))))
16:06clojurebot{:x 1}
16:07amalloyeg, 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:08hiredmanah, yes, because the resulting form is rewritten away
16:09amalloyindeed
16:09TimMcbhenry: There's a sample project.clj somewhere...
16:09hiredman*shrug*
16:09bhenryi remember that. TimMc. i'm toying with the resources dir. this could work for me.
16:10bhenrygah. nope
16:10Bronsahow can i find the position of the first non positive value in a vector?
16:10amalloyBronsa: ##(doc keep-indexed)
16:10lazybot⇒ "([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:10Bronsathanks amalloy
16:10Bronsathat was fast
16:10hiredmanthe 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:11amalloybhenry: 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:12bhenryamalloy: 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:12amalloyhiredman: 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:12TimMcbhenry: The resources dir really should work.
16:12TimMcbhenry: There's also :extra-classpath-dirs
16:12amalloybhenry: it's usually in maven central
16:12hiredmanamalloy: but macros can return forms that don't support metadata
16:13hiredmanit could do a check I guess
16:13amalloyhiredman: right, which i point out as a problem in my original post
16:13amalloyand suggest doing that check
16:13tyson2John McCarthy died last night
16:13TimMcbhenry: ...but :resources-path is intended for that.
16:14hiredmanpeople keep saying that, but I have yet to see anything on the internet to confirm it outside of a wikipedia link
16:15tyson2I guess we'll have to wait for the cellphone video
16:15TimMctyson2: Wiki talk page links to laughingsquid links to HN links to... WP.
16:16TimMcI was just wondering last week if he was still around.
16:20jcromartietyson2: so they say
16:26semperosI'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:26semperosthe lib first tries .getConstructor, followed by .newInstance if that fails
16:27semperosany thoughts on how I could make this work?
16:27hiredmanrecords don't have 0 arg constructors
16:27hiredmanwhich .newInstance more or less requires (unless you are fiddling with this and that)
16:28semperoshere's the Java lib's code
16:28semperos(method called instantiatePage): http://code.google.com/p/selenium/source/browse/trunk/java/client/src/org/openqa/selenium/support/PageFactory.java)
16:28semperoswhich does pass in a param to newInstance
16:29hiredmanright, so you can't do that
16:30semperosso if I have a record defined (defrecord Foobar [foo])
16:30hiredmancan't do that
16:30semperoswhat happens "under the covers" in terms of constructors?
16:30semperosright, I'm just trying to better understand how records work
16:31hiredmansemperos: one plus the number of fields, more or less
16:32hiredmanactually, I take that back
16:32hiredmanit must just be the number of fields
16:32hiredmanso possibly [] might work
16:34hiredmansomething is number of fields + 1, maybe it's fn constructors or something
16:34semperosok
16:36semperosrelated question in my playing with classes
16:36semperosjava.lang.Class cannot be cast to [Ljava.lang.Class;
16:36semperoswhat exactly is the [Ljava.lang.Class piece?
16:37hiredman[ means array, L means reference type
16:37hiredmanwell, L...; means reference type, the bit in the middle is the name
16:37semperosok, thanks
16:39broquaintI'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:40broquaintMy naive attempt of (use 'fnparse) is failing with java.io.FileNotFoundException.
16:40amalloyhiredman: fields+1 for meta
16:40semperosbroquaint: how are you starting your REPL?
16:41mefestobroquaint: did you restart the repl since performing lein deps?
16:41TimMcsemperos: THe lib is expecting beany classes?
16:41amalloyfnparse is not the package name
16:41broquaintAha, indeed, amalloy :)
16:41hiredmanamalloy: sure, it definitely exposes a fields constructor
16:41semperosTimMc: just plain ol' classes
16:42broquaintShould've just followed the example instead of trying to be a clever dick :s http://brehaut.net/blog/2011/fnparse_introduction
16:43brehautbroquaint: if there are any real bugs in that let me know and i'll fix it
16:44broquaintThanks, brehaut, will do :)
16:46Raynesjodaro: Ping.
16:46amalloybrehaut: does the garish yellow-orange count?
16:46brehautamalloy: thats a feature
16:47semperoscalling .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:47Raynesbrehaut: I actually had to nix your fnparse stuff in lazybot's Clojure plugin.
16:47brehautRaynes: sad
16:47semperoseven if I add the hint in the defrecord form for the class it should accept
16:47brehautRaynes: was it breaking something?
16:47RaynesI 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:47semperosexample: https://gist.github.com/1310181
16:47brehautRaynes: ah :S
16:47RaynesTwas a hard decision.
16:47semperosthat code throws:
16:48semperosuser.MyPage.<init>(org.openqa.selenium.WebDriver)
16:48semperos [Thrown class java.lang.NoSuchMethodException]
16:48Raynesamalloy and I cried as we hit backspace.
16:48brehautRaynes: when parsley has docs i guess i could try recreating it
16:48jodaroRaynes: pong
16:58Raynesbrehaut: More docs than the README? Psh.
16:58RaynesYou should be able to get everything you need from a README. Even ones that aren't there. It just happens.
16:58brehautRaynes: im only a simpleton
17:02aaelonyHi, 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:02aaelony I'd like to extract the contents of :b3 and deeper... Simplified example here http://pastie.org/2752755
17:03aaelonyany help appreciated..
17:03aaelonyI wonder if there is a :keys-in or something...
17:04RaynesThat'd be too easy,
17:04pierre1hey
17:04aaelony...fair enough...
17:04jamiltronfnparse is abandoned :( ?
17:04mefestoaaelony: (let [{:keys [name newValue]} (get-in data [:b :b3])] [name newValue]) ;; not good enough?
17:04brehautaaelony: (let [{{c :a} :b} {:b {:a 1}}] c)
17:04pierre1am I missing the way to get a backtrace in the repl, with clojure 1.3.0?
17:04Raynespierre1: (pst *e)
17:05pierre1Raynes++ thanks
17:05TimMc(inc Raynes)
17:05lazybot⟹ 6
17:05Rayneso/
17:05aaelonymefesto, brehaut I'll experiment with those ideas, thanks, that might do it
17:08brehautthe parsley docs are way more complete than i recall them being
17:08brehautthere goes the next weekend
17:08Raynesbrehaut: :)
17:09Raynesbrehaut: You could always do this in the meantime: https://github.com/flatland/lazybot/issues/40
17:31devnRIP John McCarthy
17:32Raynesdevn: Is it actually confirmed yet?
17:32jcrossley3http://techcrunch.com/2011/10/24/creator-of-lisp-john-mccarthy-dead-at-84/
17:32RaynesWell, son of a bitch.
17:33RaynesEh. They source the HN thread that sources wikipedia that sources HN.
17:33brehauthigh quality reporting there
17:34devnthey reference a portugese website on wikipedia
17:34brehauthttp://g1.globo.com/tecnologia/noticia/2011/10/morre-john-mccarthy-pioneiro-da-inteligencia-artificial.html is the article that WP cites
17:34devn^
17:35technomancyif only they had cyclic dependency detection
17:35devnThe Talk page has friends of the family and a couple of journalists confirming.
17:36devn"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:37brehautthat talk page really highlights how farcically anal retentive wikipedia can be
17:37RaynesI'm kind of on wikipedia's side here.
17:38RaynesBut it is looking good.
17:38devnbrehaut: yeah it's sad
17:39devnbrehaut: 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:39devnthe 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:40brehautdevn: 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:40brehautdevn: perhaps http://en.wikipedia.org/wiki/Wikipedia:WikiProject_Programming_languages ?
17:41devnJobs, Ritchie, McCarthy
17:42mdeboardSQL inventor is next
17:43mdeboardDon Chamberlin, he's getting up there
17:43brehautmdeboard: oh crap, that'll take out about 100 people
17:43mdeboardbrehaut: lol
17:47devnhttp://i.imgur.com/Y02DM.jpg
17:48technomancyI had that printed out at my desk at my job a couple years ago
17:50brehauti had http://i.imgur.com/1gF1j.jpg on the wall at my last job
17:51technomancybrehaut: I think that grid needsmore blank spaces for spots where one group is unaware of the existence of another.
17:52brehauttechnomancy: thats true
17:52devnI just have a picture of Rich on my desk that says: "That is orthogonal."
17:52devnnot really-- just trying to fit in...
17:53TimMcbrehaut: Cascading delete?
17:53brehautTimMc: i was thinking design by committee, but sure :)
17:53brehautdevn: lol
17:59jcromartiefamous people die in clusters of three
17:59amalloybrehaut: nice. i'd only seen the version of that chart without lisp/haskell
17:59brehautthe terrified cat and the buy a vowel really make it eh
18:00jamiltronI 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:07TimMcPerhaps a sexier version of Java?
18:07jodarothat must be it
18:07jodaroand
18:07brehauti think thats the implication
18:07jodarothats not really her cleavage, is it?
18:32cemerickholy crud, bad month
18:32aaelonyI 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:33brehautaaelony: you cannot have nested #(…) fns, you have to use a (fn […] …) form
18:33amalloyaaelony: you probably want to use (for) instead of a map/fn pair anyway, especially if you're nesting
18:34aaelonybrehaut: I want to learn fn syntax, but somehow can't grasp it. What is the % equivalent in fn syntax?
18:34brehaut,(map (fn [xs] (map #(inc %) xs)) [[1 2 3] [2 3 4]])
18:34clojurebot((2 3 4) (3 4 5))
18:35brehautaaelony: you explicilty name the arguments like you would any other fn
18:35aaelonyi don't know why that seemed so hard... thanks brehaut
18:35brehautaaelony: and in a real program you would never do #(inc %); you'd just pass inc
18:35aaelonyamalloy: you're likely right, but I think I need 3 map nestings and then a for (for this particular thing I need now)
18:36brehautaaelony: id write it as (map (partial map inc) [[1 2 3] [2 3 4]]) probably
18:38raekaaelony: also consider 'for': ##(for [x (range 3)] (for [y (range 3)] {:x x, :y y}))
18:38lazybot⇒ (({: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:38aaelonyusing 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:39aaelonyraek: I'll explore that more as wlel
18:39aaelonywell
18:39raek,(let [{[a b] :foo} {:foo [1 2]}] [a b])
18:39clojurebot[1 2]
18:41raekaaelony: to do nested destructuring that includes maps, use the underlying destructuring syntax {a :a, b :b} instead of the shorthand {:keys [a b]}
18:41aaelonyyeah, unfortunately :keys didn't work past the top level
18:41raekthe symbols a and b in the first one can be replaced with other destructuring
18:42aaelonyI've also got a vector of maps well into the 3rd nesting
18:42raek:keys is just a shorthand for when the thing you want to bind has the same name as the keyword
18:42aaelonyyes
18:42raekwhich is not the cae if the thing you want to bind is a destructuring form
18:43aaelonyyes
18:43raekif you are just interested in a single value, you can use get-in or ->
18:43aaelonyactually I need a list of values
18:44aaelonyselected values (usually 2 or 3) from each nesting level
18:44raekyou can also have multiple rows in a let to make this less messy
18:45aaelonyok
18:46aaelonyessentially 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:54jodarohah!
18:55jodaro"i need to get the first of the first"
18:55jodaro"theres a function for that! ffirst"
18:55jodaroso rad
18:55gfredericks$findfn [[8 7] [3 4]] 8
18:55lazybot[clojure.core/ffirst]
18:55amalloydang gfredericks, out-typed me
18:55gfredericksamalloy: you shouldn't have tried to do six-element lists
18:56amalloygfredericks: i was going for infinite
18:56gfredericksyeah that takes a while
18:56amalloy$findfn (for [x (range)] (for [y (range)] y)) 0
18:56lazybotExecution timed out.
18:56amalloyhaha ouch
18:57gfrederickshmmm
18:57gfredericks$findfn (repeat (iterate inc 0)) 0
18:57lazybotjava.lang.OutOfMemoryError: Java heap space
18:57gfredericksgolly
18:58gfrederickslazybot doesn't seem very lazy...
18:59brehautgfredericks: thats trying every function in the lib, imagine seq or vec or something on that expression
18:59gfredericksbrehaut: that there is a perfectly compelling explanation.
19:01amalloybrehaut: well, i think i changed the timeouts so that this is less of a problem
19:01amalloy$findfn 0
19:01lazybot[clojure.core/+ clojure.core/+' clojure.core/release-pending-sends]
19:02amalloyhm. that's not a very instructive example of what i meant
19:03amalloyanyway 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:17technomancyI wonder if it would be possible to make a generic lazy-seq -> rest pagination library.
19:17technomancyI 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:19hiredmanIDrop
19:24technomancysomethnig like that
19:55seancorfieldwhat is the current received wisdom on aquamacs vs regular emacs on os x?
19:55brehautregular emacs i believe
19:55technomancyGNU Emacs is supported, forks are not.
19:55brehauthttp://emacsformacosx.com/
19:55hiredmanaquamacs is dumb
19:55technomancyreports of success remain unverified
19:56dnolenAquamacs works fine last time I checked. Easier for newbies.
19:57seancorfieldi thought i'd seen a couple of the clojure/core folks using aquamacs?
19:57brehautseancorfield: emacsformacosx builds support cocoa, so have open dialogs and standard mac keys bound
19:57seancorfieldah, ok
19:57technomancyI've heard reports of aquamacs bundling an incompatible version of slime.
19:57hiredmanbrehaut: but missing the fullscreen patch
19:57brehauthiredman: sadly :(
19:58seancorfieldhiredman: so what do you think is the best version of emacs for os x?
19:58brehauthiredman: im running emacs in fullscreen terminal in the interim
19:59hiredmanseancorfield: emacsformacosx is fine, for the best you need to find a build with the fullscreen patch or build it your self
19:59seancorfield'k
20:06dnolenseancorfield: rhickey uses it
20:10scgilardiI 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:11brehauti have heard a rumour that homebrew has support for the fullscreen patch for cocoa emacs
20:12brehautbut i dont use it myself
20:12hiredmanthey have a -- flag that does nothing
20:12brehautfantastic
20:12hiredmanlike --with-fs-patch or something, but it doesn't do anything
20:20jamiltronI'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:21jamiltronI'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:24devnBuilding emacs 24 from source with the fullscreen patch is not too difficult
20:25devnit takes a bit of googling to find the patch, but it has continued to apply cleanly without issue
20:26devnjamiltron: im not sure I can be of help, but where am I looking in this repo?
20:27Raynesdevn: Pretty sure the patch is in Emacs common now.
20:27devnRaynes: good to hear
20:27Rayness/common/proper/
20:28RaynesI'm not using it though -- I don't have it in me to pull the repo.
20:28devnheh -- yeah, it's exhausting making machines fetch ;)
20:31simardis there a function like partial that would bind arguments from right to left instead of left to rigth ?
20:31simardright
20:33devnsimard: you could just grab the source and make your own reverse partial
20:33devnsimard: why do you need a reverse partial?
20:35simarddevn: 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:35simarddid that make sense ?
20:37devnsimard: im not sure what you mean. Could you post a code example?
20:37simarddevn: in the making
20:37devn(to gist.github.com or something)
20:37brehautim sure you could use a horrific point free mess of comp partial, apply and reverse
20:37jamiltrondevn: the util.clj draw function is a good start
20:37brehaut,((comp (partial apply vector 1) reverse (fn [& args] args)) 1 2 3)
20:37clojurebot[1 3 2 1]
20:37jamiltrondevn: sorry for the delay
20:38devnsimard: does what brehaut posted help you out?
20:39brehauti hope not :P
20:39simardI kinda have that same hope
20:39simardwait a minute, I'm writing a sample
20:40devnbrehaut: lol why do you say that?
20:41brehautdevn: you mean other than the attempt at todays greatest abuse of point free award (it'll only get runner up though; no juxt)?
20:41devnoh man -- dont get me started on juxting
20:41devnjuxting is some of the most fun a lad can have
20:41devn(or lady for that matter)
20:45devn,((juxt + max min) 2 3 5 1 6 4)
20:45clojurebot[21 6 1]
20:46devnbrehaut: i've always loved that one
20:47amalloybrehaut: earlier today i wrote (((partial juxt inc) dec) 5) to annoy someone: do i win a prize?
20:47brehautooh maybe
20:47simardhttps://github.com/gsimard/junk/blob/master/junk.clj
20:48brehautdevn: 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:48brehaut(project euler 18)
20:48simardok, so that is what I needed, and I'm probably just at the corner of getting it right
20:48devnhaskell is hard to read on IRC.
20:49simardalthough I'm more concerned about the very reason I need it, more than how to achieve it
20:49devnAlthough I think I once felt that way about clojure. lack of familiarity
20:49brehautlets be honest, that one doesnt get much clearer out of irc
20:49devnheh
20:49amalloybrehaut tells it like it is
20:50amalloybrehaut: what's this foldr1 thing?
20:50brehautits a right fold
20:51brehautthe 1 means that you dont pass the initial value, it takes it from the list
20:51amalloyah
20:51devnfoldr (+) 5 [1,2,3,4] => 15
20:51brehautbecause variadic functions in haskell requires some serious work
20:51devnfoldr1 (+) [1,2,3,4] => 10
20:51amalloywell now that i know what foldr1 is the whole snippet makes perfect sense...
20:53zerokarmaleftjamiltron: hmm, collision detection seems to be wonky sometimes
20:53brehautamalloy: http://www.4clojure.com/problem/solutions/79 ;)
20:54devnI have 30 tabs open in chrome.
20:54jamiltronzerokarmaleft: yeah, collision detection and edge detection are pretty crappy right now, I mostly was trying to get something working for proof-of-concept
20:55amalloywow, my solution to that is terrible
20:55jamiltronzerokarmaleft: right now I'm mostly wondering if my GL11 functions are 'right'
20:58technomancydevn: http://i.imgur.com/utsSX.png
20:59brehautgold
21:00devntechnomancy: hahaha
21:00devnDoes anyone know if there's a chrome extension to force a limit to the number of tabs?
21:01devnhttps://chrome.google.com/webstore/detail/kjecajkoiikaohhagojedcphegkcfobm
21:01amalloysudo apt-get remove google-chrome
21:01amalloythat would probably do it
21:03devnha! how nice. as soon as you install "No More Tabs", it just removes a bunch of your tabs.
21:03brehautblunt
22:00seancorfieldtechnomancy: i'm trying to follow your starter-kit instructions...
22:01seancorfieldi installed emacs 24.0.90
22:02seancorfieldi edited ~/.emacs.d/init.el as shown on your github page https://github.com/technomancy/emacs-starter-kit
22:02seancorfieldbut when i try to do package-install, it says starter-kit has no match
22:02seancorfieldwhat obvious step am i missing?
22:03duck1123seancorfield: try package-list-packages
22:03simardseancorfield: did you refresh ?
22:04simardM-x package-refresh-contents
22:05seancorfieldseems to take a long time to contact tromey.com:80
22:05simardseancorfield: you didn't evaluate the 3 other lines
22:05seancorfield?
22:05simardthe require, add-to-list and package-initialize
22:06seancorfieldthat's in init.el per technomancy's instructions
22:06simardshould be evaluated, if you're not restarting emacs
22:06seancorfieldi restarted emacs just to be sure
22:06simardevaluate them just to be sure then .. :)
22:08seancorfielddone
22:08simardie.: go at the end of their parenthesis, type C-x C-e, for all 3 lines
22:08simardand then M-x refresh
22:08simardand install
22:09seancorfieldyup, done all that, several times
22:09seancorfieldwell, i'll be blowed... this time it actually worked!
22:10seancorfieldnow it's busy installing stuff and compiling it
22:10seancorfieldbunch of warnings but it seemed to finish correctly
22:10simardwell, there you go then
22:11duck1123you can pretty much ignore the warnings
22:18seancorfieldto 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:18simardC-x 0
22:18seancorfieldah...
22:18simardon the window you don't want to keep
22:19duck1123or C-x 1 if you want to get rid of them all
22:19seancorfieldthank you!!! i couldn't find that anywhere!
22:19seancorfieldc-x 1 i knew about (from the tutorial)
22:19brehautseancorfield: you know about the terms window and frame in emacs lingo ?
22:19simardyeah, you're up for some learning curve there. but it's well worth it IMHO
22:19seancorfielddelete-window... i never would have guessed... *sigh*
22:20seancorfieldi haven't touched emacs for about 20 years
22:20archaicif you need to find something, usually c-h a will find it
22:20archaicie c-h a 'window'
22:20archaicwould find c-x 0
22:20brehautseancorfield: i spent ages trying to find revert-buffer
22:21seancorfieldone 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:21seancorfieldok, off to watch TV and do stuff on the netbook
22:21seancorfieldthank you!!
22:21brehautseancorfield: its a good time to get back into emacs for clojure i think
22:23brandelI 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:24simardbrandel: you know about viper-mode right ? :)
22:24brandelnope?
22:24duck1123brandel: it's well worth the investment
22:24simardit's a vi emulation layer for eamcs
22:24simardemacs*
22:25simardstart emacs, M-x viper-mode
22:25brandeloh.. does it work reasonably well?
22:25simardno idea :)
22:25simardyou tell me
22:25brandelfair enough! I will investigate
22:25brehautyou too can migrate from one archaic editor to another ;)
22:25brandelcheers simard
22:25brandelhahah
22:25duck1123Although, using vim keybindings in emacs is kinda missing the point
22:26simardbrehaut: what do you use youself ?
22:26brehautthe old shoggoth, emacs
22:26brehautand textmate (but not for clojure, yikes)
22:26duck1123an ancient, great power
22:26brandelduck1123: my brain is wired for vim, but I guess it's never too late to teach an old dog new tricks
22:26brehautive recently reverted
22:27brehautsimard: http://brehaut.net/blog/2011/marcel
22:27brehauti do want to give eclipse and ccw 0.4 a crack
22:27duck1123lately, I've been loving how many of the emacs bindings work in the terminal
22:28brehautduck1123: and work system wide in the mac
22:29duck1123don't get me started on the mac, too many lost windows when all I wanted to do was copy some text
22:30brandelI would be a lot happier with the mac if I could have something like xmonad/awesome
22:30duck1123I would settle for Compiz's put plugin
22:30brehautbrandel: emacs in a full screen terminal ;)
22:31archaicno, 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:31brandelhah yeah, my ghetto tiling wm emulation is screen in a full screen terminal
22:31archaicseriously
22:31archaicif you use vim..
22:31duck1123brehaut: that's how I work when I'm on the mac
22:31archaicyou want that
22:31brandelhow emacsy is that? there are two vim emulation modes? O.o
22:32duck1123I'm still upset there's no good WM in java that I can hook clojure up to. (ala. StumpWM)
22:32brandelbut thank you archaic, that sounds excellent
22:32jodaroit does everything. even other editors.
22:32brehautduck1123: just go learn rep and use sawfish ;)
22:33sean_corfieldok, on the netbook now so expect more emacs questions :)
22:34brehautmy burning emacs question is how do i step back through previous expressions in the swank repl?
22:34brehautslime?
22:34clojurebotslime-installer is http://github.com/technomancy/clojure-mode/blob/0f28b61de90ce8a09d75bf1668ef3f1c200f9c52/clojure-mode.el#L560
22:34duck1123M-p
22:35brehautand M-n to go down i see.
22:35brehaut(inc duck1123)
22:35lazybot⟹ 2
22:36duck1123If you start typing an expression, then do M-p, it'll find expressions that match
22:36brehautexcellent
22:36brehautdoes C-r work similarly?
22:37zerokarmaleftwhat's the deal with paredit advancing out of the outermost sexp when closing a square bracket?
22:37zerokarmaleftonly happens when i'm in a slime buffer
22:38duck1123zerokarmaleft: so when it's done, is it still well-formed?
22:38scottjzerokarmaleft: you probably have ] bounded to paredit-close-parenthesis instead of paredit-close-square
22:39duck1123brehaut: C-r searches in the buffer, but if you enter on that line, it'll paste it
22:39brehautduck1123: excellent, thanks :)
22:39zerokarmaleftduck1123: well no, e.g. (defn foo [x])
22:39zerokarmaleftscottj: checking, i've been messing around with keybindings lately
22:40duck1123brehaut: didn't actually have a repl running yet...
22:40zerokarmaleftscottj: nope, only rebound the slurp and barf commands
22:41scottjzerokarmaleft: go into repl or wherever this is happening and do C-h k ]
22:41zerokarmaleftit's bound to paredit-close-square
22:43scottjbut when you type ([] you get ([])| instead of ([]|)?
22:43duck1123zerokarmaleft: could you show what it looks like before and after
22:43zerokarmaleftscottj: right, except paredit fills in the closing paren before i start the square brackets
22:44zerokarmaleft1. (|) 2. ([|]) 3. ([])|
22:45duck1123zerokarmaleft: same thing is happening to me
22:45zerokarmaleftworks fine when i'm just editing a file buffer though
22:45zerokarmaleftmaybe i borked my slime hook
22:46duck1123I bet it has something to do with slime considering the expression complete
22:53archaicif there a function that does this?: apply function to the values of a map whos keys pass a predicate
22:55sean_corfieldfor emacs 24 on ubuntu, what's the recommended source?
22:55duck1123`archaic: you could use map and filter
22:55brehaut,(keep (fn [[k v]] (when (odd? k) (name v))) {1 :a 2 :b 3 :c}) ; archaic ?
22:55clojurebot("a" "c")
22:56sean_corfieldi found damien cassou's PPA for emacs-snapshot
22:56sean_corfieldother emacs 24 options on ubuntu 11.10?
22:58brehaut,(for [[k v] {1 "foo" 2 "bar" 3 "baz"} :when (odd? k)] (.toUpperCase v)) ; archaic, alternatively
22:58clojurebot("FOO" "BAZ")
22:58archaici was thinking more (fn.. {1 10 2 10 3 10} even? inc) -> {1 10 2 11 3 10} ill write it i guess
23:05duck1123`,(into {} (map (fn [[k v]] [k (if (even? k) (inc v) v)]) {1 10 2 11 3 10}))
23:05clojurebot{1 10, 2 12, 3 10}
23:06duck1123`well, that would've worked better if I had the inputs right
23:08amalloyzerokarmaleft: i think the slime repl doesn't know about clojure's syntax by default, doesn't know ] is a close-paren
23:09duck1123`does paredit use language-specific rules
23:09amalloyi 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:10archaicduck: thx, what I came up with abeit later :)
23:30sean_corfieldsorry for all the quit/joins... netbook needed a major update and now i have emacs 24.0.90 on ubuntu 11.10
23:31semperosI've defined record as follows: https://gist.github.com/1311216
23:32semperosI 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:32semperoswhat am I doing wrong?
23:34sean_corfieldhmm, 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:35archaicusing lein or cake?
23:35brehautsean_corfield: open a buffer in a project and type M-x clojure-jack-in ?
23:35duck1123`semperos: try clj-webdriver.WindowHandle
23:35duck1123`sean_corfield: alternately, lein swank and M-x slime-connect
23:36sean_corfieldlein
23:36zerokarmaleftamalloy: that works great, thanks!
23:36sean_corfieldbrehaut: no match on M-x clojure-jack-in
23:37brehautsean_corfield: have you followed the instructions here https://github.com/technomancy/swank-clojure ?
23:37sean_corfieldlein swank is not a task :)
23:37sean_corfieldbrehaut: no, i just did the starter-kit stuff
23:37brehautlein plugin install swank-clojure 1.3.3 :)
23:38sean_corfieldthx
23:38brehaut(dont run the smily face on the command line)
23:38spoon16is there a way to kill a running command at the lein repl without killing the whole process?
23:39sean_corfieldwow, that's a lot of reflection warnings (lein swank)
23:40sean_corfieldok, i don't have slime-connect either in emacs
23:40semperosyou tried M-x slime-connect ?
23:40sean_corfieldso how do i get clojure-jack-in and/or slime-connect
23:41sean_corfieldi assumed the starter-kit would give me everything i needed since it was from technomancy :)
23:41brehautdo you have start-kit-lisp in your packages ?
23:41brehauterr starter-kit-lisp
23:41zerokarmaleftspoon16: afaik, no...it's wise to set *print-length* and *print-level* to sane values
23:41sean_corfieldbrehaut: doesn't that get installed as part of the starter-kit?
23:41sean_corfieldit's no wonder folks get frustrated trying to set up emacs...
23:41brehautsean_corfield: nope, each language has a sub starter kit that you set up explicitly
23:42brehautsean_corfield: to be fair, this stuff is in the readme for the starter kit v2
23:45sean_corfieldok, installed starter-kit-lisp and still no slime-connect so wtf do i get that? *frustrated*
23:45brehautim confused now
23:45brehautcause i think thats all i did
23:47archaiccan you do m-x clojure-mode?
23:48sean_corfield*sigh* no...
23:48sean_corfieldit looks like the lisp starter kit is NOT installed
23:49sean_corfieldjeez, this is a pain
23:49mintsoupif 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:49technomancyhaha; holy crap.
23:49brehauthave you done a M-x package-refresh-contents ?
23:49technomancyclojurebot: forget slime-installer |is| http://github.com/technomancy/clojure-mode/blob/0f28b61de90ce8a09d75bf1668ef3f1c200f9c52/clojure-mode.el#L560
23:49clojurebotI forgot that slime-installer is http://github.com/technomancy/clojure-mode/blob/0f28b61de90ce8a09d75bf1668ef3f1c200f9c52/clojure-mode.el#L560
23:49technomancyseancorfield: on the elisp side all you need is clojure-mode; just one file.
23:50brehauttechnomancy disappears for an hour and #clojure becomes #emacs-cargo-cult
23:50semperoslol
23:51semperosI second mintsoup's suggestion to just follow the instructions here, if the rest is getting too complex: https://github.com/technomancy/swank-clojure
23:51sean_corfieldtechnomancy: so i followed the instructions as best i could from your starter-kit
23:51technomancybrehaut: did cemerick start a trend? =)
23:51sean_corfieldit wasn't clear that i needed to ALSO install the lisp starter-kit
23:51brehautlol
23:51sean_corfieldi thought i'd installed that but...
23:51brehauttechnomancy: i switched to emacs before it was cool :P
23:52technomancysean_corfield: hm; I'll see if I can make it clearer in the readme that the separate modules are installed on their own
23:52zerokarmalefthuh, didn't know about clojure-enable-paredit
23:52sean_corfieldi followed your instructions for init.el but none of that code seems to execute
23:53sean_corfieldi added the code to set up starter-kit, starter-kit-lisp etc and it doesn't execte
23:54technomancyseancorfield: is it possible you have a ~/.emacs file? that takes precedence over ~/.emacs.d/init.el
23:54sean_corfieldbrehaut: i was using emacs 20 years ago... version 17 in fact... but i haven't touched it for nearly 20 years
23:54sean_corfield(and now i remember why! :) )
23:54brehautsean_corfield: lets be honest, emacs has never been cool ;)
23:54brehautso technically we are all using it before it was cool
23:55sean_corfieldno, i have no .emacs file
23:55sean_corfieldjust .emacs.d/init.el
23:55daakuis 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:56brehaut(into {} (map … )
23:56brehaut)
23:57daakubrehaut: ah, perfect
23:57daakuthanks
23:57technomancysean_corfield: you can just do M-x package-install starter-kit-lisp
23:58sean_corfieldlet me try that...
23:58sean_corfieldok, it complained that already exists...
23:58spoon16is the appropriate way to take from the front of a stinrg (apply str (take 3 "abcdefg"))?
23:59brehaut,(.substring "abcdefg" 0 3)
23:59clojurebot"abc"
23:59brehautor (subs "abcdefg" 0 3)