#clojure log - May 04 2010

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

0:07 remleduff: Is clojure-mode supposed to work in the slime repl?

0:07 slyphon: i don't *think* so

0:08 well, i'll say this, it's never been active in the *slime-repl* buffer for me

0:10 remleduff: Alright, glad it's not just me :)

0:10 MadWombat: what is an easy way to sort a map by value?

0:12 _ato: sort-by val

0:12 ,(sort-by val {:a 4 :b 2 :c 3 :d 1})

0:12 clojurebot: ([:d 1] [:b 2] [:c 3] [:a 4])

0:13 remleduff: (val {:a 1 :b 2})

0:13 ,(val {:a 1 :b 2})

0:13 clojurebot: java.lang.ClassCastException: clojure.lang.PersistentArrayMap cannot be cast to java.util.Map$Entry

0:14 remleduff: ,(map val (seq {:a 1 :b 2}))

0:14 clojurebot: (1 2)

0:16 MadWombat: thanks

0:28 is there a better way to convert keywords into strings then (apply str (rest (str :asdf)))?

0:30 hiredman: ,(doc name)

0:30 clojurebot: "([x]); Returns the name String of a symbol or keyword."

0:30 MadWombat: hiredman: thanks

0:33 vIkSiT: hmm, what exactly happened to c.c.str-utils?

0:34 (and as a result, to re-partition)?

0:36 MadWombat: vIkSiT: renamed to string I believe

0:36 vIkSiT: hmm

0:36 I actually tried requiring that

0:37 doc partition

0:37 er, how did one invoke the bot again?

0:37 ,doc partition

0:37 clojurebot: java.lang.Exception: Can't take value of a macro: #'clojure.core/doc

0:37 dnolen: ,(doc partition)

0:37 clojurebot: "([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."

0:37 vIkSiT: ah thanks

0:38 hmm, so http://richhickey.github.com/clojure-contrib/str-utils-api.html

0:39 what do I import/require to use re-partition? I realized this was a different partition

0:52 remleduff: I think it depends on your clojure/clojure-contrib version at the moment

0:53 vIkSiT: remleduff, hmm which version should i be using?

0:54 remleduff: I'm meek, I still use 1.1, everyone else here mainlines the master branch ;)

0:55 vIkSiT: heh yeah, I'm on 1.2

0:56 remleduff: Looking at github, clojure.contrib.string/re-partition should still be fine

0:57 clojure.contrib.str-utils/re-partition rather

0:57 ,(clojure.contrib.str-utils/re-partition #"[a-z]+" "abc123def")

0:57 clojurebot: ("" "abc" "123" "def")

0:57 remleduff: ,*clojure-version*

0:57 clojurebot: {:interim true, :major 1, :minor 1, :incremental 0, :qualifier "master"}

1:11 MadWombat: and now I am a proud owner of yet another markov text generator written in clojure

1:12 mmarczyk: MadWombat: cool, got a gist of it? :-)

1:13 MadWombat: :)

1:13 yes, sort of

1:13 wish someone would look at it and see if I am doing anything majorly wrong

1:14 mmarczyk: not sure I'm qualified for the latter part, but I'd love to have a look if you posted a link :-)

1:17 MadWombat: http://pastie.org/944718

1:20 mmarczyk: I've got a lone 0 right outside clean-string :-)

1:20 um, I mean, you've got

1:22 I wonder if it would be better to include 's in "word characters"

1:22 that is, in the char class in clean-string

1:23 MadWombat: might be a good idea

1:25 mmarczyk: as far as I can tell, it's a very nice lazy mtg :-)

1:25 any example output?

1:28 MadWombat: yes, but it is not PC, I use bible

1:28 and Quran

1:29 s/Q/q/

1:29 sexpbot: and quran

1:29 mmarczyk: doesn't it become PC if you make that clear? :-)

1:30 or is it the contrary, I'm not entirely clear on this one ;-)

1:30 MadWombat: "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"

1:30 mmarczyk: ha :-)

1:30 MadWombat: "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"

1:31 mmarczyk: I think you should concatenate b. and q.

1:31 MadWombat: heh

1:31 mmarczyk: would be cool to read a conversation between Muhammad and Abraham :-)

1:32 MadWombat: in a bit

1:32 mmarczyk: I wonder how much of an explosion in memory use it would be

1:32 MadWombat: (def data (process-lines (concat (duck/read-lines "/home/wombat/Documents/bible.txt") (duck/read-lines "/home/wombat/Documents/MalikQuranTransaltion.txt"))))

1:33 mmarczyk: ha! right :-)

1:33 ^the memory use explosion refers to another idea I had a moment ago

1:33 which now seems silly to me, so I'm not finishing that sentence

1:34 MadWombat: hmm... this is creepy

1:34 "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"

1:34 mmarczyk: oh... wow... 8-O

1:35 MadWombat: "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"

1:37 well, this is enough, seems to be working

1:37 mmarczyk: this is actually a bit unsettling, could you tell your mtg to take it, like, more easy? ;-)

1:37 yup, and in 65 lines of Clojure :-)

1:38 MadWombat: yup

1:38 I might try building weighted graphs instead of Markov chains, see where that gets me

1:39 mmarczyk: oh, please do, then drop us a link :-)

1:39 MadWombat: this is the funnest part of clojure, the gap between idea and implementation is minimal

1:39 mmarczyk: indeed

1:41 new Full Disclojure episode, oh goody! :-)

1:41 * mmarczyk goes off to watch

1:45 unfo-: mmarczyk, url please :)

1:45 defn: "So..."

1:46 btw, i found someone else who says "closure" "cloh-jerr" besides Stuart H

1:49 mmarczyk: unfo-: http://vimeo.com/11446902

1:49 sexpbot: "Episode 18 - Performance Revisited on Vimeo"

1:49 unfo-: ty!

1:53 * scottj wonders how long before someone writes a clojure plugin for nano :)

1:54 unfo-: nano o____O

1:54 hiredman: :(

1:54 unfo-: it has plugins?

1:55 scottj: I hope not, I was just joking I can't stand it

1:56 unfo-: that sounds like "so anyone else find Margaret Thatcher REALLY hot?" - "errr what?" - "yeah, me neither, I mean sick..." ;)

1:57 defn: my friend went through a whole CS degree

1:57 scottj: haha nice

1:57 defn: and used nano the whole time

1:57 unfo-: defn, wat

1:57 defn: when we all realized this our senior year i couldn't believe it

1:57 unfo-: does nano have syntax hilite?

1:57 defn: he was writing 500, 1200 line projects in NANO

1:57 unfo-: he said he was "quite proud" when he found out how to turn that feature on

1:58 unfo-: :DD

1:58 defn: i couldnt believe it

1:58 it's no wonder he hates programming

1:58 unfo-: defn, ok, well at least it has that, compared to CS major freshmen i've seen who use notepad >__>

1:58 Associat0r: http://www.reddit.com/r/programming/comments/bzq1y/google_android_and_the_cli/

1:58 sexpbot: "Google Android and the CLI : programming"

2:02 paraseba: Hi, 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

2:02 scottj: so it looks like nano doesn't have language modes but instead you add whatever regexes you want highlighted to your rc file

2:07 paraseba: maybe email rhickey, I think he managed that list.

2:08 paraseba: 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

2:08 paraseba: yeah, the one I saw is on that list. neman.css

2:11 paraseba: scottj: yes, I had noticed that one, but it's more like a set of useful css rules than a framework to generate css

2:11 scottj: thanks anyway, I'll tray replying to rhickey

2:17 hiredman: http://hugoduncan.org/post/2010/shell_scripting_in_clojure_with_pallet.xhtml ho ho ho

2:17 sexpbot: "Hugo Duncan : Shell Scripting in Clojure with Pallet"

2:21 MadWombat: seems rather silly, what is the use case for this?

2:23 defn: to impress your friends and family

2:23 duhhhhh

2:24 LauJensen: Morning all

2:25 hiredman: you could rewrite lien in clojure

2:26 just about any server you write will need a launcher script

2:27 mmarczyk: morning, Lau

2:28 MadWombat: yes, technically, it is morning :)

2:28 mmarczyk: and it shall be a good one, hopefully ;-)

2:29 LauJensen: Indeed :)

2:30 mmarczyk: oh, I like the promises of Pallet :-)

2:32 although perhaps a clj2pyc utility would be even better, with . syntax for dealing w/ Python modules / classes :-)

2:33 best to have both, though, then transplant Clojure onto *every* host imaginable and take over the world

2:35 defn: hiredman: i remember technomancy saying the whole lein in clojure thing wouldnt work

2:35 some chicken/egg problem or something...

2:39 MadWombat: defn: Wonder what the problem is, clojure can be compiled after all

2:41 actually, I don't see any java code in leiningen github repo

2:43 * MadWombat wishes he could write Android apps in clojure

2:51 scottj: Anyone 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").

2:56 MadWombat: isn't the problem slow class loader and poor performance GC? and android 2.2 isn't addressing either but is getting JIT?

2:58 MadWombat: scottj: yes, something like that

2:59 paraseba: scottj: it doesn't. It should be added to hiccup

3:03 scottj: paraseba: k thanks. have you run into any cool non-obvious examples of what css-gen/saas are capable of?

3:05 paraseba: scottj: 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

3:05 scottj: that limits the power of the solution....

3:06 scottj: but, back to your question, take a look at compass. It's a huge, beautiful set of semantic mixins

3:08 scottj: it's really fantastic that you can write something like #nav { +horizontal-list +rounded-corners(10px) } that's really semantic CSS coding

3:09 scottj: 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

3:13 Associat0r: http://www.bestinclass.dk/index.php/2009/11/beautiful-code-manifesto/

