#clojure logs

2010-05-04

00:07remleduffIs clojure-mode supposed to work in the slime repl?
00:07slyphoni don't *think* so
00:08slyphonwell, i'll say this, it's never been active in the *slime-repl* buffer for me
00:10remleduffAlright, glad it's not just me :)
00:10MadWombatwhat is an easy way to sort a map by value?
00:12_atosort-by val
00:12_ato,(sort-by val {:a 4 :b 2 :c 3 :d 1})
00:12clojurebot([:d 1] [:b 2] [:c 3] [:a 4])
00:13remleduff(val {:a 1 :b 2})
00:13remleduff,(val {:a 1 :b 2})
00:13clojurebotjava.lang.ClassCastException: clojure.lang.PersistentArrayMap cannot be cast to java.util.Map$Entry
00:14remleduff,(map val (seq {:a 1 :b 2}))
00:14clojurebot(1 2)
00:16MadWombatthanks
00:28MadWombatis there a better way to convert keywords into strings then (apply str (rest (str :asdf)))?
00:30hiredman,(doc name)
00:30clojurebot"([x]); Returns the name String of a symbol or keyword."
00:30MadWombathiredman: thanks
00:33vIkSiThmm, what exactly happened to c.c.str-utils?
00:34vIkSiT(and as a result, to re-partition)?
00:36MadWombatvIkSiT: renamed to string I believe
00:36vIkSiThmm
00:36vIkSiTI actually tried requiring that
00:37vIkSiTdoc partition
00:37vIkSiTer, how did one invoke the bot again?
00:37vIkSiT,doc partition
00:37clojurebotjava.lang.Exception: Can't take value of a macro: #'clojure.core/doc
00:37dnolen,(doc partition)
00:37clojurebot"([n coll] [n step coll] [n step pad coll]); Returns a lazy sequence of lists of n items each, at offsets step apart. If step is not supplied, defaults to n, i.e. the partitions do not overlap. If a pad collection is supplied, use its elements as necessary to complete last partition upto n items. In case there are not enough padding elements, return a partition with less than n items."
00:37vIkSiTah thanks
00:38vIkSiThmm, so http://richhickey.github.com/clojure-contrib/str-utils-api.html
00:39vIkSiTwhat do I import/require to use re-partition? I realized this was a different partition
00:52remleduffI think it depends on your clojure/clojure-contrib version at the moment
00:53vIkSiTremleduff, hmm which version should i be using?
00:54remleduffI'm meek, I still use 1.1, everyone else here mainlines the master branch ;)
00:55vIkSiTheh yeah, I'm on 1.2
00:56remleduffLooking at github, clojure.contrib.string/re-partition should still be fine
00:57remleduffclojure.contrib.str-utils/re-partition rather
00:57remleduff,(clojure.contrib.str-utils/re-partition #"[a-z]+" "abc123def")
00:57clojurebot("" "abc" "123" "def")
00:57remleduff,*clojure-version*
00:57clojurebot{:interim true, :major 1, :minor 1, :incremental 0, :qualifier "master"}
01:11MadWombatand now I am a proud owner of yet another markov text generator written in clojure
01:12mmarczykMadWombat: cool, got a gist of it? :-)
01:13MadWombat:)
01:13MadWombatyes, sort of
01:13MadWombatwish someone would look at it and see if I am doing anything majorly wrong
01:14mmarczyknot sure I'm qualified for the latter part, but I'd love to have a look if you posted a link :-)
01:17MadWombathttp://pastie.org/944718
01:20mmarczykI've got a lone 0 right outside clean-string :-)
01:20mmarczykum, I mean, you've got
01:22mmarczykI wonder if it would be better to include 's in "word characters"
01:22mmarczykthat is, in the char class in clean-string
01:23MadWombatmight be a good idea
01:25mmarczykas far as I can tell, it's a very nice lazy mtg :-)
01:25mmarczykany example output?
01:28MadWombatyes, but it is not PC, I use bible
01:28MadWombatand Quran
01:29MadWombats/Q/q/
01:29sexpbotand quran
01:29mmarczykdoesn't it become PC if you make that clear? :-)
01:30mmarczykor is it the contrary, I'm not entirely clear on this one ;-)
01:30MadWombat"whensoever i will fan is the lord all those that city and that he that ye shall be a man of the right hand unto"
01:30mmarczykha :-)
01:30MadWombat"entrance unto the border of the covenant with the first year of it is taken on the day when the lord and the place which"
01:31mmarczykI think you should concatenate b. and q.
01:31MadWombatheh
01:31mmarczykwould be cool to read a conversation between Muhammad and Abraham :-)
01:32MadWombatin a bit
01:32mmarczykI wonder how much of an explosion in memory use it would be
01:32MadWombat(def data (process-lines (concat (duck/read-lines "/home/wombat/Documents/bible.txt") (duck/read-lines "/home/wombat/Documents/MalikQuranTransaltion.txt"))))
01:33mmarczykha! right :-)
01:33mmarczyk^the memory use explosion refers to another idea I had a moment ago
01:33mmarczykwhich now seems silly to me, so I'm not finishing that sentence
01:34MadWombathmm... this is creepy
01:34MadWombat"blameworthy rejected thy god and the lord say unto the lord sware unto the savoury meat from them and stoned him he shall be a"
01:34mmarczykoh... wow... 8-O
01:35MadWombat"brokenfooted or harm you consider him to scorn and thirty and i to spend in the plight of the lord and sabbaths in the king"
01:37MadWombatwell, this is enough, seems to be working
01:37mmarczykthis is actually a bit unsettling, could you tell your mtg to take it, like, more easy? ;-)
01:37mmarczykyup, and in 65 lines of Clojure :-)
01:38MadWombatyup
01:38MadWombatI might try building weighted graphs instead of Markov chains, see where that gets me
01:39mmarczykoh, please do, then drop us a link :-)
01:39MadWombatthis is the funnest part of clojure, the gap between idea and implementation is minimal
01:39mmarczykindeed
01:41mmarczyknew Full Disclojure episode, oh goody! :-)
01:45unfo-mmarczyk, url please :)
01:45defn"So..."
01:46defnbtw, i found someone else who says "closure" "cloh-jerr" besides Stuart H
01:49mmarczykunfo-: http://vimeo.com/11446902
01:49sexpbot"Episode 18 - Performance Revisited on Vimeo"
01:49unfo-ty!
01:54unfo-nano o____O
01:54hiredman:(
01:54unfo-it has plugins?
01:55scottjI hope not, I was just joking I can't stand it
01:56unfo-that sounds like "so anyone else find Margaret Thatcher REALLY hot?" - "errr what?" - "yeah, me neither, I mean sick..." ;)
01:57defnmy friend went through a whole CS degree
01:57scottjhaha nice
01:57defnand used nano the whole time
01:57unfo-defn, wat
01:57defnwhen we all realized this our senior year i couldn't believe it
01:57unfo-does nano have syntax hilite?
01:57defnhe was writing 500, 1200 line projects in NANO
01:57defnunfo-: he said he was "quite proud" when he found out how to turn that feature on
01:58unfo-:DD
01:58defni couldnt believe it
01:58defnit's no wonder he hates programming
01:58unfo-defn, ok, well at least it has that, compared to CS major freshmen i've seen who use notepad >__>
01:58Associat0rhttp://www.reddit.com/r/programming/comments/bzq1y/google_android_and_the_cli/
01:58sexpbot"Google Android and the CLI : programming"
02:02parasebaHi, I created a library for CSS generation using a clojure DSL. I would like to have it listed on http://clojure.org/libraries since it seems to be first one of its kind. What should I do? There was a discussion on the google group for this, but it's closed now
02:02scottjso it looks like nano doesn't have language modes but instead you add whatever regexes you want highlighted to your rc file
02:07scottjparaseba: maybe email rhickey, I think he managed that list.
02:08scottjparaseba: By the way, I don't think it's the first. I'm pretty sure I saw one of those before, though I like yours better
02:08scottjparaseba: yeah, the one I saw is on that list. neman.css
02:11parasebascottj: yes, I had noticed that one, but it's more like a set of useful css rules than a framework to generate css
02:11parasebascottj: thanks anyway, I'll tray replying to rhickey
02:17hiredmanhttp://hugoduncan.org/post/2010/shell_scripting_in_clojure_with_pallet.xhtml ho ho ho
02:17sexpbot"Hugo Duncan : Shell Scripting in Clojure with Pallet"
02:21MadWombatseems rather silly, what is the use case for this?
02:23defnto impress your friends and family
02:23defnduhhhhh
02:24LauJensenMorning all
02:25hiredmanyou could rewrite lien in clojure
02:26hiredmanjust about any server you write will need a launcher script
02:27mmarczykmorning, Lau
02:28MadWombatyes, technically, it is morning :)
02:28mmarczykand it shall be a good one, hopefully ;-)
02:29LauJensenIndeed :)
02:30mmarczykoh, I like the promises of Pallet :-)
02:32mmarczykalthough perhaps a clj2pyc utility would be even better, with . syntax for dealing w/ Python modules / classes :-)
02:33mmarczykbest to have both, though, then transplant Clojure onto *every* host imaginable and take over the world
02:35defnhiredman: i remember technomancy saying the whole lein in clojure thing wouldnt work
02:35defnsome chicken/egg problem or something...
02:39MadWombatdefn: Wonder what the problem is, clojure can be compiled after all
02:41MadWombatactually, I don't see any java code in leiningen github repo
02:51scottjAnyone know if compojure 0.4.0 has optional-attrs by a different name? It was the 0.3.x feature that allowed you to do (submit-button {:id "foo"} "Text").
02:56scottjMadWombat: isn't the problem slow class loader and poor performance GC? and android 2.2 isn't addressing either but is getting JIT?
02:58MadWombatscottj: yes, something like that
02:59parasebascottj: it doesn't. It should be added to hiccup
03:03scottjparaseba: k thanks. have you run into any cool non-obvious examples of what css-gen/saas are capable of?
03:05parasebascottj: I maintain a large Rails social network, with lots of CSSs, it would be terrible without sass. The problem is sass authors (and less authors, and others) decided to implement a parser, instead of embedding the DSL in the host language
03:05parasebascottj: that limits the power of the solution....
03:06parasebascottj: but, back to your question, take a look at compass. It's a huge, beautiful set of semantic mixins
03:08parasebascottj: it's really fantastic that you can write something like #nav { +horizontal-list +rounded-corners(10px) } that's really semantic CSS coding
03:09parasebascottj: in cssgen you don't need to learn a new language ... you just define functions and call them to get the properties added to your rule
03:13Associat0rhttp://www.bestinclass.dk/index.php/2009/11/beautiful-code-manifesto/
03:13sexpbot"Beautiful code — The Manifesto | BEST IN CLASS"
03:20scottjparaseba: yeah, I've been following your commits since it was mentioned on disclojure and I'll probably start using it in the next few days. I was glad to see it required fewer things to be strings than neman.css; I guess that's the advantage of the saas parser is they don't have to quote/keyword as many things
03:22scottjbut then you end up having to denote all the functions/variables so maybe it's moot
03:24parasebascottj: cool! you would probably be the first user besides me. I'm using it on a project of my own, and that's driving the commits. Let me know if you find any problems or you have feature requests
03:25parasebascottj: yes, it's a compromise between syntax and power. Probably cssgen could use some macros to avoid having to keyword so much, but with things like "1px" I can't see a good solution, since it's not even a valid symbol
03:27parasebascottj: at some point, I though of using macros and px1 em0.5 notation, but I'm not sure about it
03:28LauJensenAssociat0r: Did you like it?
03:28scottjparaseba: yeah strings are probably better than that. If I think of anything I'll be in touch. /away
03:29Associat0rLauJensen: I like clojure but the article isn't that good in retrospect
03:29Associat0rmade C# deliberatly too verbose
03:30Associat0rnot a good comparison
03:30LauJensenI didn't actually - Just took a native C# speakers code to try and be realistic
03:31Associat0rLauJensen: btw I didn't realise you were the guy who wrote it
03:31LauJensennp, I like critique
03:31Associat0rLauJensen: also I see it's using ArrayList
03:31Associat0rLauJensen: that's from the pre generic gays
03:31Associat0rdays
03:32Associat0rLauJensen: and you could have used LINQ
03:32LauJensenAssociat0r: I used to do work as a Project Manager, so I know that if the language allows for certain levels of horror, at some point, given the right circumstances, developers will start producing garbage, at later this is where you go bug hunting
03:32LauJensenFor that reason I dont clean the examples up, but just take them as an example of what a native speaker could write
03:33Associat0rLauJensen: I understand
03:37remleduffLauJensen: Did you ever get Brian's Brain as fast as you'd like?
03:37LauJensenremleduff: No, cgrand blogged afterwards where he got a 160x160 board to run 1.6ms iterations. Then later Zach Tellman, author of Penumbra emailed me, saying he put it on the GPU, still 1.6ms but now 2000x2000 board :)
03:39remleduffThat's a big brain
03:42defnwhat is the next step in clojure...i wonder
03:42defni mean obviously things are evolving, i just wonder about what the future will look like with clojure
03:44hoeckdefn: clojure-in-clojure?
03:44defnyeah but that's sort of a ... i dont know ... a tree, im talking about the forest
03:49hoeckLauJensen: that reminds me of a guy in my class who did a Nvidia-CUDA presentation, after the hands-on session, I realized that he was basically doing FP with immutable datastructures in C!
03:49Chousukewell, there's the "cell" idea which sounds interesting
03:49remleduffI'm still interested to see what becomes of cells and scopes
03:52Associat0rLauJensen: I also disagree about performance and space, you can't do sequential pure FP code in mainstream languages these days that rival proper imperative ones, without some form of multi-staging or linear typing
04:11remleduffHow do I get [] and {} to work right with paredit in the slime repl?
04:12defnremleduff: i needed to set a couple vars
04:12AWizzArdChousuke: what I would also find interesting: more features for sorted maps/sets. For example: a much faster way to construct them when you already have the data in sorted form.
04:23Chousukeremleduff: this is my setup. the important bit is the hook at the end http://github.com/Chousuke/emacs.d/blob/0c27cc6d308921357185c6e2dd8f4f7aedb62411/init-clojure.el
04:27remleduffThanks Chousuke, I'll give that a shot
04:27remleduffMan, I just found out about clojure.set/join, I've hand-coded that about 3 times in the past week :\
04:28LauJensenhoeck: where did the immutable come in ?
04:29LauJensenAssociat0r: You remark is relating mostly to performance?
04:29hoeckimmutable-by-convention, for the arrays you send to the graphics card
04:29Associat0rLauJensen: yes
04:30Associat0rLauJensen: what is your opinion on multiparadigm?
04:30hoeckand you could not write to input variables/arrays in the reduce/map function
04:30Drakeson,(do (deftype foo [a]) (new foo 42))
04:30clojurebotjava.lang.Exception: Unable to resolve symbol: deftype in this context
04:30LauJensenAssociat0r: Well, yes and no. The most costly item in development is man-hours not cpu-cycles, so its important to prioritize. But as you can see from my fluid-dynamics blogpost, its possible to start with sequential and pure FP code, then rewrite, starting from the bottom going upwards, the performance critical parts to perform identically with imperative programs
04:31LauJensenAssociat0r: Thats its poison to quality
04:32Associat0rLauJensen: I disagree with that, since not every problem fits 1 paradigm well
04:32LauJensenAssociat0r: Good - Then I still have more to learn about software development :)
04:32Associat0rLauJensen: I think a layered approach to language design is best
04:35ChousukeI'm not a fan of the term "multiparadigm"
04:35Chousukemost languages are multiparadigm, yet are very different, so the information content of the word is very low
04:36LauJensenChousuke: I read it as mixing 'functional and imperative', which just means you're watering out your FP
04:36ChousukeLauJensen: that's too limited a definition
04:36ChousukeClojure itself could be said to be multiparadigm :P though with heavy focus of functional programming
04:36LauJensenChousuke: Yea, I didn't mean it was accurate, but most dicussions come down to that
04:37Chousukeit's best to describe languages by their focus, not by the paradigms they support
04:37_atoheh, if you go off wikipedia's list it's ridiculous http://en.wikipedia.org/wiki/List_of_multi-paradigm_programming_languages
04:37sexpbot"List of multi-paradigm programming languages - Wikipedia, the free encyclopedia"
04:37_atojava's is apparently four paradigm
04:37LauJensenhehe
04:37_ato"imperative, object-oriented (class-based), reflective, generic"
04:37_atowhich is just silly
04:38Chousukeand Common lisp is definitely functional/imperative/object-oriented and it's still a great language.
04:39Associat0rLauJensen: it's not about watering down, you can have a imperative language layered on top of FP and with a proper effect types system you can still maintain correctness while keeping performance
04:41Associat0rand OO could also be built on top of that
04:41ChousukeYou can do imperative programming in clojure just as well. It'll just feel weird because by default the language gives you little support for that.
04:41Associat0ron FP that is
04:41Chousukebut with a library of imperative tools and datastructures, it'd be just fine.
04:41Associat0rI know
04:42Associat0rbut I was mostly responding to his article about beatiful code
04:42ChousukeI think imperative code can be beautiful too
04:42Chousukeit's just much more difficult
04:43LauJensenAssociat0r: AFAIK there is not yet a correct way to model OO functionally, which is way Clojure isnt OO
04:43_atoSome self-modifying assemblying I'd call beautiful ;-)
04:43Associat0rLauJensen: also if you are interested in performance with FP code then I recommend you see this video this http://garabedyan.wordpress.com/2009/05/25/resource-aware-programming/
04:43sexpbot"MetaOCaml-Resource Aware Programming «"
04:43_atos/assemblying/assembly/
04:43sexpbotLauJensen: also if you are interested in performance with FP code then I recommend you see this video this http://garabedyan.wordpress.com/2009/05/25/resource-aware-programming/
04:44Chousukehuh
04:44LauJensenI am, thanks
04:44Chousukesexpbot fails :P
04:44_atos/fails/sucks/
04:44sexpbotsexpbot sucks :P
04:45_atoah that's annoying
04:45LauJensen_ato: oops, it was something I request0red
04:45LauJensenERC does it automatically, but the rest of you guys wont see it :)
04:48LauJensens/does//quit
04:48sexpbotLauJensen: Format is sed [-<user name>] s/<regexp>/<replacement>/ Try $help sed
04:48_atos/i/\t/
04:48sexpbots/does//qutt
04:58_atoThe point of Clojure (as I understand it) isn't so much FP but about state. Pure FP has been done pretty well by other languages, the point is more recognizing that sometimes state is necessary, not every program is a pure calculation. Sometimes it's just a natural part of the problem and so Clojure has tools to introduce state in a controlled manner.
04:58LauJensentrue
04:59LauJensenAnd I think that generally where my style of comparing is different from others, is that I think you need to look at the worst possible code, which will realistically be produced by someone using the language. ie if you can mix the mutable and immutable, someday, somehow, someone in your team will do that - which is why I like Clojures default
05:01Associat0rI am mostly using F# these days
05:01remleduffIn that case, you need to look at clojure code that's completely full of sigils :)
05:29jowagseems like http://build.clojure.org/releases is down
05:31LauJensenmaybe its down, maybe Maven just decided it shouldn't be allowed to emit html
05:32jowagI've got connection reset when lein tries to download from this repo
05:34_atoyeah, it's definitely down
05:44LauJensenrhickey: Are you the guy who's going to reboot it ?
06:00cschreiner.
06:05_extermIs there any documentation about the inner workings of the clojure compiler? I'm looking for a general explanation of the course of events started by a call to (eval).
06:06_extermI forgot to say: Hello everybody!
06:09remleduff,(into {} (for [[{k v}] ["123" 1.0, "456" 2.0] {"id" k, "rank" v}))
06:09clojurebotUnmatched delimiter: )
06:10remleduff,(into {} (for [[{k v}] ["123" 1.0, "456" 2.0]] {"id" k, "rank" v}))
06:10clojurebotjava.lang.Exception: Unable to resolve symbol: v in this context
06:10remleduff,(into {} (for [[{k v}] [{"123" 1.0}, {"456" 2.0}]] {"id" k, "rank" v}))
06:10clojurebotjava.lang.Exception: Unable to resolve symbol: v in this context
06:10remleduffhmph, sorry
06:16_ato_exterm: not that I've seen. The high-level is pretty straight-forward: http://github.com/richhickey/clojure/blob/master/src/jvm/clojure/lang/Compiler.java#L5307
06:16LauJensen$(into {} (for [{:keys [k v]} [{"123" 1.0}, {"456" 2.0}]] {"id" 'k, "rank" 'v}))
06:16sexpbotresult: {"rank" v, "id" k}
06:16_atofirst expand macros
06:17_atothen eval the form, which often means recursively evaling
06:19_atoeach type of expression has a class, like IfExpr, LoopExpr, FnExpr, which does the real work of emiting byte code
06:21remleduffThanks LauJensen, I'm too tired at the moment :)
06:21hiredmaneval and emit are distinct code paths
06:21_atothere's various dynamic variables (all the "final Var" definitions near the top) to keep track of things like local variables, the current line number etc
06:22cgrand,(into {} (for [[[k v]] [{"123" 1.0}, {"456" 2.0}]] {"id" k, "rank" v}))
06:22clojurebotjava.lang.RuntimeException: java.lang.UnsupportedOperationException: nth not supported on this type: PersistentArrayMap
06:22cgrand,(into {} (for [m [{"123" 1.0}, {"456" 2.0}] [k v] m] {"id" k, "rank" v}))
06:22clojurebot{"id" "456", "rank" 2.0}
06:24cgrandbut i'm pretty sure that's not what you expected
06:24cgrand,(for [m [{"123" 1.0}, {"456" 2.0}] [k v] m] {"id" k, "rank" v}) ; maybe
06:24clojurebot({"id" "123", "rank" 1.0} {"id" "456", "rank" 2.0})
06:24remleduffI was just thinking I had to be missing something
06:42mmarczykhm, guys -- what are your opinions on having Refs inside Refs? ok? not ok? <- just came up in Clojure101 @ rubylearning.org
06:43mmarczykor more generally, what to do when it seems appropriate to have a number of mutable references which are all fairly independent and the number of which is not fixed
06:43mmarczyka Ref containing a collection / sequence of Refs is one obvious answer... any pros/cons/other options?
06:57_exterm_ato: thanks - but it seems I am working with an older version of the compiler that isn't as straightforward. I'm thinking of switching my project to a newer compiler, but as I have modified it, that is not so easy. My eval method looks like this http://gist.github.com/389263
06:58_extermit seems that all the magic happens in the call to analyze().
07:20giaceccoHi all, I have a question for you
07:20giaceccoWhy can't I use 'apply' with macros?
07:21giaceccoI can do (apply + [1 2 3])
07:21giaceccoBut I can't do (apply or [true false false])
07:22giaceccoand I need to do the latter!
07:23mmarczykyou actually need to do (some identity [true false false]) :-)
07:24giaceccoCan you give an example?
07:25giaceccoWhat do you mean by "some identity"?
07:26mmarczyk,(some identity [true false false])
07:26clojurebottrue
07:26mmarczyk,(doc some)
07:26clojurebot"([pred coll]); Returns the first logical true value of (pred x) for any x in coll, else nil. One common idiom is to use a set as pred, for example this will return :fred if :fred is in the sequence, otherwise nil: (some #{:fred} coll)"
07:26Borkdude(identity true) -> true
07:27mmarczykI don't mean just "some identity", I mean *just the identity you need*
07:27giaceccoLike
07:28giacecco(true or [...]) ?
07:28Borkdudeyou could also do: (some true? [true false true]), it reads more intuitive maybe?
07:28giaceccoHa!
07:29mmarczykbut it's no longer equivalent to your (apply or ...) idea
07:29mmarczyk,(or 1 2 3)
07:29clojurebot1
07:29mmarczyk,(some true? [1 2 3])
07:29clojurebotnil
07:29giaceccoThanks I'll try
07:30giaceccoIt's counter intuitive though that I can't use apply with macros
07:30mmarczykyw
07:30giaceccoI would stay around but I'm on my mobile, thank you and see you soon!
07:30Borkdudegiacecco: good luck
07:31mmarczykbye :-)
07:31BorkdudeiPhone, hmm, can you run a repl on that? :)
07:32mmarczykperhaps, but if it is in any way useful to you, you're likely violating a contract :-)
07:35BorkdudeMaybe he could have used `(or ~@[true false true]) if he really needed to some list inside or? But somehow I never used this myself ;)
07:36BorkdudeCan you eval a sexp in private with sexpbot?
07:37greghthat sounds kinky
07:39Borkdudehehe it does
07:47lessthantristanis the "downloading: ....pom from clojure-snapshots" step in lein deps running really really slow for anyone else?
07:48_atolessthantristan: build.clojure.org is down
07:48lessthantristanah i see
07:49lessthantristanfigured it would be something like that
08:09cemerickrhickey: that assembla chat room is sorta broken :-)
08:11rhickeycemerick: wow, yeah
08:11cemerickwhoa, was that a URL?
08:11rhickeyyes, pasted in!
08:12cemericknice
08:12rhickeystunning
08:12cemerickThey should just pull the feature.
08:12cemerick"feature"
08:12cemerickrhickey: shall I just paste that email exchange in the ticket?
08:12rhickeyshame, because theoretically it would be loged
08:12rhickeycemerick: yes, thanks
08:14AWizzArd,(doc replace)
08:14clojurebot"([smap coll]); Given a map of replacement pairs and a vector/collection, returns a vector/seq with any elements = a key in smap replaced with the corresponding val in smap"
08:14cemerickI worry about assembla when I see stuff like that.
08:15rhickeycemerick: yeah, well they have limited resources and run at the things people use most. Unfortunately, the big appeal of assembla is that they bring this suite of tools. But once you can't use messages and chat and wiki because they stink...
08:16AWizzArdI've got a suggestion for the replace function. It could optionally take a :key argument with a fn that would serve as accessor. For example, I want to do replacements in 100 maps such as {:a 1 :b 2 :coll [1 2 3]}, in the :coll slot. Then such a keyword arg would be helpful.
08:17cemerickrhickey: I should go poke atlassian again, see what terms they'd be willing to offer on a clojure space in their studio product.
08:17mmarczyk,((fn [a b c d e f g h i j k l m n o p q r s t & u] :foo) 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21)
08:17clojurebotnil
08:17mmarczykrhickey: thought you might be interested to see the above
08:17AWizzArdcemerick: Atlassian (Jira) would be very cool. What did they say last time?
08:17mmarczykrhickey: also happens in 1.2
08:18mmarczyk(that's 20 args + varargs => nil return)
08:18cemerickAWizzArd: last time I pinged them, they were just getting studio rolled out, and hadn't figured out what they'd be offering for open source projects.
08:19cemerickThey liked the concept of free hosting, but had stuff to figure out on their end.
08:20rhickeycemerick: what's the Jira + Github story?
08:21rhickeyexternal git being a nice feature of assembla
08:24cemerickrhickey: Looks like they have git support in studio -- are there github-specific requirements?
08:25rhickeycemerick: Assembla let's us: keep source on github, use a commit hook to let assembla know about changes there, grabs #issue from commit messages to link to and close issues
08:26AWizzArdAt least for local checkins this works, though I don't know if Assembla can inform Jira about it.
08:30cemerickrhickey: svn is their default, but it looks like there's a git plugin with at least some of the commit hook-driven behaviour you're looking for: https://plugins.atlassian.com/plugin/details/4984
08:31cemerickI'm not sure any of that is github-specific....?
08:33rhickeycemerick: probably doesn't need to be
08:33cemerickthat page seems out of date -- this is the relevant one for the studio product, it would seem: https://studio.plugins.atlassian.com/browse/JGIT
08:40bosieis there a better book than Stuart's 'Programming Clojure' around, for beginners of FP/Clojure?
08:41AWizzArdTypically these version control plugins for Jira check if on the local installation a checkin was done. For example, see https://issues.apache.org/jira/browse/PIVOT - there is a "Subversion Commits" tab. I have the same for Mercurial, and the Git-Plugin offers also such a thing.
08:42dnolenhmm, is http://build.clojure.org/ down?
08:42cemerickyeah
08:46cemerickrhickey: FWIW, I think a biggest limiting factor on the tools discussion is the hosting. You could have a top of the line toolset right now, for free (w.r.t. licensing), but we'd have to find somewhere to host it.
08:48AWizzArdThis I would find to be the best solution, and also the one which looks most professional.
08:48dnolenbosie: that book is a good introduction. There are other good books on FP but getting through them is a roundabout path to having fun in Clojure. Best way IMO is to start writing some code. Reading some Clojure code on the good Clojure blogs is also educational.
08:49bosiednolen: i fail to do 'start writing some code' because as soon as i hit lazy collections i am done
08:49bosiednolen: considering they never get executed ;)
08:50chouserMmmmm... "~<#(~;~@{~w~^ ~_~}~;)~:>"
08:50cemerickAWizzArd: The costs are not trivial. ~$200/mo, + maybe ~10 hours a week of admin time, assuming an environment that housed, say, a full atlassian toolchain, hudson, nexus, and assorted other goodies.
08:50cemerickchouser: "Don't bring that disgusting thing in my house!" :-P
08:51dnolenbosie: using lazy collections is pretty transparent unless you're doing side effects, then you need to force it with something like doseq, doall, etc.
08:51chousercemerick: :-) But... it's already there, in contrib. Slated for core...
08:51bosiednolen: what you mean transparent?
08:51AWizzArdcemerick: high quality root servers in Germany cost around 100$/month
08:51bosieAWizzArd: which ones?
08:51AWizzArdBut I agree that this will require some time.
08:51cemerickchouser: I've not looked at the pprint stuff at all. Oh no.
08:51AWizzArdbosie: http://www.hetzner.de/en/hosting/produktmatrix/rootserver-produktmatrix-eq/
08:51sexpbot"Hetzner Online AG: Root Server Productmatrix EQ"
08:52bosieAWizzArd: isn't hetzner relatively bad?
08:52AWizzArdNo, it is very good.
08:52AWizzArdWon in tests of serious magazines.
08:52dnolenbosie: as in you don't need to do anything special when dealing with them.
08:53cemerickI'd put it on AWS if we were to sponsor it, but all of this is a little moot at the moment.
08:53AWizzArdA 12 GB RAM quad core box should easily be enough for hosting a Clojure website
08:53bosiednolen: i have to realize them somehow which i seem to be unable to do
08:53dnolenbosie: sounds like you have some side-effects then no?
08:53bosiednolen: no
08:54bosiednolen: http://pastie.org/945072
08:55dnolenbosie: print is side effect
08:56bosiednolen: yea but that doesn't matter, does it?
08:56bosiednolen: fun will not get called
08:56dnolenbosie: (doall (map fun get-files)) if you want to see output
08:57_atoAWizzArd: getting someone to look after it month after month, year after year is the hard part, not so much server costs or initial setup. ;-)
08:57bosiednolen: hmm no, results in an exception
08:57dnolenbosie: er, get_files in your case. underscores are not so idiomatic in Clojure.
08:57sparievstill, Hetzner's dedicated servers are very good, a few friends of mine have great experience with them
08:57AWizzArd_ato: yes
08:57dnolenbosie: what is the exception?
08:57bosie Don't know how to create ISeq from: user$get_files__3 (main.clj:0)
08:58AWizzArdbosie: if get-files is a function then (map fun (get-files)) would do the right thing supposedly
09:00bosietrue
09:05zmilais there a way to put in-line comment inside a s-expr?
09:05zmila,(-> 1 (Math/asin ,,,) (doc Math/sin ,,,) )
09:05clojurebotjava.lang.IllegalArgumentException: Wrong number of args passed to: sandbox$my-doc
09:06AWizzArdzmila: you can use (comment ...) or #_"your comment"
09:06AWizzArdwhere the second form is in nearly all cases better
09:06zmilainstead of ,,, i like to comment the meaning/name of the param
09:06AWizzArd,(println #_"I want to print something" "Hello World")
09:06clojurebotHello World
09:07chouser,(-> 1 (#^{:doc "This is a sort of comment"} Math/asin))
09:07clojurebot1.5707963267948966
09:07zmila,(-> 1 (Math/asin #_"num") (Math/sin #_"angle") )
09:07clojurebot1.0
09:08zmilanice! thank you, AWizzArd
09:08AWizzArdzmila: the reader will completely remove the expression that follows the reader-macro #_
09:09zmilai tried (comment "zzz") but it evaluates to nil
09:09cemerickSurely that isn't to be encouraged?
09:09rhickeymmarczyk: fixed - thanks!
09:09mmarczykrhickey: oh, cool :-)
09:09mmarczykrhickey: out of curiosity, what was it about?
09:09mmarczykrhickey: or actually I guess I'll go read the patch
09:10rhickeymmarczyk: there's a difference in sig between invoke and doInvoke (for rest fns) at that arity, but same sig was being used for both
09:12mmarczykrhickey: I see, thanks
09:13mmarczykrhickey: especially since reading the patch wouldn't have made it obvious to me with my measly Java-fu :-(
09:13cemerickchouser: Yeah, I hadn't really internalized the fact that pprint carries cl-format along
09:14cemerickSorta like a disease vector or something. (Apologies to Tom :-))
09:15chouserI suppose I just need to learn that syntax. Then I'm sure I'll love it.
09:15cemerickIt's quite simply bad IMO.
09:16chouserregex is arguably bad as well, but I sure use it a lot
09:16cemerickIndeed, they're similar. There isn't a reasonable alternative to regexes, though, AFAIK.
09:17chousercemerick: working on it. ;-)
09:18cemerickchouser: Yeah, I implemented sexpr regex and XSLT engines in CL a long while back. :-)
09:18cemerickThe latter was nice, the former ended up being *way* too verbose.
09:18dnolencl-format always a seemed a step up from all the other C derived formatting standards. Perhaps makes pretty printing Clojure a lot simpler, as well?
09:19cemerickI'm absolutely certain of its usefulness.
09:19cemerickI wouldn't inflict cl-format strings on the future maintainer of my code, though.
09:22dnolen_heh, well we're already inflicting Lisp on future maintainers. Though I prefer "blessing"
09:22dnolen_so what's the verdict on importing 1.2.0 features sanely? Any conventions?
09:24dnolenit sounded like try/catch around (use ...) doesn't work so well.
09:25cemerickdnolen: try/catch works just fine
09:25cemericknot pretty, but it works
09:27dnolencemerick: what advantage over checking *clojure-version* in a cond or something?
09:27drewrrhickey: do you mind if gmane serves up clojure-dev? you haven't approved the subscription request, but I didn't know if it was just oversight
09:27rhickeydrewr: I don't want incoming from gmane
09:27cemerickdnolen: it's easier and more reliable. Version-sniffing is bad in almost every context.
09:28cemerickfeature-based conditional execution is ideal, but not here yet
09:28drewrrhickey: you mean spam, or even legitimate mail? (gmane uses a challenge-response mechanism to prevent the former)
09:29dnolencemerick: Java exceptions are kind slow tho no? If everyone has try/catch everywhere, seems kinda bad further down the road? why not (try-use ...) that checks for the files existence w/o throwing excepetions
09:30cemerickdnolen: Exceptions actually aren't particularly slow anymore. In any case, you'd put the try/catch as a top-level, which means you're looking at a max of 1 exception being thrown per namespace in the worst case.
09:30cemerickAnd, you want to prefer the newer namespaces, so any potential for having an exception thrown goes down over times.
09:30cemericktime*
09:31cemerickdnolen: a live example, FWIW: http://github.com/cemerick/pallet/blob/master/src/pallet/compat.clj
09:37jowaghow do I specify a backslash character literal?
09:38carkh,\\
09:38clojurebot\\
09:38jowagno
09:38jowag,(str "a" \b \\)
09:38clojurebot"ab\\"
09:38jowagsee
09:38carkh(print "ab\\")
09:38carkh,(print "ab\\")
09:38clojurebotab\
09:39carkhso i guess it's a yes =)
09:39cemerickrhickey: is the 18/20-arg limit ever likely to be eliminated?
09:39jowaghmm, so why (str \\) prints \ twice
09:39cemerick(I presume not...)
09:39rhickeycemerick: I'd like to reduce it
09:40carkhjowag: string literals are escaping the backslash
09:40carkhbackslash is used to escape stuff
09:40cemerickrhickey: ouch :-(
09:40defnis there a good place to read about why there is a limited number of args?
09:40carkh,"\"
09:40clojurebotEOF while reading string
09:41carkhsee not working
09:41cemerickI guess passing a boxed arg-vector is to be the norm for e.g. generated code.
09:41jowagah yes, result is string literal which contains escaped backslash, now I understand, thanks
09:41rhickeycemerick: ?
09:41defni mean frankly i dont ever see using 20 arguments, it just seems crazy -- at a certain point you just use a map or something as your arg, not sure why people would be upset by a 20 arg limit
09:42carkhdefn: maybe for macro generated code ?
09:42cemerickrhickey: i.e. generate (fn [[a b c ...unlimited args]] ...) instead of (fn [a b c ....]),
09:42chouserpass a vector for goodness' sake
09:42defnindeed
09:42chouser:-)
09:42carkhhey i agree to that =)
09:43cemerickdefn: generated code can easily grow more than 20 args
09:43defncarkh: yeah i dont know much about macro gen'd code
09:43chouserso does 'satisfies?' work on protocols both extended and implemented in-line in defrecord?
09:43cemerickthat's obviously an edge case though
09:43rhickeychouser: yes, as does extends? now
09:44rhickeychouser: only extenders is limited to the explicit ones
09:45foguscemerick: Generated code with 20+ args smells very Java-esque
09:45chouserok, great. But not quite as fast as 'instance?' I would guess...
09:45cemerickfogus: Seems like it's a question of domain, not language impl. *shrug*
09:46cemerickThe code gen we do never gets above 14 I think. I can easily see going higher being useful/convenient.
09:46foguscemerick: perhaps.
09:48foguscemerick: Is your generated API for human consumption?
09:49cemerickfogus: one sane part is. The gnarly backend stuff, definitely not.
09:50cemerickthe latter isn't really an API though -- it's the result of a training process.
09:50cemerickOr, I should say, it's the implementation of an API that is the result of a training process.
09:52fogusi see
10:00chouserMALOUS
10:01cemerickfogus: create(column1, ...., column 43), update(column1, ...., column 43), etc? :-)
10:01defncemerick: what do you mean by training process?
10:03cemerickdefn: very roughly, we take a set of training documents that have been marked up with where data of interest is located, what it should look like (for validation, etc), and a pile of other info, dump it into an offline process, and out pops a bag of data and code that, when provided with a "live" document, will emit the data elements mapped as defined by the user within the training set.
10:05foguscemerick: Yes... but mostly constrained to the c-tors. ;-)
10:33dnolenreplaca: so I think fixed the import of pprint in swank-clojure. However swank-clojure macroexpansion will not work without contrib anyway - it uses the mexpand-all from contrib.
10:33zmilais there (get-in m keys default-value)?
10:33zmila,(doc get-in)
10:33clojurebot"([m ks]); returns the value in a nested associative structure, where ks is a sequence of keys"
10:33zmilareturns nil if no key found
10:39defncemerick: sounds like art. very cool.
10:39replacadnolen: ok, makes sense
10:40replacadnolen: I guess that makes it even less of a hurry! :)
10:40defncemerick: is there anyway to limit the generated arguments by placing them in a vector or something?
10:42dnolenreplaca: well it's good to have the pprint fix, the to way call pprint has changed slightly.
10:43replacadnolen: you mean just cause it's moved and there's no PrettyWriter anymore?
10:43replacaoh and code-dispatch lost its ears
10:43dnolenreplaca: yeah
10:44cemerickdefn: yeah, that's the general workaround
10:44dnolenreplaca: http://github.com/swannodette/swank-clojure/commit/3cac865429c476b94e7449abf55e545dd364a9dc
10:44dnolenis my workaround at the moment
10:44replacadnolen: k, I just wanted to make sure I hadn't changed anything unintentionally (cause I changed plenty intentionally)
10:45replacadnolen: cool, I have to take my kid to school - I'll look through the code in 1/2 an hour when I get to the cafe :-)
10:45dnolenreplaca: thx
10:45replacadnolen: no, thank *you* :)
11:53defn,(apply str (mapcat #(map char %) (concat [(map inc [70 110 110 99 109 104]) (reverse '(33 116 104 103))])))
11:53clojurebot"Goodnight!"
11:54defnnot my work -- found that while testing something in walton
11:54defnanyway, night all
11:54mmarczykso that was the response to (what? "Goodnight!")
11:54mmarczykmight want to work on the kind of examples it prioritises ;-)
11:55mmarczykgood night!
11:56TakeVHow do you perform the equivalent of a while loop? Loop/recur?
11:56ChousukeTakeV: there's a while macro
11:56TakeVSafe for the stack?
11:57Chousukewhat are you trying to do with it?
11:57Chousukeit doesn't make sense to use while unless you have some side-effecting condition
11:57TakeVChousuke: Game programming. Figuring out how I'd do the game loop.
11:58Chousukeah, right.
11:58Chousuke(while @running ...) is okay I think
11:58TakeVThanks.
12:08arohnerwhat ever happened to the circular load detection patch?
12:14signalseekerHi, How do I make swank-clojure point to my own clojure/clojure-contrib repos?
12:15technomancysignalseeker: set swank-clojure-classpath in Emacs; should be a list of paths to jar files
12:16signalseekertechnomancy: thanks. I'll try that.
12:18signalseekertechnomancy: list of paths should be quoted, just like clojure syntax?
12:18technomancyright. be sure it includes the swank-clojure jar too.
12:18signalseekerI see, there is no way it can pick this up from my .bash_profile?
12:20replacatechnomancy: can you explain the "don't depend on clojure" thing?
12:20replaca(just so I understand what I'm doing)
12:20technomancyreplaca: if a piece of code is a lein plugin, then it's implied that it has all the same dependencies as lein itself.
12:20technomancyotherwise what happens when lein upgrades to Clojure 1.2 but the plugin doesn't?
12:22replacatechnomancy: ah, so plug-ins only. Makes sense. But the dependency story seems more complex, since other libs may depends on a given version of clojure (like enlive, for instance).
12:22replaca?
12:23technomancyenlive might be able to get away with clojure as a dev-dependency
12:23technomancybut I haven't thought that all the way through.
12:24replacatechnomancy: well, presumably enlive just has clojure as a dependency cause it doesn't know it's being used in a plugin
12:25technomancyreplaca: not as a lein plugin, but it knows it's being used by a project that already depends on clojure
12:25replacatechnomancy: one of the things on my list is to hook up lein/mvn to graphviz to understand why I have all the libs I do
12:26technomancybut 1.2 vs 1.1 differences make that more complicated
12:27signalseekerIs there a swank-clojure-1.2?
12:27replacatechnomancy: yeah, when I run autodoc standalone it's still all on top of 1.1 (but I had to crack things open so it launches a separate process to actually harvest the info because different branches may need different clojure versions)
12:54Licenserkreetings everyone
13:04LicenserHmm I have a problem, not a code one but a decision one. I'm working on that swing clojure wrapper and I have seriouse problems with documents (which would allow to nicely couple refs and STM) with text fields and the like. So I have two options, A) skip then for now and get the other stuff working first or B) stay there till I figured it out.
13:05LicenserProblem being that A) means that a big part of nice disapears since it'll not be so simple as I wish B) means I'll not be able to do much new stuff anytime soon
13:05zakwilson__Why do we have first and second for maps, but not nth?
13:05slyphonhrm
13:05slyphonanyone ever get "error in process filter: Wrong number of arguments: nil, 0" with swank-clojure-project?
13:06wlangstrothzakwilson: nth for maps?
13:08zakwilsonwlangstroth: yes
13:09zakwilson,(first {:a 1 :b 2})
13:09clojurebot[:a 1]
13:09zakwilson,(nth {:a 1 :b 2} 0)
13:09clojurebotjava.lang.UnsupportedOperationException: nth not supported on this type: PersistentArrayMap
13:10bosiezakwilson__: works for me
13:10Licenser(doc nth)
13:10clojurebot"([coll index] [coll index not-found]); Returns the value at the index. get returns nil if index out of bounds, nth throws an exception unless not-found is supplied. nth also works for strings, Java arrays, regex Matchers and Lists, and, in O(n) time, for sequences."
13:10chouserfirst calls seq on its arg. nth does not
13:10bosiezakwilson: oh you mean like that, sorry
13:10Licensermy guess would be because nth can't guarantee anything of the position
13:10chouseryou don't want nth to call seq because you want it to be fast for vectors and such
13:11rhickeymost recent push has last-one-in-wins for refers and interns - feedback welcome
13:11zakwilsonThanks, chouser.
13:11zakwilsonThough that seems like an application for multimethods.
13:13chouserprotocols, perhaps, but there is a pleasing simplicity in "seq fns like first, second, next, last always call 'seq', but more specific fns like nth, peek, pop never do"
13:15zakwilsonI suppose. I was thinking of nth as a seq function, for no particular reason.
13:18Licenserrhickey: protocols are a new toy, expect to see people playing with it wherever possible in the beginning, things need to settle in before they are used in a reasonable fassion. Hence when I learned about macros I stuffed a lot of things in them just because I was so proud I learned it and now could do that :P
13:18slyphonLicenser: hah, we used to refer to that as "New Hammer Syndrome"
13:19slyphonfrom "when all you have is a hammer..."
13:19rhickeyzakwilson: ouch!
13:19Licenserslyphon: :P
13:19slyphonLicenser: it happens to everyone :)
13:19Licenserwhat is function composition I want to try out the hammer!
13:20mmarczykzakwilson: oh, this is so obviously *wrong*!
13:20slyphonhahaha
13:20mmarczykzakwilson: everyone knows it should be * doing function composition
13:20stuartsierraor .
13:20mmarczykright :-)
13:21Licenserhmm you could do ++ that behaves like ..?
13:21zakwilsonDidn't work on + or certain other core functions though. Well... it did, but it totally corrupted the running image.
13:22mmarczykzakwilson: sounds like fun :-)
13:22stuartsierraPersonally, I favor the rocket ship operator ##]===>
13:23mmarczykstuartsierra: that's for when Rich opens the reader :-)
13:23Licenserhmm (* inc 3 3) (inc (inc (inc 3)))
13:23mmarczyk(s/when/if/ if necessary)
13:24zakwilsonmmarczyk: it was. I didn't like that I couldn't get it working for everything though. I want a language where every function is generic, with method combination.
13:24Licenser(+ inc dec) -> #(inc (dec %))
13:24zakwilsonLicenser will be entering the first obfuscated Clojure contest.
13:24Licenserwooh!
13:25Licenserwe could do a rose opperator: @-->-----
13:25Licenserthe first opperato that is a ref!
13:26mmarczykzakwilson: only generic functions -- performant -- great interop with an existing rich platform
13:26Licenserthat works!
13:26Licenser(def ->--- (ref inc))
13:26mmarczykzakwilson: can we even pick any two, I wonder
13:26Licenser(@->--- 1)
13:27Licenserit's the new way to say 'I love this idea'
13:27slyphonLicenser: hah!
13:27mmarczyk@->--- is cool :-)
13:27zakwilson,(let [-->----- (ref (fn [] "@-->-----"))] (@-->-----))
13:27clojurebot"@-->-----"
13:28zakwilsonmmarczyk: I think all functions generic is analogous to everything is an object.
13:28wlangstrothdoes the stem get longer the more you like the idea?
13:29Licenserrhickey: if I send you a CA can @->--- get into clojure core?
13:29slyphonwlangstroth: if your stem keeps getting longer for more than 4 hours, consult your doctor
13:29wlangstrothslyphon: as soon as I wrote it, I realized my mistake
13:29rhickeyLicenser: I doubt it
13:29slyphonwlangstroth: :D
13:30Licenserif I send you some candy?
13:30LicenserI don't think bribery is forbidden by the EPL is it?
13:30wlangstrothMaybe if you send him $15 million in unmarked bills
13:31Licenserwlangstroth: I can write $15 million on an unmarked bill
13:31wlangstrothLicenser: sold! OH, wait - you tricked me again!
13:31slyphonargh, wasn't htere a method that let you 'alter' a hash in such a way as to avoid (assoc blah :foo (inc (blah :foo)))
13:32Licenserupdate-in?
13:32slyphonyes! thank you!
13:32Licenser(update-in bla [:foo] inc)
13:32slyphonnot on the cheatsheet
13:32Licenserhmm do you realize, since @->--- is a ref you can run change the meaning within transactions!
13:32Licenserhow about clojure.contrib.silly?
13:33slyphoni like it
13:33LicenserI bet 95% of all programmers would love that :P
13:33zakwilsonIs there any way around Clojure's rules about cross-namespace redefinitions?
13:33wlangstrothslyphon: right you are ... I'm working on a new version of the cheatsheet with links, so thanks.
13:33slyphonwlangstroth: oh, awesome
13:34slyphonyeah, the links would be great
13:34slyphonwlangstroth: anything i can do to help?
13:34wlangstrothIt's available in crappy half-finished form here: http://langstroth.net/clojurepedia/cheatsheet.html
13:34Licenserwlangstroth: will they worked on printed copies
13:34sexpbot"Clojure cheat-sheet"
13:35Licenser(let [<3 inc] (<3 1))
13:35Licenser$(let [<3 inc] (<3 1))
13:35sexpbotresult: 2
13:35wlangstrothLicenser: I can do a print css pretty easily - I'm going to get all the links correct and check for missing things first
13:35slyphonLicenser: what's the $ syntax?
13:36slyphonoh, just clojurebot
13:36Licenserslyphon: that is sexpbot
13:36Licenserclojurebot's sister
13:36slyphon:)
13:36zakwilsonWhy is there more than one eval-bot in the channel? (aside from the fact that sexpbot is a cool name)
13:37Licenserbecause sexy is just more sexy
13:37Licenseralso I think it collects logs for walton
13:38wlangstrothLicenser: does the current cheat sheet work as a printed copy? (I haven't tried)
13:42wlangstrothslyphon: sure - let me know if any of the links don't work, and tell me if you notice anything missing. It's on github, too - hold on.
13:43slyphonah nice
13:43wlangstrothhttp://github.com/wlangstroth/clojurepedia
13:43wlangstrothexcuse the pretentious title
13:44wlangstroth(it was the first thing that lept to mind)
13:44slyphon:)
13:49anonymouse89does anyone know of a gedit plugin for clojure?
13:50wlangstrothslyphon: FZ fan? (your avatar)
13:51slyphonwlangstroth: hah, indeed :)
13:51wlangstrothnice
13:52mabeswlangstroth: do you have any plans on making clojurepedia's notes available via the REPL?
13:54wlangstrothmabes: if they turn out to be something helpful, that would be up to Rich et al. - at this point, I'm just thinking of making a few webpages for learning.
13:54wlangstrothprobably best to finish it first
13:55wlangstroth(or geez, start it)
13:58mabeswlangstroth: yeah, and I suppose walton already provides examples via the repl
14:04LicenserI have the likey coolest clojure function ever
14:04Licenserthere is also a walton webside
14:04Licenserhttp://gist.github.com/389741
14:08Licenser$(let [<3 (fn [love & loves] (loop [l (str "I love " love) loves loves] (let [[love & loves] loves] (if (nil? love) (str l ".") (if (empty? loves) (str l " and " love ".") (recur (str l ", " love) loves))))))] (<3 "clojure" "cookies" "pizza"))
14:08sexpbotresult: I love clojure, cookies and pizza.
14:08slyphonwow
14:09wlangstrothmabes: right - I'm picking out the simplest examples so I can remember the functions' uses
14:09slyphonnow all we need is an international obfuscated clojure competition
14:09Licenserslyphon: that sn't so obfuscared
14:09Licenserit is just a big let that holds a function and then the call of the function (<3 "clojure" "cookies" "pizza")
14:09wlangstrothLicenser: I'm pretty obfuscared of that code
14:10Licenserread the gits and it gets clear
14:10Licensersadly the bots only eat one line code
14:21LauJensenEvening gents
14:22wlangstrothLauJensen: is it a fine scandahoovian evening?
14:22LauJensenYes sir - It most certainly is
14:22wlangstrothexcellent
14:27arohnerwhat's the difference between (var ~foo) and (resolve (quote ~foo)) in a macro?
14:28arohneraside from compile time name resolution?
14:35wlangstrotharohner: I thought resolve was for namespaces (?)
14:35wlangstroth,(doc resolve)
14:35clojurebot"([sym]); same as (ns-resolve *ns* symbol)"
14:35arohnerwlangstroth: it resolves symbols in the current namespace
14:35arohnerand in my macro, it appears to work sometimes and not others
14:36arohnerI can't figure out why. It works 100% at the repl, and some of the time in running code
14:37wlangstrothhmm ... you've probably tried anything I could suggest (deps, classpath, etc.)
14:38wlangstrotharohner: do you have the code up somewhere?
14:38arohnerwlangstroth: it's too big to paste right now
14:39wlangstrothcool (this is me being on vacation)
14:41ordnungswidrogwhy I like cloure: http://www.alphaworks.ibm.com/tech/msdk/
14:41sexpbot"alphaWorks : Multicore Software Development Kit : Overview"
14:43wlangstrothyeah, yikes
14:43slyphonConcurrency: You're Doing It Wrong
14:46cp2lol wow
14:46wlangstrothslyphon: Concurrency, the "Brown Shoes Don't Make It" version.
14:46slyphonHAH!
14:46slyphon:D
14:47ordnungswidroglovery colourful pictures
14:47ordnungswidrogs/lovery/lovely/
14:47sexpbotlovely colourful pictures
14:49wlangstrothordnungswidrog: The "My Fair Lady" version is "loverly"
14:50slyphonor the Team America Kim Jong Il version
14:53ordnungswidrig*facepalm*
14:54wlangstrothwas bedeutet "ordnungswidrig"?
14:55kotarakwlangstroth: being against a rule or law. When you park your car where you are not allowed to park your car, your a commiting an "ordnungswidrigkeit"
14:55wlangstrothordnungswidrig: apparently, Jobs thinks so, too
14:56slyphonkotarak: in what language?
14:56wlangstrothGerman
14:56slyphonah
14:57wlangstrothah, like "ordinance"
14:57wlangstroth... thus "infraction" - got it.
14:59wlangstrothNatural languages are much more difficult than computer languages
14:59zakwilsonGoogle translates Google translates ordnungswidrigkeit as misdemeanor, but the useage doesn't line up with how misdemeanor is used in US law.
15:00kotarak"icelandic volcano" translates to "best friend". active volcano == no planes :)
15:00ordnungswidrigPerl comes close to a natural language. If the energy that went into the perl implement went into NLP we could talk to our computers :)
15:00ordnungswidrigzakwilson: try dict.leo.org
15:00wlangstrothzakwilson: really? I thought a misdemeanor in the states was processed without jury ... no?
15:01zakwilsonwlangstroth: no. You can go to jail for up to a year for a misdemeanor. If you can go to jail, you can have a jury trial.
15:01wlangstrothzakwilson: oh, quite right then.
15:02zakwilsonNot only does it use geolocation, I can't see where to change the language. I suppose I can just take advantage of Chrome's integration with Google Translate to translate another translation site.
15:03ordnungswidrigAn ordnungswidrigkeit is a small violation of rules which can only be lead to a fine (or a ban on driving)
15:03arohnerwlangstroth: ok, my issue appears to have something to do with ns aliases
15:03wlangstrothso "ordinance infraction" is pretty close
15:03zakwilsonIn the US, we'd call that an infraction or a violation.
15:04wlangstrotharohner: that figures, since it was working fine in the repl
15:04arohnerif I do (:require foo.bar :as bar), (resolve (quote bar/my-fn)) doesn't work, but (resolve (quote foo.bar/my-fn)) does
15:04arohnerand (var bar/my-fn) does work
15:04wlangstrothbrowr?
15:06alexykhey guys -- anyone played with Apache Avro?
15:06Licenserkotarak: I disagree, no planes == I am stuck away from home :(
15:07kotarakLicenser: at Frankfurt airport "no planes" means \o/. Sorry.
15:07Licenserkotarak: no it does not since it means I'll be stuck in Kuwait and trust me you doNt# want to be stuck here
15:07wlangstrotharohner: weird
15:09alexykI'm not getting serialization performance out of any Clojure/Java thing. I store large graphs as adjacency maps: {:a {:b [1 2 3] :c [2 4] :b [3 5]} b: {:c [6 7] ...}}. Congomongo anc cupboard store a million node graph in minutes, but retrieve in half an hour or more.
15:09alexykSomething makes it really hard to rebuild
15:09alexykunless I find a working solution I go back to OCaml with Marshal
15:09alexykso it's up to the community now
15:09alexyk:)
15:10Licenseralexyk: for the k/v store databases write and read performance are often not the same
15:10alexykLicenser: to put it mildly
15:10alexykanyone tried Tokyo Cabinet? I'll try anything
15:10Licenserdid you try to read the stuff w/o serializing it back? to see how much of the time the query takes and how long the serialisation does?
15:11alexykLicenser: what do you mean read w/o serializing? With eyes?
15:11Licenseralexyk: my way to go would be a) write the stuff to a file and have clojure read it again with (read-string)
15:11Licenseralexyk: just do a query that counts everything or something
15:11Licenseror wring just plain numbers as values instead of hashes
15:12alexykLicenser: I don't write it to files. It's a 2 GB or more graph; I write it either to MongoDB as JSON or to BDB JE as binary dumps
15:12Licenserand what read algorithm are you using, aka how are you serializing? perhas you can use transittiens?
15:12Licenserah
15:12Licenserwell json is slow
15:12alexykLicenser: Mongo uses JSON, BDB uses fast recursive write with bind APIs
15:12alexykI don't know how to make it rebuild the damn maps faster
15:12alexykhere the dynamism hurts somehow
15:13Licenserhmm so you store the data structure with a single query or do you write it on your own?
15:13alexykwith BDB JE, I could unleash concurrency, and it's still 15-20 minutes read to 1 minute write. I use mongo/bdb idioms
15:14alexykwhat I wonder is Apache Avro, Tokyo Cabinet, or some other way of fast dump/read. OCaml with Marsha, Python with cPickle are so much faster than Java stuff, makes one wonder.
15:14alexykocamlgraph reads in a minute
15:14alexykand it's the same mix of nested maps and lists
15:15ordnungswidrigalexyk: how will 1.2 with serialization do?
15:15Licenserhmm okay
15:15alexykordnungswidrig: should it be better?
15:15Licensernative serialisation should be better then json stuff
15:15Licenserkeep in mind creating a json means making a huge string out of it
15:16alexykhow is 1.2 improved in terms of serialization?
15:16Licenserand reading it again will likely get you a 2 gb string in the reader or something :P
15:16ordnungswidrigxstream perhaps?
15:16ordnungswidrigalexyk: clojure data structures will be serializable
15:17alexykordnungswidrig: mongo is json already... somehow I don't think jsons will be much faster
15:17Licenserif you just want to store one big thing in ther and then load it again (pr) and (read-string) might actually not be that bad I think
15:17Licenseralexyk: json = strings = slow
15:17alexykso 1.2 trunk already has serialization?
15:18Licenseralexyk: may i ask something, when you retreive the data, do you load the entire data into memory or do you keep the data in the db and only work on parts of it?
15:19alexykLicenser: entire graph, I need for speed. I don't care for random access now, just a whole slurp -- but fast
15:19chouseralexyk: http://www.assembla.com/spaces/clojure/tickets/281
15:19sexpbot"#281 - Make more datastructures serializable (Fixed) | Clojure | Assembla"
15:19Licenserah okay
15:19wlangstrotharohner: I can't reproduce it - what's the error?
15:20arohnerwlangstroth: I just finished reproducing & pasting it
15:20arohnerhttp://gist.github.com/389842
15:20alexykchouser: wow, applied today! coincidence?
15:21arohnerwlangstroth: the problem is, that resolve returns nil
15:23chouseralexyk: oh, sure enough. I didn't think it had been applied yet.
15:23alexykchouser: let's say that my asking about it and your linking to it magically materialized it!
15:24alexykwe have no proof otherwise that the flow of time was not altered at that very moment
15:24alexykand git repos magically rewtitten
15:24wlangstrothalexyk: are you one of the new writers for Doctor Who?
15:24alexykwlangstroth: I don't even know what it is :)
15:25alexykbut, it puts pressure now to switch to 1.2 and nag the dependencies' owners to upgrade theirs!
15:28alexykchouser: so, from that history, does it follow that it's already in the trunk?
15:28chouserif the flow of time can be altered, we have very little proof of anything at all
15:29wlangstrothchouser: is it 4:20 where you are already?
15:29Licenseralexyk: look at this: http://github.com/ninjudd/clojure-protobuf
15:29chouserwell, halloway doesn't link from tickets back to commits, so it's a not as easy as a click to find out
15:29chouserand this is git, "trunk" isn't a word
15:31alexykchouser: yeah, HEAD then. will have to grep the log then or something
15:31alexykLicenser: thx, very interetsing. I like "WAY faster"
15:32Licenseralexyk: never used it myself just read about it some time ago
15:32chouseralexyk: http://github.com/richhickey/clojure/commit/68a14c88d11555353bb471efd94ba7d40c2d5008
15:32alexykLicenser: am definitely gonna try. Anything!
15:32chouserso it's in master.
15:32LicenserI think it gets fast by using a pure binary format
15:32Licenseralexyk: please keep me up to date with the success since I'm curiouse about it :P
15:33jfieldswhat's the idiomatic way to filter non-nil results? (map #(not (nil? %)) [1 nil 2]) seems entirely too verbose.
15:33alexykchouser: ok, thx! Now in Java/Scala we have to add @serial-something in front of the declarations; how do we do it in Clojure?
15:33chouser,(remove nil? [1 nil 2])
15:33clojurebot(1 2)
15:33alexykjfields: (remove nil? blahs)
15:34chouserjfields: see also the new 'keep' if your seq is actually a call to map
15:34jfieldschouser, alexyk: thanks.
15:34arohneranyone else have ideas on this? http://gist.github.com/389842
15:34arohnerI'm stuck
15:35chouseralexyk: I don't actually know anything. I assume the whole tree of clojure structures just gets serialized.
15:35alexykchouser: you mean when we write it to a stream?
15:36chouseralexyk: http://java.sun.com/developer/technicalArticles/Programming/serialization/
15:36sexpbot"Discover the secrets of the Java Serialization API"
15:36chouserperhaps?
15:36jweissi'm using the clutch couchdb lib, it is throwing an NPE in the json code from contrib. i can't even match up the stack trace to the contrib src:
15:36jweissjava.lang.NullPointerException\n\tat clojure.contrib.json.read$read_json
15:36jweiss__3796.invoke(read.clj:151)\n\tat clojure.contrib.json.read$read_json__3796.invo
15:36jweisske(read.clj:149)\n\tat com.ashafa.clutch.view_server$run__347$fn__349$fn__351.in
15:36jweissvoke(view_server.clj:116)
15:36jweisswhere is read.clj?
15:37jweissthere's only a json.clj that i can find in contrib
15:38jweissohh
15:38alexykchouser: looking at Java APIs is depressing!
15:38jweissswitching tags to 1.1.0 in github :)
15:38chouser,(.writeObject (java.io.ObjectOutputStream. System/out) {1 2 3 4})
15:38clojurebotnil
15:38chousersomething like that I think
15:39wlangstrothalexyk: thus clojure
15:39alexykchouser: right, that's what Java and Scala do, but you have to precede things with @serializable for classes; I guess since we have a fixed set of classes which are already such, we can just write
15:39chouseralexyk: right, if you wanted to serialize deftype or defrecord objects, you might need to use the new annotation support or something. But I don't actually know.
15:39alexyksomewhere in *out* clojurebot is staring at a bunch of bytes
15:40alexykin disbelief
15:40alexykI don't yet have any deftypes, but will try
15:43alexykaha, this barfs for old clojures:
15:43alexyk,(.writeObject (java.io.ObjectOutputStream. System/out) {1 {2 [1 2] 3 [3 4]} 2 {1 [2 3] 4 [5 6]}})
15:43clojurebotjava.io.NotSerializableException: clojure.lang.PersistentVector$Node
16:04alexykLicenser: the same guy has a tookyocabinet-based graph library! yay! my work is done for me by github. I can go drink Coca-Cola now.
16:05Licenser:D
16:06alexykarohner: who is winston?
16:06alexykstuartsierra: did you play with Apache Avro?
16:08stuartsierraalexyk: no
16:09alexykstuartsierra: google mentioned you next to hadoop, clojure, and apache avro somehow
16:09stuartsierrano idea why
16:09alexykprobably text summarization
16:09cemerickalexyk, chouser: defrecords as well as all standard data structures are now serializable
16:09arohneralexyk: the codename for my project
16:09arohnerit's a machine learning decision engine. It's named after winston wolf from pulp fiction
16:09arohneralexyk: because he "solves problems"
16:10MrEvilis there an equivlent to map for maps? update a map applying some function over the values keeping the keys the same?
16:10alexyk ~ google "clojure avro"
16:10alexykclojurebot: google "clojure avro"
16:10clojurebotFirst, out of results is:
16:11arohnerwlangstroth: I figured it out. The value of *ns* was changing
16:11alexyk~ google clojure avro
16:11clojurebotFirst, out of 313 results is:
16:11clojurebotHw09 Hadoop + Clojure
16:11cemerickMrEvil: see clojure.contrib.generic.functor/fmap
16:11arohnerwlangstroth: at compile time in the repl, *ns* was the namespace I was in
16:11clojurebothttp://www.slideshare.net/cloudera/hw09-hadoop-clojure
16:11chouserMrEvil: there are a few options. one is (zipmap (keys m) (map f (vals m)))
16:11alexykstuartsierra: that first link has your name in the summary
16:11arohnerwlangstroth: when compiling a file and then running it, *ns* was clojure.core
16:11wlangstrotharohner: OH - that makes sense, then.
16:11stuartsierraalexyk: That's a presentation I gave on using Hadoop with Clojure, but I do not recall mentioning Avro
16:11MrEvilthanks!
16:11arohnerso replacing it with (ns-resolve current-ns sym) works
16:12alexykstuartsierra: probably google knows that avro is a hadoop part
16:12wlangstrothright
16:12alexykarohner: after winston churchill?
16:12technomancyalexyk: ISTR some lazy map implementation in contrib
16:12wlangstrothalexyk: winston wolf
16:13wlangstroth"That's about 30 minutes away. I'll be there in 10"
16:13alexyk~ google winston wolf
16:13clojurebotFirst, out of 218000 results is:
16:13clojurebotYouTube - Winston Wolf - I Solve Problems
16:13clojurebothttp://www.youtube.com/watch?v=ANPsHKpti48
16:14ordnungswidrigwolf, the cleanr
16:14alexykchurchill's first solved problem was the Mahdi uprising, which he solved with two early machine guns. He wrote that the problem-solvng description is omitted for the standards of the times do now allow for it...
16:16arohneralexyk: what is that from?
16:16alexykarohner: history :)
16:16arohneralexyk: sigh. the article :-)
16:17alexykarohner: I read about it in a book on Churchill
16:18alexykhis first posting as an officer was n Egypt, where he had to put down the Mahdi uprising. 10,000 horsemen were very effectively cut down by two Maxim prototypes and very surprised. Early technology "success."
16:19alexykiirc, of course
16:19alexykso, a suitable name for a clojure project as well :)
16:19arohnernice. I might use that
16:19MrEviloh the other thing i was wondering about is there an equivlent to python's repr? When I debug I like to print out datastructures but the standard println doesn't make it easy to distinguish between integers and strings or different elements in a list of strings
16:23carkhMrEvil: look at clojure.contrib.pprint
16:25cemerickMrEvil: or pr/prn, depending on what you want to do.
16:38alexykhmm, can you encode vectors and maps in protobufs?
16:44chouserprotobufs can have repeated fields for vector-like things
16:44chousera protobuf message is a sort of map
16:45chouserthe main mismatch I see between clojure collections and protobufs is that protobufs require schema-like information, and like all statis type systems it becomes a hub and multiplier of complexity.
16:45chouserstatic
16:46alexykright
16:46arohner,(partition 3 [1 2 3 4 5 6 7])
16:46clojurebot((1 2 3) (4 5 6))
16:46arohner,(partition 10 [1 2 3 4 5 6 7])
16:46clojurebot()
16:46alexykwhen faced with various ORMs for Scala, I have a sudden reluctance to go there
16:47alexyklike a kid being pulled from the street
16:47chouserarohner: partition-all
16:47rshwhen can a future not be killed with future-cancel?
16:47rsh,(doc future-cancel)
16:47clojurebot"([f]); Cancels the future, if possible."
16:47chouserrsh: busy calculation loops, for example.
16:47arohnerchouser: thanks
16:48arohnerI misread the doc for partition, returning a partition with less than n elements is only if you supply a pad
16:48rshwill it eventually get killed or will the call just be ignored?
16:49chouseroh, I forgot pad was still in there. :-/
16:49chouserrsh: if the thread comes to a cancellable point, I believe it will then be cancelled.
16:49chouserrsh: so, some kind of IO, attempting to take a lock, etc.
17:12cemerickooh, I didn't know about future-cancel
17:30slyphontechnomancy: hey, with slime.core/break do i have to be running 1.2 to get the locals?
17:30slyphonit didn't seem to work as advertized
17:31chouserhm, it could be using &env in which case it would need 1.2
17:31slyphonshit
17:31slyphonwhen is 1.2 tentatively scheduled for?
17:32ordnungswidrigslyphon: use clojure.contrib.trace instead of interactive debugging *g*
17:32chouseruse a java debugger that can step, instead of debug-repl which can't
17:32slyphonchouser: can you recommend one?
17:33slyphoni'm using slime for all my dev :/
17:33dakroneslyphon: http://groups.google.com/group/clojure/msg/21f9dbb6c6ee5196
17:33slyphonwoah, sweet
17:35technomancyslyphon: yes, 1.2 is required for swank.break locals
17:35slyphonah
17:35slyphonok
17:35slyphonanyone have a java debugger they use w/ clojure and would recommend?
17:36chouserslyphon: jswat has worked
17:36slyphonok, i'll have a look
17:36slyphonthanks :)
18:40alexykI'm leinifying a project which has a file called test.clj with a defn run running tests. What can I say in project.clj to make lein test invoke that?
18:45maxhodakit looks like congomongo is leaking memory in a huge way to me
18:45maxhodakhas anyone seen this before?
18:45maxhodaklike, every fetch opens a new fd and leaves it open... indefinitely
18:45maxhodakuntil i eventually hit the ulimit and it crashed the jvm
18:46maxhodakcrashes
18:46alexykmaxhodak: perhaps
18:46alexykhmm
18:46alexykI don't do that many fetches and throw 32 GB at it, but it annoyingly creeps up in it
18:47maxhodaki do one fetch to retrieve ~8k documents
18:47maxhodakand then 8k fetches to retrieve more data on each of those
18:47maxhodakactually
18:47maxhodakthats a retarded way to do it
18:47maxhodakobviously
18:47alexykmaxhodak: sounds like it :)
18:47maxhodakbut regardless, congomongo shouldn't die
18:48maxhodakit basically opens one fd for the 8k record fetch
18:48maxhodakand then on more for each 1 record fetch
18:48maxhodakuntil it hits 1024 open files and dies
18:48maxhodakeven though each 1 record fetch should be isolated in terms of scope
18:48maxhodaklike, it should completely close out the previous one each time
18:48alexykI wonder what happens when the fetch is exhausted -- I'd guess it must close the fd
18:49alexykwait until somTAB completes to somnium and asks him :)
18:49alexykso, what does leiningen expects in test/ ?
18:50maxhodakwait until somTAB completes to somnium?
18:50alexykmaxhodak: i.e. until somnium shows up here :)
18:51alexykmy new way to check if someone's here is to tab-complete them in my IRC client
18:51maxhodakoh haha got it
18:52maxhodakthanks
18:52alexyknp
18:54maxhodakis there a way to force gc in clojure?
18:59alexykam trying to leinify a project, get: Caused by: java.lang.IllegalArgumentException: No matching field found: getCommandLine for class org.apache.tools.ant.taskdefs.Java -- do I have to depend on ant explicitly, and ant-sy stuff?
19:00zakwilson__maxhodak: almost. From what I understand, you can't exactly force it, but you can strongly suggest it with (System/gc)
19:09defnmaxhodak: the new disclojure screencast shows how the jvm optimizes after a little bit in some situations, he gives a specific example which i dont quite remember at the moment, but maybe worth a look
19:23eslickmaxhodak: I think we're seeing similar things
19:24eslickWe have a similar usage pattern and will be hitting scale in our data analysis in a few days using congomongo
19:24eslickI'd be interested in what you find.
19:25maxhodakheh, hi ian
19:25eslickHey max!
19:25eslicksmall world?
19:26maxhodakyeah...
19:26eslickStarted switching compass' internal analytical tools to clojure last week
19:26eslickAre you using incanter by any chance?
19:26maxhodakclojure is amazing. and mongo is an incredible database.
19:26eslickI'm feeling similarly rosy about the coupling
19:26maxhodakno; incanter has a reasonably bad reputation at this point
19:26eslickHow so?
19:27maxhodakit's designed to really be an R-like environment
19:27maxhodaknot so much as online inferencing code
19:27eslickAh, I've started to use it for interactive data mining to explore dataset while developing production algs
19:28maxhodakand does some really horribly inefficient things (i.e., try filling in a matrix from seqs using the naive incanter methods)
19:28eslickOur product stuff is likely to be in custom clojure or pre-existing Java tools
19:28maxhodakyeah
19:29maxhodakmy big thing right now is im looking for a good interface to libsvm (or another svm lib)
19:29maxhodakyou'd think there'd be a lot, but there isn't
19:29eslickIn all honesty, I just like the pretty pictures Incanter produces without having to talk to JFreeChart
19:29eslickI'll keep an eye out
19:29maxhodakthanks
19:29maxhodakyeah, they are pretty good
19:30maxhodaki use incanter's pca which seems to be pretty good
19:30eslickGotta run now. Let me know what happens with congomongo; I'll let you know what we find as we play later this week
19:30maxhodakok, later
19:30alexykwhere does ns 'clojure.test come from, for lein test?
19:31tomojyou need to require or use it yourself
19:31tomoje.g. in the test file, add (:use clojure.test) to the ns
19:31technomancyalexyk: that error makes me think perhaps you're using an old lein-swank version?
19:31technomancythe ant exception
19:32alexyktechnomancy: I fixed that, that was googled in the group and was an older gitted lein
19:32technomancyoh, cool
19:33alexyknow I get a mild, project-related: namespace 'clojure.test' not found after loading '/clojure/test'
19:33alexykI've got a project with ant
19:33alexykit has a file test.clj which says (use 'clojure.test)
19:33alexykapparently that's not found
19:33tomojold clojure?
19:34alexykclojure is respectable 1.1.0
19:35alexykwhere should it come from?
19:35alexykclojure.jar?
19:35clojurebotclojure is a very attractive hammer with a nice heft to it
19:36alexykclojurebot: aren't you a chatterbox!
19:36clojurebotIt's greek to me.
19:39alexyktechnomancy: so how should I cook tests to ensure lein test does them? In the original, there was a test/ subdir and test.clj driver with defn run in it, then (run). I created src/{main,test}/clojure and moved test/, test.clj to src/test/clojure. Apparently lein test finds test.clj there
19:40livingstonI heard Stuart Sierra say that he didn't like clojure.walk .. but I didn't have a chance to talk to him more at the moment .. is there some way that's more preferred for mapping trees?
19:40technomancyalexyk: you could try doing "lein new dummy" to output a dummy project and base your structure on that
19:41tomojlein test shouldn't care, should it?
19:41tomojsince it will just run all discovered tests
19:41alexyktechnomancy: src/{main,test}/language is kind of standard maven structure, lein used to eat it well
19:42alexykI mean it finds test.clj there
19:47technomancysorry, it's hard to say without seeing the project. maybe you could ask on the mailing list with more details? I could take a look at it later.
19:50defnis 1.2 imminent?
20:23defnoooo, clojure-refactoring is awesome
20:26livingstonthere's no way to (gensym) into a specific ns is there?
20:29scottjlivingston: does it work to put the ns including / as the prefix-string?
20:30livingstonhow about that
20:30livingstonscottj: thanks
20:31livingstonI don't like all the string munging that comes with namespaces, it's kinda ugly, so I wasn't even thinking about that as an option
20:39lotiagreetings all. anyone have a link or any other resources on setting up clojure with slime when installing clojure from the git repo?
20:45livingston* is annoyed with "reify" being a name taken by clojure -- as I am working with RDF and now have to call "reify" something else, like "reify-statement" -- boo
20:47dnolenlotia: You could do that. But have you considered using lein? clojure is continuously built not and lein will grab it for you.
20:47dnolenlivingston: why not exclude reify?
20:47livingstonthis is an api i need to expose to the world, that wouldn't be a great idea
20:48livingstonit's not a huge deal
20:48dnolenlotia: I meant "continuously built *now*"
20:48MrEvilis there a way to get lazy-xml/emit to write to a file? it looks like it might be hard coded to output to stdout, and xml.emit looks like it's not very useful because it doesn't properly escape data
20:48lotiadnolen: thanks
20:48lotiathat made it clearer
20:49lotiadnolen: is keeping current a simple matter or anyother lein command
20:50dnolenlotia: if your project dependency includes org.clojure/clojure "1.2.0-master-SNAPSHOT", lein deps will always try to get the latest.
20:52livingstonthe docs say only one "/" is allowed in a symbol but things work like I'd like with something like a/b/c giving me a/b and c -- anyone know if that's the required behavior? right now the documentation on the reader says that's not a valid symbol
20:56chouserI think there is some intention for simple urls to be valid symbols
20:56chouserso slashes in namespaces is likely to continue to work
20:57cemerickit's odd though, right?
20:57livingstonchouser: that would be really nice
20:57cemerick,(name (symbol "http://oracle.com/foo&quot;))
20:57clojurebot"foo"
20:57chouserright, not terribly common
20:58cemerickno, I meant the impl -- it doesn't lend itself to representing URLs very nicely *shrug*
20:58livingstonsince then RDF URI's will break down in common sense ways into ns and local-name
20:58cemerick,(name (symbol "http://oracle.com/foo/bar/baz.html&quot;))
20:58clojurebot"baz.html"
20:58livingstoncemerick: no it's great
20:59cemericklivingston: shouldn't foo/bar/baz.html be the "local name" there?
20:59livingstonthe bottom line though it that then you can force it as needed if you give (symbol ) an ns with a "/" it won't get all fubared
20:59cemericksure
21:00livingstoncemerick: in RDF not really, although there's no set in stone thing, but commonly it's just the bit at the end
21:00cemerickI just didn't think URLs were any kind of consideration there
21:00cemerickOh, you can control it, of course
21:00cemerick,(symbol "oracle.com" "/foo/bar/baz.html")
21:00clojurebotoracle.com//foo/bar/baz.html
21:00livingstonright, exactly
21:01lotiadnolen: i've been a bit lost attempting to get the emacs side of things going.
21:02dnolenlotia: I suppose you prefer that route over NetBeans or Eclipse? Otherwise the fastest way to get with Emacs going is ELPA + lein
21:02lotiai'm not using technomancy's starter kit (too much of my own emacs customization already done), but want to use SLIME to play with clojure. does lein also take care of that?
21:03chouserwell, not really.
21:03livingstonis there a limit on ns or symbol name length either practical or enforced?
21:03chouser,(read-string (pr-str (symbol "oracle.com" "/foo/bar/baz.html")))
21:03clojurebotoracle.com//foo/bar/baz.html
21:03chouser,(namespace (read-string (pr-str (symbol "oracle.com" "/foo/bar/baz.html"))))
21:03clojurebot"oracle.com//foo/bar"
21:04technomancylotia: lein is working with projects. if you want a "raw repl" for experimentation you don't need it; you can use just swank-clojure
21:04livingstonchouser: ooh that's a bit of a problem now isn't it... although I don't think I'm counting on that to work -- I hope not anyway
21:05lotiatechnomancy: thanks. i'm just at a bit of a loss about which of the gihub forks to clone in order to set it up. or should i just use elpa to install.
21:06livingstonin rdf you frequently use a shorthand for the ns, like rdf/type to be "http://www.w3.org/1999/02/22-rdf-syntax-ns#type&quot;
21:06technomancylotia: my fork is the canonical one; the readme there should get you going
21:06lotiai want to use my own install of clojure over the one that clojure mode installs
21:06technomancylotia: why's that?
21:07livingstonso as long as a I always have a short-hand up front, I'm good, but hrm, this could be an issue I've overlooked, although as long as I don't serialize/read in my messed up clj symbol world, it wouldn't be an issue (I think).
21:07lotiatechnomancy: i'm likely clueless, but does clojure mode also just clone the repo off github and do the install? i have a different directory hierarchy etc.
21:08technomancylotia: clojure-mode used to have some install capabilities, but those are quite out of date. you should be able to follow the instructions from my swank-clojure's readme
21:09lotiatechnomancy: thanks
21:11chouserlivingston: if you're not going to read them, why use symbols? Why not just strings or a java or clojure object just for URIs?
21:13livingstonI will be reading them, but hopefully they will all have shorthand then or the object part will be at the end.. ugh hrm,...
21:13defn,(-> [] (fn (+ 1 2)) (Thread.) (.start))
21:13clojurebotnil
21:14livingstonthe idea is it'll be easy to drop into rdf world from clojure with something like `(ex/foo rdf:type ex/bar) etc.
21:15livingstonRDF triples are really just lists of symbols
21:16livingstonI wish I could write a reader macro like I could in common lisp, and then I could guarentee I wouldn't have a problem with this, and could actually allow already supported RDF notations
21:17livingstonif I run into a huge issue I guess I could convert to using java URI objects, just seemed messier (or I guess I could allow a mix of symbols when then shorthand is possible)
21:41lotiatechnomancy: is there a way to point swank-clojure to the latest versions of clojure and clojure-contrib (even if unstable)
21:42_atolotia: put them in ~/.swank-clojure (and move the originals out of there)
21:42_atoyou might also need to fiddle with the version of the swank-clojure.jar in there, there might be compatibility problems due to the changes in 1.2
21:43lotia_ato: thanks
22:27Blackfootanyone else having issues connection to clojars with mvn/lein?
22:59defnBlackfoot: someone mentioned something maybe 12 hours ago or so about the clojure build site being down
22:59defnBlackfoot: but i havent had any issues today
23:00defntechnomancy: is leiningen broken for 1.1 projects? I seem to hang at the point where it starts to move my :dev-deps into ./lib/dev/
23:02Blackfootyes,that's what i see
23:29technomancydefn: there's a bug in maven that causes it to spin up threads preventing it from exiting cleanly
23:29technomancydefn: you can just control-c it
23:35replacatechnomancy: I'm thinking more about this autodoc/lein thing and it feels a little doomed
23:36replacatechnomancy: first it depends on both contrib and enlive and I have to pick versions for those
23:36replacatechnomancy: and those will depend on a specific clojure version underneath
23:37technomancyreplaca: in that case my fallback suggestion would be to match autodoc versions with lein versions
23:38technomancysince lein versions (so far) match clojure versions
23:38replacatechnomancy: second: I'm trying to have a single jar that can be both the plugin & executable depending on args
23:38alexykhow do I specify java.library.path in project.clj?
23:39replacatechnomancy: OK. I'll need to check to see if Christophe is ready to go to 1.2
23:39alexykyeah, lein just hanging there is annoying
23:39technomancyreplaca: with pprint in clojure you should be able to reduce your contrib usage though
23:39technomancyalexyk: yeah, we may have to roll back to a maven version from before that bug was introduced
23:40replacatechnomancy: yeah, but I use other stuff as well so...
23:40alexyktechnomancy: so how about java.library.path? that ant takes with -D...
23:41technomancyalexyk: I think :native-path in project.clj does it
23:41technomancyI haven't used that myself
23:41alexykah!
23:41technomancyreplaca: well the first step is admitting you have a problem
23:42replacatechnomancy: hmm, I think we're taking a step backward when we think library usage is a problem
23:42alexyktechnomancy: does it take a string? :-separated?
23:43technomancyalexyk: not sure; try it and see what works
23:43technomancyreplaca: libraries that are clojure-version-agnostic are never a problem
23:43technomancyreplaca: but it looks like you've only got two contrib libs in there that aren't destined for clojure 1.2: shell-out and find-namespaces
23:44technomancyreplaca: the real problem is that contrib is monolithic
23:44replacatechnomancy: yeah, and the others should be fine too actually, cause pprint is staying in contrib for a bit as is duck-streams
23:45technomancyright, for backwards-compatibility
23:45technomancyI guess the real killer is seq-utils, since it defs stuff that is now in clojure.core
23:45replacatechnomancy: but why is that really a problem? The problem is that that pom also has a clojure dependency
23:46replacatechnomancy: I think the problem is the transitive dependency thing in libraries. I can't write a library that depends on another library without proclaiming what version of that llibrary I depend on
23:47technomancythere's always version ranges
23:47technomancybut your deps have to specify ranges as well
23:48replacaso that's part of the maven deal?
23:48replacaI haven't studied it as much as I should
23:48technomancyyeah, my fault for not documenting it
23:49technomancyactually I didn't even know it worked until someone else who knew maven better than I did tried it
23:50technomancyI need someone who speaks Japanese to help me keep up with the tweets about Leiningen
23:50slyphonis there a "standard" or recommended way to have periodic tasks run in a background thread?
23:50slyphonkind of like "cron" only, well, in-vm
23:50replacawell maybe 3 versions of autodoc then: standalone, lein 1.1 plugin, lein 1.2 plugin
23:50replacaor I could just suck in all the contrib stuff I wanted (and enlive too for that matter)
23:50replacabut that also seems like the way backwards
23:51technomancyyeah, I'm hesitant to suggest that
23:51technomancyif you can talk cgrand into using version ranges for enlive's deps that might help
23:52technomancyreplaca: next time I am in SF I am going to steal your laptop and surreptitiously add whitespace-mode as a clojure hook
23:52technomancywait, you work for a security/surveillance company, don't you... that might not be a good idea.
23:52replacatechnomancy: am i putting in tabs?
23:52technomancyoh heavens no, just trailing spaces and long lines
23:53technomancy=)
23:53replacaahh
23:53replacawhat does whitespace mode do
23:53replaca?
23:54slyphonreplaca: makes it harder to do that
23:54technomancyreplaca: http://p.hagelb.org/whitespace-mode.png
23:54slyphonooh
23:54technomancyit makes you cringe when you see long lines and trailing whitespace =)
23:55slyphonit's useful
23:55replacai could add that
23:55slyphonhaving trailing whitespace makes diffing harder
23:55replacayeah, I know
23:55replacaI don't *mean* to do it :-)
23:55slyphonwoah
23:55slyphontechnomancy: is that a screenshot of your sys?
23:56technomancyslyphon: ja
23:56replacayeah, all places where I split lines
23:57replacais whitespace mode built in or on elpa?
23:57technomancyslyphon: it's these ridiculous widescreen aspect ratios... vertical space is far too valuable to waste on something like a panel
23:57technomancyreplaca: it's in emacs 23+
23:57technomancyreplaca: http://p.hagelb.org/whitespace-mode-activate.html
23:57sexpbot"*temp*"
23:57slyphontechnomancy: yeah, totally
23:57slyphonhah
23:57slyphonthe gradient in mine is making it kind aridiculous
23:57replacacool - I'm still a little downrev, but I'm about to upgrade to the new ubuntu
23:58replacaand pull emacs with it
23:58technomancyif you build from source you can get the experimental branch with threading support
23:58technomancyfun stuff =)
23:58replacaI'm trying not to be experimental with emacs :-)
23:59replacatoo many experiments going on in my life already
23:59replacaok, I'm on baby duty. bbl
23:59technomancylater