#clojure log - Apr 05 2010

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

0:00 Licenser: heh

0:00 _ato: so the first problem is how to figure out what the latest version is

0:01 Licenser: _ato: yes I can imagine that

0:01 _ato: Given the current Maven API probably actually the easiest way of doing that is to ask maven to download it (with a ranged version) and then see which version it downloaded. :-P

0:01 albino: haha, I thought mvn2 was a rewrite for the same reasons of mvn1

0:02 _ato: it's actually available here: http://clojars.org/repo/compojure/compojure/maven-metadata.xmlded. :-P [14:01]

0:02 <albino> haha, I thought mvn2 was a rewrite for the same reasons of mvn1

0:02 ERC> it's actually available here:

0:02 oops

0:02 Licenser: oi?

0:03 _ato: http://clojars.org/repo/compojure/compojure/maven-metadata.xml

0:03 technomancy: Licenser: so just because a feature is absent from leiningen doesn't mean I don't think it's good, just that I don't think it's something I would use right away. =)

0:03 Licenser: technomancy: hmm you wouldn't?

0:04 actually which feature do you mean?

0:05 technomancy: I was thinking of rubygems-style "lein install $FOO"

0:06 I wouldn't use it because I don't use any Clojure CLI tools

0:06 and there just aren't that many because currently Clojure CLI integration is crap

0:06 but if leiningen can write out shell wrappers then maybe people will create more of them

0:06 Licenser: *nods it is'

0:06 ah I see what you mean

0:12 hmm hmm

0:15 _ato: you have set up clojars?

0:19 albino: someone should beat the maven developers to an implementation of maven3 with clojure

0:19 drop it on their front door step

0:20 _ato: Licenser: yeah clojars is my neglected baby ;-)

0:20 Licenser: albino: I don't think it is hard to find people wiling to beat the maven developpers for any reason :P

0:21 _ato: then perhaps you can tell me, is there a way to fetch a list of files?

0:21 chouser: Licenser: http://clojars.org/repo/

0:22 Licenser: chouser: I found that :) I just hoped there is some kind (and I am ashamed to say that) xml file that lists the actual jars

0:23 _ato: Licenser: heh, well there's: rsync --list-only -a clojars.org::clojars

0:23 that's probably not what you had in mind though

0:23 Licenser: _alex: heh no not exactly

0:24 _ato: what are you looking to use it for? for searching?

0:24 Licenser: _ato: I hoped for something that allows - exactly

0:24 AntonyBlakey: alibino: I've just published a version of polyglot maven (which uses maven3) with a clojure front-end. There's no need to redo the backend

0:24 Licenser: and yes I know there is a web interface but it should be maven generic

0:25 AntonyBlakey: i think I read your mail in the mailing list?

0:25 _ato: ah, yeah there's no general way to list a maven repo as far as I know

0:25 brian__: noob question: (def f 1) , (def f (inc f)) , (prn f) , 2 f looks rather mutable to me, what am i missing?

0:25 _ato: it's unfortunate

0:25 AntonyBlakey: licenser: probably

0:25 Licenser: AntonyBlakey: ah

0:26 sorry to say it :P it scared me ^^

0:26 AntonyBlakey: mvn -f project.clj

0:26 that's it

0:27 if you want to use more of maven (plugins etc) then it's hardly more effort

0:27 Licenser: I don't look for running something with maven but for a way to easiely find the right jar and install it

0:27 sadly I don't know maven :(

0:28 somnium: brian__: vars are mutable so that you can redefine things (functions) dynamically, but using def to do imperative things is generally considered a sin against god and country

0:28 AntonyBlakey: I believe one of the IDEs has a 'find me this jar' or even 'find me this class' which will search maven repositories

0:29 _ato: Eclipse appears to do it, I'm sure where its getting the list from though, it might be something the m2eclipse people are mainintaining

0:29 brian__: ok, but what happened to f? it doesnt seem to have everlasting life, and im having existensial doubbts

0:29 Crowb4r: _ato: netbeans does it as well.

0:29 _ato: aah

0:29 apparently Nexus has some API for it

0:30 Licenser: _ato hmm but if it is not general to maven it does not really help I think

0:30 _ato: http://repository.sonatype.org/

0:30 Licenser: I mean if it only works on 'some' repos it isn't too helpfull

0:31 _ato: I guess it hits that

0:31 Crowb4r: _ato: you wrote clojars?

0:31 _ato: Crowb4r: yes

0:32 Crowb4r: geesh, I feel like the lazy one around here.

0:32 Licenser: heh

0:33 Crowb4r: everyone active in here seems to have wrote something I use in clojure quite regularly. :p

0:33 Licenser: hmm question would be, I am sure we could make a clojars specific implemation that would work great but is that what we want?

0:34 _ato: well clojars + maven central would cover a good chunk of use-cases. If you're using another repository you'd have to add it to your config anyway

0:34 Licenser: hmm but general would be nicer :P

0:35 _ato: hmm, looks like you can just download their indexer and run it

0:35 I might give it a try

0:35 Crowb4r: Licenser: Well, clojars is kind of the unofficial repo for clojrue packages. I think that it would be up to )ato is that was the defacto repo for deps.

0:36 _ato

0:36 unless he is not paying for bandwidth. :p

0:37 Licenser: :P well a central repo for clojure libs would be great

0:39 _ato: bandwidth is currently not at all a problem and I don't expect it will be unless the Clojure community suddenly grew several orders of magnitude

0:39 and if it does grow that large then I'm sure there'd be plenty of companies willing to host it, so no big deal

0:40 http://www.sonatype.com/people/2009/06/nexus-indexer-api-part-1/

0:40 herm1t: Is there an or-like form that treats empty strings as nil? (or "" "test") -> "test"

0:40 Crowb4r: Does clojure have really any companies backing it?

0:40 hiredman: there is a method on String

