#clojure logs

2011-12-07

00:02amalloyambrosebs: def creates a new var, as i understand it. so the metadata on the old one is gone
00:02amalloybut i'm not sure i've understood what you're trying to do anyway
00:03ambrosebsamalloy: at compile time, I intern a var, and add ::type metadata
00:04ambrosebsI guess I didn't expect `def` to overwrite the var at *compile time*
00:04ambrosebsI'm probably wrong
00:04ambrosebsit would be at runtime no?
00:05amalloywelllll, those two kinda get mixed up when you're evaluating a namespace's forms sequentially
00:06ambrosebsright
00:06ambrosebsso it might be a good idea to store type annotations elsewhere
00:08dnolenambrosebs: you're not using that info at runtime anyway right?
00:08ambrosebsor add metadata to the var at "runtime"
00:08ambrosebsdnolen: no, but it seems `def` blurs the line
00:09ambrosebs(T my-function :- (Fn (Integer -> Integer)))
00:09ambrosebsthat interns a new var #'my-function and adds metadata at compile time
00:10dnolenambrosebs: why not just persist that information in a atom of type information?
00:10dnolenambrosebs: you know the symbol and the namespace
00:10ambrosebsdnolen: yes, I did that initially, raek suggested storing in the var
00:10dnolenambrosebs: I don't see the benefits. you're not going to use that information at runtime.
00:11ambrosebsdnolen: ok, I'll switch back
00:11dnolenambrosebs: (T …) should maybe even be a no-op? It something only that analyzer deals w/.
00:12ambrosebsdnolen: It's a separate top level form, I assume it needs some sort of global side effect
00:13ambrosebsit's not metadata
00:13ambrosebshmm
00:13dnolenambrosebs: I don't see why. if type-checking doesn't effect compilation and runtime - why do you need a global side effect?
00:14dnolenambrosebs: seems like you should be able to (type-check "foo.clj")
00:16ambrosebsdnolen: where would (type-check "foo.clj") be called from?
00:17dnolenambrosebs: would be nice if you could just do that from the REPL, (typed-clj/check "foo.clj")
00:19ambrosebsdnolen: but what about normal compilation of a namespace? I don't see where to hook that kind of command in
00:20dnolenambrosebs: I think rhickey point about not coupling compilation and type-checking are important.
00:20ambrosebsdnolen: must have missed that :)
00:21ambrosebsdnolen: It sounds counter-intuitive. What am I missing? Don't I want transparent type checking when I compile my file?
00:22dnolen"you can do type checking independent of compilation, there's not much reason to do it as you go, and doing so will only invite the problems of mandatory typing"
00:22dnolenrhickey quote from the desig ndoc
00:22dnolendesign doc
00:22ambrosebsah
00:22ambrosebsvery interesting
00:22ambrosebsI brushed past that
00:23ambrosebsok, some problems fall away with that in mind
00:24dnolenambrosebs: I think rhickey is pushing us to develop good analysis tools / infrastructure. wiring it up to compilation will need a more compelling argument.
00:24ambrosebsdnolen: ok, I get it now.
00:25dnolenI don't find type-checking compelling in of itself - remove intermediate steps when doing higher order operations on persistent vectors of primitives - hells yeah.
00:25dnolenwhat I mean, is I don't find hooking up type-checking to the compiler compelling, sorry.
00:26ambrosebsdnolen: I don't have any attachment to running at compilation, I just didn't think of anything else
00:26dnolendefinitely having that as analysis tool w/in easy grasp would be welcomed by many folks.
00:28ambrosebsyet another concept that now looks horribly complected xD
00:28ambrosebsI am enlightened
00:29ambrosebscould you elaborate on your use case with primitives?
00:30dnolenambrosebs: http://citeseer.ist.psu.edu/viewdoc/summary?doi=10.1.1.104.7401
00:30dnolenthat was what rhickey mentioned at the conj
00:30hiredmanhttp://stackoverflow.com/questions/578063/what-is-haskells-stream-fusion
00:30hiredmanah
00:33dnolencore.logic koans in progress … https://github.com/sritchie/core.logic-koans/blob/master/src/koans/basics.clj
00:37ambrosebsdnolen: hiredman: woooo that's some heavy stuff
00:38dnolenambrosebs: you got through Maranget, I'm sure you can handle it ;)
00:39ambrosebsdnolen: what's the purpose of this? "Here's a vector of stuff, see if you can implicitly covert to primitive array?"
00:41dnolenambrosebs: do you mean the purpose in general?
00:41ambrosebsdnolen: yes, I have no idea what this is
00:42licenserRaynes: are you working on a twitter api integration for clojure?
00:42RaynesNo. Why would you assume that?
00:42dnolenambrosebs: operations like map and reduce have a lot of intermedia steps - many of which can be eliminated. we'd rather use reduce but get areduce perf.
00:43licenserRaynes: Because you had two test's in twitter and that might mean you are up to something sneaky
00:43licenserI know you, you are a sneaky one ;)
00:43RaynesI started using twittering-mode for Emacs today, and I wrote a hook to get growl notifications for new mentions. I tweeted @ myself so as to trigger the hook. Nothing sneaky going on here.
00:44licenserah I see, but keep in mind, I have an eye on you, don't you sneak up on things again :P
00:45ambrosebsdnolen: and where does typing come into this?
00:46hiredmanI believe you need to be able to prove the optimizations are correct
00:47hiredmannot a type system per se
00:47dnolenambrosebs: analysis, I think the paper is pretty clear that they leverage the type information to generate the worker function f'
00:49dnolenambrosebs: as w/ most interesting papers correctness is not really that interesting. they talk about their framework lacking a rigorous correctness proof.
00:50dnolenambrosebs: I'm only skimming it, but that papers looks really approachable and leverageable from a Clojure context.
00:54ambrosebsdnolen: awesome.
00:54ambrosebsdnolen: I've learnt a lot about the analyzer, only a few things need to be changed to be generalized
00:55dnolenambrosebs: excellent! Look forward to seeing your notes on the design doc :)
00:55ambrosebsnamely resolving macro expanders and getting rid of substituions of clojure.core to cljs.core
00:56ambrosebsdnolen: I think I'll do a brain dump now, and then read the stream fusion paper :)
00:56dnolenambrosebs: cool!
00:58ambrosebsdnolen: I really don't have an attachment to type checking either, but it seemed like a cool experiment
01:01dnolenambrosebs: I think the type checking is actually really, really cool, and very useful.
01:01dnolenwas really only talking about the completing checking/compilation being uninteresting.
01:01dnolencomplecting
01:02dnolenunless you're using it for stream fusion of course ;)
01:04ambrosebsdnolen: hehe
01:05ambrosebsdnolen: I have a vague understanding that people will find it useful, but I still haven't convinced myself totally ;)
01:05ambrosebsdnolen: type checking that is
01:09dnolenambrosebs: I think there's a good chance it could end up being used a lot. And if not, at least there some blazed trails on how to build custom analysis for Clojure - seem equally big at least to me.
01:11ambrosebsdnolen: It's crazy how far I've got in just a few days
01:11ambrosebsdnolen: the analyzer rocks
01:13hiredmanambrosebs: do you have it running on clojure or clojurescript?
01:13ambrosebsclojure
01:16ambrosebsdnolen: actually I think I'll rewrite it to decouple compilation, then add my thoughts. The more I work with the analyzer, the more work I dump onto it :)
01:16dnolenambrosebs: looking forward to it, off to sleep.
01:17ambrosebsdnolen: cya
01:18ambrosebshiredman: I don't have much interest in clojurescript at the moment. Probably wouldn't be hard to port it
01:18ambrosebsaside from the compiler, of course
01:28patchworkIn a lein project, is there an easy way to access the root directory of that project from clojure?
01:29patchworkFrom inside the app I guess
01:29patchworkit seems like it should be a simple thing to do, but I haven't found anything on it
01:29tolstoyI think File(".") does it.
01:29tolstoyBut that probably depends on where the JVM was started.
01:30patchworkI'll try that
01:31tolstoyIf you're talking lein plugin, I believe it's attached to the project data structure passed to your plugin.
01:31patchworkNo, just from within the src of that project
01:33patchworkHmm, here is the clojure I am trying to do:
01:33patchwork(import java.io.File)
01:33patchwork(File. ".")
01:33tolstoyI think (File. "") gets you the dir you're in.
01:34patchworkIt returns a #<File > object
01:34tolstoyYeah.
01:34tolstoyYou can also use clojure.java.io.
01:35tolstoyTry: (.getAbsolutePath (java.io.File. ""))
01:35patchworkThere it is
01:36patchworkthank you!
01:36patchworkchecking out clojure.java.io now
01:36tolstoyI always forget to use it. ;)
01:36tolstoy(require '[clojure.java.io :as io])
01:37tolstoy(.getAbsolutePath (as-file ""))
01:37tolstoyAlso, (System/getProperty "user.dir"), but that's just the place where the JVM was started. lein repl and lein swank put you in the top of your project.
01:38patchworkThat is what I'm looking for
01:38patchworklein root
01:40michaelr525hello
01:55prosanoob question: is there a way to reload libraries that have already been loaded into the REPL, without restarting it? for example, when bumping a version in leiningen?
02:00tolstoyI don't know. Do you mean like you've started with foo-1.0.jar on the class path, then outside the JVM, you replace it with foo-2.0.jar?
02:46patchworkokay, if I have a file containing clojure code, how could I get a list of functions defined in it?
02:47patchworkI am thinking of defining a macro that builds a map of function names to functions that I can later reference from other code
02:47patchworkbut something like this could already exist
02:59hiredman,(doc ns-publics)
02:59clojurebot"([ns]); Returns a map of the public intern mappings for the namespace."
03:02G0SUB,(doc def)
03:02clojurebotCool story bro.
03:02G0SUB,(doc eval)
03:02clojurebot"([form]); Evaluates the form data structure (not text!) and returns the result."
04:15patchworkf I have a vector [:a 5 :b 11 :c 12] how do I convert that to a map with keys :a :b :c and vals 5 11 and 12?
04:15patchwork*if
04:18patchworknm: (apply hash-map [:a 5 :b 77])
04:36BahmanHi all!
04:37BahmanIs it possible to define a function like (defn f [x y z] ...) and store the partial application of one variable to that function in a variable like (def v (f x))?
04:38ejacksonlike (def v (partial f x)) ?
04:38ejacksonwhere x is some value
04:38Bahmanejackson: Exactly...thanks.
04:43BahmanIs there any naming convention for 'v'?
05:10ejacksonBahman: nope,
05:11ejacksonalthough if you're careful with your arrangements you can do things like (defn sell [product client] ...) (def sell-apples (partial sell apples)), to make the partially applied function names flow well in the code
05:12Bahmanejackson: Thanks for the hint.
05:19pyrhi
05:19pyri have a war which needs to be fed a config pointing to a jar which has clojure namespaces
05:20pyri'm going to have to play dirty tricks with URLClassLoaders and friends, right ?
05:55BorkdudeDoes anyone know a nice tutorial in TDD in Java? (free)
05:55Borkdudeon TDD
05:58michaelr`Borkdude: why in java?
05:59Borkdudemichaelr`: because my students know Java (but I will teach them some Clojure, I promise ;))
06:07erujolcare you intending to teach your students how to do unit testing, retrospectively, or actually drive stuff out through tdd? seems a lot of confusion, but best is by example
06:24viveknWhat does the "#( .. )" form signify in clojure? Does it have something to do with side effects?
06:26pyrvivekn: it is a reader form which builds anon fns
06:26pyr#(+ % 2) => (fn [x] (+ x 2))
06:27viveknThanks. Is there only 1 substitution "%" possible ?
06:28pyrnope
06:28pyr%1 %2 %3 refer to the args
06:28pyrand %& refers to the rest of the args
06:29viveknoh, thats useful. thanks
06:43Borkdudeerujolc: I want them to see an example of how TDD can help you design a simple problem. Just wondering if there is a good tutorial on this onlinr which I can use in class. Next I want to create an assignment based on another problem, so they can try it out for themselves
06:43Borkdude(sorry, had to leave, now I'm commuting)
06:43Borkdudethat is: design software to solve a simple problem
06:53Borkdudegtg again, if you have smth interesting contact me at michielborkent@gmail.com
07:53kzarAny ideas why something like (try stuff (catch Exception e nil)) didn't catch this exception? "PortForwardingL: local port 127.0.0.1:5984 cannot be bound. [Thrown class com.jcraft.jsch.JSchException]"
07:55erujolcthrown in a different thrad?
07:57clgvkzar: there was a change to exception handling in 1.3 - so are you using 1.3=
07:57kzarclgv: Yea
07:59clgvkzar: hmm ok I dont know if it applies when you catch 'Exception.
07:59clgvkzar: but if you aimed to catcha more specific exception than your code might stop working in 1.3 since there are cases when your specific exception gets wrapped into a RuntimeException
08:00kzarMaybe erujolc's right about it being thrown in another thread, I'm using clj-ssh which uses jsch for SSH so maybe jsch throws it in another thread?
08:00clgvkzar: I noticed that with EOFException
08:00kzarBut as my code is interupted and the loop doesn't continue I guess not
08:01clgvkzar: try catching Throwable there. if that doesn catch anything than it's not thrown in there.
08:03kzarclgv: Oh I think that's it
08:04clgvkzar: though it's advised not to catch Throwable in production code. you should narrow it down to specific type you expect there.
08:04kzarcatching throwable worked, yea I was just going to say that
08:05kzarclgv: It's catching the fact the port is in use and spamming me with security dialogues
08:05kzarhad to just kill java
08:05clgvkzar: when debugging I always do (try (suspicious code) (catch Throwable t (debug-repl)) ;)
08:06kzarclgv: So with my example exception above how do I catch that one specifically?
08:07clgvkzar: look at its inheritance tree and decide which class you take. if you only need that exception, catch only its class
08:41pyralright, so i narrowed my classloader issue to this:
08:41pyrin a repl i can add a jar to the classpath
08:41pyrthen use find-namespaces-in-jarfile from tools.namespace
08:41pyrthen call require on them
08:41pyrit works
08:41pyrinside a ring handler
08:41pyrwhen running for instance with lein ring
08:42pyran exception is thrown saying i don't have a DynamicClassLoader
08:42pyrand if i try to set the current classloader to an instance of dynamicclassloader
08:42pyrit fails
08:42pyr(initially: i want to require namespaces found in a jar being loaded after the application starts)
08:47clgvpyr: so you want to build a plugin architecture?
08:48pyryes
08:48pyrwell not really
08:49pyrclgv: i have a daemon which can be configured using a clojure dsl and need the configuration to be supplied as namespaces in a jar
08:49clgvyou probably could do that with the sdk classes for jar files and load-file or load-string - did you give that a shot?
08:50pyrthat's what i'm trying to achieve
08:50pyrunless i misunderstand what you mean by sdk classes for jar files
08:50clgvthere is this builtin: http://docs.oracle.com/javase/6/docs/api/java/util/jar/JarFile.html
08:51pyroh, and load-file can take this as input ?
08:51pyrbecause i'm already building and instance of JarFile to use with find-namespaces-in-jarfile
08:53clgvyou can get the content of the jar via that one -> entries() returns all JarEntries which you can filter and then get an InputStream via JarFile.getInputStream() put that input stream into a suited reader and use one of clojures load* methods that fits
08:53pyr'k
08:54clgvI didnt really do that myself yet - so there might be unexpected obstacles but I guess they are not likely
08:55pyrthe output of entries is not seqable it seems
08:55pyrenumeration-seq
08:55pyrgot it
09:16kzarWhen an exception is thrown it seems to list two exception classes. For example "java.net.UnknownHostException: dub.kzar.co.uk [Thrown class com.jcraft.jsch.JSchException]", can you catch either? I tried catching com.jcraft.jsch.JSchException to no avail and I don't really want to catch java.net.UnknownHostException because it's too vague for my purposes.
09:29clgvkzar: they are probably nested so you could catch java.net.UnknownHostException and check with getCause if it was cause by JSchException
09:29clgvor vice versa. I am not familiar with the output string format you have ;)
09:32kzarclgv: Ah right, I pasted it from Emacs. I tried (catch com.jcraft.jsch.JSchException e ...) but it didn't catch it. I wanted to avoid catching java.net.UnknownHostException so that I don't have to catch an exception for each possible problem with ssh connection. Equally though, as you mentioned, catching throwable seems too promiscuous
09:34clgvkzar: there is also an advanced try-catch löib try+ or something that promised easier exceptionhandling. I didnt try it yet
09:36kzarclgv: ah right, cheers I'll check it out
09:42lemoqhey folks... is there a way to add meta information to pre and postconditions? I have a bunch of functions, each with pre and post conditions, but whenever they fail I do not get in what function exactly that happened (this is the error thrown #<AssertionError java.lang.AssertionError: Assert failed: (== (count %) 1)>)
09:46clgvlemoq: does the stacktrace not tell you where it happened?
09:48lemoqclgv: nope, it just throws the mentioned error
09:54boodleHowdy can someone kindly direct me to how to use a github clone of a leingingen dependency (that I'm hacking on) ?
09:54clgvlemoq: I tried with (defn f [x] {:pre [(pos? x)]} (* x x)) - in the stacktrace the first element of AssertionError show playground$f.invoke playground.clj:47
09:56kzarclgv: Ah the exception was wrapped in RuntimeException like people talked about on google groups
09:57clgvkzar: ah that was my initial assumption.
09:59kzarSo what's the idiomatic way of handling exceptions like that? Catch RuntimeExeption and then use regexp to search the string representation of the exception for the exception class / message you where looking out for?
10:01lemoqclgv: it seems to be a misbehaviour of my editor... in the standard REPL I can at least see the line of code in the source file causing the problem. But thanks anyway for your help :)
10:02clgvlemoq: you can define a print-method for AssertionError that shows you more
10:05lemoqclgv: I don't get that, how?
10:05tsallyis there a symbol where equals always evaluates to false?
10:07clgvlemoq: via defining (defmethod print-method AssertionError [o w] ...) and building the output string that you wana see in this method
10:08clgvlemoq: there is an example in JoC book for queues. maybe you can find that one via google
10:09clgvlemoq: ah here it is: http://my.safaribooksonline.com/book/programming/clojure/9781935182641/composite-data-types/92
10:11lemoqclgv: that looks promising, thanks for the hint
10:11pyrclgv: ok, so that approach worked
10:11pyrclgv: but
10:12pyrclgv: there's a problem when the clj files in the jar require something
10:12pyrlet me be more clear
10:13pyri have a daemon that serves models over http
10:13pyrsaid models are described through a dsl
10:13pyrbut of some fields are generated through utility functions
10:14pyrso if my structure if fooapp.model.post, fooapp.model.category and i have a support fooapp.util
10:14pyrand i load the namespace using the jarfile trick
10:14pyrit doesn't work, even though i set the currentContextClassLoader to a loader which has the jar in its path
10:15pyrweird
10:20clgvpyr: humm right. it doesnt know where the :reuqire/:use-dependencies are if they are not on classpath
10:20clgvpyr: maybe you can have a "plugin" directory that is always on your classpath and just extract the jars there as a workaround?
10:21clgvpyr: I mean, extracting them via thze JarFile access you just used
10:22pyrclgv: ok, but again, the plugin dir will can not be part of the configuration / dynamic. oh well.
10:23clgvpyr: humm I meant you just have this directory thats on classpath where you can temporarily extract all those jars to?
10:24clgvpyr: you could also have a look at JSPF codebase how they use classloaders and try to adopt that to your clojure use case
10:34clgvpyr: on second thought - some time ago I found a snippet of add-to-classpath that worked pretty well with 'use
10:37pyrclgv: ah ?
10:37clgvpyr: have to search it in my git repo. the problem is I deleted it in a later revision - so just figuring out how to search the git repo
10:41clgvpyr: got it -> http://pastebin.com/EjXxK2Rh
10:41clgvpyr: it contains an evil reflection hack, though
10:44pyrah ok
10:44pyryou force addURL
10:44pyrwhich is supposed to be protected
10:44pyrheh
10:44pyrdirty trick
10:44pyri'll try that
10:45clgvyep, it's not my idea. but I dont have the reference url anymore
10:49licenseraloa
10:52pyrclgv: you made my day
10:52clgv:)
11:02bostonaholicjoin #clojure
11:06kzarWhat's the opposite of this? (apply hash-map [:a 1 :b 2]) (Something that turns {:a 1 :b 2} into [:a 1 :b 2].)
11:08vijaykiranvec ?
11:09kzar,(apply hash-map [:a 1 :b 2])
11:09clojurebot{:a 1, :b 2}
11:09kzar,(apply vec {:a 1 :b 2})
11:09clojurebot#<ArityException clojure.lang.ArityException: Wrong number of args (2) passed to: core$vec>
11:09clgv&(vec (concat {:a 1 :b 2}))
11:09lazybot⇒ [[:a 1] [:b 2]]
11:09vijaykiran,(vec {:a 1 :b 2})
11:09clojurebot[[:a 1] [:b 2]]
11:09dnolen(mapcat vec {:a 1 :b 2})
11:09dnolen,(mapcat vec {:a 1 :b 2})
11:09clgv&(flatte {:a 1 :b 2})
11:09clojurebot(:a 1 :b 2)
11:09lazybotjava.lang.RuntimeException: Unable to resolve symbol: flatte in this context
11:09clgv&(flatten {:a 1 :b 2})
11:09lazybot⇒ ()
11:10kzaraha thanks guys
11:10clgv&(vec (apply concat {:a 1 :b 2}))
11:10lazybot⇒ [:a 1 :b 2]
11:10clgv&(vec (apply concat {:b 2 :a 1}))
11:10lazybot⇒ [:a 1 :b 2]
11:11vijaykiranwhat was the +1 karma syntax again ?
11:16jweissis there a page somewhere with recommended packages for emacs-starter-kit? for instance, is durendal still used? slime-clj?
11:18gtrak`&(inc vijaykiran)
11:18lazybotjava.lang.RuntimeException: Unable to resolve symbol: vijaykiran in this context
11:19gtrak`(inc vijaykiran)
11:19lazybot⇒ 1
11:29jcromartieOK, so why don't we have this? http://re-factor.blogspot.com/2010/09/visual-repl.html
11:30kzarjcromartie: Oo fancy
11:30jcromartieor Dr. Scheme
11:30jcromartieanyway, should just be a Swing REPL
11:30jcromartiethe trick is keybindings
11:30jcromartieI like my readline
11:30jcromartieand I do not look forward to porting that
11:30jcromartieJLine sucks
11:49cemerickjcromartie: http://cemerick.com/2011/10/26/enabling-richer-interactions-in-the-clojure-repl/
11:50hhutchi was just about to paste that
11:53ejacksonmeh, mathematica's repl slays all
11:53ejacksonfor rich data stuff, at any rate
11:55ejacksoncheck out http://www.wolfram.com/mathematica/new-in-8/combine-knowledge-and-computation/
12:27cemerickejackson: We should have the raw materials to enable that sort of thing in the very, very near future.
12:27cemerickTool support will be the blocker.
12:27ejacksonwow !
12:27cemerick*raw* materials :-)
12:38hugodritz snapshot supports slime-media, and slime-presentation, so you can return images, and attach context menus to them
12:45cemerickhugod: unfortunately, such things will never be available for tools other than emacs
12:47hugodcemerick: so it would seem
12:54jweissanyone know why I get "Cannot open load file clojure-mode" when I have a (require 'clojure-mode) in my starter kit $USER.el file?
12:55jweissfor some weird reason clojure-mode isn't on the load-path, even though the elpa package is installed.
13:00technomancy_jweiss: if you installed with package.el, you shouldn't require it; you'll have autoloads set up for you
13:02jweisstechnomancy: i'm trying to use custom-clojure.el, how should i add that to my configuration then? (it calls (require 'clojure-mode)
13:02jweissor is custom-clojure outdated? it has code highlighting in the repl, which is the main thing i wanted from it
13:03technomancyI don't know; I've never heard of it
13:03jweissreally? does no one else have code highlighting in the repl then?
13:03jweissor is there some other thing that does it
13:03technomancyyou can do that with a hook; I don't remember the exact invocation
13:03jweisshttps://github.com/mrBliss/dotfiles/blob/master/.emacs.d/custom-clojure.el
13:04jweisstechnomancy: any suggestion how to get that to load ^
13:05technomancyit's not a general-purpose library; it's just some code from some guy's dotfiles
13:06technomancyit looks like he's just grabbed elisp from a bunch of places; there's stuff copied from durendal and an outdated lein-swank defun.
13:08jweisstechnomancy: i'm moving to emacs 24, trying to do things the 'clean' way, but don't know where to get the functionality i had before from this file
13:09jweissdefinitely don't get syntax highlighting in repl without it, and paredit does not work correctly in the repl either (create a paren pair, delete the open paren, close paren stays there)
13:09technomancyI never got paredit working satisfactorily in the repl
13:10technomancyit's hard because the repl contains output, so there's no guarantee that it's structurally sound
13:11technomancyyou probably want elein instead for invoking lein tasks if you want to avoid the shell
13:13jweisstechnomancy: it worked well for me in emacs23
13:13jweissbut then again i had a mishmash of customizations that i am not entirely sure what they did
13:14cemerickI think I've finally come 'round to appreciating hiccup et al.
13:22dnolenhmm a pretty amazing ClojureScript debugging experience could probably be built with this, http://trac.webkit.org/browser/trunk/Source/WebCore/inspector/Inspector.json
13:22dnolenremote debugging protocol
13:27Raynescemerick: Have you used Story at all?
13:28cemerickRaynes: Nope, just looked at the pretty pictures.
13:28RaynesI was playing with it yesterday. Couldn't get it to output anything but the actual source file.
13:29cemerickUt-oh. :-P
13:30RaynesIf I could get the darn thing to work, I'd probably start contributing to it. The project is in dire need of restructuring.
13:30tmciverRaynes: what's story?
13:30Rayneshttp://jedahu.github.com/story/
13:32Raynescemerick: Aha! I got it to work.
13:32RaynesEureka. Hackin' time.
13:32tmciverRaynes: cool, thanks.
13:40jcrossley3is there a better way to ensure true/false when x may be nil than (not (not x))?
13:41TimMccoercing to boolean?
13:41TimMc$findarg map % [true 5 false nil] [true true false false]
13:41lazybot[clojure.core/boolean]
13:41TimMcthere you go
13:42jcrossley3TimMc: cool, thanks!
13:43TimMcRaynes: Looks like shit on FF 3.6.
13:44TimMchttp://i.imgur.com/6oA6Z.png
13:44TeXnomancyyouch: http://lift.la/scalas-version-fragility-make-the-enterprise
13:45RaynesTimMc: Looks fine in 7.
13:45RaynesTimMc: Make an issue: https://github.com/jedahu/story
13:46RaynesTeXnomancy: That can't be good.
13:47TeXnomancyRaynes: tl;dr: AOT creates nightmares.
13:54cemerickNot sure fixing FF 3.6 bugs is going to be very high on anyone's list.
13:55acceldear the great ones of clojure
13:55accelhas any wizard conjured up an editor in clojure
13:55accelwhere I can code in unicode and latex expressions?
13:55cemerickPollak has been "honest" about Scala quite a lot lately.
13:56cemerickaccel: any decent editor will let you use unicode.
13:56cemerickAny decent editor will also make you think twice about using latex. :-P
13:56OlegYch|hyou heard him being "unhonest" ?
13:57acceli'm confused
13:57acceldoes "unhonest" mean honest?
13:57accelsince "" negates the word within
13:57accelso is "unhonest" like not unhonest ?
13:57accelyeah; I have unicode support in vim; but hmm; I guess what I reallyw ant is the abilityt o layout equations in latex
13:57acceland then have them evaluate as clojure code
13:58accelI think fortress was supposed to do this?
13:58cemerickWhat I was getting at is that criticism is alternatively honesty, bitterness, trolling, etc., depending on the reader.
13:59cemerickaccel: IIRC, fortress can emit latex for code, but doesn't consume it.
13:59cemerickit has nothing to do with clojure though.
13:59OlegYch|hsorry, you mean he is trolling?
14:00accelcemerick: if fotress had an editor that could write typeset math, and evaluate it, I would like to create a clojure binding for it
14:00accelwhich shouldn't be hard sine both are Java based
14:00cemerickOlegYch|h: Definitely not what I'm saying.
14:00cemerickI retract all my comments on the matter.
14:00cemerick:-P
14:01cemerickaccel: I don't think there is such a thing as a "fortress editor" — it takes in fortress code, and can evaluate it and/or emit latex, images, etc. containing that code.
14:18TimMccemerick: 3.6 is still fairly common, unfortunately
14:18TimMcincluding my machine :-(
14:18cemerickmy apologies
14:18cemerickI was stuck there myself for longer than I wanted until the PDF plugin was updated for 4+
15:03jodarosheesh
15:04jodarojodaro: 1 emacs: infinity
15:10TimMcjodaro: http://www.printmojo.com/deviantlogic/Store/Product.php?ProductID=14252
15:11TimMc(Disclosure: That's a friend of mine's store.)
15:12jodaroheh
15:16jcromartie_desktsup
15:17jcromartie_deskM-x irc is the best thing ever
15:22jcromartie_deskI wonder if paredit works in irc mode
15:22duck1123jcromartie_desk: I know it does in erc if you turn it on
15:22duck1123smilies will kill you though
15:24TeXnomancyjust switch to korean smiles: ^_^
15:25duck1123I find I try to avoid doing smiles or frowns in here simply because of the unmatched parens
15:28djhworld
15:28djhworld
15:28djhworld
15:36Squee-Ddjhworld make them look like homer (8-)
15:37djhworldSquee-D: sorry have I been posting nonsense again
15:37Squee-Dno sorry
15:37Squee-Di missed. duck1123 was who i should have hit
15:37Squee-Dyou did post three blank lines immediately after him which is what cause me to miss.
15:37djhworldhaha OK, was just worried then as I'm messing around with emacs and rcirc
15:38djhworldthe blank lines would probably explain that!
16:10jedahudoes clojure(script) have anything analogous to common lisp's read-time conditionals?
16:13dnolenjedahu: no, but perhaps one day.
16:16jedahudnolen: I'm stuck with cpp then; ugh.
16:18dnolenjedahu: yeah sharing code between CLJ / CLJS needs to be sorted out ...
16:30gtrak`dnolen, still waiting for that turn-dial rich hickey promised :-)
16:40jweissanyone emacs folk know if clojure repl (emacs starter kit) should run in slime-repl-mode or just REPL-mode? mine is in REPL-mode. doesn't seem right
16:53nighty-pyr, salut :) c'est Christophe
16:59daniel__1im trying to work out where to put the css iles in a noir app, so that include-css inds them. can anyone help me out?
17:11djhworlddaniel__1: create a dir structure called "resources/public/"
17:11djhworldunder the root of your project
17:12technomancyI'm wondering with all this complaining about binary compatibility in scala if they have looked into using classifiers to specify artifacts targeting different scala versions
17:13pjstadigi don't think that is the problem people are highlighting
17:14pjstadigthe problem is the dependency hell and combinatorial explosion caused by the incompatibilities
17:15technomancyif it's an issue of binary compatibility only, then I think as long as each library in the dependency chain was careful to publish versions with the appropriate classifiers it would help.
17:15technomancyif it's an issue of source-level incompatibility, not so much
17:17pjstadigsure it would probably help, but who wants to be responsible for compiling a bunch of different copies of their libraries, one for each Scala version
17:17technomancyit's easy using lein-multi
17:17technomancyclearly the problem is that they are using sbt; they should all switch to lein. =)
17:18pjstadighehe
17:18technomancyhm; actually lein doesn't support setting the classifier when publishing, just when consuming.
17:18technomancybetter fix that
17:21technomancyhttps://github.com/technomancy/leiningen/issues/349
17:31jasperlahi
17:37cemericktechnomancy: people have a rough time with SNAPSHOT, and you want everyone to publish N artifacts with suitable classifiers? ;-)
17:37devinushas anybody here worked with both CL and clojure?
17:38technomancycemerick: weeeeeeeellllll... it's something that should be trivial to automate, right?
17:40cemericktechnomancy: *if* you've got a good release process + good metadata
17:40technomancyright; "trivial" is probably not the right word. =)
17:40pdki'd assume a lot of folks here have at least learned cl dvev
17:40pdkdev
17:40technomancybut "possible to automate in such a way that it appears trivial to the user" maybe?
17:40technomancypdk: it's a much smaller number than you'd think
17:41technomancyaround 5% of survey respondents: http://cemerick.com/2011/07/11/results-of-the-2011-state-of-clojure-survey/
17:41pdkwow
17:41technomancyMAYBE they are all keeping quiet in order not to draw attention to themselves, since that could result in me convincing them to help maintain swank-clojure.
17:41cemerickTo be fair, that's a choose-one question asking where people came from Clojure.
17:42zakwilsonI used to use CL a lot and now pretty much only use Clojure.
17:42cemerickMaybe more like 20% have *some* prior experience.
17:42cemerickI personally try to forget my brief affair with CL.
17:43zakwilsonI like some things in CL that are missing from Clojure.
17:43technomancyyeah, "having used CL at some point" is more common than "has used CL and Clojure in time periods with non-trivial overlap"
17:43zakwilsonI've actually used symbol-macrolet in production code.
17:49zakwilsonIt's interesting that while few people came from Common Lisp, many would go to it if they couldn't use Clojure.
17:52TimMcOr they'd go to Scheme.
17:53gtrak`clojure is lisp gateway drug?
17:54brehautid go to scheme or an ML if clojure vanished today
17:55devni think it is a gateway drug. i went looking for a lisp and found CL. the community was not very friendly, and clojure seemed to present an opportunity for me to get a real job writing it.
17:56devnthat meant I finally knuckled down and learned some emacs. after copying/pasting I found myself writing elisp. lately i've been playing with racket. so yes, gateway drug.
17:57devinus"The read table is currently not accessible to user programs"
17:57devinusis that still true?
17:57seancorfieldi'm not sure what i'd go to if clojure disappeared - i'm wedded to the jvm right now
17:57devnif clojure disappeared I would attempt undisappear it
17:57devnattempt to*
17:58seancorfieldwell, given it's on github and lots of people have forked it, "disappear" is unlikely i suppose :)
17:58bhenrydevn: if clojure disappeared i would use it as it is now forever.
17:59seancorfieldbut _if_ the community went away, and there was essentially no support out there, then i'd move to something else for the mental peace of my company... i just don't know what that would be...
17:59devnyeah, i mean, if clojure did not exist, I think I would probably end up needing to choose a "hobby" language, which is the best part about clojure
17:59devnI don't feel like clojure is a hobby language.
17:59amalloygtrak`: "lisp gateway drug"? that's like marijuana being a marijuana gateway drug
17:59seancorfieldi sort of came to clojure from scala (in a very loose sense) but i don't think i'd want to go back to scala :(
17:59devinuszakwilson: what's in CL that you miss from clojure?
18:00gtrak`amalloy, we are all hyper-sensitive to this point by now :-)
18:00devnamalloy: it's lisp lite or something -- seemed less daunting to me as a newb, but then again i was totally unfamilliar with lisp so I had no real criteria to use when choosing clojure over another lisp
18:00zakwilsonUser-defined reader macros, symbol macros, method combination.
18:01devinuszakwilson: CLOS?
18:01zakwilsonNot really.
18:01devnI didn't choose clojure. Clojure chose me.
18:01devnWe're best friends who happen to also be lovers.
18:01zakwilsonWell, method combination is from CLOS I guess, but I don't miss classes.
18:01devinusisn't it hard to do macros using a Lisp-1 ?
18:01zakwilsonNot really.
18:02devinusnot knowing clojure well enough i couldn't say
18:02devnFirst rule of macro club: Don't use macros.
18:03seancorfieldif lisp ran on the jvm, i'd use that... oh, wait... :)
18:04jodaroclojure and i are secret lovers
18:04jodaroand penny lovers
18:04zakwilsonClojure macros qualify symbols to their namespace by default, so unintended name capture is unlikely.
18:04devnclojure and i ride penny farthings, attend ice cream socials, and Get Things Done together
18:05technomancydevinus: it's harder to write composable macros than it is to write composable functions, and lisp-1 users generally care more about composability.
18:05devinuszakwilson: do you miss the condition/restart system?
18:05amalloyhugod: what's the Right Way to get a clojure debugger (preferably in slime) these days? i'd like to be able to step through some code that's crashing in a way that makes it extremely hard to get a stacktrace
18:06zakwilsondevinus: Sort of. It's available as a library in Clojure, but I haven't wanted it enough to try it out.
18:08zakwilsonMostly, I think it will be annoying to have both that and Java exceptions, so I haven't bothered.
18:37seancorfieldamalloy: have you tried george's swank-cdt lately?
18:44amalloyseancorfield: not lately
18:45amalloyi think when i searched for it just now i found some really-old document about it, implying it doesn't have features i want, like stepping. but i found something newer that says it does
18:46technomancyI've done stepping with cdt
18:46technomancyhelped me find a bug in the clojure reader
18:47amalloytechnomancy: and whatever version of lein swank i have is compatible?
18:48technomancyamalloy: you need 1.4.0-SNAPSHOT specifically; none of the cdt stuff is on 1.3.x
18:49amalloyoh ugh, but i can't use lein swank anyway on this project, because it uses cake stuff that isn't in lein yet
18:49licenserbut isn't cake dead dead?
18:51amalloymostly i think it just uses native deps, which work fine in lein but require some different syntax in project.clj
18:52technomancyman are there a lot of Japanese clojure tweets.
18:53technomancyI wonder how far off ClojureConj.jp is
18:53amalloytechnomancy: about halfway around the world, eh?
18:53technomancybadum
18:56licenser^^
18:57_ulisesyou still on cough medicine?
18:59licenser_ulises: should be, but I figured not to take it any more, it isn't helping just making me fuzzy(er then usual)
18:59cgrayis anyone else having problems pushing to github?
19:00licenserfigured a good alternative is to stay awake through the night, the cough is worst there and really sucks when you try to sleep. And around 10am you are so wasted that you can sleep no matter what :)
19:01technomancyit's amusing how load-file doesn't take a file
19:02_ulisesheh
19:03jodarowow
19:03jodarothis should be interesting
19:03jodaroso i've got this little service framework in clojure
19:03jodarousing zeromq
19:03licenserso my gui issue is quite easy, I have this really cool project, a programming ai game and I've a quite decent backend by now, working in erlang, nicely distributed and everything. But my gui guy abandoned me so I have a part of a gui but nothing really :( sooo frustrating
19:04jodaroone of the clients of said framework here needs to access it via http
19:04jodaroso i put a stupid simple layer in front for that
19:04jodaroin my tests
19:04jodaroaccessing via http is like 9 times slower
19:04jodarothan the direct zeromq request/response
19:08amalloyjodaro: just buy eight more computers
19:08jodaroyeah
19:08jodaroor i could make it even faster and buy 16
19:29AWizzArdtechnomancy: does Leiningen support something like :java-test-path in the project.clj? I saw this key mentioned in an issue, but there is no example in the sample-project.clj file.
19:29technomancyAWizzArd: no, there's no way to run java tests, so it doesn't make sense to specify the path to them
19:30AWizzArdtechnomancy: could one not use some test framework in Clojure (for example Midje, but it could be something else too) which can be called after "lein compile" and which then simply creates Java classes and tests them?
19:31technomancyAWizzArd: sure, you could do all kinds of stuff like that in a plugin
19:31AWizzArdThis would be only for mirroring the directory structure that one can find under the src/ dir, such as src/clj and src/java, for which one can specify the :source-path and :java-source-path.
19:32AWizzArdIt would now look strange to have all tests just under test/. It would look more symmetric to have test/clj/ and test/java/ too.
19:32AWizzArdSo, you would say that it would be the best option that lein-midje adds such a key yes?
19:33technomancyyeah, whoever runs the test should dictate what the options look like
19:33AWizzArdA key like :midje-options or :java-test-path.
19:33AWizzArdOkay okay, then I will continue discussing this with Brian. Thanks for your inputs :-)
19:34technomancysure
19:34technomancymaybe a "lein junit" plugin or something? that's a pretty well-defined interface to work against
19:38AWizzArdYes. There is already lein-midje which adds "lein midje". That also takes a list of namespaces to test.
19:39AWizzArdIn principle that existing plugin could respect :midje { ... } if that was specified in the project.clj.
19:40sridI am tempted to name my Python module implementing some clojure primitives as "pojure.py"
19:40sridor clothon.py?
19:41licenserAWizzArd: wow du lebst :D
19:41AWizzArdlicenser: yes, but need to head to bed now ;)
19:41licensersleep well friend :)
19:45cemerickHas anyone used test.generative before?
19:46cemerickOr, more concretely, are there any alternatives out there to test.generative?
20:03alexbaranoskyI haven't heard of any alternatives other than ClojureCheck, which I think is out of date
20:08cemerickalexbaranosky: Yup, I just noticed it. re-rand ended up being what I needed. https://github.com/weavejester/re-rand
20:15buduhi
20:16budui was wondering if anybody know of a sensible name for the following function
20:16budu(defn foo [coll] (partition 2 (butlast (rest (interleave coll coll)))))
20:16buduand also if it already exists?
20:17_ulisesbudu: what does it do?
20:17budu(foo [1 2 3 4 5]) -> ((1 2) (2 3) (3 4) (4 5))
20:17_ulisesright
20:17amalloy&(partition 2 1 (range 1 6))
20:18lazybot⇒ ((1 2) (2 3) (3 4) (4 5))
20:18cgraybudu: there's (partition 2 1 (range))
20:18cgraytoo slow
20:18buduoh yeah, forgot about that!
20:18buducgray: what is too slow?
20:18cgrayi am :)
20:19cgrayamalloy beat me to it :)
20:19amalloyif you were reimplementing, a nicer solution would be ##(let [coll (range 1 6)] (map list coll (rest coll)))
20:19lazybot⇒ ((1 2) (2 3) (3 4) (4 5))
20:19buduamalloy: nice one
20:37cgraybtw, i submitted a patch through jira a few weeks ago that doesn't seem to have been noticed... is there anything i should do to change that? it's http://dev.clojure.org/jira/browse/CLJ-873
20:57hiredmancgray: http://dev.clojure.org/display/design/JIRA+workflow
20:58cgrayhiredman: I've seen that, I don't know what I'm missing from it.
20:58hiredmancgray: your issue is in an "open" state, which means a member of clojure/core has not yet looked at the issue and decided it is a real issue
20:58hiredmanso you can go on the clojure-dev mailing list and try to get the attention of someone from clojure/core
20:59cgrayok, sounds like a plan
20:59hiredmanat which point it will most likely sit in the vetted backlog until a clojure commiter (smaller group than clojure/core) decides it should be in the next release
21:00hiredmanat which point someone will look at the patch and decide if it is "good"
21:00hiredmanif it is "good" and rich oks it, it goes in
21:04dnolencgray: I can't imagine that ticket getting high enough priority to be considered in anytime soon. When Clojure was simpler and rhickey was working on it all the time, patches were applied pretty quickly. Things are pretty slow these days.
21:05cgraydnolen: that's the way it seems... i'm only a little worried that the patch will become out of date if it sits for too long
21:06dnolencgray: well it's a simple patch, so going out of date isn't such a big deal. it's your ticket and you can keep it up to date.
21:23devncemerick: you around?
21:23cemerickdevn: only notationally; what's up?
21:24devncemerick: I was thinking about the volume of messages on the Clojure mailing list, secondary sources like disclojure, planet.clojure.in etc.
21:24RaynesHah.
21:26devnI suggested to the rubyinside guy (Peter Cooper) that he should do some sort of week or month in review of the ML, up-and-coming projects, interesting ideas, IRC snippets, etc.
21:26zakwilsonIt seems like transitioning from one guy's project that a few people contribute patches for to a big community thing might be a tricky process.
21:26devnMostly Lazy seemed like it might be a good place for that. Honestly if someone went through and gave me a podcast or screencast digest would be great.
21:27devnd'oh. cemerick left me :(
21:28devnblech -- I can't write coherent sentences. :\ I guess what I'm saying is, if someone spent the time to give a human-edited abridged clojure and/or clojure-dev ML that is something I would pay a subscription to.
21:41ihodesamalloy: horrible mistake there (for in lieu of doseq), but unfortunately that wasn't it
22:34gtrak``it's not so hard to keep track of all that, is it?
22:35gtrak``there's a 'today in the intertweets' somewhere
22:36gtrak``disclojure's rss feed has a little summary every day
22:38gtrak``so you want kind of what michael larabel does with phoronix?
22:39gtrak``he keeps track of all the mailing lists and writes articles from time to time, it's an interesting thought
22:40gtrak``I think he's making a living off of ad revenue
22:53gtrak``devn, i like the idea, seems like disclojure is where it should live
22:56tbatchelligtrak``, devn: I am open to new contributors to disclojure :)
22:57tbatchellikeeping track of everything is a lot of work though
23:44amalloydnolen: updated my cljs patch just now. letting you know, since jira didn't email me when you commented and maybe it doesn't email you either?
23:45dnolenamalloy: cool, yeah I'm not sure when JIRA emails and when it doesn't
23:46dnolenamalloy: thx, that looks great
23:47amalloyso far my experience has been: email me when anyone, including me, does something on any ticket ever; except the one time i don't bother checking back in because it always emails me
23:56dnolenamalloy: patch applied
23:57amalloyexcellent, thanks