#clojure logs

2010-08-14

02:44tomojdoes clojure-protobuf really require my project to use cake to be useful?
02:49notsonerdysunnycan I get leiningen's help to create a pom.xml file for an existing jar file .. it is not available on any repositories.. So, I want to push it on to clojars.org I am talking about jReality.jar
02:50notsonerdysunnyexcuse me for saying everying in ..the reverse order
02:54tomojhmm, the jar doesn't need any dependencies?
02:57notsonerdysunnytomoj: it has native dependencies ...
02:58tomojhow would that even work?
03:17ninjuddtomoj: you don't have to use cake for clojure-protobuf. it just provides tasks for easily compiling proto files
03:18ninjuddtomoj: you can download google's code and install it on your own, and use protoc directly if you want
03:20ninjuddalso, it doesn't have native dependencies once you have compiled your proto files to java files
03:21ninjuddjiraph is a better example of a project with native dependencies (tokyocabinet)
03:22ninjuddcake is useful there because it automatically extracts the native libraries from the tokyocabinet jar and sets up your library path
03:50hiredmanhttp://gist.github.com/524109
03:52GRongood morning
03:54GRoncould someone give me a hint why the following code complains that the symbol case can not be resolved?
03:54GRon(defn read-input [input-receiver]
03:54GRon (loop [data (read)]
03:54GRon (case data
03:54GRon "[A" (;(send input-receiver move 'up)
03:54GRon (print "UP"))
03:54GRon "[B" (print "DOWN"))
03:54GRon (recur [data (read)])))
03:54hiredmanwhich version of clojure?
03:54GRon1.1
03:55hiredmanI believe case didn't exist then
03:55GRonok, that could explain it. thanks
04:05GRonthanks hiredman, using 1.2 worked :)
06:54callen-permnychas anyone here worked with aleph much?
08:45tcrayford,(use 'clojure.walk)
08:46clojurebotnil
08:46tcrayford,(postwalk identity {:tag :atom :content ("zni")})
08:46clojurebotjava.lang.ClassCastException: java.lang.String cannot be cast to clojure.lang.IFn
08:46tcrayfordoh
08:47tcrayfordduh
08:47tcrayfordthe list needs quoting
09:08neotykHi *
09:09neotykI'm trying to design developer friendly API fro async http client for clojure, and would very much appreciate your comments
09:11neotykhttp requests that are supposed to finish will return promise
09:12neotykwhile those that are to consume http streams return ref to map that contains promises for different stages of processing
09:13neotykit doesn't look right to have to different results types, does it?
09:16hiredmanso no "oh gee weez that's cool" on fork?
09:17hiredmanhttp://gist.github.com/524109
09:24neotyklet me as it otherwise
09:25neotykhttp://github.com/neotyk/ahc-clj/blob/master/test/async/http/client/test.clj#L163
09:25neotykresp here is a promise
09:25neotykso once it is delivered all map members are in place
09:25avdiN00b here.
09:25neotykwhile stream API http://github.com/neotyk/ahc-clj/blob/master/test/async/http/client/test.clj#L252
09:26avdiWhere are the clojure equivalents of gets/scanf/read/readline etc.?
09:26avdi(and why the heck isn't that covered in the first chapter of every Clojure book??)
09:27neotykis (ref {}), so will not have straight away :body and :headers
09:33hoeck(doc read-line)
09:33clojurebot"([]); Reads the next line from stream that is the current value of *in* ."
09:33hoeckavdi: ^
09:36avdihoeck: thank you. Is there somewhere I can see the whole family of related functions?
09:37hoeckavdi: clojuredocs.org, clojure.org ...
09:37hoeckavdi: and for lower-level reading, I'd suggest using the related java methods
09:42hoeckavdi: and clojure has a repl, so there is imo no real need using readline/scanf to ask for program input (and thus not being in the first chapter of any clojure book)
10:19avdihoeck: fair point.
10:20avdicall me old-fashioned but my first standalone program in a new language is always something with plain-old console IO
11:33BahmanHi all!
11:34arkhhi Bahman
11:37BahmanHi arkh!
12:19qbgIt's slow, but Clojure runs under IKVM
12:21arkhthat's cool. I wonder how much overlap there is between available bytecode-level operations on the JVM vs. CLR
12:22arkhI'm guessing Microsoft thought ahead on that one and made sure they weren't close enough to be convenient ... but I wouldn't know
12:22qbgIt dies when you run the generated exe by ikvmc though :(
12:25qbgIf you think the startup time of Clojure is terrible, just take a look at Clojure under IkVM
12:25arkhhow fast is java on IKVM, or does it really depend on what you're doing?
12:25qbgThing get faster once they are JIT'ed
12:25qbg(+ 2 2) take a bit at first
12:25clojurebot4
12:26qbgWell, at the repl anyways
12:27qbgMy sudoku solver is at least 60x slower
12:27qbg(Mono probably isn't the best here)
12:29qbgtime ikvm -jar clojure.jar -e "(System/exit 0)" takes 9 seconds
12:29arkhI wonder which is the better pursuit: clojure on CLR or clojure on JVM + IKVM. With the second option, you only need to learn one set of outside libraries.
12:29arkhimpressive (depressive?)
12:29qbgIKVM isn't perfect; my swing gui was messed up a bit
12:31qbgClojure on the CLR has got to be better than Clojure under IKVM
12:32arkhif IKVM got more complete (e.g. a swing gui ran correctly, etc.) and everything was compiled ahead of time, speed would probably be comparable?
12:33arkhJIT everytime would probably be impractical
12:34qbgikvmc barfs a lot of warnings when compiling clojure.jar
12:34arkhbecause IKVM isn't done yet
12:34arkh?
12:36qbgAll the warnings come from stuff created by proxy
12:37qbgThey are all like "Warning IKVMC0116: emitted java.lang.AbstractMethodError in "clojure.pprint.proxy$java.io.Writer$0.flush()V""
12:38qbgAnd the clojure.exe dies with java.lang.IllegalAccessError: Try to access field clojure.lang.PersistentList.EMPTY from class clojure.core$reverse
12:38qbgStartup time doesn't look any better, though
12:39arkhthat's no good
12:39arkhI wish I knew enough about that stuff to dig in and understand why the .exe would be slow
12:40qbgWell, IKVM is a VM on a VM
12:40arkhit's not translating java bytecode to CLR bytecode?
12:40qbgIIRC, IKVM also needs to emulate some constructs of the JVM
12:42qbgIt sounds like it does translate as much as it can, though
12:42flintfdo you guys think Oracle's shenanigans will have any impact on Clojure?
12:43qbgIMO, indirectly at best
12:44flintf:-/
12:44qbgIf a lot of people start moving to another platform, Clojure would probably get ported to that platform at some point
12:45flintfyea
12:45arkhflintf: from what I understand, Oracle is upset at Google for making an almost-java runtime and not paying licensing or whatever. Clojure doesn't change the JVM so should be all good.
12:45technomancythe biggest bummer is that it kills the forkability prospects
12:46technomancybefore oracle, we could say "well if Sun screws it up too badly we can always fork openJDK"
12:46flintfyea that's what I was thinking technomancy
12:46technomancynow you can only do that if you live in a country with a sane patent policy (outside the US, in other words)
12:46mefestoopenjdk is unforkable?
12:46flintfit's all above my head tbh
12:46flintfbut from how I understand it, Oracle is mad that google made their own jvm
12:47technomancymefesto: if you implement a subset or superset of the JDK and can't get certified, you're vulnerable to all manner of patent asshatery
12:47woobyanyone experimented w/ scala interop? trying to instantiate a scala class here and failing, thanks in advance
12:47qbgDoes it? openJDK has a patent grant and other stuff that a fork might inherit (I am no lawyer)
12:48technomancyqbg: the patent grant only applies if your fork is Certified Java
12:48technomancyand oracle can withhold certification for no good reason
12:48hiredmanwooby: will be tricky, scala's code generation is bound to be complicated
12:48hiredmanwooby: will need to do spelunking with repl-utils/show and javap
12:49hiredmanor not
12:49flintfas long as clojure will continue to exist in some form, I'll be happy...but I liked the java interop
12:49hiredmanlooks like Scala classes generate Java classes
12:50hiredmanwooby: http://www.codecommit.com/blog/java/interop-between-java-and-scala might help
12:50woobyhiredman: thanks, yeah they're supposed to be java classes
12:51woobybut in the case of the one i'm dealing with, the ctor is missing
12:51qbgflintf: I doubt there is going to be a sudden mass exodus from Java in the near future
12:51hiredmanwooby: if you use javap you can get a dump of methods/ctors from classes
12:52flintfI agree probably not
12:52woobyhiredman: i'll play with it more, thanks
12:52hiredmanyou can also run repl-utils/show on classes
12:52flintfit's just I'm just starting out in Clojure, and loving it...and now Oracle is sort of castingh a cloud over my honeymoon
12:54qbgI wouldn't worry about it too much
12:56woobyhiredman: turns out this object is a trait, and officially has no constructor http://blog.jayway.com/2010/04/28/intercepting-scala-trait-constructors/
13:17hv,(read-string ";")
13:17clojurebotjava.lang.RuntimeException: java.lang.Exception: EOF while reading
13:17technomancyclojure will always be safe to use with java 6
13:18technomancyit's just that the odds of moving beyond 2005-era technology are uncertain
13:18opqdonutjvm 7 will be here Real Soon Now :)
13:18hvdoes clojure run on dalvikvm ?
13:21flintfhv, some were just discussing that earlier
13:21flintfapparently it does, but not very well at all
13:25mefestothis whole oracle thing is very confusing for me. i thought the whole point of openjdk was that it would become a community gpl'd project (most parts of it at least) and as long as your derivative is gpl too then it's all good :-\
13:25flintfactually, don't mind me, they weren't
13:26flintfthey were talking about ikvm
13:26flintfwell it's all above my head mefesto, but I think the issue is patents
13:27mefestoflintf: yeah it's over my head too. seems like patents and open source are at odds with each other.
13:27technomancymefesto: well, that's true modulo software patents
13:27technomancythe license is great
13:28technomancypatents and software are at odds with each other
13:28technomancyit's certainly not specific to any one licensing scheme
13:29mefestoyeah, i heard that microsoft has/had a patent pending on the if-not condition, or something along those lines :)
13:30technomancyhttp://www.plotpatents.com/about_us.htm
13:31anarsI'm starting to believe my efforts for working with clojure-clr on the Mono CLR runtime is a waste of time
13:31arkhit used to be that patents protected the motivation to invent. Now they're more often used to protect someone's business model in an otherwise changing or competitive environment.
13:32anarsit just keeps on surprising me with traps and other unpleasant stuff :-(
13:33flintfI'm going to apply for a patent on "a method for protecting one's business model by harrasing other organizations with patent lawsuits"
13:33technomancyflintf: plenty of prior art there, unfortunately
13:34technomancynot that prior art has ever gotten in the way of the USPTO
13:34flintfyea
13:34arkhis it possible to trademark with prior art? I get my IP law mixed up
13:34flintfI think someone managed to get a patent on the linked list
13:34arkhflintf: disgusting
13:35arkhUS patent system == broken
13:37technomancyarkh: it's a great advantage to companies outside the US, on the other hand. =)
13:38arkhtechnomancy: ; )
13:38flintfI think the problem is the patent system was invented at a time where they could not forsee a lot of the considerations we face with patents on modern technology
13:39kencauseyYes, when it took months, years, even decades to make an 'invention' into a marketable patents made a lot more sense.
13:39flintfits works pretty well for a better mousetrap, but patenting human genes? I dunno
13:39kencauseys/marketable/marketable product/
13:39sexpbotYes, when it took months, years, even decades to make an 'invention' into a marketable product patents made a lot more sense.
13:40arkhThe ability for large organizations with large profit motives to slowly grow it to benefit them over time made into something more than what was perhaps originally intended
13:42arkhthe whole area of IP law has become polluted - easy evidence can be found when companies can find it more profitable to sue than to make new products or services
13:43kencauseyWill we ever learn that sometimes it makes more sense to remove legislation than to add more?
13:43arkhimpairing the free market and the ability for the buyer to choose their best option
13:46arkhending on a positive note: I'm thankful for all the brilliant people that work on the open source successes out there, clojure and its related projects included :)
13:47arkhI owe most of my education to them. Have a good day all.
13:56KirinDavehiredman: "join" ?
13:56anarswhen talking about "clojure in clojure", how does it make sense to talk about progress? I mean, is there a project group who concentrates on implementing it?
14:04Chousukeanars: As far as I know there's no concentrated effort to actually rewrite the compiler yet.
14:07ChousukeI suspect it'll be a gradual change at first, with interfaces being replaced with protocols, and the datastructures possibly getting rewritten in Clojure, etc.
14:07anarsChousuke: is the language still evolving too much for it not to be a waste of time?
14:08anarsah yeah, protocols. now that 1.2 is close (I believe the protocols API s frozen :))
14:08anarsperhaps the work on CiC will begin.
14:08ChousukeSome would say it's already underway :)
14:10ChousukeBut I think it would be rather optimistic to say that 1.3 will do away with all the java bits :P
14:11anarsyou mean 1.2?
14:11anarsis the work on cic being done on the master branch of clojure on github?
14:12ChousukeNo, I mean 1.3
14:12ChousukeThat is, I suspect the cinc stuff won't be done within the next release cycle :)
14:14anarsI see
14:16Chousukethere are a whole bunch of branches in the Clojure repo it seems
14:16anarsI guess cross-vm clojure will take speed when cinc is a reality then
14:16anarsaye, checking now
14:17ChousukeMaybe some of those branches should be moved or deleted though, they're old :/
15:05phaerI have got (ns clog.core (:gen-class)) in my core.clj and (defproject <...> :main clog.core) in my project.clj? But when i do "java -cp "lib/*" -jar clog-1.0.0-SNAPSHOT.jar" it says "Could not find the main class: clog.core. Programm will exit. (full error: http://clojure.pastebin.com/LUTd79Nu) Any ideas?
15:06phaerAnd when i start the repl (lein repl or lein swank, no difference) clojure does not know my ns (clog.core)...
15:10chouserphaer: Using -jar causes java to ignore all other classpath specs. You can't mix -cp and -jar
15:12phaerchouser: Thank you, i am not a jvm guy. Got it working with lein uberjar. But would still be interested in my swank/repl problem for incremental development.
15:17chouserI'm not sure what would be causing your swank problem, but it definitely sounds like classpath configuration.
15:20phaerchouser: What kind of classpath configuration do i have to do? I thought lein deps would solve that for me?
15:22hiredmanping?
15:22clojurebotPONG!
15:23tomojphaer: ./classes/clog/core.class exists?
15:24phaertomoj: yes.
15:24tomoj".../classes" is in (System/getProperty "java.class.path") ?
15:24phaertomoj: one sec
15:25phaertomoj: yes it is
15:26phaertomoj: (as an abolute path, not relative)
15:26tomojwhat makes you think clojure doesn't know about clog.core?
15:27phaertomoj: Oh just found out: it does. I did some mistakes with the namespace functions before. thanks for your help :)
16:15raekis the clojure-dev group also for contrib issues?
16:16raek(the google group, that is. not the assembla space)
16:17LauJensenFinal try: Does anybody here know the name of a deployment tool which lets you host multiple projects on a single JVM instance?
16:19technomancyLauJensen: osgi might support that
16:19technomancyfrom the tiny bit that I've heard of it
16:19LauJensenI'll go look, thanks
16:44polypusanyone know of a function someplace which converts a camelcase string to a dashed one which i could grab?
16:46polypusnever mind, found one
16:46clojurebotforget Clarity of mind means clarity of passion, too; this is why a great and clear mind loves ardently and sees distinctly what it loves. -- Pascal
16:47LauJensenpolypus: Can I see?
16:47raekpolypus: nice... where? :)
16:47polypushttp://gist.github.com/raw/462593/9a8e3ce957ce5282672a145d0ec20a9393fa009f/enhanced-record.clj
16:47LauJensenah nice, almost what I thought
16:47LauJensen,(->> (re-find #"([a-z]+)([A-Z]+.*)" "camelCase") rest (map #(.toLowerCase %)) (interpose \-) (apply str))
16:47clojurebot"camel-case"
16:47polypusclojurebot: only pascal wasn't a prime example of clarity of mind
16:47clojurebotforget Clarity of mind means clarity of passion, too; this is why a great and clear mind loves ardently and sees distinctly what it loves. -- Pascal
16:48technomancyclojure defines one for internal use; it would be nice if it exposed it
16:49polypustechnomancy: where is that one?
16:54technomancynot sure
16:55dnolenhmm how can you get .printStackTrace to print to out instead of err?
16:55kenshohow would you implement a function like this http://pastebin.com/YYmu4EDU in clojure? prefix notation makes this very unpleasent. is there another way? Also this is used in a tight inner loop so it's performance critical.
16:56opqdonutjust write it out
16:56opqdonutuse primitive math
16:56opqdonutyou get used to prefix math
16:57opqdonutand by primitive math I mean the int and float functions
16:58kenshoI see. But I think prefix notation is very awkward in this case
16:58opqdonutone gets used to it
16:58kensho:)
17:05raekkensho: have you looked at the incanter math lib?
17:06kenshono. I'm a total noob :)
17:06raekhttp://data-sorcery.org/2010/05/14/infix-math/
17:07kenshothat looks cool. thanks
17:08polypuskensho: if you're a total noob, as a point of discipline, i'd go prefix. imnvho
17:09kenshoI will try, thanks for the advice :)
17:09polypusnp :)
17:12LaPingvinohello
17:12polypuskensho: for clarity you could also always break up your function into a few private macros. generally writing macros when a function will do is frowned upon, but for an inner loop, i think breaking that rule aint so bad
17:12LaPingvinois there a canonical way to do a post-request from clojure/java/...?
17:13opqdonutpolypus: I've always assumed hotspot's inlining works with clojure functions too
17:13opqdonutbut I've never checked...
17:16polypusopqdonut: i'd be very curious to know that. i forget which clojure book, mentioned using macros for performance reasons, might have been TJoC?
17:17kenshopolypus: thanks, I'll keep that in mind
17:17polypusnp
17:17Chousukehotspot inlining works, but it has its limits
17:17opqdonutthe things that are most performance critical I code as static java functions
17:17ChousukeI think the biggest problem is that clojure functions don't support primitives (work on that is underway in the prim branch)
17:18raekI have found a bug in clojure.contrib.json which should be pretty straight forward to fix
17:19raekshould I send an email to the google group first?
17:19raekor can I just create a ticket and make a patch?
17:25LaPingvinoI see some clojure.http stuff
17:25LaPingvinowhere does that get from?
17:26LaPingvinoand clojure.http.resourcefully ?
17:27LaPingvinoI can find references but not the packages
17:27technomancyLaPingvino: it was renamed to clojure-http.resourcefully recently
17:28technomancyin order to work around direct binding
17:28technomancyhttp://github.com/technomancy/clojure-http-client
17:28LaPingvinoah great
17:28LaPingvinotnx a lot!
17:30tomojdirect binding?
17:30technomancytomoj: it was removed from clojure 1.2 and will return (in a much more pleasing form) as static functions in 1.3
17:31technomancyit automatically turned all vars in nses starting with "clojure." into definiline-like functions
17:31technomancyso they couldn't be rebound =(
17:31tomojah
17:32technomancyin 1.3 it will be opt-in, but in 1.2 it caused unexpected issues
17:33tomojopt-in from the var author's perspective?
17:33technomancyyes
17:49LaPingvinomy use/require doesn't work :(
17:49LaPingvinodrives me mad :(
17:57raekLaPingvino: are you using the use/require functions or the ns macro?
17:57LaPingvinons
17:57raekwhat error do you get?
17:58LaPingvinojava.io.FileNotFoundException: Could not locate clojure_http/client__init.class or clojure_http/client.clj on classpath: (tasks_due_today.clj:1)
17:58raeklooks like a class path issue
17:58LaPingvinohehe
17:58raekare you using a project management tool like lein?
17:58LaPingvinoyes
17:59raekhave you ran lein deps?
17:59LaPingvinobut this is in clojure with a clj batch file
17:59LaPingvinoyup
17:59raekhow does the batch file set up the class path?
17:59raekyou can always use lein repl, if a repl is what you want
17:59LaPingvino got it
17:59LaPingvinotnx
17:59raekthat will set up the classpath automagically
18:00LaPingvinoworks
18:00LaPingvinoI see
18:00LaPingvinohehe :)
18:00raekthe batch file solution was very common before leiningen and the other tools appeared
18:00LaPingvinoI know
18:00LaPingvinowe still lack a lot in documentation :(
18:01raeksomething special missing? docs should of course be improved....
18:02raeklike, what did you feel was missing this time?
18:02LaPingvinoa good overview
18:03technomancyLaPingvino: have you read the leiningen tutorial?
18:03raekyeah, I guess there is tutorials for how to use the various tools
18:03technomancyclojurebot: google leiningen tutorial.md
18:03clojurebotFirst, out of 603 results is:
18:03clojurebotTUTORIAL.md at master from technomancy&#39;s leiningen - GitHub
18:03clojurebothttp://github.com/technomancy/leiningen/blob/master/TUTORIAL.md
18:03LaPingvinoit's all pretty scattered :(
18:03technomancyclojurebot: botsnack!
18:03clojurebotthanks; that was delicious. (nom nom nom)
18:03raekbut maybe not a good overview for what tools a newbie would want to use
18:03LaPingvinoexactly
18:03LaPingvinoit was easy in the early days
18:04technomancyeasy isn't the word I would use
18:04LaPingvinonowadays I hear everyone complaining about how hard it is to get started in Clojure
18:04raekthere are lots of old tutorials out there too
18:04LaPingvinoyeah, but it's all starting to break a little :(
18:05LaPingvinoI propose to make a big documentation and getting-started improvement on arrival of 1.2 final
18:05raekeven though it is substantially easier today, a lot of tutorials does things the old and complicated way...
18:06LaPingvinoand pitfalls
18:06LaPingvinolike "getting started with jar" "getting started with war" "getting started with compojure/jetty" "getting started with compojure/war" and "getting started with clojure scripts (.clj)"
18:06technomancyLaPingvino: everyone's got big proposals to improve documentation... there are at least three independent web sites doing their own big push
18:06LaPingvinoI know
18:06technomancyperhaps it would be more useful to unify the existing efforts instead
18:06LaPingvinosure
18:06LaPingvinobut first make clear where the need is
18:06technomancyI feel like the official wiki does a decent job at tools overview: http://www.assembla.com/wiki/show/clojure/Getting_Started
18:07technomancymost of the web sites are about documenting on the individual function level
18:07LaPingvinoI know
18:07LaPingvinothat documentation is really great
18:08LaPingvinobut a lot of common pitfalls when starting a project remain relatively uncovered
18:08LaPingvinogen-class for example
18:08LaPingvinothe ns macro
18:08technomancythat's one thing I hope can improve in 1.3
18:08technomancy(the implementation, not just the docs though)
18:08LaPingvinothe difference between using clojure files independently and using them in a jar
18:08LaPingvinoah great :)
18:09LaPingvinois there a usecase-based getting started?
18:09LaPingvinothe existing docs are all great in their own right
18:09technomancylike a cookbook?
18:09LaPingvinobut a "I want to do this, what should I do" is missing
18:09LaPingvinoyup
18:09technomancywikibooks may have something like that
18:09technomancybut it's not very well-maintained
18:10LaPingvinoyup
18:10LaPingvinobeginners are mostly helped with such an approach
18:10LaPingvinoand it's useful for every new version as well
18:10LaPingvinoas those things tend to change
18:10technomancywhatever you do, try to make it a coordinated effort
18:10LaPingvinoso you can get (back) up to speed
18:10LaPingvinosure :)
18:11LaPingvinoI am just thinking of what it should look like
18:11LaPingvinothe community stuff of clojure is really awesome
18:11LaPingvinoand the libraries are wonderful
18:11LaPingvinoalmost anything useful you can think of is available
18:23technomancyit's official: javadocs are (usually) not actually documentation
18:24LaPingvinoclojure autodoc is great actually :P
18:24technomancynot without docstrings
18:24LaPingvinobut javadoc is just so you know what's available more or less
18:24LaPingvinosure
18:24technomancysure, but the slime inspector can do that with way less fuss
18:24LaPingvinobut I do write docstrings ;)
18:24LaPingvinoyup
18:25technomancyagain, slime or even just doc/find-doc are just as good
18:25technomancyoften more helpful
18:25RaynesI really hope that "What about Oracle suing Google?" doesn't become a typical first question from people interested in Clojure. :\
18:25LaPingvinoI know :)
18:25LaPingvinoOracle those bastards... :(
18:26LaPingvinoit's all just a bit better than common lisp as far as I know it :)
18:39pdkraynes this is news to me so how does it relate to clojure
18:39Raynespdk: It doesn't.
18:43LaPingvinojust that people get less sure about the position of Java...
19:14tcrayfordtechnomancy: you about?
19:26defnOh well... Oracle is sad.
19:27tcrayforddefn: have you seen the new changes to clojure-refactoring-mode? I have reasonable global renaming now, along with (soon) comment preservation and no problems with newlines in strings
19:27defntcrayford: I have not! I will check it out post-haste
19:27defntcrayford: got a functioning minor mode?
19:27tcrayforddefn: yes
19:28defnooo!
19:28defnloading it up...
19:29tcrayfordglobal renaming still doesn't quite work (it won't handle referencing by explicit-ns/var-name, or (require [ns :as name]) stuff
19:29tcrayfordbut its getting far better
19:29defntcrayford: good to hear tcrayford -- i think this sort of project is what can make a new language really great
19:29defni mean, not everyone is using emacs, but as these sorts of things begin to creep into clojure environments
19:29tcrayforddefn: I'm talking to lpetit about integrating it into eclipse
19:29defni think it will really help the community at large
19:30defntcrayford: great!
19:30tcrayforddefn: I actually use the same parser (cgrands parsley) as eclipse does, so should be relatively doable
19:33defntcrayford: one thing im a bit confused on -- is it required that we have this as part of a dev-dep
19:33defntcrayford: i seem to remember not needing to do that before, but perhaps im remembering wrong
19:34tcrayforddefn: probably that, its always needed to be a dev dep
19:35defnk
19:36defnwhat's the latest 1.2.0
19:36tcrayford[org.clojure/clojure "1.2.0-RC3"]
19:36defnty
19:36raekhas anyone had trouble with cljr swank?
19:36tcrayford[org.clojure/clojure-contrib "1.2.0-RC3"]
19:37raekthe swank server does not seem to start for me
19:37tcrayforddefn: though note that global rename has just broken for me, with a very weird output. There are still several bugs in that.
19:39defnhey tcrayford could you tell me... is there a way to hook into refactoring
19:39tcrayfordin what way?
19:39defnso after it performs something like thread-last
19:40defnit runs (cleanup-buffer)
19:40tcrayfordyep
19:40tcrayfordand that is defined in the emacs starter kit (I really should just delete all calls to cleanup buffer)
19:41tcrayfordor was there something else?
19:47defntcrayford: err, im not sure what you mean
19:47defni guess my question is /how/ do i hook into refactoring mode to run cleanup buffer every time
19:47defnmy elisp is weak
19:48tcrayfordlook up defadvice
19:48tcrayfordhttp://www.zvon.org/other/elisp/Output/SEC206.html looks decent
19:48defntcrayford: interesting thanks
19:49defntcrayford: clojure-refactoring could make a neat tiny little web app
19:49tcrayforddefn: in what way?
19:50defnpaste a form into the box, select an operation
19:50defni think it's instructive
19:50tcrayfordgotcha
19:50defnseeing thread-first and last was helpful to me early on
19:50defnso i could see /where/ those things make sense to use
19:50tcrayfordthread-first/last and unthread have been hugely funny to me recently
19:50defnthat was something that took me a little while
19:50defntcrayford: whyzat? :)
19:51tcrayfordyou can do some really silly things with them and have them work
19:51defnoh yeah exactly, if you want to obfuscate some code
19:51defnyou can do wonders with those two
19:51defn:)
19:51tcrayford #clojure: "Leaving"
19:51tcrayfordERC> #clojure: "Leaving"
19:51tcrayfordERC> (->>
19:51tcrayford (postwalk
19:51tcrayford (fn [node]
19:51tcrayford (if (is-node-the-binding-form? form node)
19:51tcrayford (add-to-binding node value var-name)
19:52tcrayford node))
19:52tcrayford form)
19:52tcrayford (defn modify-existing-let-block [form value var-name]))
19:52tcrayfordthat actually compiles absolutely fine
19:52defnheh
19:52tcrayford(should have put that on paste.lisp.org, whoops)
19:53tcrayfordI like how I can randomly select bits of code and see what threading does to them now
19:53defns'okay -- it happens occassionally
19:53defnyes it's wonderful -- you can quickly turn a big ugly function into something that is more, i dont know, "piece-wise"?
19:53clojurebotfunctions are maps
19:54tcrayfordaye
19:54defni had a big function that, with 2 thread-lasts seemed to make a ton more sense
19:54tcrayfordrename is still the best refactoring
19:55defni havent used it much tbqh
19:55defni tend to ruminate on my naming up front
19:55tcrayfordaye
19:56tcrayfordI tend to go completely opposite (lots of functions named blah, rename them later)
19:56defnyeah sometimes i get in the habit of just saying "okay this is x, t, n, k, j, f, p, q, and z"
19:56defnthen put the pieces together, and then think of their names later
19:57defnbrb
20:02pdkyou'd be perfect for writing a math paper then defn
20:02pdkexcept they prefer to leave the single letter names there forever
20:08defnpdk: heh
20:12tcrayforddefn: and now global renames don't delete comments (in my parsley branch anyway). Downside: global renames now take ~15 seconds to complete
20:14technomancytcrayford: looking forward to giving that a go
20:15technomancydoes cleanup-buffer remove unused imports/refers etc?
20:15technomancybecause I've been meaning to implement that for aaaages.
20:15tcrayfordcleanup-buffer was probably written by you (its just a tiny part of emacs starter kit)
20:15technomancyoh, heh. =)
20:15technomancyyeah... don't use that with clojure
20:15tcrayfordalready removed now
20:15technomancyit deletes trailing commas even inside docstrings =(
20:16tcrayfordI'm going to do a "cleanup unused imports etc" thing soon, shouldn't be that hard at all
20:16technomancyyezzzzzz
20:17tcrayfordalso I have a realization with that "rec-contains?" function in swank-clojure
20:17tcrayford(some #{obj} (tree-seq sequential? seq node))
20:18technomancytcrayford: I'm not even sure what that is... I don't really know my way around swank-clojure's internals that well. =\
20:18tcrayfordtechnomancy: you commented on it as part of my patch. I'll submit a new patch for it soonish
20:21technomancytcrayford: this is kind of ridiculous; there's no reason you shouldn't have commit on swank
20:21technomancydone ={
20:21technomancy=) rather
20:22tcrayfordI really need to do some screencasts/promotional stuff on clojure-refactoring-mode soon
20:23tcrayfordalso cheers for the commit rights
20:23tcrayfordone patch, coming up
20:54scottjCool, I didn't know swank-clojure had gained support for who-calls
20:56nickikCan I make default values for defrecords?
21:41defntcrayford: technomancy why not used cleanup-buffer with clojure?
21:41defnit seems to work well enough
21:41defnuse*
21:42defnoh i see -- trailing commas
21:43defnIs there any tool or utility which will show you a graph of your namespaces in a project?
21:55hugoddefn: you might be interested in http://github.com/hugoduncan/lein-namespace-depends
21:56defnhugod: you were the one asking about that the other day weren't you? :)
21:57defnhugod: do you have a release on clojars
21:57hugodI asked a few weeks ago
21:57nickikcan i get the name from a record?
21:57hugoddefn: should be on clojars
21:57defngot it, cool
21:58defnthanks hugod
22:00defnyou know, it would be nice if there was a sort of project euler, but specific to graph theory
22:51defnhugod: graphviz-dot doesn't produce a graph for me
22:51defnit just gives me "digraph { "foo.core" -> "foo.bar"; }"
22:54hugoddefn: you'll need to pipe it into graphviz dot
23:05defnhugod: ah yes i figured it out, thanks
23:12iveyIs this a good place for clojure-swank questions?
23:12slyrusdefn: you could add some graph layout routines to shortcut, my graph library
23:12slyrusivey: as good a place as any, except maybe for the slime and clojure mailing lists
23:12defnslyrus: is it on github?
23:12slyrusyes
23:13iveyslyrus: thanks
23:13slyrushttp://github.com/slyrus/shortcut
23:13iveyTrying to figure out how to get to the swank repl
23:14slyrusivey: do you have a running clojure process you're trying to connect to or are you trying to start it with slime itself?
23:14iveyC-u C-c C-z, "clj" doesn't do anything, but regular interaction with the swank server (C-c C-e, etc) works
23:14iveyslyrus: lein swank is running
23:14slyrusok, that's good
23:14slyrusand you connected with slime-connect?
23:14iveyyep
23:15slyrusI don't know what you expect C-u C-c C-z to be bound to. do you have a *slime-repl clojure* buffer?
23:15slyrusdo you have slime-repl enabled in your .emacs?
23:15slyruse.g. (slime-setup '(slime-asdf slime-repl slime-presentations))
23:15iveyC-c C-z is "run a repl", but it defaults to looking for lisp
23:16iveydo not have slime-repl clojure buffer, but thought I had slime-repl enabled
23:16slyrusyou should get that buffer when you do slime-connect
23:16iveyah
23:16iveyi bet i know the problem
23:18iveyyep, i got it. i had an older working version about a year ago, and was using autoloads, and the code i thought would run slime-repl wasn't running
23:18iveythanks. looks good.
23:20slyrusglad to hear it
23:27defnlancepantz: you around?
23:27defnlancepantz: im curious what options ~/.cake/config
23:27defnallows
23:31Raynesdefn: You and I need to get our signs ready and protest outside of ninjudd's home chanting "DOCS! DOCS! DOCS! DOCS!"
23:33defnRaynes: his docs are pretty good
23:33CemaTo all: Question regarding behavior of reduce on a collection with one element. Appears to differ between Macos and other OSes. Could not find it discussed before.
23:33defnhe updated his main page for cake which includes quite a bit of new stuff
23:33RaynesYeah, but they have to exist to be good.
23:34CemaExample input: (reduce str [\x])
23:34CemaOutput on Macos: \x
23:34CemaOutput on Windows, Ubuntu: "x"
23:35CemaNow, (doc reduce) says, quote: If coll has only 1 item, it is returned and f is not called.
23:35CemaSo technically, Macos is correct. But is this the right behavior?
23:36CemaHas it been discussed before? Perhaps not on #clojure?
23:40rhudsonWhat's the output of (type (reduce str [\x])) on your Windows & Ubuntu systems?
23:44CemaI need a couple of minutes to get to my Windows computer. Hold on...
23:46CemaIt's still java.lang.Character, just like Macos.
23:47rhudsonSo it's just an output issue on those systems. I'm a little surprised there's a difference there, but it's the only part of the execution of that expression that could possibly be system dependent
23:48CemaYeah, but it affects execution of the rest of the program.
23:49CemaOf course, I can always specify the neutral value, ie (reduce str "" [\x])
23:50rhudsonIf you're capturing the print output, I suppose. But it's the right value and the right type.
23:51rhudsonRight, if you want a string from a 1-char vector, then your last form is the way to go
23:52rhudsonThe reason you're seeing a Character is that (reduce str [\x]) is equivalent to (reduce str \x [])
23:53rhudsonas the doc says, with a single element you never invoke the argument function
23:54CemaThanks. I hope if anyone comes across the same issue they will agree to use the neutral value. Seems to be a good idea in the general case.
23:55rhudsonAnother useful idiom is (apply str coll)
23:55rhudsonwhich gives you a string event for a 1-char coll
23:55rhudson[event => even]
23:55CemaAny performance penalty?
23:56rhudsonI don't think so
23:56rhudsonconceivably even more efficient
23:57CemaGreat. Thanks!
23:57rhudsonglad to help