3:13 sexpbot: "Beautiful code — The Manifesto | BEST IN CLASS"

3:20 scottj: paraseba: 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

3:22 but then you end up having to denote all the functions/variables so maybe it's moot

3:24 paraseba: scottj: 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

3:25 scottj: 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

3:27 scottj: at some point, I though of using macros and px1 em0.5 notation, but I'm not sure about it

3:28 LauJensen: Associat0r: Did you like it?

3:28 scottj: paraseba: yeah strings are probably better than that. If I think of anything I'll be in touch. /away

3:29 Associat0r: LauJensen: I like clojure but the article isn't that good in retrospect

3:29 made C# deliberatly too verbose

3:30 not a good comparison

3:30 LauJensen: I didn't actually - Just took a native C# speakers code to try and be realistic

3:31 Associat0r: LauJensen: btw I didn't realise you were the guy who wrote it

3:31 LauJensen: np, I like critique

3:31 Associat0r: LauJensen: also I see it's using ArrayList

3:31 LauJensen: that's from the pre generic gays

3:31 days

3:32 LauJensen: and you could have used LINQ

3:32 LauJensen: Associat0r: 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

3:32 For that reason I dont clean the examples up, but just take them as an example of what a native speaker could write

3:33 Associat0r: LauJensen: I understand

3:37 remleduff: LauJensen: Did you ever get Brian's Brain as fast as you'd like?

3:37 LauJensen: remleduff: 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 :)

3:39 remleduff: That's a big brain

3:42 defn: what is the next step in clojure...i wonder

3:42 i mean obviously things are evolving, i just wonder about what the future will look like with clojure

3:44 hoeck: defn: clojure-in-clojure?

3:44 defn: yeah but that's sort of a ... i dont know ... a tree, im talking about the forest

3:49 hoeck: LauJensen: 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!

3:49 Chousuke: well, there's the "cell" idea which sounds interesting

3:49 remleduff: I'm still interested to see what becomes of cells and scopes

3:52 Associat0r: LauJensen: 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

4:11 remleduff: How do I get [] and {} to work right with paredit in the slime repl?

4:12 defn: remleduff: i needed to set a couple vars

4:12 AWizzArd: Chousuke: 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.

4:23 Chousuke: remleduff: this is my setup. the important bit is the hook at the end http://github.com/Chousuke/emacs.d/blob/0c27cc6d308921357185c6e2dd8f4f7aedb62411/init-clojure.el

4:27 remleduff: Thanks Chousuke, I'll give that a shot

4:27 Man, I just found out about clojure.set/join, I've hand-coded that about 3 times in the past week :\

4:28 LauJensen: hoeck: where did the immutable come in ?

4:29 Associat0r: You remark is relating mostly to performance?

4:29 hoeck: immutable-by-convention, for the arrays you send to the graphics card

4:29 Associat0r: LauJensen: yes

4:30 LauJensen: what is your opinion on multiparadigm?

4:30 hoeck: and you could not write to input variables/arrays in the reduce/map function

4:30 Drakeson: ,(do (deftype foo [a]) (new foo 42))

4:30 clojurebot: java.lang.Exception: Unable to resolve symbol: deftype in this context

4:30 LauJensen: Associat0r: 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

4:31 Associat0r: Thats its poison to quality

4:32 Associat0r: LauJensen: I disagree with that, since not every problem fits 1 paradigm well

4:32 LauJensen: Associat0r: Good - Then I still have more to learn about software development :)

4:32 Associat0r: LauJensen: I think a layered approach to language design is best

4:35 Chousuke: I'm not a fan of the term "multiparadigm"

4:35 most languages are multiparadigm, yet are very different, so the information content of the word is very low

4:36 LauJensen: Chousuke: I read it as mixing 'functional and imperative', which just means you're watering out your FP

4:36 Chousuke: LauJensen: that's too limited a definition

4:36 Clojure itself could be said to be multiparadigm :P though with heavy focus of functional programming

4:36 LauJensen: Chousuke: Yea, I didn't mean it was accurate, but most dicussions come down to that

4:37 Chousuke: it's best to describe languages by their focus, not by the paradigms they support

4:37 _ato: heh, if you go off wikipedia's list it's ridiculous http://en.wikipedia.org/wiki/List_of_multi-paradigm_programming_languages

4:37 sexpbot: "List of multi-paradigm programming languages - Wikipedia, the free encyclopedia"

4:37 _ato: java's is apparently four paradigm

4:37 LauJensen: hehe

4:37 _ato: "imperative, object-oriented (class-based), reflective, generic"

4:37 which is just silly

4:38 Chousuke: and Common lisp is definitely functional/imperative/object-oriented and it's still a great language.

4:39 Associat0r: LauJensen: 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

4:41 and OO could also be built on top of that

4:41 Chousuke: You 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.

4:41 Associat0r: on FP that is

4:41 Chousuke: but with a library of imperative tools and datastructures, it'd be just fine.

4:41 Associat0r: I know

4:42 but I was mostly responding to his article about beatiful code

4:42 Chousuke: I think imperative code can be beautiful too

4:42 it's just much more difficult

4:43 LauJensen: Associat0r: AFAIK there is not yet a correct way to model OO functionally, which is way Clojure isnt OO

4:43 _ato: Some self-modifying assemblying I'd call beautiful ;-)

4:43 Associat0r: LauJensen: 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/

4:43 sexpbot: "MetaOCaml-Resource Aware Programming «"

4:43 _ato: s/assemblying/assembly/

4:43 sexpbot: LauJensen: 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/

4:44 Chousuke: huh

4:44 LauJensen: I am, thanks

4:44 Chousuke: sexpbot fails :P

4:44 _ato: s/fails/sucks/

4:44 sexpbot: sexpbot sucks :P

4:45 _ato: ah that's annoying

4:45 LauJensen: _ato: oops, it was something I request0red

4:45 ERC does it automatically, but the rest of you guys wont see it :)

4:48 s/does//quit

4:48 sexpbot: LauJensen: Format is sed [-<user name>] s/<regexp>/<replacement>/ Try $help sed

4:48 _ato: s/i/\t/

4:48 sexpbot: s/does//qutt

4:58 _ato: The 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.

4:58 LauJensen: true

4:59 And 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

5:01 Associat0r: I am mostly using F# these days

5:01 remleduff: In that case, you need to look at clojure code that's completely full of sigils :)

5:29 jowag: seems like http://build.clojure.org/releases is down

5:31 LauJensen: maybe its down, maybe Maven just decided it shouldn't be allowed to emit html

5:32 jowag: I've got connection reset when lein tries to download from this repo

5:34 _ato: yeah, it's definitely down

5:44 LauJensen: rhickey: Are you the guy who's going to reboot it ?

6:00 cschreiner: .

6:05 _exterm: Is 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).

6:06 I forgot to say: Hello everybody!

6:09 remleduff: ,(into {} (for [[{k v}] ["123" 1.0, "456" 2.0] {"id" k, "rank" v}))

6:09 clojurebot: Unmatched delimiter: )

6:10 remleduff: ,(into {} (for [[{k v}] ["123" 1.0, "456" 2.0]] {"id" k, "rank" v}))

6:10 clojurebot: java.lang.Exception: Unable to resolve symbol: v in this context

6:10 remleduff: ,(into {} (for [[{k v}] [{"123" 1.0}, {"456" 2.0}]] {"id" k, "rank" v}))

6:10 clojurebot: java.lang.Exception: Unable to resolve symbol: v in this context

6:10 remleduff: hmph, sorry

6: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

6:16 LauJensen: $(into {} (for [{:keys [k v]} [{"123" 1.0}, {"456" 2.0}]] {"id" 'k, "rank" 'v}))

6:16 sexpbot: result: {"rank" v, "id" k}

6:16 _ato: first expand macros

6:17 then eval the form, which often means recursively evaling

6:19 each type of expression has a class, like IfExpr, LoopExpr, FnExpr, which does the real work of emiting byte code

6:21 remleduff: Thanks LauJensen, I'm too tired at the moment :)

6:21 hiredman: eval and emit are distinct code paths

6:21 _ato: there'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

6:22 cgrand: ,(into {} (for [[[k v]] [{"123" 1.0}, {"456" 2.0}]] {"id" k, "rank" v}))

6:22 clojurebot: java.lang.RuntimeException: java.lang.UnsupportedOperationException: nth not supported on this type: PersistentArrayMap

6:22 cgrand: ,(into {} (for [m [{"123" 1.0}, {"456" 2.0}] [k v] m] {"id" k, "rank" v}))

6:22 clojurebot: {"id" "456", "rank" 2.0}

6:24 cgrand: but i'm pretty sure that's not what you expected

6:24 ,(for [m [{"123" 1.0}, {"456" 2.0}] [k v] m] {"id" k, "rank" v}) ; maybe

6:24 clojurebot: ({"id" "123", "rank" 1.0} {"id" "456", "rank" 2.0})

6:24 remleduff: I was just thinking I had to be missing something

6:42 mmarczyk: hm, guys -- what are your opinions on having Refs inside Refs? ok? not ok? <- just came up in Clojure101 @ rubylearning.org

6:43 or 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

6:43 a Ref containing a collection / sequence of Refs is one obvious answer... any pros/cons/other options?

6: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

6:58 it seems that all the magic happens in the call to analyze().

7:20 giacecco: Hi all, I have a question for you

7:20 Why can't I use 'apply' with macros?

7:21 I can do (apply + [1 2 3])

7:21 But I can't do (apply or [true false false])

7:22 and I need to do the latter!

7:23 mmarczyk: you actually need to do (some identity [true false false]) :-)

7:24 giacecco: Can you give an example?

7:25 What do you mean by "some identity"?