0:41 ,(->> String .getMethods (map #(.getName %)))

0:41 clojurebot: ("hashCode" "compareTo" "compareTo" "indexOf" "indexOf" "indexOf" "indexOf" "equals" "toString" "length" "isEmpty" "charAt" "codePointAt" "codePointBefore" "codePointCount" "offsetByCodePoints" "getChars" "getBytes" "getBytes" "getBytes" "getBytes" "contentEquals" "contentEquals" "equalsIgnoreCase" "compareToIgnoreCase" "regionMatches" "regionMatches" "startsWith" "startsWith" "endsWith" "lastIndexOf" "lastIndexOf" "lastIn

0:41 Licenser: hmm hmm

0:41 Crowb4r: hermit isempty?

0:42 hiredman: ,(->> String .getMethods (map #(.getName %)) (filter #(.contains "mpty")))

0:42 clojurebot: java.lang.IllegalArgumentException: Wrong number of args passed to: sandbox$eval--7763$fn

0:42 hiredman: ,(->> String .getMethods (map #(.getName %)) (filter #(.contains % "mpty")))

0:42 clojurebot: ("isEmpty")

0:42 Licenser: (empty? "")

0:42 ,(empty? "")

0:42 clojurebot: true

0:43 hiredman: ,(seq "")

0:43 clojurebot: nil

0:43 Crowb4r: ,(empty

0:43 clojurebot: EOF while reading

0:43 _ato: ,(first (remove empty? ["" nil "" "test"]))

0:43 clojurebot: "test"

0:43 Crowb4r: oppd

0:43 opps

0:44 ,(empty? " ")

0:44 clojurebot: false

0:44 herm1t: I want to use it with or, though. I have a hash that has a key and if the value is empty I want to supply a different value. Otherwise I have to pull the value out of the map twice: once to test and once to use.

0:44 Licenser: so generally the only universal way would be walking the entire repo and parsing http as I see it?

0:47 Crowb4r: So, how many people here use clojure professionally?

0:48 _ato: ah ha... http://repo1.maven.org/maven2/.index/nexus-maven-repository-index.gz

0:52 Licenser: hmm I have the feeling their index is huge

0:52 _ato: 40 MB

0:54 Licenser: yea but that isn't a thing you can fetch often :P

0:54 ah it indexes all classes

0:55 _ato: it seems to be what m2eclipse uses

0:57 Licenser: but seriousely every time someone querries for a jar

0:57 _ato: nono, it caches it

0:57 downloads it once

0:58 I might replace clojars' dodgie search with this actually if it works well

0:58 wish I'd looked into it earlier

0:58 Licenser: but it is outdated once something new is pushed isn't it?

0:59 _ato: yeah, presumably it updates every now and then

1:00 might be better to use a web service for that reason

1:00 Licenser: *nods* well being able to search clojure libraries would be a huge improvement I think

1:01 technomancy: Licenser: speaking of search, you know about jarvana.com?

1:02 Licenser: technomancy: nope

1:02 technomancy: it's just for maven central

1:02 but it's pretty handy

1:02 Licenser: that is kind of nice

1:03 _ato: hmm nexus-maven-repository-index.gz for clojars is around 200 Kb.

1:04 Licenser: taht isn't that bad

1:04 bmason: jarvana looks nice, just wish it supported more repos

1:28 TakeV: So, Java arrays are faster than the default Clojure datastructures?

1:28 data structures*

1:29 underdev: TakeV: I've heard Rich Hickey say that it depends... but generally, probably yes

1:29 depends on the usecase

1:30 TakeV: Is there a reason why?

1:30 Unless you are using refs and you need the mutability, I guess...

1:31 underdev: i believe he said the reads were as good or better, the writes could be 4x slower

1:34 TakeV: Ah, that makes a lot of sense.

1:37 hiredman: java arrays are as close to directly manipulating memory as you get on the jvm, of course they are faster

1:42 TakeV: Hmm, so any game development should probably use the Java arrays.

1:55 underdev: so, a day in maven hell has really helped me understand and appreciate lein

1:55 project.clj isn't a configuration file, it's a file containing a defproject macro, rt?

1:56 the structure created by "lein new foo" is a maven convension

1:58 also helped me make sense of swank-clojure, and how it works, and why its so damn handy\

1:59 very cool ecosystem you got there, technomancy

2:07 doseq: technomancy made leiningan?

2:08 Thanks! Although I wish it put things in a visible folder instead of some hidden .m2 thing.

2:09 TakeV: Is there a guide for using leiningan? Just put it in bin and do "lein compile"?

2:09 doseq: As a Mac user I feel so dirty when programs use the unix standard file system.

2:09 underdev: i think its jochu who made swank-clojure and technomancy who made lein

2:10 i don't know, i'm just seeing his name all over both

2:10 robink: underdev: Correct

2:11 Although technomancy may now commit more to swank-clojure than jochu.

2:13 underdev: TakeV, lein i think suffers from a lack of docu.

2:13 i have a really good link though

2:13 Crowb4r: UFS!! AHHHHH

2:15 underdev: http://zef.me/2470/building-clojure-projects-with-leiningen

2:15 _ato: http://github.com/technomancy/leiningen/blob/master/INTRO.md

2:16 there's also Sean's screencast: http://vimeo.com/8934942

2:16 underdev: jimminy crickets, where have you been all my life?!?!

2:17 TakeV: Thanks.

2:17 _ato: and the readme contains a reference of the various commands and config options: http://github.com/technomancy/leiningen/blob/master/README.md

2:19 underdev: you know what's great about me? my crappy attempts at helping seem to elicit worthwile help from others, if only out of frustration.

2:21 i try, but you can't fix stupid

2:24 TakeV: You need emacs to use Lein? :\

2:24 _ato: TakeV: no

2:24 TakeV: Huh.

2:25 _ato: there's a lein plugin, lein swank for use with emacs, but you can use whatever editor you want

2:25 lein just has a command-line interface

2:26 underdev: no, but the swank-clojurey goodness plays well with lein

2:26 TakeV: Ah, alright.

2:26 underdev: and slime is amazing with swank-clojure

2:27 TakeV: Yeah, though I couldn't ever get slime and swank-clojure to work.

2:27 underdev: oic

2:27 TakeV: I'm that guy who can't get anything to work. :P

2:28 underdev: i'm that ram that thinks he can butt a whole in a dam

2:29 it took me a loooong time to figure out the emacs stuff

2:29 but soooo worth the effort

2:29 tomoj: for a normal clojure-only setup, it's supposed to be really easy now

2:29 no need to even edit .emacs

2:29 TakeV: You'd think. >_>

2:30 tomoj: TakeV: are you using something that resembles linux?

2:30 doseq: I know this is dickish but I will *never* use Emacs. I refuse, in the name of progress.

2:30 tomoj: just curious

2:30 TakeV: tomoj: Ubuntu.

2:30 tomoj: strange

2:31 should work flawlessly

2:31 underdev: 10 years of vim, i saw Lau's screencasts, and realized IM DOING IT WRONG

2:31 TakeV: Keeps saying that it can't find swank.

2:31 _ato: TakeV: do you have a file or directory ~/.clojure ?

2:31 tomoj: underdev: does lau do paredit wizardry in the screencasts, or what?

2:32 underdev: TakeV, yeah i'm on ubuntu. If care to, you might want to start by looking at the Emacs Starter Kit

2:32 it comes with elpa, and if you use the stuff in elpa together, it's pretty seemless

2:32 TakeV: _ato: Ah, no, I don't. I have clojure in ~/lib/clojure/clojure.

2:32 tomoj: you shouldn't have to put clojure anywhere

2:33 _ato: ok that's good

2:33 underdev: a few things... "i vill make a keyboard macro, and..."

2:33 _ato: last time I checked if you have something at ~/.clojure swank-clojure gets confused (for historical reasons it checks that)

2:33 somnium: vim doesnt have keyboard macros?

2:33 TakeV: Er, wait, I seem to have it...

2:34 underdev: vi is the one true editor. long live emacs.

2:35 TakeV: I like gedit. >_>

2:35 Actually, I kind of like that Eclipse plugin.

2:35 underdev: tomoj: but the paredit stuff is so great it makes me cry...

2:36 tomoj: :)

2:36 underdev: anyway, good night guys.

3:17 LauJensen: Morning crew

3:40 doseq: Hi Lau :)

3:41 Thanks for the blog links, I really enjoyed reading them.

3:44 LauJensen: Great I'm glad to hear it :)

3:48 hamza: is it possible to remove a jar from clojars?

3:58 _ato: hamza: I can remove one manually if necessary (mistake or legal problems), although in general I prefer to keep older jars around as people may be using them

3:59 LauJensen: _ato: In that case you have a broken ClojureQL fork on there

3:59 Which is also the only one which came up when I searched for ClojureQL, where clojars.org/clojureql (ours) might have been more appropriately

3:59 I also sent you a mail regarding this, but it bounced back after 8 days or so

4:00 _ato: http://clojars.org/search?q=clojureql it appears now, I put in a temporary hack for them problem where jars with no description don't show up in the search results

4:01 org.clojars.snuxoll is the broken one?

4:01 LauJensen: I think so, it was a while since I tested

4:17 phlaem: hi, I'm new to clojure and I've got a problem running the loop example in: http://clojure.org/functional_programming#Functional%20Programming--Recursive%20Looping

4:17 is there something I should have done before running the function? Because I am ending up in an endless loop

4:19 mikem: phlaem: if you just copied and pasted it from the website, it shouldn't do that. did you modify the code? check for typos?

4:20 phlaem: I have just copy/pasted yes and I used both the 1.1.0 binaries from the eclipse plugin binaries

4:20 in both cases my repl is stuck and I don't get a result

4:21 Chousuke: there is an error in the example

4:21 the rest function calls should be calling next instead

4:22 tomoj: :(

4:22 mikem: Chousuke: ah, good catch! in code I write I use rest and check with empty?

4:22 Chousuke: use next

4:22 or check with (seq foo)

4:22 empty? is not very idiomatic

4:22 tomoj: why did (seq foo) become idiomatic?

4:23 Chousuke: because most clojure functions do it and because rhickey said so :P

4:23 zmila: because that was said by the Master

4:23 tomoj: ah

4:23 :)

4:23 Chousuke: empty? itself is implemented as (not (seq x))

4:23 tomoj: hah

4:25 * mikem goes to change his code

4:27 phlaem: whats the rest function good for anyway, if it's not returning the tail of the list?

4:28 but it's working now thx :)

4:29 mikem: phlaem: the difference between rest and next is what they return for lists with only one element; next returns nil, rest returns ()

4:30 Chousuke: rest also returns () for () :)

4:31 which is why the example loops forever

4:31 LauJensen: Back to the bit-twiddling. An RGB value is made up of 3x8 bits. Lets say I have each of those 3 chunks in an integer value going from 0 - 255, how do I stuff those back into an 3x8 bit sequence?

4:31 _ato: partly it's historical (and that's probably the reason that example is wrong)

4:31 Chousuke: yeah

4:31 rest used to do what next does now

4:31 it was changed to enable full laziness

4:32 phlaem: "<Chousuke> rest also returns () for () :)" I think that's a flaw

4:32 somnium: the rest of nil is () too :)

4:32 phlaem: I would expect an exception in that case

4:32 mikem: LauJensen: you mean stuff them into one integer where bits 0-7 are R, 8-15 are G, etc?

4:32 Chousuke: phlaem: it's by design

4:33 phlaem: exceptions are icky

4:33 LauJensen: mikem: exactly

4:33 So that I can pass it to a java.awt.Color. constructor, which takes such an int

4:33 phlaem: yes but I would rather fail hard, than loop forever

4:33 Chousuke: phlaem: the loop is in your code, not in rest :)

4:34 phlaem: anyway, rest returns a sequence of elements representing the tail of the sequence. if there are no elements, the sequence is simply empty

4:34 phlaem: yes, but rest enables it :(

4:34 somnium: is the only reason so we can cons onto a thunk without disturbing it?

4:34 mikem: LauJensen: here's some code I have which does something similar (4 bytes into one int): http://gist.github.com/356162

4:34 Chousuke: phlaem: yes, but if you couldn't call rest on an empty thing, you would have to write special code to handle empty things

4:35 LauJensen: mikem: Thanks - Looks complicated :)

4:35 phlaem: which I have to do in the base case anyway?

4:35 mikem: LauJensen: byte-quad is a list, like (byte0 byte1 byte2 byte3)

4:35 LauJensen: maybe I can turn it into a nice reducer

4:35 _ato: ,(let [r 1, g 90, b 180] (-> r, (bit-or (bit-shift-left g 8)), (bit-or (bit-shift-left b 16))))

4:35 clojurebot: 11819521

4:35 _ato: maybe somethin like that, might be backwards

4:36 LauJensen: ,(let [r 255, g 2550, b 255] (-> r, (bit-or (bit-shift-left g 8)), (bit-or

4:36 clojurebot: EOF while reading

4:36 Chousuke: phlaem: perhaps

4:36 phlaem: Chousuke, I guess in non-recursive cases you are right, that would bloat the code

4:36 LauJensen: ,(let [r 1, g 90, b 180] (-> r, (bit-or (bit-shift-left g 8)), (bit-or (bit-shift-left g 8)) (bit-or (bit-shift-left b 16))))

4:36 clojurebot: 11819521

4:37 Chousuke: I think most things in Clojure are designed to throw as few exceptions as possible anyway

4:37 LauJensen: ,(let [r 255, g 255, b 255] (-> r, (bit-or (bit-shift-left g 8)), (bit-or (bit-shift-left g 8)) (bit-or (bit-shift-left b 16))))

4:37 clojurebot: 16777215

4:37 LauJensen: _ato: That should yield -1

4:37 Chousuke: calling first on an empty list is not an error either

4:37 _ato: LauJensen: eh? it's only 3 bytes though... an Integer is four bytes

4:38 ,0xffffff

4:38 clojurebot: 16777215

4:38 LauJensen: ,(.getRGB (java.awt.Color/WHITE))

4:38 clojurebot: -1

4:38 Chousuke: LauJensen: it's probably padded with 0xFF for the last byte

4:38 _ato: ,(.getRGB (java.awt.Color/BLACK))

4:38 clojurebot: -16777216

4:39 LauJensen: True

4:39 (let [r 0, g 0, b 0] (-> r, (bit-or (bit-shift-left g 8)), (bit-or (bit-shift-left g 8)) (bit-or (bit-shift-left b 16))))

4:39 ,(let [r 0, g 0, b 0] (-> r, (bit-or (bit-shift-left g 8)), (bit-or (bit-shift-left g 8)) (bit-or (bit-shift-left b 16))))

4:39 clojurebot: 0

4:39 tomoj: there's gotta be an easier way

4:40 _ato: ,(.getRGB (java.awt.Color. 0 0 0))

4:40 clojurebot: -16777216

4:41 LauJensen: ,(java.awt.Color. -16777216)

4:41 clojurebot: #<Color java.awt.Color[r=0,g=0,b=0]>

4:41 tomoj: why not just use the int,int,int constructor?

4:41 LauJensen: tomoj: I need to do some predicate testing, that'll be faster if I only have 1 int to test

4:41 Thanks a lot _ato and mikem though

4:42 tomoj: oh, this is the inner loop?

4:42 drawing graphics or something?

4:42 mikem: LauJensen: i sure learned something :)

4:42 LauJensen: tomoj: Yea

4:43 mikem: Me too - Havent done this stuff in 15 years, about the time when I presented a demo at 'The Party'

4:43 _ato: ,(let [r 255, g 255, b 255] (-> (bit-or r -16777216), (bit-or (bit-shift-left g 8)), (bit-or (bit-shift-left b 16))))

4:43 clojurebot: -1

4:43 _ato: ^ if you need the padding

4:44 LauJensen: Thanks!

4:46 _ato: That's one of the few things that's much nicer when expressed in C: 0xff000000 | r | (g << 8) | (b << b)

4:46 err.. that last b should be a 16 obviously ;-)

4:47 the lack of unsigned integers is also rather annoying for that sort of thing

4:49 psykotic: LauJensen: wow, The Party, that takes me back.

4:49 LauJensen: i think last time i was there was in 96, it might have been the same year.

5:00 doseq: Can anyone translate this to make it clearer: (doc seq) => Returns a seq on the collection.

5:00 What does that actually mean?

5:02 _ato: doseq: http://clojure.org/sequences

5:03 let me know if that also doesn't make any sense ;-)

5:03 doseq: I just want clarification on the grammar of "on the collection".

5:04 But thanks for the link... I don't really like the clojure.org docs.

5:05 tomoj: doseq: it means it's a seq which somehow gives the contents of the collection

5:05 _ato: a list is a seq it implements ISeq directly, so seq on a list returns the list

5:05 tomoj: so for example

5:05 ,(seq {:foo 3 :bar 4})

5:05 clojurebot: ([:foo 3] [:bar 4])

5:06 _ato: ,(class (seq [1 2 3]))

5:06 clojurebot: clojure.lang.PersistentVector$ChunkedSeq

5:06 tomoj: that is a seq, it's "on" the map because it returns (sequentially) values from the map

5:06 doseq: Sorry to bitch guys, I'm just so fed up with lazily written documentation that means nothing.

5:06 *deep breath*

5:06 _ato: doseq: Have you got the Programming Clojure book?

5:06 tomoj: it's like you're attaching the sequential interface on top of the collection

5:07 _ato: if not, I higly recommend it

5:07 tomoj: since the seq just walks through the immutable content of the collection, I'd think

5:08 doseq: So in that case "on the collection" means "by consuming the contents of the arguments and returning a 1-dimensional list"... is that about right?

5:09 LauJensen: doseq: yea, like it says "on the collection" :)

5:09 doseq: lol, OBVIOUS :D

5:10 You guys have been around for ages... how is the documentation process run on the source code, is there room for someone to contribute by improving the language?

5:10 _ato: doseq: not really. It's more like an iterator, it doesn't create a list.

5:11 documentation patches are certainly welcome, you need to sign the contribtuors agreement though

5:11 see http://clojure.org/contributing

5:12 doseq: Yup, thanks. I've been considering it for a few days already I just thought I'd hang out first and make sure I'm not duplicating anyone else's job.

5:13 tomoj: I think that there is work being done on collaborative documentation which will become relevant

5:13 _ato: seq returns something that behaves like a cons-cell list, it's not necessarily an actual list

5:15 doseq: tomoj: something web-based you mean? Or the doc strings in the source itself.

5:16 tomoj: uh, perhaps web-based at some point

5:17 the current web-based work I've seen is focused on collecting examples of uses from #clojure logs, I believe, but I think it could be easily made to also work with bits of explanatory documentation

5:20 doseq: I'm just really interested in doing something helpful documentation-wise because the experience for newcomers could be better.

5:27 psykotic: doseq: i feel you. the library documentation for clojure is awful.

5:28 every function should have a few examples. they could also double as tests.

5:30 cemerick: psykotic: The documentation is generally pretty amazing, short of having examples. Have you seen the docs for other languages, even far more popular ones?

5:31 doseq: As an example, the sequences page casually explains seq in terms of the ISeq interface, without any sense that if you don't know seq, then you're certainly not going to know the ISeq interface.

5:31 psykotic: cemerick: Python is pretty much my bar for documentation.

5:31 doseq: I see this circularity all over the place.

5:31 cemerick: psykotic: I think clojure surpassed python's documentation quality long, long ago.

5:31 psykotic: you are smoking crack

5:32 cemerick: well argued. :-P

5:32 kzar: the last 2 times I went into #python I got flamed by about 5 idiots until my question got too hard for them and they all went silent

5:32 psykotic: kzar: what does that have to do with the official documentation?

5:33 kzar: not a lot, just an anecdote I thought I'd share

5:33 psykotic: ruby's is certainly much worse than clojure's but that's not much of a statement

5:33 cemerick: look at the doc for reduce, for example.

5:34 cemerick: ,(doc reduce)

5:34 clojurebot: "([f coll] [f val coll]); f should be a function of 2 arguments. If val is not supplied, returns the result of applying f to the first 2 items in coll, then applying f to that result and the 3rd item, etc. If coll contains no items, f must accept no arguments as well, and reduce returns the result of calling f with no arguments. If coll has only 1 item, it is returned and f is not called. If val is supplied, returns the re

5:34 psykotic: block of text. you could convey the same thing better and much more concisely with a simple 'expression schematic' or an example.

5:35 and reduce is among the better examples in that it's at least fairly complete, if not very well written

5:35 doseq: This is the same problem as wikipedia though. You go looking for a definition, and in the first paragraph it branches off into six other unfamiliar terms.

5:35 cemerick: psykotic: this isn't paint-by-numbers. You need (and should want) a rigorous definition of what is going on. The community can fill in with examples and recipes as things go along.

5:36 psykotic: you are an idiot

5:36 cemerick: I guess what I'm saying is, patches welcome. :-)

5:36 psykotic: but that's okay

5:36 cemerick: psykotic: this is a friendly channel. Keep it that way, please.

5:37 psykotic: then keep your passive-aggressive "this isn't paint by numbers" shit in check.

5:38 i'm glad that someone with experience in technical writing in doseq is thinking of contributing. if i was a technical writer, i would do the same.

5:38 cemerick: psykotic: That wasn't meant as passive-aggressive in any way. I'm sorry if it seemed like it was. I'm happy to see the various documentation projects ramping up as well.

5:39 psykotic: so, here's what i'm contributing.

5:39 i'm working on a program i call genie. it is a bit like hoogle for haskell except it is not based on types but actual values.

5:40 doseq: Ok cool, I'm excited about this. Clojure is such an amazing concept and promises to make life easier, but it's a tough thing to write about which makes dissemination a problem.

5:40 psykotic: if you give it the template (= (% (fn [x] (* x 2)) [1 2, 3]) [2 4 6]), it will return clojure.core/map

5:40 and so on

5:41 it uses a mix of white lists and black lists to handle pure/impure functions

5:41 right now it works with everything in core and contrib

5:41 it has some nice tricks you might not expect, e.g. it will automatically try permutations of the function call template, in case you didn't "guess" the right order of arguments for the function you're searching for

5:42 so, for example, you could have written the above template as (= (% [1 2 3] (fn [x] (* x))) [2 4 6]) and it would have given the same result

5:42 doseq: psykotic: so does that mean you can supply it with some answers and finds the question? Or am I misunderstanding it.

5:42 psykotic: yes

5:43 doseq: Wow.

5:43 psykotic: it's actually very simple. it's basically just a matter of calling a list of candidates functions in turn, with exception wrappers, and checking the return values

5:43 it works well in a language like clojure where most functions are side-effect-free.

5:43 doseq: Like a brute force thing.

5:43 psykotic: sure but we're talking about a few thousand candidates, it's no biggie.

5:44 doseq: Sounds cool.

5:46 psykotic: i think the original idea behind this kind of thing comes from the smalltalk world, but it's much less useful there, because everything is oo and hence based on side effects.

5:53 somnium: psykotic: that sounds awesome. It would be fun to be able to say something like (fns-for {"" nil 42 nil "foobar" 'foo} n) and have it glom together n fns that match those criteria.

5:54 psykotic: any chance of getting a peek at the source in the near future?

5:56 psykotic: i'm building it out to interface with my quickcheck-style contracts system, so it's in a state of disarray right now, but sure

5:56 it isn't anything difficult though. most of the value is in the idea, not the implementation.

5:57 somnium: sure, its come up before, how to make a try_ruby for clojure. no one ever suggested brute forcing pure functions before afaicr

6:02 ska2342: Hi. If -> is the threading operator, is there already an established name for ->>?

6:02 somnium: Ive been wanting to make something for fixed arity fns too, so (fn** foo [x y] (* x y)) gets a tag like [:number :number :number], and if you call (foo 42) it inlines `(fn [x#] (* x# 42)).

6:03 It would be fun to experiment with that and an inference system

6:31 kzar: I haven't played with Clojure for a while but I'm going to give it another go. I remember before getting Emacs to work with it was a bit of a pain and there where a few different ways to do it. Which is the best / easiest way to do it at the moment?

6:31 psykotic: kzar: it should be pretty painless if you install swank-clojure with ELPA.

6:32 it's pretty much turn-key these days.

6:32 i use the adjective "pretty" advisedly, as i think there are still some issues with older versions of emacs.

6:33 kzar: psykotic: Hmm that ELPA thing looks interesting, haven't heard of that before thanks

6:33 psykotic: I'm using Emacs 23.1.1 so I should be alright I guess

6:33 psykotic: yeah, it's pretty neat, unfortunately it still doesn't have a whole lot of packages. their package submission process is pretty old school :)

6:33 yup, it works great with 23

6:35 kzar: psykotic: Sweet I like how ELPA installs, just eval a s-exp :D

6:36 psykotic: yeah, if a bit unsafe :)

6:37 (it evals code over the network)

6:39 kzar: psykotic: I'll trade being a bit unsafe for a week of my life not spent headbutting my computer

6:39 psykotic: a trade-off well made

6:40 there's another thing called auto-install which install directly from emacswiki pages :)

6:40 it has the courtesy of showing you a diff by default when it upgrades, so you at least have a chance of catching someone who inserted malicious code :)

6:41 the nice thing is that it's much more open in where it sources its packages from. elpa's achilles heel is really its 19th century package submission process. you have to _email_ the elpa maintainer every time you want to upload a new package version.

6:41 he might as well require delivery by carrier pigeon at that point.

6:42 kzar: pyskotic: A slight irony in the one easy package installer being hard to install into

6:42 psykotic: but i hear that's changing.

6:44 kzar: psykotic: So I've installed clojure-mode and swank-clojure with ELPA. Is it still best to get one of those bundles that includes Clojure and a clj bash script to launch it all?

6:45 psykotic: kzar: i believe you can just try to start swank and it will download the latest for you. yes, magic.

6:47 kzar: psykotic: Hmm I usually launched it with (slime) to get to the repl but that's still loads SBCL, do you mean I should do it like that?

6:49 psykotic: i haven't tried installing it alongside sbcl. when you install slime fresh, it should do the clojure install, etc, the first time you do a (slime).

6:50 kzar: psykotic: Ah OK I'll figure it out I'm sure

6:50 Gertm: kzar: I did the same as you yesterday. You need to remove your .slime directory if you have any, and leave all the references to your old slime out of your emacs config

6:51 psykotic: yeah, i'm looking at the source, it seems it wants to be "the" slime", rather than coexist.

6:52 Gertm: I moved my emacs config to another name, rm -rf ~/.emacs.d/elpa, rm -rf ~/.slime, elpa install, then install swank-clojure through elpa

6:52 then it works :)

6:53 hmm I just noticed I've got the habit of writing '-rf' instead of '-r'.. could be problematic in the future :o

6:55 psykotic: it's always fun when you insert a space and write ~/ .emacs.d/elpa instead :)

6:55 Gertm: heh

6:55 kzar: Gertm: psykotic: Sweet OK, I'll brb because I've got to restart emacs

6:56 Gertm: oo rcirc, share you config will you :)

6:56 your*

6:58 dm3: how do you serve-file with compojure 0.4.0?

7:05 kzar: Hmm so since I did that (package-install 'clojure-mode) and (package-install 'swank-clojure) both fail saying "Package x not available for installation" :/

7:06 My IRC settings in my .emacs http://paste.lisp.org/display/97342

7:06 Gertm: thanks!

7:07 kzar: Gertm: They aren't perfect but they connect to two servers, a few channels. Setup spell checking and auth with Nickserv all from typing M-x irc

7:07 Gertm: so I see :)

7:07 it's nice and small

7:08 kzar: so if the ELPA thing fails you what's the next best option?

7:08 Gertm: did you do 'M-x package-list-packages' ?

7:09 then enter that buffer and search for 'swank-clojure', press 'i' on it's line to mark it for installation

7:09 then hit 'x' to actually install

7:09 after that you should be able to do M-x slime

7:12 kzar: Gertm: OK brb let me try this again

7:13 avar: I finally got swank-clojure / slime working with my .emacs without using the ELPA sillyness

7:33 kzar: So I found an old #clojure log which gave me a hint, the problem was that an old version of slime was installed site wide. I removed that and this time it prompted me and installed Clojure.

7:33 Gertm: aha :)

7:34 it's always a bit of a search

7:34 kzar: Now M-x slime launches clojure but it's slime is constantly trying to connect, the prompt is fucked and said "java.lang.NullPointerException" a lot

7:34 Gertm: I never installed lisp stuff through my package manager, neither will I with clojure

7:34 hmm

7:34 that's strange

7:35 kzar: Gertm: Well this box has been running for like 5 + years now and I've upgraded stuff as I've gone and as I've learnt

7:35 Gertm: I knew no Lisp when I did the Debian install for it so I probably did apt-get install slime at some point

7:36 (hmm maybe not 5 years, I'm not sure how many but quite a long time anyway heh)

7:41 Gertm: Where does ELPA put the Clojure it grabs?

7:43 Gertm: kzar: I'm not sure, ~/.emacs.d/elpa/ or ~/.swank-clojure/

7:43 I think

7:43 (I've only installed clojure and stuff yesterday, so I'm by no means an expert)

7:45 kzar: Gertm: Yea you're right ~/.swank-clojure has it

7:46 brb again

8:09 patrkris: does anyone here know what to do to get Swing to work from within a VimClojure REPL? I've ensured that the laf.jar is included in the nailgun server's classpath, but still doesn't work when I do (def frame (JFrame. "Test"))

8:09 i get a nullpointerexception

8:09 bobo_: do you set it as visible?

8:10 patrkris: no

8:10 it works fine if I do it from a leiningen REPL

8:10 bobo_: ah

8:17 kzar: Gertm: phew I got it working

8:19 Again trawling the inter-webs helped, I had an old version of GNU Java installed (a few actually heh), so I got rid of them all and got sun-java6-jdk + sun-java6-jre installed instead and it works

8:21 so to be fair on ELPA it would have just worked really nicely if it wasn't for the old stuff I had lying around on my system

8:33 LauJensen: :q! emacs M-x slime (doto (JFrame.) .show)

9:06 G0SUB: ,(re-seq (re-pattern "\bbar\b") "foo bar baz")

9:06 clojurebot: nil

9:06 G0SUB: ,(re-seq #"\bbar\b" "foo bar baz")

9:06 clojurebot: ("bar")

9:06 G0SUB: weird!

9:10 _ato: not so weird

9:10 ,(re-seq (re-pattern "\\bbar\\b") "foo bar baz")

9:10 clojurebot: ("bar")

9:12 _ato: ,(first "\bbar\b")

9:12 clojurebot: \backspace

9:15 chouser: ,(re-pattern "\\bbar\\b")

9:15 clojurebot: #"\bbar\b"

9:15 chouser: ,(re-pattern "\bbar\b")

9:15 clojurebot: #"bar"

9:16 chouser: hm, it'd be nice if #"" didn't print unprintables like that.

9:16 my fault, I'm afraid. :-/

9:18 _ato: what would it print instead?

9:19 if it printed #"\bbar\b" that would be very misleading ;-)

9:19 same with question marks or most other symbols

9:20 spaces maybe

9:21 chouser: #"\010bar\010"

9:21 Fossi: i like the utf blocks ;D

9:22 _ato: ah.. of course

9:22 chouser: or maybe #"\x08bar\x08"

9:22 _ato: yeah, hex is nicer

9:23 chouser: and extends to the unicode \u0000 more coherently

9:23 G0SUB: makes sense. thanks.

9:24 \\b it is, then.

9:24 chouser: G0SUB: why are you using re-pattern?

9:24 #"" is much nicer for regex than ""

9:24 _ato: G0SUB might be composing strings to make a regex?

9:25 chouser: yeah, sometimes an unforunte necessity.

9:25 unfortunate

9:25 though sometimes you can get away with composing regex literals

9:27 ,(re-pattern (str #"\b" (java.util.regex.Pattern/quote "bar") #"\b"))

9:27 clojurebot: #"\b\Qbar\E\b"

9:28 _ato: nice

9:29 chouser: only works if each #"" fragment is itself a complete and vaild regex though, so not always usable.

9:29 can't use #"(" and later #")" for example

9:31 huh. java regex has a Printable group, but no matching predicate in Character

9:35 G0SUB: _ato, you got it right :)

9:35 _ato: the Printable group is ASCII only

9:35 might be why it's not in character

9:51 licoresse: Is there a metadata to use to mark a (def ...) as private?

9:52 stuartsierra: yes

9:52 (def #^{:private true} foo ...)

9:52 licoresse: So. do I get an exception if it is called outside the namespace it is defined?

9:53 Fossi: why would you?

9:53 licoresse: oh yes

9:53 an error from slime

9:53 Fossi: why make it private?

9:54 Fossi: don't know

9:54 i use def- and such a whole lot

9:54 don't know what they do though

9:58 maravillas: is there any sort of consensus on how to organize functions across a library's namespaces? by which i mean...i'd heard some talk of putting the public api in core and supporting functions in other namespaces, but that doesn't seem to be very common

9:59 and i have a couple public functions that my private functions reference, so i'd need to do something like defining them outside of core, and referencing those defs in core itself

9:59 underdev: maravillas: sounds sane to me

9:59 Chousuke: You can just define private functions in the same namespace, it doesn't really matter

10:00 but optimally all functions in a single namespace should have the same "theme"

10:01 maravillas: yeah, i'm just wondering if a convention has emerged. separating them makes it quite a bit easier to see the public api just by scanning core, but i'm left with that wart of redefining some functions

10:01 underdev: maravillas: as a consumer i would really like that

10:02 chouser: I tend to organize namespaces based on dependencies -- if some functions depend on 3rd party libs that others to do not, they get their own namespace.

10:02 underdev: maravillas: and as a dev i'm adopting it.

10:04 maravillas: hm...ok, thanks guys

10:05 underdev: it would be great than to use qualified names to indicate you were calling the library api in the core api, or at least :as it

10:05 from a consumers point of view

10:05 good stuff maravillas

10:06 maravillas: yeah, that's probably a good call

10:07 underdev: and it would really clean up the testing

10:07 licoresse: using map in doall to do sideeffects, is this kosher?

10:08 it does not feel that way

10:08 Chousuke: prefer doseq

10:09 licoresse: ok

10:09 underdev: oh, but the support lib ns wouldn't be included when a person use'd the core

10:09 i don't think

10:09 so you would have to doc that you would need both

10:10 i think

10:10 chouser: if ns C requires B and B requires A, then when C is loaded, A will be also

10:11 underdev: oic, never ran into it, but in a screencast (somewhat older) it mentioned that would NOT happen

10:11 chouser: however, if C 'use's B and B 'use's A, the Vars from A become available in B but not (without qualification) in C

10:11 underdev: oic, yeah, i get it

10:12 but the core *would* be access the lib, just not ns hosting the core

10:12 which is probably what you want anyway

10:13 thanks chouser

10:13 chouser: sure.

10:14 fwiw, I don't much care for libs using the 'core' naming scheme. I suppose they're just copying clojure.core, but I sorta wish "core" always meant "cloujure.core"

10:17 underdev: i am just appreciating the seperation of concerns, not a naming convention. but i see what you mean. If i say "core" in the context of tcl, i mean the commands included with the runtime, aside from any additional libs

10:17 it obfuscate that would be a bad thing

10:20 doseq: Do we call collection items "items", or elements?

10:21 chouser: doseq: I think either is fine

10:21 doseq: I think I'll prefer items.

10:32 Raynes: I just read the first log file in defn's logs. Fri Feb 01 2008, in which chouser was a solid newbie. How creepy is that?

10:33 cemerick: those early logs are good readin' :-)

10:33 chouser: complete newbie. "how do I run code?" right?

10:33 somnium: when was clojure first released?

10:33 stuartsierra: somnium: First public release was in Fall 2007

10:34 chouser: Raynes: his logs are a copy of my logs. and of course my logs start when I first showed up here.

10:34 if anyone has any older logs, I'd be happy to integrate them.

10:34 Raynes: chouser: Indeed. It was the "how do I run code?"

10:35 cemerick: chouser: when did you move to a lower case 'C'?

10:35 chouser: cemerick: oh, relatively recently, in the vague and unltimately vane hope it would help differentiate me from Chousuke

10:35 vain

10:36 cemerick: huh...and I thought you just didn't sleep.

10:36 ;-)

10:36 ska2342: somnium: I think one can consider http://sourceforge.net/mailarchive/forum.php?thread_name=7E06A48B-2A93-4FBD-ADA5-7C23D0F7B16D%40richhickey.com&forum_name=foil-users to be the first public announcement :-)

10:36 chouser: cemerick: :-)

10:36 cemerick: Man, 2/7/2008! :-P

10:37 It's funny how I waft over to that page every now and then.

10:39 chouser: it's intruiging to me long I was using clojure while still complaining about the syntax

10:39 stuartsierra: The first thing every Lisp user does is complain about the syntax. It's a rite of passage.

10:39 hiredman: pffft

10:40 the syntax is beautiful

10:40 somnium: is there any benefit to the syntax other than macros? (compared to say, ML or Haskell)

10:41 bsteuber: somnium: uniform = less to learn, I think

10:42 I always got confused in haskell when I'm allowed to insert linebreaks or not

10:42 underdev: f* yeah

10:42 everything else is noise now

10:44 Raynes: hiredman: Did you use a different nick before 2009-07-30?

10:44 I can't seem to find your first appearance, unless this is actually it and you already knew Clojure when you joined the channel.

10:45 hiredman: I think maybe november 08 should be my first appearance

10:46 chouser: http://clojure-log.n01se.net/date/2008-11-11.html " is this coljure swag, or libertarian swag?"

10:46 hiredman: right

10:50 doseq: The syntax makes more sense if you read a copy of the Lisp 1.5 Programmer's Manual.

10:51 The 1.0 manual is good too but the 1.5 one is written to be more accessible.

10:51 fogus: doseq: How so?

10:51 doseq: fogus: how does it make more sense?

10:53 Thanks for your blog, btw, I enjoyed reading some of it the other day.

10:53 fogus: doseq: Yes. Sorry I came to the conversation late, so I might have missed a point earlier

10:54 doseq: Someone was just saying that it's common to question S-expression syntax.

10:55 ska2342: doseq: nah, it's about lispers complaining about Clojures syntax at first. I've been through that, too what with all those curlies and such...

10:55 doseq: Oh, gotcha.

10:55 Still, it's a good book to read :)

10:56 Raynes: Morning, rhickey.

10:56 rhickey: so if maps throw exceptions on duplicate keys, should sets as well?

10:56 Raynes: hi

10:57 doseq: I've been going on a nostalgia binge lately, reading all the original papers by the creators of various things. The UNIX stuff is pretty fascinating in relation to Clojure... they were so big on interactive environments but that kinda got lost somewhere.

10:58 Raynes: Sets can be useful to filter duplicates.

10:59 doseq: rhickey: what would be the benefit of the exception?

10:59 hiredman: why can't this just be simple

10:59 :(

11:00 ska2342: rhickey: stupid question first: when exactly do maps throw?

11:00 rhickey: doseq: people considered supplying the same key again in a map init to be a mistake they wanted caught, just trying to see if they feel the same way about set members

11:00 fogus: rhickey: yes.

11:00 rhickey: ska2342: they throw on my machine, at the moment

11:00 doseq: rhickey: thx.

11:00 hiredman: simple or easy, choose one :D

11:02 ska2342: ,{:a 1 :b 2 :a 3}

11:02 clojurebot: {:a 1, :b 2, :a 3}

11:02 Raynes: ,(->> "abcddefffgeeheff" (into #{}) (apply str))

11:02 clojurebot: "abcdefgh"

11:02 doseq: Does anyone know what the rationale is behind the ([x] [x form] [x form & more]) style of example syntax in the doc strings? Just wondering if those conventions are used elsewhere.

11:02 rhickey: Raynes: we're not talking about into here, in either case

11:02 hiredman: doseq: those are arg lists, not examples

11:03 doseq: hiredman: right, well notional examples.

11:03 Raynes: rhickey: I was confused about what you meant. I see.

11:03 rhickey: Raynes: more about #{:a :b :c :b}

11:04 doseq: rhickey: I don't think it should throw an exception for keys if it doesn't for any other type.

11:04 ska2342: rhickey: if it's only about the read-syntax-form I'd go for consistency. Otherwise you'll have to answer the question, why sets don't throw when maps do about once a week ;)

11:05 rhickey: not just about reader syntax, also hash-set

11:06 chouser: yeah, sets should do the same as map keys. I think the less frequent complaints about dups in sets are roughly proportial to their frequency of use.

11:07 ska2342: anyway: consistency. I'm not sure what I'd expect from an apply hash-set ..., though.

11:08 chouser: that's a good point -- maybe they should provide uniqueness instead of throwing

11:08 bah, gotta go.

11:09 fogus: I would say that if maps throw on dup keys then so should sets. The really useful exception would be when people use contains? as .contains. IllegalAssumptionException

11:10 ska2342: applying hash-set to a seq feels like a solution to removing duplicates. But that is probably Perl-influenced thinking and using distinct is the better, more idiomatic way.

11:17 hng, got sidetracked by reading the source of distinct. Can anyone explain why that doesn't stack-overflow when it is calling the step function explicitly recursively?

11:17 fogus: I guess I see it as a difference between wanting a set, or simply wanting a seq without duplicates. I like the clear distinction (no pun)

11:17 S11001001: well, a seq without duplicates where order doesn't matter is a set :)

11:18 rhickey: there is the set fn

11:18 aargh, could someone please fix test so it doesn't always report exceptions at test_clojure.clj:77 ?

11:19 hiredman: ska2342: I imagine the step function returns a lazy-seq

11:20 ska2342: hiredman: it does.

11:20 hiredman: so there you go

11:20 fogus: rhickey: Do you have this sentence always available in your clipboard? ;-) test_clojure.clj:77 seems to be a persistence source of headache for you.

11:21 ska2342: hiredman: why? Do I have to reread the lazy stuff to see how it avoids blowing the stack?

11:21 hiredman: ska2342: lazy-seqs sort of flip the stack out sideways

11:22 ska2342: hiredman: sort of ... what?? ;-) what shall I read? LazySeq.java?

11:23 hiredman: so normally in recursion without tco the stack grows down with each recursive call

11:24 in a lazy-seq those recursive calls are strung out as a datastructure

11:25 next gives you the next "recursive" call

11:25 rhickey: ok, explicit this, dupe checking on set and map keys up

11:27 ska2342: hiredman: I'm trying to make sense of LazySeq.java and it's calls to seq and sval at the moment. Maybe I'll see the light later

11:31 Ankou: hi, I already asked that some time ago but nobody could help me, maybe this time there's somebody who knows the answer: The error messages of compiling clojure by using (compile) or (load) or C-c C-l/C-c C-k in slime are rarely helpful, there's almost never a line number or something like that. I don't know if it is exactly the same but it is very similiar if I use leiningen to compile it or run the file just with the command line use of clojure.

11:31 However, in enclojure there are pretty exact error messages an I would like to know how to get them with emacs too. As far as I know enclojure uses Ant to build the clojure source but I have no Idea how that could help getting better error messages. Any Ideas?

11:31 somnium: ska2342: maybe another way to say it is lazyseq wraps the recursive call in a thunk that gets returned immediately, so the stack never grows.

11:33 ska2342: I think the point in distinct is that the step function, which is called recursively, lives outside the lazy-seq so that a new lazy-seq is created on every call. Sth like that?

11:37 somnium: ska2342: yeah, in pseudo-clojure first call returns a thunk that holds {:first first-distinct-item :rest (fn [] (distinct xs...)) }

11:40 licoresse: code-coverage tools for clojure, anyone?

11:43 cemerick: that's going to be a tough one

11:44 maravillas: not sure how much help it is, but this was mentioned some time ago (here in #clojure, I believe): http://p.hagelb.org/thomas.html

11:45 licoresse: Lex Spoon had something in Smalltalk which I think was a cool concept; tag function access in the metadata, all functions with no access have a count of 0

11:45 maravillas: looking

11:45 hehe

11:45 cemerick: We should be able to use existing line-level code coverage tools in Java. Just a matter of hooking the pieces together, but that's the deeper end of the pool.

11:46 licoresse: the same principle almost

11:54 ska2342: can someone elaborate on the fundamental difference between comp and ->

11:55 hiredman: comp is a function, -> is a macro

11:56 ska2342: E.g. I have a fn which walks the ns-publics of clojure.core, tries to deref the second of each and tests for fn?. I can write that with -> or comp just as well and don't know which is better

11:57 somnium: also (-> x f g) => (g (f x)), ((comp f g) x) => (f (g x))

11:57 Raynes: $walton ->

11:57 sexpbot: Raynes: http://getclojure.org:8080/examples/->

11:57 Raynes: defn: That stuff is extremely useful. I <3 you.

11:58 cemerick: many people find -> easier to read, especially when there's java interop going on as well

12:01 ska2342: hm, while trying to create a version for clojurebot I'm beginning to get a feeling for the diffs. -> with anon functions is rather tricky if possible at all (in my case)

12:02 cemerick: yeah, -> and anon fns don't mix

12:02 Raynes: ,(-> 1 (#(+ 2 %)))

12:02 clojurebot: 3

12:03 cemerick: yeah, I wouldn't call that mixing well :-)

12:03 somnium: some people even like (-> 1 ((partial + 2))) :p

12:03 Raynes: I do it quite a bit, actually. Not enough that I'd call it a problem.

12:03 Only for simple things.

12:04 ska2342: Being a long timer lisper I have to admit that I have problems seing any comfort in -> at all, but since it is widespread I have to adopt ;-)

12:04 Raynes: It's more comfortable than )))))))))))))))))))0

12:05 Minus that last zero there. :>

12:05 ska2342: Raynes: I happen to disagree, but nevermind

12:05 ipostelnik: usually, I use -> to avoid creating anon functions in the first place

12:05 Raynes: Well, fair enough. If that's your thing.

12:05 ipostelnik: ,(-> 1 (+ 2))

12:05 clojurebot: 3

12:06 ska2342: BTW (I asked this earlier) is there a common name for ->>?

12:06 TakeV: ,(doc ->)

12:06 clojurebot: "([x] [x form] [x form & more]); Threads the expr through the forms. Inserts x as the second item in the first form, making a list of it if it is not a list already. If there are more forms, inserts the first form as the second item in second form, etc."

12:06 ipostelnik: I prefer to think of it is a pipeline operator

12:08 as in "shell pipeline"

12:08 ska2342: ipostelnik: -> is threading and ->> is pipeline for you?? Or did I misunderstand?

12:12 ipostelnik: ska2342, no I think of both of them as pipeline, just different order of arguments

12:13 ska2342, I rarely use ->>, when I have control over the method signature I generally design toward usability with ->

12:14 ska2342: ipostelnik: I don't use either of them, but for documentation purposes I'm looking for the *name* of ->>. -> is the "threading operator", but ->>?

12:14 cemerick: It depends on what your fns' arguments are. If there's a sequence involved, you generally want it to be last, so it can work with ->>

12:15 ipostelnik: -> and ->> are both threading operators, the only difference is insertion point

12:16 ska2342: "tail threading op" (compare to tail recursion)?

12:44 doseq: I still don't get what ([x] [x form] [x form & more]) is actually saying.

12:45 joshua-choi: doseq: It's exactly like ([x & forms]), only it was separated into three probably just for optimization.

12:45 doseq: Oh, so that space is an OR?

12:45 stuartsierra: yes

12:46 doseq: So the space character means two different things.

12:47 ska2342: doseq: you can call that function with either one argument (x), or x and another form, or x and more forms. Each possible arglist is displayed as a vector just like in arity-overloaded dfns

12:48 doseq: Ok so in order to read it you need to know what an arity-overloaded dfns looks like? I question that choice :)

12:49 But thanks for the explanation, that helps.

12:50 ipostelnik: arity = number of args

12:50 a function can have different signatures based on the number of args

12:51 doseq: Am I right in reading it as: "(-> x) or (-> x form) or (-> x form [form ...])"

12:54 ipostelnik: yes

12:55 div: ,(-> 1 (* 2) (+ 3) (* 2))

12:55 clojurebot: 10

12:55 fogus: doseq: It might be simpler just to think of it as (-> x [form...])

12:55 doseq: Indeed.

12:57 Oh, so those things are actually generated automatically from the source code? That makes more sense. Initially I thought maybe someone had written them that way.

12:59 ska2342: doseq: some of them are generated, some are written in the functions metadata, IIRC

13:00 doseq: I'm writing all this up as part of a "Clojure for absolute beginners" type of thing.

13:12 In this arg list, I can see that the ? means that something is optional, but how about the * and +?

13:12 ([name doc-string? attr-map? [params*] body] [name doc-string? attr-map? ([params*] body) + attr-map?])

13:18 thickey: doseq: I think the * means "one or more" and the + means "the previous form can be repeated"

13:18 doseq: Thanks Tom.

13:19 Fossi: i'd guess from regexs + is one or more, * is none or more

13:19 doseq: That makes sense.

13:19 ska2342: params* in context of defn is obviously none or more :)

13:20 thickey: yep

13:38 slyphon: anyone ever have a problem with inconsistent behavior between 'lein swank' and 'slime-connect' ?

13:38 it seems like sometimes emacs gets into this state where it can't connect, but telnet can connect

13:40 underdev: slyphon: use it all the time, never had that problem

13:40 slyphon: hrm

13:40 poop

13:40 there too many possible things that could be wrong :/

13:40 underdev: slyphon: depending on the usecase, you can use swank-clojure-project

13:40 does that fail too?

13:41 slyphon: no, but i have a bunch of environment and java properties i need to set

13:41 underdev: oic

13:41 slyphon: yeah, i'll probably just try reinstalling emacs i guess

13:41 could be the particular port i'm using

13:41 underdev: OS?

13:41 clojurebot: most horrible thing is http://tinyurl.com/b65o8e

13:41 slyphon: OS-X

13:42 but installed emacs w/ macports

13:42 underdev: gotcha

13:42 * slyphon is addicted to bitmap fonts

13:42 underdev: slyphon: are you using elpa?

13:42 slyphon: yeah

13:43 underdev: when people are pulling from HEAD from here and thar, stuff seems to break more

13:43 okay

13:43 * slyphon investigorates further

13:44 * underdev does not like that contains? just returns false when used with vectors, instead of breaking

13:44 slyphon: yes!

13:45 poor name choice

13:45 or poor behavior

13:45 underdev: my fault, but didn't realize wtf i've been doing wrong... :)

13:46 IT'S IN THERE! ITS RIGHT THERE!!!

13:46 slyphon: hahahahahah

13:51 too bad elpa cant install cedet

13:51 d

13:53 tomoj: ,(contains? [1 2 3] 0)

13:53 clojurebot: true

13:54 fogus: fogusbot> IllegalAssumptionException!

13:56 SynrG: ,(contains? [1 2 3] 3)

13:56 clojurebot: false

13:56 SynrG: fun :)

13:56 dakrone: it's annoying that contains only works on maps

13:58 tomoj: it works on other things too..

13:58 dakrone: alright, thinks with k/v pairs

13:58 *things

13:59 chouser: maps, sets and vectors -- everything Associative

13:59 SynrG: ,(some (fn [x] (= x 0)) [1 2 3])

13:59 clojurebot: nil

13:59 fogus: dakrone: It works on vectors too. But the result is not what you're assuming it should be.

13:59 chouser: ,(some #{0 3} [1 2 3])

13:59 clojurebot: 3

13:59 chouser: ,(contains? #{:a :b :c} :b)

13:59 clojurebot: true

14:00 dakrone: yea, the whole point is that it's misleading for people who think it's going to do something else

14:00 LauJensen: ,(contains? [1 2 3 3] 3)

14:00 clojurebot: true

14:00 hiredman: strings too

14:00 fogus: dakrone: I think most here are sympathetic to what you're saying

14:00 dakrone: ,(contains? [1 2] 2)

14:00 clojurebot: false

14:00 dakrone: is the big gotcha

14:01 fogus: yea, I shouldn't complain unless I'm suggesting a solution anyway :)

14:01 chouser: suggested solution: rename 'contains?' to 'has-key?'

14:01 slyphon: yes

14:02 chouser++

14:02 bsteuber: or contains-key?

14:02 slyphon: bsteuber: that's *way* more typing!

14:02 chouser: that suggestion isn't perfect, but I do think it's better than status-quo.

14:02 LauJensen: "kontains?" :)

14:02 chouser: because the statis is *not* quo.

14:03 fdaoud: ,([1 2 3] 2)

14:03 slyphon: chouser: really? punning in latin?

14:03 clojurebot: 3

14:03 slyphon: chouser: have you no shame?

14:03 chouser: slyphon: just quoting

14:03 slyphon: :)

14:03 dakrone: chouser: I agree also

14:03 fogus: ,(let [contains-but-not-the-way-that-you-think? contains?] (contains-but-not-the-way-that-you-think? [1 2 3] 0)

14:03 clojurebot: EOF while reading

14:04 slyphon: contains-dwim!

14:04 fogus: You get the point. (parens-fail)

14:04 chouser: http://www.youtube.com/watch?v=apEZpYnN_1g -- Dr Horrible's Sing Along Blog

14:04 fdaoud: ,(doc contains?)

14:04 clojurebot: "([coll key]); Returns true if key is present in the given collection, otherwise returns false. Note that for numerically indexed collections like vectors and Java arrays, this tests if the numeric key is within the range of indexes. 'contains?' operates constant or logarithmic time; it will not perform a linear search for a value. See also 'some'."

14:05 fdaoud: can't say it's not doc'ed.

14:05 ,(doc some)

14:05 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)"

14:08 underdev: what isn't mentioned is that when used with a numerically indexed colllection, it will return false when using a non-numeric keys. Clojures been very happy to just break when i've made similarly stupid mistakes.

14:09 not complaining, 100% my bad, but docu doesn't make that obvious

14:10 tomoj: it will not perform a linear search for a value

14:14 brian__: noob question -> user=> (def counter (let [count (ref 0)] #(dosync (alter count inc)))) ; user=> (counter)

14:14 1

14:14 @count

14:14 java.lang.ClassCastException

14:14 dakrone: brian__: you are declaring count as local only to the counter function

14:15 brian__: ok

14:15 thx

14:15 chouser: your local 'count' is out of scope by the time you are back at the repl

14:15 dakrone: no problem, good luck

14:15 chouser: so you're trying to deref the builtin fn named 'count', hence the ClassCastException

14:15 brian__: yep

14:15 thx

14:23 * cemerick just upgraded to the 3/23 release of enclojure. Good stuff. :-)

14:25 LauJensen: Whats good about it cemerick ?

14:26 cemerick: Mostly a good pile of refinements. Better sexpr navigation (though I'm not too keen on the default keybindings), code outlines are more reliable, some irritating bugs are gone. It ostensibly has much-improved debugging support as well, which I've not had a chance to try out.

14:27 doseq: has-key? sounds cool. or key-in?

14:27 LauJensen: Sounds cool

14:27 * fogus tried to install Enclojure but broke his Netbeans instead.

14:28 LauJensen: cemerick: This is probably a very noobish question, but when you're editing, are you clicking and using error keys, or something similar to C-n C-p M-v etc

14:28 stuartsierra: fogus: sounds painful

14:28 * doseq thanks god he doesn't have to use a Java-based IDE.

14:29 fogus: stuartsierra: I'm glad that I didn't have to explain that (oh so subtle) joke. ;-)

14:29 stuartsierra: fogus: good :)

14:32 doseq: Night all.

14:32 * Crowb4r wishes he could find a clojure job or internship

14:38 rlb: I just started looking at lein the other day. Would it be reasonable to think that, its approach could increase the potential security risks to a machine or account (via clojars) a bit?

14:38 s/that,/that/

14:40 I'm mostly just wondering about the vetting/trust associated with any items in clojars that can be pulled down indirectly (as compared to say debian packages, or grabbing the upstream source). Of course no doubt lein is more convenient.

14:45 chouser: rlb: anyone can upload anything to clojars, I believe.

14:46 So I guess when you have lein fetch deps for you, you're trusting every person that has uploaded items into the tree of deps you're fetching. I don't think any of those are generally signed.

14:47 That does indeed sound higher risk than the signed packages you generally get from debian, though I don't actually know how carefully they control those signing keys.

14:49 cemerick: LauJensen: "error keys"?

14:49 chouser: "arrow keys" I think

14:50 LauJensen: cemerick: Arrows! :)

14:51 fogus: rhickey: Do you have a link to the paper we spoke about in VA for the Haskell paper describing the benefits of a coarse-grained STM approach?

14:53 cemerick: LauJensen: I don't touch the mouse very often, no. I do use sexpr navigation a fair bit, but probably less than I could.

14:53 I don't know what C-n, C-p, or M-v do, tho.

14:54 LauJensen: forward, backward, line above, next view (page down) etc

14:55 The-Kenny: I use M-v and C-v a lot

14:56 cemerick: No, I use mac-standard shortcuts for that.

14:56 Cmd- left, right, up, down, Option- for moving by "words", shift with either to select.

15:00 rlb: chouser: debian tries to be pretty careful, though you're still dealing with ~1000 maintainers. Also as you move from unstable -> testing -> stable, the risk should tend to decrease, and at a bare minimum, the debian maintainer that uploaded a given package actually grabbed the source and built it themselves.

15:01 chouser: rlb: right. so either way you're trusting a somewhat nebulous cross-section of procedures, software, and people. That said, I would expect clojars to be a bit more "wild west" than debian.

15:01 rlb: I wonder if lein makes it easy to tell it to "only use the jars in this dir" or similar. Then if you wanted to you could provide them yourself as it complains.

15:01 chouser: I have no idea about other maven repos

15:05 rlb: chouser: ok, so it sounds like clojars really doesn't have a security model - it's entirely dependent on any given project to verify the providers of each dependency (direct and indirect) that it lists.

15:07 If there's not one, I'd definitely like a "don't automatically grab anything" mode. Then when you wanted to, you could use that and fulfill the deps manually.

15:07 cemerick: central has some kind of keying requirement these days, though I'm not sure what practical impact that has.

15:07 brian__: noob question - is it possible to read/write a clojure data structure to disk?

15:07 outsde of a database/

15:08 cemerick: brian__: prn and read will get you by if you're only using clojure data structures

15:08 beyond that, there's the undocumented-on-purpose print-dup

15:08 brian__: ?

15:09 why is it undocumented/

15:09 rlb: In any case, it sounds like in the limiting case, clojars (and maven if it works the same way) could have the potential to be a bit too much like running random binaries off the net for me. Thanks for the help.

15:09 cemerick: because it's very much subject to future change.

15:09 brian__: ok

15:09 * Drakeson wishes people would upload to a repo before writing blog entries ...

15:10 rlb: Though I'll probably poke at it a bit more...

15:12 cemerick: rlb: this seems relevant: http://www.sonatype.com/people/2010/01/nexus-oss-ecosystem/

15:21 rlb: cemerick: thanks

15:27 div: how would i go about checking if an integer is a perfect square ?

15:27 e.g. 9 is a perfect square, but 8 isn't

15:28 if i (sqrt 8) i get a double, is there a predicate or something that checks if something is an integer

15:29 chouser: since doubles are inaccurate, I'd round to the nearest int, do int multiplication, then see if you're back where you started.

15:29 maybe there's a better way, but it seems like that should be accurate at least.

15:30 rys: just check if the fractional part is zero?

15:31 ztellman: (= (Math/floor num) num)

15:32 div: yea, thx

15:32 that will do it, i was expecting some kind of instanceof based predicate

15:32 so looking in the wrong direction :)

15:33 chouser: ,(zero? (rem (Math/sqrt 10000000000000001) 1))

15:33 clojurebot: java.lang.ExceptionInInitializerError

15:33 chouser: eh. That's 'true' for me.

15:34 ,(let [n 10000000000000001, i (Math/round (Math/sqrt n))] (= (* i i) n))

15:34 clojurebot: java.lang.ExceptionInInitializerError

15:34 chouser: and that's false

15:38 div: hm

15:38 overflow error ?

15:39 Fare: anyone wants to speak for the Boston Lisp Meeting?

15:39 in June, July, August?

15:40 wthidden: Given some map M, with key K, what is wrong with: (get M K (throw (Throwable. (str "Key not found.")))) ?

15:41 chouser: wthidden: "get" is a function, so all args are evaluated before it's called.

15:41 wthidden: Argh.... how sensible... thanks.

15:42 chouser: is it possible for M to have nil or false values?

15:42 wthidden: no

15:42 chouser: ok, then I'd suggest (or (M K) (throw ...))

15:43 'or' is a macro and won't evalutated expressions after if gets a "true" one

15:43 wthidden: ah simple and elegant, thanks chouser.

15:44 for some reason i had it in my head get was a macro.

15:45 i should have swallowed what little ego I had/have an hour ago and asked for help.

15:46 * Fare lost his ego and is not afraid of asking really really stupid questions anymore

15:46 Fare: or making stupid remarks.

15:47 wthidden: i wish i was as smart as Fare

15:48 and it would be really cool if someone spoke about clojure again at the Boston Lisp meeting.

15:51 Fare: it would.

15:51 come on big boys - clojure has lots of cool stuff happening to it. Surely there must be a clojure hacker around Boston to give a talk this year?

15:56 LauJensen: Fare, are you paying travel expenses?

15:56 Fare: Unhappily, this year's budget is 0.

15:56 so, no.

15:57 but I'm offering you beer.

15:57 LauJensen: Hmm, so I'll have to weight a beer against about 2000 USD worth of plane tickets.. hmmm :)

15:57 Crowbar7: It must be a hell of a beer. :p

15:58 stuartsierra: You could get me for the cost of train fare from NYC ;)

15:58 LauJensen: If I did have business in the US I would be happy to hop aboard, but unfortunately I dont

15:58 div: maybe it's a beer subscription

15:58 underdev: the bad news: it's coors light. The good news: it's 6 metric tonnes of it.

16:00 LauJensen: Fare: Dont miss stuarts offer, he gives good presentations as seen on Vimeo :)

16:04 Fare: stuartsierra, I'll try to raise the fare. It's still like $200.

16:04 stuartsierra: check dates first: when is this?

16:04 Fare: since you come from afar, it's pretty much whenever you want, starting in June

16:04 LauJensen: stuartsierra: remember, since I handled marketing, I'll be taking 20% - which means a little bit of walking for you :)

16:05 Fare: usually we meet on the last monday of the month, but you get to pick.

16:05 (I have speakers for April and May already)

16:05 underdev: there's a clojure meetup in pittsburgh this wednesday; we'ld be happy to get a speaker!

16:10 fdaoud: stuartsierra: is it looking good for your book to come out mid-May?

16:13 stuartsierra: fdaoud: Hang on, are you in Boston with Fare?

16:13 Oh, the book.

16:13 Dunno. We're in copy-editing, but Luke still has a chapter to finish.

16:13 fdaoud: stuartsierra: no, I'm in Montreal

16:14 stuartsierra: thanks, sounds good

16:14 tomoj: wait, you're writing a book too?

16:14 stuartsierra: tomoj: yes, with Luke Vanderhart, for Apress

16:14 fdaoud: http://apress.com/book/view/1430272317

16:15 apress ebook prices are ridiculous. it's not normal that it's cheaper to get the paper book from Amazon (shipping included)

16:16 Crowbar7: I did exactly that

16:16 it

16:16 it's on pre-order

16:16 fdaoud: ditto

16:17 43% off the list price

16:18 Borkdude: In what way will the book be different from Clojure in Action, The Joy of Clojure, Programming Clojure?

16:19 Asked a question about it on SO: http://stackoverflow.com/questions/2578837/comparing-clojure-books

16:19 stuartsierra: Luke and I wrote it, so it will be different.

16:19 But seriously, the goal is to make a more detailed language reference, like the Rhino book for Javascript

16:20 Borkdude: like a C# in a Nutshell kind of book?

16:20 stuartsierra: dunno, never read those

16:25 Borkdude: Hmm, from Germany free shipping: 30,66 EUR for the book

16:25 Amazon.de

16:27 fdaoud: wow, here in Canada it's the equivalent of 23.21 EUR

16:27 underdev: that's like what $177 us dollars?

16:28 fdaoud: $41.41 USD

16:30 ,(if [] "hi")

16:30 clojurebot: "hi"

16:30 fdaoud: ruby: if [] "hi" end => "hi"

16:30 groovy: if ([]) { "hi" } => null

16:31 tomoj: I see $34.99 USD at apress and $31.49 at amazon

16:32 bozhidar: I don't generally like Apress books

16:32 and I was planning on skipping this one

16:32 stuartsierra: that's ok, I don't mind :)

16:32 fdaoud: tomoj: you're not comparing the right thing, at apress it's for the ebook. paper book = $49.99

16:32 bozhidar: but now that I know stuart is one of the authors

16:32 I'll definitely will buy it

16:32 :)

16:32 stuartsierra: Wow, thanks.

16:33 tomoj: fdaoud: ah I see

16:33 I think my team will probably be getting your book

16:33 bozhidar: I think that books written by those that have contributed to the community have the highest value

16:34 fdaoud: tomoj: don't you agree $34.99 for an ebook is exagerrated price

16:34 tomoj: we're forcibly bringing clojure to a few people I think :)

16:34 you mean $34.99 is too expensive?

16:34 seems reasonable to me..

16:34 LauJensen: cemerick: I've gone through your screencast now, and I'll admit, that was pretty slick

16:35 fdaoud: tomoj: too expensive for a PDF

16:36 tomoj: hmm, programming clojure is $21.00

16:36 it amazes me they make a profit at that price

16:37 bozhidar: tomoj: lower prices, higher volumes...

16:37 cemerick: LauJensen: tip of the iceberg :-)

16:37 bozhidar: since it's the only book about Clojure at the moment I guess it's still selling very good

16:46 div: LauJensen, which screencast ?

16:47 LauJensen: cemerick: got a link for div?

16:47 cemerick: div: http://muckandbrass.com/web/display/~cemerick/2010/03/25/Why+using+Maven+for+Clojure+builds+is+a+no-brainer

16:47 div: thanks

16:49 bozhidar: mentioning maven reminded me something

16:49 is it normal in a lein build to see every download attempted from every repo configured?

16:50 Downloading: org/apache/maven/maven-ant-tasks/2.0.10/maven-ant-tasks-2.0.10.jar from clojure

16:50 Downloading: org/apache/maven/maven-ant-tasks/2.0.10/maven-ant-tasks-2.0.10.jar from clojure-snapshots

16:50 Downloading: org/apache/maven/maven-ant-tasks/2.0.10/maven-ant-tasks-2.0.10.jar from clojars

16:50 Downloading: org/apache/maven/maven-ant-tasks/2.0.10/maven-ant-tasks-2.0.10.jar from central

16:50 in maven this certainly did not happen...

16:51 stuartsierra: I think it does happen in Maven actually

16:52 bozhidar: stuartsierra: not if you're repos are up and containing the artifact

16:53 I get this in the build for every artifact, otherwise I probably would have dismissed it

16:54 the artifacts are downloaded and everything works fine never-the-less, but it still seems that something is off

16:54 maybe I've spent far too much time with maven :)

16:54 cemerick: maven certainly keeps track of where snapshot artifacts came from, which saves it from checking other repos

16:55 trptcolin: stuartsierra: do you know if there's a discount for buying both the alpha version of your book and also the hard copy when it comes out?

16:55 stuartsierra: no idea

16:56 trptcolin: k, thanks

17:02 LauJensen: Isn't lein calling maven directly ?

17:07 cemerick: LauJensen: it's using its dependency resolution. Beyond that, I know nothing.

17:07 danlarkin: lein uses the "backend" maven java classes

17:09 LauJensen: k, thanks

18:16 digash: What is the "idiomatic enum" in Clojure?

18:16 rhickey: digash: a keyword?

18:18 digash: ahh, keywords can be namespaced in Clojure, sorry still stuck in CL mindset

18:26 one thing that is problematic with keywords as enums that compiler does not complain about typos

18:49 div: how would i go from (2 2 3 3 3 7) to ((2 2) (3 3 3) (7)) ?

18:50 it's okay to assume my list will be sorted

18:50 basically, i have a function that decomposes a number into its prime factors, but I need to know their exponents

19:00 tufflax: Why doesn't (.start (Thread. (fn [] (println "hello")))) print anything in emacs but (println "hello") does? :P

19:00 slyphon: anyone use the mock library?

19:05 div: tufflax, when you start a new thread it outputs to the *inferior-lisp* buffer

19:05 only the main repl thread outputs to the slime-repl buffer

19:06 tufflax: ok, can I change that so both of them output to the slime-repl buffer?

19:06 div: i'm sure you could, but I don't know how you would go about doing that.

19:07 I'm fairly new to messing around with clojure / emacs myself

19:07 tufflax: hm ok

19:07 btw, I don't have any *inferior-lisp* buffer open, how can I open one to see the output?

19:08 oh, i had one

19:08 div: if you do C-x C-b the inferior-lisp buffer is not ther ?

19:08 a right :)

19:08 tufflax: didn't show up in the manu though

19:08 menu

19:09 div: http://www.mail-archive.com/clojure@googlegroups.com/msg23270.html

19:09 tufflax: ok, off to google...

19:09 thank you

19:09 div: that may be a good starting point for redirecting output

19:09 tufflax: ok, will see

19:12 ah, much better :D

19:25 defn: 'lo all

19:26 tufflax: hello

21:29 TakeV: If I have a hash, and one of the values is a struct, and I want to access one of the members of the struct, is there an easy way to do that?

21:29 chouser: (-> myhash :avalue :amember)

21:30 TakeV: Ah, thank you.

21:30 dnolen: ,(doc get-in)

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

21:30 dnolen: works as well.

21:31 * TakeV nods

22:48 brandonw: without having to delve into maven too deeply, could anyone point me at a sample pom file for a java library? I am trying to put something up on clojars, but I want to make the pom file as accurate is possible, but it is hard without leiningen :)

22:49 mostly i'm curious about the <repositories> and <dependencies> elements

22:49 how they would be converted to java repos and java deps, and if that is even needed

22:50 cemerick: brandonw: clojure-contrib's pom is moderately simple: http://github.com/richhickey/clojure-contrib/blob/master/pom.xml

22:51 brandonw: awesome, thanks cemerick

22:51 cemerick: brandonw: clojure-maven-plugin is pure java and has a pile of dependencies, which might be helpful: http://github.com/talios/clojure-maven-plugin/blob/master/pom.xml

22:53 brandonw: okay, so if a java .jar has no deps other than java itself, then it doesn't need any repositories or deps specified, right?

22:54 or more clearly: if there are no deps specified, then there is no reason to include repos because it seems like repos purpose to direct maven on where to look for deps

22:56 cemerick: right

22:57 and, you don't need to declare repositories for central, or any repository that you can assume is declared in each user's local settings (this only applies to in-house stuff, and I'd go ahead and declare those internal repos anyway, or perhaps have them off in a parent pom)

23:00 brandonw: ah crap

23:01 i accidentally published the jar to the root package name instead of my user namespace on clojars

23:01 is it possible to delete a jar from your profile or something along those linse?

23:02 _ato: brandonw: bwapi-proxy?

23:03 brandonw: yes

23:03 i had just e-mailed the author of the project that i was going to publish it on my user namespace, then i went ahead and didn't modify the pom, heh

23:04 _ato: I'll remove it

23:04 brandonw: awesome, thanks :)

23:05 cemerick: brandonw: your "user namespace"?

23:05 brandonw: user group

23:05 whatever it is called, i can't remember i am a complete maven newbie :)

23:05 cemerick: are you referring to the project coordinates?

23:05 brandonw: the groupid i think it is called

23:05 cemerick: ok, right

23:05 brandonw: putting it in the scope of your user, instead of the root scope (where the project owner would typically publish it)

23:06 cemerick: not sure what you mean by scope either, but that's OK :-)

23:07 brandonw: less programming scope, more general definition of scope

23:07 cemerick: it's a little bit of an odd situation, as it's rare AFAIK for artifacts to be published by someone other than their maintainer

23:09 brandonw: yeah definitely

23:09 well

23:09 rare in very popular projects

23:10 and also rare when the repo you are publishing is primarily for a language that the original project was not designed specifically for

23:10 it seems to be fairly common to develop a clojure wrapper around a java library, and host the java library in a user groupid on clojars.org, just to give clojurians ease of access via leiningen

23:11 or whatever maven-compatible build tool one uses

23:12 cemerick: well, that's OK as long as the java lib isn't available elsewhere in maven-land. (not that I know what's in clojars well at all)

23:13 brandonw: right

23:15 are there a lot of public maven repos out there? i looked briefly, and all i saw was some people opining that that mvnrepository.com had too many hurdles to overcome in order to get something published to it

23:16 cemerick: yes, there are tons of 'em

23:17 central is certainly the largest, followed by apache and codehaus probably. There's some way to host a maven repo out of github and google code projects as well, or so I hear.

23:17 carkh: is it possible to browse the available clojars ?

23:18 cemerick: carkh: clojars.org/repo

23:18 carkh: ah ok thanks

23:18 there maybe should be a link to this from the main page

23:18 cemerick: brandonw: getting things into central is becoming easier and easier, especially if you're signing your poms and artifacts.

23:19 brandonw: cemerick: interesting. the library i am uploading to clojars is not in a complete enough form to be used as a library at the moment, so i don't think the maintainer(s) would mind if i upload it to clojars, but they are hosted on google-code, so i wonder if they have any plans to utilize the mvn repo feature

23:20 i should rephrase and say the version they are currently hosting on google code is not in an immediately usable library form

23:21 cemerick: brandonw: looks like the google code-as-maven-repo thing is a hack, but I've come across them fairly often: http://www.jroller.com/mrdon/entry/find_of_the_day_wagon

23:22 doseq: Does anyone know if contributor agreements can be faxed?

23:23 cemerick: doseq: I remember Rich required that I send mine snail-mail.

23:23 doseq: k, yeah I figured that was the case. Thanks.

23:24 What country are you in?

23:24 cemerick: US

23:24 doseq: Australia here :)

23:24 cemerick: So you should be all set by Thanksgiving! ;-)

23:27 doseq: I'll have to shell out for express delivery.

23:29 _ato: it took mine a month to arrive via regular snail mail (from Australia)

Logging service provided by n01se.net