7:26 mmarczyk: ,(some identity [true false false])

7:26 clojurebot: true

7:26 mmarczyk: ,(doc some)

7:26 clojurebot: "([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)"

7:26 Borkdude: (identity true) -> true

7:27 mmarczyk: I don't mean just "some identity", I mean *just the identity you need*

7:27 giacecco: Like

7:28 (true or [...]) ?

7:28 Borkdude: you could also do: (some true? [true false true]), it reads more intuitive maybe?

7:28 giacecco: Ha!

7:29 mmarczyk: but it's no longer equivalent to your (apply or ...) idea

7:29 ,(or 1 2 3)

7:29 clojurebot: 1

7:29 mmarczyk: ,(some true? [1 2 3])

7:29 clojurebot: nil

7:29 giacecco: Thanks I'll try

7:30 It's counter intuitive though that I can't use apply with macros

7:30 mmarczyk: yw

7:30 giacecco: I would stay around but I'm on my mobile, thank you and see you soon!

7:30 Borkdude: giacecco: good luck

7:31 mmarczyk: bye :-)

7:31 Borkdude: iPhone, hmm, can you run a repl on that? :)

7:32 mmarczyk: perhaps, but if it is in any way useful to you, you're likely violating a contract :-)

7:35 Borkdude: Maybe he could have used `(or ~@[true false true]) if he really needed to some list inside or? But somehow I never used this myself ;)

7:36 Can you eval a sexp in private with sexpbot?

7:37 gregh: that sounds kinky

7:39 Borkdude: hehe it does

7:47 lessthantristan: is the "downloading: ....pom from clojure-snapshots" step in lein deps running really really slow for anyone else?

7:48 _ato: lessthantristan: build.clojure.org is down

7:48 lessthantristan: ah i see

7:49 figured it would be something like that

8:09 cemerick: rhickey: that assembla chat room is sorta broken :-)

8:11 rhickey: cemerick: wow, yeah

8:11 cemerick: whoa, was that a URL?

8:11 rhickey: yes, pasted in!

8:12 cemerick: nice

8:12 rhickey: stunning

8:12 cemerick: They should just pull the feature.

8:12 "feature"

8:12 rhickey: shall I just paste that email exchange in the ticket?

8:12 rhickey: shame, because theoretically it would be loged

8:12 cemerick: yes, thanks

8:12 * rhickey disables chat tool in Assembla

8:14 AWizzArd: ,(doc replace)

8:14 clojurebot: "([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"

8:14 cemerick: I worry about assembla when I see stuff like that.

8:15 rhickey: cemerick: 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...

8:16 AWizzArd: I'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.

8:17 cemerick: rhickey: I should go poke atlassian again, see what terms they'd be willing to offer on a clojure space in their studio product.

8:17 mmarczyk: ,((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)

8:17 clojurebot: nil

8:17 mmarczyk: rhickey: thought you might be interested to see the above

8:17 AWizzArd: cemerick: Atlassian (Jira) would be very cool. What did they say last time?

8:17 mmarczyk: rhickey: also happens in 1.2

8:18 (that's 20 args + varargs => nil return)

8:18 cemerick: AWizzArd: 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.

8:19 They liked the concept of free hosting, but had stuff to figure out on their end.

8:20 rhickey: cemerick: what's the Jira + Github story?

8:21 external git being a nice feature of assembla

8:24 cemerick: rhickey: Looks like they have git support in studio -- are there github-specific requirements?

8:25 rhickey: cemerick: 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

8:26 AWizzArd: At least for local checkins this works, though I don't know if Assembla can inform Jira about it.

8:30 cemerick: rhickey: 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

8:31 I'm not sure any of that is github-specific....?

8:33 rhickey: cemerick: probably doesn't need to be

8:33 cemerick: that page seems out of date -- this is the relevant one for the studio product, it would seem: https://studio.plugins.atlassian.com/browse/JGIT

8:40 bosie: is there a better book than Stuart's 'Programming Clojure' around, for beginners of FP/Clojure?

8:41 AWizzArd: Typically 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.

8:42 dnolen: hmm, is http://build.clojure.org/ down?

8:42 cemerick: yeah

8:46 rhickey: 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.

8:48 AWizzArd: This I would find to be the best solution, and also the one which looks most professional.

8:48 dnolen: bosie: 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.

8:49 bosie: dnolen: i fail to do 'start writing some code' because as soon as i hit lazy collections i am done

8:49 dnolen: considering they never get executed ;)

8:50 chouser: Mmmmm... "~<#(~;~@{~w~^ ~_~}~;)~:>"

8:50 cemerick: AWizzArd: 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.

8:50 chouser: "Don't bring that disgusting thing in my house!" :-P

8:51 dnolen: bosie: using lazy collections is pretty transparent unless you're doing side effects, then you need to force it with something like doseq, doall, etc.

8:51 chouser: cemerick: :-) But... it's already there, in contrib. Slated for core...

8:51 bosie: dnolen: what you mean transparent?

8:51 AWizzArd: cemerick: high quality root servers in Germany cost around 100$/month

8:51 bosie: AWizzArd: which ones?

8:51 AWizzArd: But I agree that this will require some time.

8:51 cemerick: chouser: I've not looked at the pprint stuff at all. Oh no.

8:51 AWizzArd: bosie: http://www.hetzner.de/en/hosting/produktmatrix/rootserver-produktmatrix-eq/

8:51 sexpbot: "Hetzner Online AG: Root Server Productmatrix EQ"

8:52 bosie: AWizzArd: isn't hetzner relatively bad?

8:52 AWizzArd: No, it is very good.

8:52 Won in tests of serious magazines.

8:52 dnolen: bosie: as in you don't need to do anything special when dealing with them.

8:53 cemerick: I'd put it on AWS if we were to sponsor it, but all of this is a little moot at the moment.

8:53 AWizzArd: A 12 GB RAM quad core box should easily be enough for hosting a Clojure website

8:53 bosie: dnolen: i have to realize them somehow which i seem to be unable to do

8:53 dnolen: bosie: sounds like you have some side-effects then no?

8:53 bosie: dnolen: no

8:54 dnolen: http://pastie.org/945072

8:55 dnolen: bosie: print is side effect

8:56 bosie: dnolen: yea but that doesn't matter, does it?

8:56 dnolen: fun will not get called

8:56 dnolen: bosie: (doall (map fun get-files)) if you want to see output

8:57 _ato: AWizzArd: getting someone to look after it month after month, year after year is the hard part, not so much server costs or initial setup. ;-)

8:57 bosie: dnolen: hmm no, results in an exception

8:57 dnolen: bosie: er, get_files in your case. underscores are not so idiomatic in Clojure.

8:57 spariev: still, Hetzner's dedicated servers are very good, a few friends of mine have great experience with them

8:57 AWizzArd: _ato: yes

8:57 dnolen: bosie: what is the exception?

8:57 bosie: Don't know how to create ISeq from: user$get_files__3 (main.clj:0)

8:58 AWizzArd: bosie: if get-files is a function then (map fun (get-files)) would do the right thing supposedly

9:00 bosie: true

9:05 zmila: is there a way to put in-line comment inside a s-expr?

9:05 ,(-> 1 (Math/asin ,,,) (doc Math/sin ,,,) )

9:05 clojurebot: java.lang.IllegalArgumentException: Wrong number of args passed to: sandbox$my-doc

9:06 AWizzArd: zmila: you can use (comment ...) or #_"your comment"

9:06 where the second form is in nearly all cases better

9:06 zmila: instead of ,,, i like to comment the meaning/name of the param

9:06 AWizzArd: ,(println #_"I want to print something" "Hello World")

9:06 clojurebot: Hello World

9:07 chouser: ,(-> 1 (#^{:doc "This is a sort of comment"} Math/asin))

9:07 clojurebot: 1.5707963267948966

9:07 zmila: ,(-> 1 (Math/asin #_"num") (Math/sin #_"angle") )

9:07 clojurebot: 1.0

9:08 zmila: nice! thank you, AWizzArd

9:08 AWizzArd: zmila: the reader will completely remove the expression that follows the reader-macro #_

9:09 zmila: i tried (comment "zzz") but it evaluates to nil

9:09 cemerick: Surely that isn't to be encouraged?

9:09 rhickey: mmarczyk: fixed - thanks!

9:09 mmarczyk: rhickey: oh, cool :-)

9:09 rhickey: out of curiosity, what was it about?

9:09 rhickey: or actually I guess I'll go read the patch

9:10 rhickey: mmarczyk: there's a difference in sig between invoke and doInvoke (for rest fns) at that arity, but same sig was being used for both

9:12 mmarczyk: rhickey: I see, thanks

9:13 rhickey: especially since reading the patch wouldn't have made it obvious to me with my measly Java-fu :-(

9:13 cemerick: chouser: Yeah, I hadn't really internalized the fact that pprint carries cl-format along

9:14 Sorta like a disease vector or something. (Apologies to Tom :-))

9:15 chouser: I suppose I just need to learn that syntax. Then I'm sure I'll love it.

9:15 cemerick: It's quite simply bad IMO.

9:16 chouser: regex is arguably bad as well, but I sure use it a lot

9:16 cemerick: Indeed, they're similar. There isn't a reasonable alternative to regexes, though, AFAIK.

9:17 chouser: cemerick: working on it. ;-)

9:18 cemerick: chouser: Yeah, I implemented sexpr regex and XSLT engines in CL a long while back. :-)

9:18 The latter was nice, the former ended up being *way* too verbose.

9:18 dnolen: cl-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?

9:19 cemerick: I'm absolutely certain of its usefulness.

9:19 I wouldn't inflict cl-format strings on the future maintainer of my code, though.

9:22 dnolen_: heh, well we're already inflicting Lisp on future maintainers. Though I prefer "blessing"

9:22 so what's the verdict on importing 1.2.0 features sanely? Any conventions?

9:24 dnolen: it sounded like try/catch around (use ...) doesn't work so well.

9:25 cemerick: dnolen: try/catch works just fine

9:25 not pretty, but it works

9:27 dnolen: cemerick: what advantage over checking *clojure-version* in a cond or something?

9:27 drewr: rhickey: 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

9:27 rhickey: drewr: I don't want incoming from gmane

9:27 cemerick: dnolen: it's easier and more reliable. Version-sniffing is bad in almost every context.

9:28 feature-based conditional execution is ideal, but not here yet

9:28 drewr: rhickey: you mean spam, or even legitimate mail? (gmane uses a challenge-response mechanism to prevent the former)

9:29 dnolen: cemerick: 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

9:30 cemerick: dnolen: 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.

9:30 And, you want to prefer the newer namespaces, so any potential for having an exception thrown goes down over times.

9:30 time*

9:31 dnolen: a live example, FWIW: http://github.com/cemerick/pallet/blob/master/src/pallet/compat.clj

9:37 jowag: how do I specify a backslash character literal?

9:38 carkh: ,\\

9:38 clojurebot: \\

9:38 jowag: no

9:38 ,(str "a" \b \\)

9:38 clojurebot: "ab\\"

9:38 jowag: see

9:38 carkh: (print "ab\\")

9:38 ,(print "ab\\")

9:38 clojurebot: ab\

9:39 carkh: so i guess it's a yes =)

9:39 cemerick: rhickey: is the 18/20-arg limit ever likely to be eliminated?

9:39 jowag: hmm, so why (str \\) prints \ twice

9:39 cemerick: (I presume not...)

9:39 rhickey: cemerick: I'd like to reduce it

9:40 carkh: jowag: string literals are escaping the backslash

9:40 backslash is used to escape stuff

9:40 cemerick: rhickey: ouch :-(

9:40 defn: is there a good place to read about why there is a limited number of args?

9:40 carkh: ,"\"

9:40 clojurebot: EOF while reading string

9:41 carkh: see not working

9:41 cemerick: I guess passing a boxed arg-vector is to be the norm for e.g. generated code.

9:41 jowag: ah yes, result is string literal which contains escaped backslash, now I understand, thanks

9:41 rhickey: cemerick: ?

9:41 defn: i 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

9:42 carkh: defn: maybe for macro generated code ?

9:42 cemerick: rhickey: i.e. generate (fn [[a b c ...unlimited args]] ...) instead of (fn [a b c ....]),

9:42 chouser: pass a vector for goodness' sake

9:42 defn: indeed

9:42 chouser: :-)

9:42 carkh: hey i agree to that =)

9:43 cemerick: defn: generated code can easily grow more than 20 args

9:43 defn: carkh: yeah i dont know much about macro gen'd code

9:43 chouser: so does 'satisfies?' work on protocols both extended and implemented in-line in defrecord?

9:43 cemerick: that's obviously an edge case though

9:43 rhickey: chouser: yes, as does extends? now

9:44 chouser: only extenders is limited to the explicit ones

9:45 fogus: cemerick: Generated code with 20+ args smells very Java-esque

9:45 chouser: ok, great. But not quite as fast as 'instance?' I would guess...

9:45 cemerick: fogus: Seems like it's a question of domain, not language impl. *shrug*

9:46 The code gen we do never gets above 14 I think. I can easily see going higher being useful/convenient.

9:46 fogus: cemerick: perhaps.

9:48 cemerick: Is your generated API for human consumption?

9:49 cemerick: fogus: one sane part is. The gnarly backend stuff, definitely not.

9:50 the latter isn't really an API though -- it's the result of a training process.

9:50 Or, I should say, it's the implementation of an API that is the result of a training process.

9:52 fogus: i see

9:58 * fogus remembers some old custom Java ORM code that spewed out method arg-lists of unusual size.

10:00 chouser: MALOUS

10:01 cemerick: fogus: create(column1, ...., column 43), update(column1, ...., column 43), etc? :-)

10:01 defn: cemerick: what do you mean by training process?

10:03 cemerick: defn: 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:05 fogus: cemerick: Yes... but mostly constrained to the c-tors. ;-)

10:33 dnolen: replaca: 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:33 zmila: is there (get-in m keys default-value)?

10:33 ,(doc get-in)

10:33 clojurebot: "([m ks]); returns the value in a nested associative structure, where ks is a sequence of keys"

10:33 zmila: returns nil if no key found

10:39 defn: cemerick: sounds like art. very cool.

10:39 replaca: dnolen: ok, makes sense

10:40 dnolen: I guess that makes it even less of a hurry! :)

10:40 defn: cemerick: is there anyway to limit the generated arguments by placing them in a vector or something?

10:42 dnolen: replaca: well it's good to have the pprint fix, the to way call pprint has changed slightly.

10:43 replaca: dnolen: you mean just cause it's moved and there's no PrettyWriter anymore?

10:43 oh and code-dispatch lost its ears

10:43 dnolen: replaca: yeah

10:44 cemerick: defn: yeah, that's the general workaround

10:44 dnolen: replaca: http://github.com/swannodette/swank-clojure/commit/3cac865429c476b94e7449abf55e545dd364a9dc

10:44 is my workaround at the moment

10:44 replaca: dnolen: k, I just wanted to make sure I hadn't changed anything unintentionally (cause I changed plenty intentionally)

10:45 dnolen: 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:45 dnolen: replaca: thx

10:45 replaca: dnolen: no, thank *you* :)

11:53 defn: ,(apply str (mapcat #(map char %) (concat [(map inc [70 110 110 99 109 104]) (reverse '(33 116 104 103))])))

11:53 clojurebot: "Goodnight!"

11:54 defn: not my work -- found that while testing something in walton

11:54 anyway, night all

11:54 mmarczyk: so that was the response to (what? "Goodnight!")

11:54 might want to work on the kind of examples it prioritises ;-)

11:55 good night!

11:56 TakeV: How do you perform the equivalent of a while loop? Loop/recur?

11:56 Chousuke: TakeV: there's a while macro

11:56 TakeV: Safe for the stack?

11:57 Chousuke: what are you trying to do with it?

11:57 it doesn't make sense to use while unless you have some side-effecting condition

11:57 TakeV: Chousuke: Game programming. Figuring out how I'd do the game loop.

11:58 Chousuke: ah, right.

11:58 (while @running ...) is okay I think

11:58 * TakeV nods

11:58 TakeV: Thanks.

12:08 arohner: what ever happened to the circular load detection patch?

12:14 signalseeker: Hi, How do I make swank-clojure point to my own clojure/clojure-contrib repos?

12:15 technomancy: signalseeker: set swank-clojure-classpath in Emacs; should be a list of paths to jar files

12:16 signalseeker: technomancy: thanks. I'll try that.

12:18 technomancy: list of paths should be quoted, just like clojure syntax?

12:18 technomancy: right. be sure it includes the swank-clojure jar too.

12:18 signalseeker: I see, there is no way it can pick this up from my .bash_profile?

12:20 replaca: technomancy: can you explain the "don't depend on clojure" thing?

12:20 (just so I understand what I'm doing)

12:20 technomancy: replaca: if a piece of code is a lein plugin, then it's implied that it has all the same dependencies as lein itself.

12:20 otherwise what happens when lein upgrades to Clojure 1.2 but the plugin doesn't?

12:22 replaca: technomancy: 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:22 ?

12:23 technomancy: enlive might be able to get away with clojure as a dev-dependency

12:23 but I haven't thought that all the way through.

12:24 replaca: technomancy: well, presumably enlive just has clojure as a dependency cause it doesn't know it's being used in a plugin

12:25 technomancy: replaca: not as a lein plugin, but it knows it's being used by a project that already depends on clojure

12:25 replaca: technomancy: 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:26 technomancy: but 1.2 vs 1.1 differences make that more complicated

12:27 signalseeker: Is there a swank-clojure-1.2?

12:27 replaca: technomancy: 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:54 Licenser: kreetings everyone

13:04 Hmm 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:05 Problem 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:05 zakwilson__: Why do we have first and second for maps, but not nth?

13:05 slyphon: hrm

13:05 anyone ever get "error in process filter: Wrong number of arguments: nil, 0" with swank-clojure-project?

13:06 wlangstroth: zakwilson: nth for maps?

13:08 zakwilson: wlangstroth: yes

13:09 ,(first {:a 1 :b 2})

13:09 clojurebot: [:a 1]

13:09 zakwilson: ,(nth {:a 1 :b 2} 0)

13:09 clojurebot: java.lang.UnsupportedOperationException: nth not supported on this type: PersistentArrayMap

13:10 bosie: zakwilson__: works for me

13:10 Licenser: (doc nth)

13:10 clojurebot: "([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:10 chouser: first calls seq on its arg. nth does not

13:10 bosie: zakwilson: oh you mean like that, sorry

13:10 Licenser: my guess would be because nth can't guarantee anything of the position

13:10 chouser: you don't want nth to call seq because you want it to be fast for vectors and such

13:11 rhickey: most recent push has last-one-in-wins for refers and interns - feedback welcome

13:11 zakwilson: Thanks, chouser.

13:11 Though that seems like an application for multimethods.

13:13 chouser: protocols, 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:15 zakwilson: I suppose. I was thinking of nth as a seq function, for no particular reason.

13:15 * rhickey dreads when people start using protocols to extend abstractions to where they don't belong

13:18 Licenser: rhickey: 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:18 slyphon: Licenser: hah, we used to refer to that as "New Hammer Syndrome"

13:18 * zakwilson is going to extend + to do function composition just to see rhickey overcome with dread.

13:19 slyphon: from "when all you have is a hammer..."

13:19 rhickey: zakwilson: ouch!

13:19 Licenser: slyphon: :P

13:19 slyphon: Licenser: it happens to everyone :)

13:19 Licenser: what is function composition I want to try out the hammer!

13:20 mmarczyk: zakwilson: oh, this is so obviously *wrong*!

13:20 slyphon: hahaha

13:20 mmarczyk: zakwilson: everyone knows it should be * doing function composition

13:20 stuartsierra: or .

13:20 mmarczyk: right :-)

13:20 * zakwilson once did write a macro in CL to turn existing functions generic so as to enable misbehavior of that sort.

13:21 Licenser: hmm you could do ++ that behaves like ..?

13:21 zakwilson: Didn't work on + or certain other core functions though. Well... it did, but it totally corrupted the running image.

13:22 mmarczyk: zakwilson: sounds like fun :-)

13:22 stuartsierra: Personally, I favor the rocket ship operator ##]===>

13:23 mmarczyk: stuartsierra: that's for when Rich opens the reader :-)

13:23 Licenser: hmm (* inc 3 3) (inc (inc (inc 3)))

13:23 mmarczyk: (s/when/if/ if necessary)

13:24 zakwilson: mmarczyk: 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:24 Licenser: (+ inc dec) -> #(inc (dec %))

13:24 zakwilson: Licenser will be entering the first obfuscated Clojure contest.

13:24 Licenser: wooh!

13:25 we could do a rose opperator: @-->-----

13:25 the first opperato that is a ref!

13:26 mmarczyk: zakwilson: only generic functions -- performant -- great interop with an existing rich platform

13:26 Licenser: that works!

13:26 (def ->--- (ref inc))

13:26 mmarczyk: zakwilson: can we even pick any two, I wonder

13:26 Licenser: (@->--- 1)

13:27 * mmarczyk sips his tea and ponders the glorious vision of having all three at once

13:27 Licenser: it's the new way to say 'I love this idea'

13:27 slyphon: Licenser: hah!

13:27 mmarczyk: @->--- is cool :-)

13:27 zakwilson: ,(let [-->----- (ref (fn [] "@-->-----"))] (@-->-----))

13:27 clojurebot: "@-->-----"

13:28 zakwilson: mmarczyk: I think all functions generic is analogous to everything is an object.

13:28 wlangstroth: does the stem get longer the more you like the idea?

13:29 Licenser: rhickey: if I send you a CA can @->--- get into clojure core?

13:29 slyphon: wlangstroth: if your stem keeps getting longer for more than 4 hours, consult your doctor

13:29 wlangstroth: slyphon: as soon as I wrote it, I realized my mistake

13:29 rhickey: Licenser: I doubt it

13:29 slyphon: wlangstroth: :D

13:30 Licenser: if I send you some candy?

13:30 I don't think bribery is forbidden by the EPL is it?

13:30 wlangstroth: Maybe if you send him $15 million in unmarked bills

13:31 Licenser: wlangstroth: I can write $15 million on an unmarked bill

13:31 wlangstroth: Licenser: sold! OH, wait - you tricked me again!

13:31 slyphon: argh, 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:32 Licenser: update-in?

13:32 slyphon: yes! thank you!

13:32 Licenser: (update-in bla [:foo] inc)

13:32 slyphon: not on the cheatsheet

13:32 Licenser: hmm do you realize, since @->--- is a ref you can run change the meaning within transactions!

13:32 * slyphon uses the cheatsheet pretty religiously

13:32 Licenser: how about clojure.contrib.silly?

13:33 slyphon: i like it

13:33 * zakwilson approves

13:33 Licenser: I bet 95% of all programmers would love that :P

13:33 zakwilson: Is there any way around Clojure's rules about cross-namespace redefinitions?

13:33 wlangstroth: slyphon: right you are ... I'm working on a new version of the cheatsheet with links, so thanks.

13:33 slyphon: wlangstroth: oh, awesome

13:34 yeah, the links would be great

13:34 wlangstroth: anything i can do to help?

13:34 wlangstroth: It's available in crappy half-finished form here: http://langstroth.net/clojurepedia/cheatsheet.html

13:34 Licenser: wlangstroth: will they worked on printed copies

13:34 sexpbot: "Clojure cheat-sheet"

13:35 Licenser: (let [<3 inc] (<3 1))

13:35 $(let [<3 inc] (<3 1))

13:35 sexpbot: result: 2

13:35 wlangstroth: Licenser: I can do a print css pretty easily - I'm going to get all the links correct and check for missing things first

13:35 slyphon: Licenser: what's the $ syntax?

13:36 oh, just clojurebot

13:36 Licenser: slyphon: that is sexpbot

13:36 clojurebot's sister

13:36 slyphon: :)

13:36 zakwilson: Why is there more than one eval-bot in the channel? (aside from the fact that sexpbot is a cool name)

13:37 Licenser: because sexy is just more sexy

13:37 also I think it collects logs for walton

13:38 wlangstroth: Licenser: does the current cheat sheet work as a printed copy? (I haven't tried)

13:42 slyphon: 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:43 slyphon: ah nice

13:43 wlangstroth: http://github.com/wlangstroth/clojurepedia

13:43 excuse the pretentious title

13:44 (it was the first thing that lept to mind)

13:44 slyphon: :)

13:49 anonymouse89: does anyone know of a gedit plugin for clojure?

13:50 wlangstroth: slyphon: FZ fan? (your avatar)

13:51 slyphon: wlangstroth: hah, indeed :)

13:51 wlangstroth: nice

13:52 mabes: wlangstroth: do you have any plans on making clojurepedia's notes available via the REPL?

13:54 wlangstroth: mabes: 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:54 probably best to finish it first

13:55 (or geez, start it)

13:58 mabes: wlangstroth: yeah, and I suppose walton already provides examples via the repl

14:04 Licenser: I have the likey coolest clojure function ever

14:04 there is also a walton webside

14:04 http://gist.github.com/389741

14:08 $(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:08 sexpbot: result: I love clojure, cookies and pizza.

14:08 slyphon: wow

14:09 wlangstroth: mabes: right - I'm picking out the simplest examples so I can remember the functions' uses

14:09 slyphon: now all we need is an international obfuscated clojure competition

14:09 Licenser: slyphon: that sn't so obfuscared

14:09 it is just a big let that holds a function and then the call of the function (<3 "clojure" "cookies" "pizza")

14:09 wlangstroth: Licenser: I'm pretty obfuscared of that code

14:10 Licenser: read the gits and it gets clear

14:10 sadly the bots only eat one line code

14:21 LauJensen: Evening gents

14:22 wlangstroth: LauJensen: is it a fine scandahoovian evening?

14:22 LauJensen: Yes sir - It most certainly is

14:22 wlangstroth: excellent

14:27 arohner: what's the difference between (var ~foo) and (resolve (quote ~foo)) in a macro?

14:28 aside from compile time name resolution?

14:35 wlangstroth: arohner: I thought resolve was for namespaces (?)

14:35 ,(doc resolve)

14:35 clojurebot: "([sym]); same as (ns-resolve *ns* symbol)"

14:35 arohner: wlangstroth: it resolves symbols in the current namespace

14:35 and in my macro, it appears to work sometimes and not others

14:36 I can't figure out why. It works 100% at the repl, and some of the time in running code

14:37 wlangstroth: hmm ... you've probably tried anything I could suggest (deps, classpath, etc.)

14:38 arohner: do you have the code up somewhere?

14:38 arohner: wlangstroth: it's too big to paste right now

14:39 wlangstroth: cool (this is me being on vacation)

14:41 ordnungswidrog: why I like cloure: http://www.alphaworks.ibm.com/tech/msdk/

14:41 sexpbot: "alphaWorks : Multicore Software Development Kit : Overview"

14:43 wlangstroth: yeah, yikes

14:43 slyphon: Concurrency: You're Doing It Wrong

14:46 cp2: lol wow

14:46 wlangstroth: slyphon: Concurrency, the "Brown Shoes Don't Make It" version.

14:46 slyphon: HAH!

14:46 :D

14:47 ordnungswidrog: lovery colourful pictures

14:47 s/lovery/lovely/

14:47 sexpbot: lovely colourful pictures

14:49 wlangstroth: ordnungswidrog: The "My Fair Lady" version is "loverly"

14:50 slyphon: or the Team America Kim Jong Il version

14:51 * ordnungswidrog is out of american culture...

14:53 * wlangstroth was a drummer in a former life, thus the musical references

14:53 ordnungswidrig: *facepalm*

14:54 * ordnungswidrig thinks adobe should have better named "flash" "crash". This would be more honest.

14:54 wlangstroth: was bedeutet "ordnungswidrig"?

14:55 kotarak: wlangstroth: 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:55 wlangstroth: ordnungswidrig: apparently, Jobs thinks so, too

14:56 slyphon: kotarak: in what language?

14:56 wlangstroth: German

14:56 slyphon: ah

14:56 * slyphon thought that sounded like an Icelandic volcano or something

14:57 wlangstroth: ah, like "ordinance"

14:57 ... thus "infraction" - got it.

14:59 Natural languages are much more difficult than computer languages

14:59 zakwilson: Google translates Google translates ordnungswidrigkeit as misdemeanor, but the useage doesn't line up with how misdemeanor is used in US law.

15:00 kotarak: "icelandic volcano" translates to "best friend". active volcano == no planes :)

15:00 ordnungswidrig: Perl 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:00 zakwilson: try dict.leo.org

15:00 wlangstroth: zakwilson: really? I thought a misdemeanor in the states was processed without jury ... no?

15:01 * zakwilson wants to smack dict.leo.org for using geolocation to set the default language.

15:01 zakwilson: wlangstroth: 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:01 wlangstroth: zakwilson: oh, quite right then.

15:02 zakwilson: Not 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:03 ordnungswidrig: An ordnungswidrigkeit is a small violation of rules which can only be lead to a fine (or a ban on driving)

15:03 arohner: wlangstroth: ok, my issue appears to have something to do with ns aliases

15:03 wlangstroth: so "ordinance infraction" is pretty close

15:03 zakwilson: In the US, we'd call that an infraction or a violation.

15:04 wlangstroth: arohner: that figures, since it was working fine in the repl

15:04 arohner: if I do (:require foo.bar :as bar), (resolve (quote bar/my-fn)) doesn't work, but (resolve (quote foo.bar/my-fn)) does

15:04 and (var bar/my-fn) does work

15:04 wlangstroth: browr?

15:06 alexyk: hey guys -- anyone played with Apache Avro?

15:06 Licenser: kotarak: I disagree, no planes == I am stuck away from home :(

15:07 kotarak: Licenser: at Frankfurt airport "no planes" means \o/. Sorry.

15:07 Licenser: kotarak: no it does not since it means I'll be stuck in Kuwait and trust me you doNt# want to be stuck here

15:07 wlangstroth: arohner: weird

15:09 alexyk: I'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:09 Something makes it really hard to rebuild

15:09 unless I find a working solution I go back to OCaml with Marshal

15:09 so it's up to the community now

15:09 :)

15:10 * wlangstroth is playing with arohner's namespace dilemma

15:10 Licenser: alexyk: for the k/v store databases write and read performance are often not the same

15:10 alexyk: Licenser: to put it mildly

15:10 anyone tried Tokyo Cabinet? I'll try anything

15:10 Licenser: did 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:11 alexyk: Licenser: what do you mean read w/o serializing? With eyes?

15:11 Licenser: alexyk: my way to go would be a) write the stuff to a file and have clojure read it again with (read-string)

15:11 alexyk: just do a query that counts everything or something

15:11 or wring just plain numbers as values instead of hashes

15:12 alexyk: Licenser: 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:12 Licenser: and what read algorithm are you using, aka how are you serializing? perhas you can use transittiens?

15:12 ah

15:12 well json is slow

15:12 alexyk: Licenser: Mongo uses JSON, BDB uses fast recursive write with bind APIs

15:12 I don't know how to make it rebuild the damn maps faster

15:12 here the dynamism hurts somehow

15:13 Licenser: hmm so you store the data structure with a single query or do you write it on your own?

15:13 alexyk: with BDB JE, I could unleash concurrency, and it's still 15-20 minutes read to 1 minute write. I use mongo/bdb idioms

15:14 what 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:14 ocamlgraph reads in a minute

15:14 and it's the same mix of nested maps and lists

15:15 ordnungswidrig: alexyk: how will 1.2 with serialization do?

15:15 Licenser: hmm okay

15:15 alexyk: ordnungswidrig: should it be better?

15:15 Licenser: native serialisation should be better then json stuff

15:15 keep in mind creating a json means making a huge string out of it

15:16 alexyk: how is 1.2 improved in terms of serialization?

15:16 Licenser: and reading it again will likely get you a 2 gb string in the reader or something :P

15:16 ordnungswidrig: xstream perhaps?

15:16 alexyk: clojure data structures will be serializable

15:17 alexyk: ordnungswidrig: mongo is json already... somehow I don't think jsons will be much faster

15:17 Licenser: if 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:17 alexyk: json = strings = slow

15:17 alexyk: so 1.2 trunk already has serialization?

15:18 * alexyk would like to see an example

15:18 Licenser: alexyk: 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:19 alexyk: Licenser: entire graph, I need for speed. I don't care for random access now, just a whole slurp -- but fast

15:19 chouser: alexyk: http://www.assembla.com/spaces/clojure/tickets/281

15:19 sexpbot: "#281 - Make more datastructures serializable (Fixed) | Clojure | Assembla"

15:19 Licenser: ah okay

15:19 wlangstroth: arohner: I can't reproduce it - what's the error?

15:20 arohner: wlangstroth: I just finished reproducing & pasting it

15:20 http://gist.github.com/389842

15:20 alexyk: chouser: wow, applied today! coincidence?

15:21 arohner: wlangstroth: the problem is, that resolve returns nil

15:23 chouser: alexyk: oh, sure enough. I didn't think it had been applied yet.

15:23 alexyk: chouser: let's say that my asking about it and your linking to it magically materialized it!

15:24 we have no proof otherwise that the flow of time was not altered at that very moment

15:24 and git repos magically rewtitten

15:24 wlangstroth: alexyk: are you one of the new writers for Doctor Who?

15:24 alexyk: wlangstroth: I don't even know what it is :)

15:25 but, it puts pressure now to switch to 1.2 and nag the dependencies' owners to upgrade theirs!

15:26 * alexyk lays in wait for the deps owners

15:28 alexyk: chouser: so, from that history, does it follow that it's already in the trunk?

15:28 chouser: if the flow of time can be altered, we have very little proof of anything at all

15:29 wlangstroth: chouser: is it 4:20 where you are already?

15:29 Licenser: alexyk: look at this: http://github.com/ninjudd/clojure-protobuf

15:29 chouser: well, halloway doesn't link from tickets back to commits, so it's a not as easy as a click to find out

15:29 and this is git, "trunk" isn't a word

15:31 alexyk: chouser: yeah, HEAD then. will have to grep the log then or something

15:31 Licenser: thx, very interetsing. I like "WAY faster"

15:32 Licenser: alexyk: never used it myself just read about it some time ago

15:32 chouser: alexyk: http://github.com/richhickey/clojure/commit/68a14c88d11555353bb471efd94ba7d40c2d5008

15:32 alexyk: Licenser: am definitely gonna try. Anything!

15:32 chouser: so it's in master.

15:32 Licenser: I think it gets fast by using a pure binary format

15:32 alexyk: please keep me up to date with the success since I'm curiouse about it :P

15:33 jfields: what's the idiomatic way to filter non-nil results? (map #(not (nil? %)) [1 nil 2]) seems entirely too verbose.

15:33 alexyk: chouser: 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:33 chouser: ,(remove nil? [1 nil 2])

15:33 clojurebot: (1 2)

15:33 alexyk: jfields: (remove nil? blahs)

15:34 chouser: jfields: see also the new 'keep' if your seq is actually a call to map

15:34 jfields: chouser, alexyk: thanks.

15:34 arohner: anyone else have ideas on this? http://gist.github.com/389842

15:34 I'm stuck

15:35 chouser: alexyk: I don't actually know anything. I assume the whole tree of clojure structures just gets serialized.

15:35 alexyk: chouser: you mean when we write it to a stream?

15:35 * alexyk tries to tab-complete stuTAB in vain

15:36 chouser: alexyk: http://java.sun.com/developer/technicalArticles/Programming/serialization/

15:36 sexpbot: "Discover the secrets of the Java Serialization API"

15:36 chouser: perhaps?

15:36 jweiss: i'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:36 java.lang.NullPointerException\n\tat clojure.contrib.json.read$read_json

15:36 __3796.invoke(read.clj:151)\n\tat clojure.contrib.json.read$read_json__3796.invo

15:36 ke(read.clj:149)\n\tat com.ashafa.clutch.view_server$run__347$fn__349$fn__351.in

15:36 voke(view_server.clj:116)

15:36 where is read.clj?

15:37 there's only a json.clj that i can find in contrib

15:38 ohh

15:38 alexyk: chouser: looking at Java APIs is depressing!

15:38 jweiss: switching tags to 1.1.0 in github :)

15:38 chouser: ,(.writeObject (java.io.ObjectOutputStream. System/out) {1 2 3 4})

15:38 clojurebot: nil

15:38 chouser: something like that I think

15:39 wlangstroth: alexyk: thus clojure

15:39 alexyk: chouser: 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:39 chouser: alexyk: 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:39 alexyk: somewhere in *out* clojurebot is staring at a bunch of bytes

15:40 in disbelief

15:40 I don't yet have any deftypes, but will try

15:43 aha, this barfs for old clojures:

15:43 ,(.writeObject (java.io.ObjectOutputStream. System/out) {1 {2 [1 2] 3 [3 4]} 2 {1 [2 3] 4 [5 6]}})

15:43 clojurebot: java.io.NotSerializableException: clojure.lang.PersistentVector$Node

16:04 alexyk: Licenser: 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:05 Licenser: :D

16:06 alexyk: arohner: who is winston?

16:06 stuartsierra: did you play with Apache Avro?

16:08 stuartsierra: alexyk: no

16:09 alexyk: stuartsierra: google mentioned you next to hadoop, clojure, and apache avro somehow

16:09 stuartsierra: no idea why

16:09 alexyk: probably text summarization

16:09 cemerick: alexyk, chouser: defrecords as well as all standard data structures are now serializable

16:09 arohner: alexyk: the codename for my project

16:09 it's a machine learning decision engine. It's named after winston wolf from pulp fiction

16:09 alexyk: because he "solves problems"

16:10 MrEvil: is there an equivlent to map for maps? update a map applying some function over the values keeping the keys the same?

16:10 alexyk: ~ google "clojure avro"

16:10 clojurebot: google "clojure avro"

16:10 clojurebot: First, out of results is:

16:11 arohner: wlangstroth: I figured it out. The value of *ns* was changing

16:11 alexyk: ~ google clojure avro

16:11 clojurebot: First, out of 313 results is:

16:11 Hw09 Hadoop + Clojure

16:11 cemerick: MrEvil: see clojure.contrib.generic.functor/fmap

16:11 arohner: wlangstroth: at compile time in the repl, *ns* was the namespace I was in

16:11 clojurebot: http://www.slideshare.net/cloudera/hw09-hadoop-clojure

16:11 chouser: MrEvil: there are a few options. one is (zipmap (keys m) (map f (vals m)))

16:11 alexyk: stuartsierra: that first link has your name in the summary

16:11 arohner: wlangstroth: when compiling a file and then running it, *ns* was clojure.core

16:11 wlangstroth: arohner: OH - that makes sense, then.

16:11 stuartsierra: alexyk: That's a presentation I gave on using Hadoop with Clojure, but I do not recall mentioning Avro

16:11 MrEvil: thanks!

16:11 arohner: so replacing it with (ns-resolve current-ns sym) works

16:12 alexyk: stuartsierra: probably google knows that avro is a hadoop part

16:12 wlangstroth: right

16:12 alexyk: arohner: after winston churchill?

16:12 technomancy: alexyk: ISTR some lazy map implementation in contrib

16:12 wlangstroth: alexyk: winston wolf

16:13 "That's about 30 minutes away. I'll be there in 10"

16:13 alexyk: ~ google winston wolf

16:13 clojurebot: First, out of 218000 results is:

16:13 YouTube - Winston Wolf - I Solve Problems

16:13 http://www.youtube.com/watch?v=ANPsHKpti48

16:14 ordnungswidrig: wolf, the cleanr

16:14 alexyk: churchill'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:16 arohner: alexyk: what is that from?

16:16 alexyk: arohner: history :)

16:16 arohner: alexyk: sigh. the article :-)

16:17 alexyk: arohner: I read about it in a book on Churchill

16:18 his 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:19 iirc, of course

16:19 so, a suitable name for a clojure project as well :)

16:19 arohner: nice. I might use that

16:19 MrEvil: oh 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:23 carkh: MrEvil: look at clojure.contrib.pprint

16:25 cemerick: MrEvil: or pr/prn, depending on what you want to do.

16:38 alexyk: hmm, can you encode vectors and maps in protobufs?

16:44 chouser: protobufs can have repeated fields for vector-like things

16:44 a protobuf message is a sort of map

16:45 the 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:45 static

16:46 alexyk: right

16:46 arohner: ,(partition 3 [1 2 3 4 5 6 7])

16:46 clojurebot: ((1 2 3) (4 5 6))

16:46 arohner: ,(partition 10 [1 2 3 4 5 6 7])

16:46 clojurebot: ()

16:46 alexyk: when faced with various ORMs for Scala, I have a sudden reluctance to go there

16:47 like a kid being pulled from the street

16:47 chouser: arohner: partition-all

16:47 rsh: when can a future not be killed with future-cancel?

16:47 ,(doc future-cancel)

16:47 clojurebot: "([f]); Cancels the future, if possible."

16:47 chouser: rsh: busy calculation loops, for example.

16:47 arohner: chouser: thanks

16:48 I misread the doc for partition, returning a partition with less than n elements is only if you supply a pad

16:48 rsh: will it eventually get killed or will the call just be ignored?

16:49 chouser: oh, I forgot pad was still in there. :-/

16:49 rsh: if the thread comes to a cancellable point, I believe it will then be cancelled.

16:49 rsh: so, some kind of IO, attempting to take a lock, etc.

17:12 cemerick: ooh, I didn't know about future-cancel

17:30 slyphon: technomancy: hey, with slime.core/break do i have to be running 1.2 to get the locals?

17:30 it didn't seem to work as advertized

17:31 chouser: hm, it could be using &env in which case it would need 1.2

17:31 slyphon: shit

17:31 when is 1.2 tentatively scheduled for?

17:31 * slyphon is wondering if he should just switch

17:32 ordnungswidrig: slyphon: use clojure.contrib.trace instead of interactive debugging *g*

17:32 chouser: use a java debugger that can step, instead of debug-repl which can't

17:32 slyphon: chouser: can you recommend one?

17:33 i'm using slime for all my dev :/

17:33 dakrone: slyphon: http://groups.google.com/group/clojure/msg/21f9dbb6c6ee5196

17:33 slyphon: woah, sweet

17:34 * slyphon wonders if his code will work w/ 1.2

17:35 technomancy: slyphon: yes, 1.2 is required for swank.break locals

17:35 slyphon: ah

17:35 ok

17:35 anyone have a java debugger they use w/ clojure and would recommend?

17:36 chouser: slyphon: jswat has worked

17:36 slyphon: ok, i'll have a look

17:36 thanks :)

18:40 alexyk: I'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:45 maxhodak: it looks like congomongo is leaking memory in a huge way to me

18:45 has anyone seen this before?

18:45 like, every fetch opens a new fd and leaves it open... indefinitely

18:45 until i eventually hit the ulimit and it crashed the jvm

18:46 crashes

18:46 alexyk: maxhodak: perhaps

18:46 hmm

18:46 I don't do that many fetches and throw 32 GB at it, but it annoyingly creeps up in it

18:47 maxhodak: i do one fetch to retrieve ~8k documents

18:47 and then 8k fetches to retrieve more data on each of those

18:47 actually

18:47 thats a retarded way to do it

18:47 obviously

18:47 alexyk: maxhodak: sounds like it :)

18:47 maxhodak: but regardless, congomongo shouldn't die

18:48 it basically opens one fd for the 8k record fetch

18:48 and then on more for each 1 record fetch

18:48 until it hits 1024 open files and dies

18:48 even though each 1 record fetch should be isolated in terms of scope

18:48 like, it should completely close out the previous one each time

18:48 alexyk: I wonder what happens when the fetch is exhausted -- I'd guess it must close the fd

18:49 wait until somTAB completes to somnium and asks him :)

18:49 so, what does leiningen expects in test/ ?

18:50 maxhodak: wait until somTAB completes to somnium?

18:50 alexyk: maxhodak: i.e. until somnium shows up here :)

18:51 my new way to check if someone's here is to tab-complete them in my IRC client

18:51 maxhodak: oh haha got it

18:52 thanks

18:52 alexyk: np

18:54 maxhodak: is there a way to force gc in clojure?

18:59 alexyk: am 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:00 zakwilson__: maxhodak: almost. From what I understand, you can't exactly force it, but you can strongly suggest it with (System/gc)

19:09 defn: maxhodak: 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:23 eslick: maxhodak: I think we're seeing similar things

19:24 We have a similar usage pattern and will be hitting scale in our data analysis in a few days using congomongo

19:24 I'd be interested in what you find.

19:25 maxhodak: heh, hi ian

19:25 eslick: Hey max!

19:25 small world?

19:26 maxhodak: yeah...

19:26 eslick: Started switching compass' internal analytical tools to clojure last week

19:26 Are you using incanter by any chance?

19:26 maxhodak: clojure is amazing. and mongo is an incredible database.

19:26 eslick: I'm feeling similarly rosy about the coupling

19:26 maxhodak: no; incanter has a reasonably bad reputation at this point

19:26 eslick: How so?

19:27 maxhodak: it's designed to really be an R-like environment

19:27 not so much as online inferencing code

19:27 eslick: Ah, I've started to use it for interactive data mining to explore dataset while developing production algs

19:28 maxhodak: and does some really horribly inefficient things (i.e., try filling in a matrix from seqs using the naive incanter methods)

19:28 eslick: Our product stuff is likely to be in custom clojure or pre-existing Java tools

19:28 maxhodak: yeah

19:29 my big thing right now is im looking for a good interface to libsvm (or another svm lib)

19:29 you'd think there'd be a lot, but there isn't

19:29 eslick: In all honesty, I just like the pretty pictures Incanter produces without having to talk to JFreeChart

19:29 I'll keep an eye out

19:29 maxhodak: thanks

19:29 yeah, they are pretty good

19:30 i use incanter's pca which seems to be pretty good

19:30 eslick: Gotta run now. Let me know what happens with congomongo; I'll let you know what we find as we play later this week

19:30 maxhodak: ok, later

19:30 alexyk: where does ns 'clojure.test come from, for lein test?

19:31 tomoj: you need to require or use it yourself

19:31 e.g. in the test file, add (:use clojure.test) to the ns

19:31 technomancy: alexyk: that error makes me think perhaps you're using an old lein-swank version?

19:31 the ant exception

19:32 alexyk: technomancy: I fixed that, that was googled in the group and was an older gitted lein

19:32 technomancy: oh, cool

19:33 alexyk: now I get a mild, project-related: namespace 'clojure.test' not found after loading '/clojure/test'

19:33 I've got a project with ant

19:33 it has a file test.clj which says (use 'clojure.test)

19:33 apparently that's not found

19:33 tomoj: old clojure?

19:34 alexyk: clojure is respectable 1.1.0

19:35 where should it come from?

19:35 clojure.jar?

19:35 clojurebot: clojure is a very attractive hammer with a nice heft to it

19:36 alexyk: clojurebot: aren't you a chatterbox!

19:36 clojurebot: It's greek to me.

19:39 alexyk: technomancy: 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:40 livingston: I 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:40 technomancy: alexyk: you could try doing "lein new dummy" to output a dummy project and base your structure on that

19:41 tomoj: lein test shouldn't care, should it?

19:41 since it will just run all discovered tests

19:41 alexyk: technomancy: src/{main,test}/language is kind of standard maven structure, lein used to eat it well

19:42 I mean it finds test.clj there

19:47 technomancy: sorry, 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:50 defn: is 1.2 imminent?

20:23 oooo, clojure-refactoring is awesome

20:26 livingston: there's no way to (gensym) into a specific ns is there?

20:29 scottj: livingston: does it work to put the ns including / as the prefix-string?

20:30 livingston: how about that

20:30 scottj: thanks

20:31 I 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:39 lotia: greetings all. anyone have a link or any other resources on setting up clojure with slime when installing clojure from the git repo?

20:45 livingston: * 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:47 dnolen: lotia: You could do that. But have you considered using lein? clojure is continuously built not and lein will grab it for you.

20:47 livingston: why not exclude reify?

20:47 livingston: this is an api i need to expose to the world, that wouldn't be a great idea

20:48 it's not a huge deal

20:48 dnolen: lotia: I meant "continuously built *now*"

20:48 MrEvil: is 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:48 lotia: dnolen: thanks

20:48 that made it clearer

20:49 dnolen: is keeping current a simple matter or anyother lein command

20:50 dnolen: lotia: if your project dependency includes org.clojure/clojure "1.2.0-master-SNAPSHOT", lein deps will always try to get the latest.

20:52 livingston: the 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:56 chouser: I think there is some intention for simple urls to be valid symbols

20:56 so slashes in namespaces is likely to continue to work

20:57 cemerick: it's odd though, right?

20:57 livingston: chouser: that would be really nice

20:57 cemerick: ,(name (symbol "http://oracle.com/foo"))

20:57 clojurebot: "foo"

20:57 chouser: right, not terribly common

20:58 cemerick: no, I meant the impl -- it doesn't lend itself to representing URLs very nicely *shrug*

20:58 livingston: since then RDF URI's will break down in common sense ways into ns and local-name

20:58 cemerick: ,(name (symbol "http://oracle.com/foo/bar/baz.html"))

20:58 clojurebot: "baz.html"

20:58 livingston: cemerick: no it's great

20:59 cemerick: livingston: shouldn't foo/bar/baz.html be the "local name" there?

20:59 livingston: the 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:59 cemerick: sure

21:00 livingston: cemerick: in RDF not really, although there's no set in stone thing, but commonly it's just the bit at the end

21:00 cemerick: I just didn't think URLs were any kind of consideration there

21:00 Oh, you can control it, of course

21:00 ,(symbol "oracle.com" "/foo/bar/baz.html")

21:00 clojurebot: oracle.com//foo/bar/baz.html

21:00 livingston: right, exactly

21:01 lotia: dnolen: i've been a bit lost attempting to get the emacs side of things going.

21:02 dnolen: lotia: I suppose you prefer that route over NetBeans or Eclipse? Otherwise the fastest way to get with Emacs going is ELPA + lein

21:02 lotia: i'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:03 chouser: well, not really.

21:03 livingston: is there a limit on ns or symbol name length either practical or enforced?

21:03 chouser: ,(read-string (pr-str (symbol "oracle.com" "/foo/bar/baz.html")))

21:03 clojurebot: oracle.com//foo/bar/baz.html

21:03 chouser: ,(namespace (read-string (pr-str (symbol "oracle.com" "/foo/bar/baz.html"))))

21:03 clojurebot: "oracle.com//foo/bar"

21:04 technomancy: lotia: 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:04 livingston: chouser: 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:05 lotia: technomancy: 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:06 livingston: in 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"

21:06 technomancy: lotia: my fork is the canonical one; the readme there should get you going

21:06 lotia: i want to use my own install of clojure over the one that clojure mode installs

21:06 technomancy: lotia: why's that?

21:07 livingston: so 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:07 lotia: technomancy: 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:08 technomancy: lotia: 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:09 lotia: technomancy: thanks

21:11 chouser: livingston: 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:13 livingston: I will be reading them, but hopefully they will all have shorthand then or the object part will be at the end.. ugh hrm,...

21:13 defn: ,(-> [] (fn (+ 1 2)) (Thread.) (.start))

21:13 clojurebot: nil

21:14 livingston: the idea is it'll be easy to drop into rdf world from clojure with something like `(ex/foo rdf:type ex/bar) etc.

21:15 RDF triples are really just lists of symbols

21:16 I 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:17 if 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:41 lotia: technomancy: is there a way to point swank-clojure to the latest versions of clojure and clojure-contrib (even if unstable)

21:42 _ato: lotia: put them in ~/.swank-clojure (and move the originals out of there)

21:42 you 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:43 lotia: _ato: thanks

22:27 Blackfoot: anyone else having issues connection to clojars with mvn/lein?

22:59 defn: Blackfoot: someone mentioned something maybe 12 hours ago or so about the clojure build site being down

22:59 Blackfoot: but i havent had any issues today

23:00 technomancy: 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:02 Blackfoot: yes,that's what i see

23:29 technomancy: defn: there's a bug in maven that causes it to spin up threads preventing it from exiting cleanly

23:29 defn: you can just control-c it

23:35 replaca: technomancy: I'm thinking more about this autodoc/lein thing and it feels a little doomed

23:36 technomancy: first it depends on both contrib and enlive and I have to pick versions for those

23:36 technomancy: and those will depend on a specific clojure version underneath

23:37 technomancy: replaca: in that case my fallback suggestion would be to match autodoc versions with lein versions

23:38 since lein versions (so far) match clojure versions

23:38 replaca: technomancy: second: I'm trying to have a single jar that can be both the plugin & executable depending on args

23:38 alexyk: how do I specify java.library.path in project.clj?

23:39 replaca: technomancy: OK. I'll need to check to see if Christophe is ready to go to 1.2

23:39 alexyk: yeah, lein just hanging there is annoying

23:39 technomancy: replaca: with pprint in clojure you should be able to reduce your contrib usage though

23:39 alexyk: yeah, we may have to roll back to a maven version from before that bug was introduced

23:40 * alexyk seems like you can walk back to #clojure anytime and find lein talk! :)

23:40 replaca: technomancy: yeah, but I use other stuff as well so...

23:40 alexyk: technomancy: so how about java.library.path? that ant takes with -D...

23:41 technomancy: alexyk: I think :native-path in project.clj does it

23:41 I haven't used that myself

23:41 alexyk: ah!

23:41 technomancy: replaca: well the first step is admitting you have a problem

23:42 replaca: technomancy: hmm, I think we're taking a step backward when we think library usage is a problem

23:42 alexyk: technomancy: does it take a string? :-separated?

23:43 technomancy: alexyk: not sure; try it and see what works

23:43 replaca: libraries that are clojure-version-agnostic are never a problem

23:43 replaca: 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:44 replaca: the real problem is that contrib is monolithic

23:44 replaca: technomancy: yeah, and the others should be fine too actually, cause pprint is staying in contrib for a bit as is duck-streams

23:45 technomancy: right, for backwards-compatibility

23:45 I guess the real killer is seq-utils, since it defs stuff that is now in clojure.core

23:45 replaca: technomancy: but why is that really a problem? The problem is that that pom also has a clojure dependency

23:46 technomancy: 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:47 technomancy: there's always version ranges

23:47 but your deps have to specify ranges as well

23:48 replaca: so that's part of the maven deal?

23:48 I haven't studied it as much as I should

23:48 technomancy: yeah, my fault for not documenting it

23:49 actually I didn't even know it worked until someone else who knew maven better than I did tried it

23:50 I need someone who speaks Japanese to help me keep up with the tweets about Leiningen

23:50 slyphon: is there a "standard" or recommended way to have periodic tasks run in a background thread?

23:50 kind of like "cron" only, well, in-vm

23:50 replaca: well maybe 3 versions of autodoc then: standalone, lein 1.1 plugin, lein 1.2 plugin

23:50 or I could just suck in all the contrib stuff I wanted (and enlive too for that matter)

23:50 but that also seems like the way backwards

23:51 technomancy: yeah, I'm hesitant to suggest that

23:51 if you can talk cgrand into using version ranges for enlive's deps that might help

23:52 replaca: next time I am in SF I am going to steal your laptop and surreptitiously add whitespace-mode as a clojure hook

23:52 wait, you work for a security/surveillance company, don't you... that might not be a good idea.

23:52 replaca: technomancy: am i putting in tabs?

23:52 technomancy: oh heavens no, just trailing spaces and long lines

23:53 =)

23:53 replaca: ahh

23:53 what does whitespace mode do

23:53 ?

23:54 slyphon: replaca: makes it harder to do that

23:54 technomancy: replaca: http://p.hagelb.org/whitespace-mode.png

23:54 slyphon: ooh

23:54 technomancy: it makes you cringe when you see long lines and trailing whitespace =)

23:54 * slyphon had something like that for vim

23:55 slyphon: it's useful

23:55 replaca: i could add that

23:55 slyphon: having trailing whitespace makes diffing harder

23:55 replaca: yeah, I know

23:55 I don't *mean* to do it :-)

23:55 slyphon: woah

23:55 technomancy: is that a screenshot of your sys?

23:56 technomancy: slyphon: ja

23:56 * slyphon thinks that left-hand panel is pretty badass

23:56 replaca: yeah, all places where I split lines

23:57 is whitespace mode built in or on elpa?

23:57 technomancy: slyphon: it's these ridiculous widescreen aspect ratios... vertical space is far too valuable to waste on something like a panel

23:57 replaca: it's in emacs 23+

23:57 replaca: http://p.hagelb.org/whitespace-mode-activate.html

23:57 sexpbot: "*temp*"

23:57 slyphon: technomancy: yeah, totally

23:57 hah

23:57 the gradient in mine is making it kind aridiculous

23:57 replaca: cool - I'm still a little downrev, but I'm about to upgrade to the new ubuntu

23:58 and pull emacs with it

23:58 technomancy: if you build from source you can get the experimental branch with threading support

23:58 fun stuff =)

23:58 replaca: I'm trying not to be experimental with emacs :-)

23:59 too many experiments going on in my life already

23:59 ok, I'm on baby duty. bbl

23:59 technomancy: later

Logging service provided by n01se.net