#clojure logs

2010-04-05

00:00Licenserheh
00:00_atoso the first problem is how to figure out what the latest version is
00:01Licenser_ato: yes I can imagine that
00:01_atoGiven 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
00:01albinohaha, I thought mvn2 was a rewrite for the same reasons of mvn1
00:02_atoit's actually available here: http://clojars.org/repo/compojure/compojure/maven-metadata.xmlded. :-P [14:01]
00:02_ato<albino> haha, I thought mvn2 was a rewrite for the same reasons of mvn1
00:02_atoERC> it's actually available here:
00:02_atooops
00:02Licenseroi?
00:03_atohttp://clojars.org/repo/compojure/compojure/maven-metadata.xml
00:03technomancyLicenser: 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. =)
00:03Licensertechnomancy: hmm you wouldn't?
00:04Licenseractually which feature do you mean?
00:05technomancyI was thinking of rubygems-style "lein install $FOO"
00:06technomancyI wouldn't use it because I don't use any Clojure CLI tools
00:06technomancyand there just aren't that many because currently Clojure CLI integration is crap
00:06technomancybut if leiningen can write out shell wrappers then maybe people will create more of them
00:06Licenser*nods it is'
00:06Licenserah I see what you mean
00:12Licenserhmm hmm
00:15Licenser_ato: you have set up clojars?
00:19albinosomeone should beat the maven developers to an implementation of maven3 with clojure
00:19albinodrop it on their front door step
00:20_atoLicenser: yeah clojars is my neglected baby ;-)
00:20Licenseralbino: I don't think it is hard to find people wiling to beat the maven developpers for any reason :P
00:21Licenser_ato: then perhaps you can tell me, is there a way to fetch a list of files?
00:21chouserLicenser: http://clojars.org/repo/
00:22Licenserchouser: I found that :) I just hoped there is some kind (and I am ashamed to say that) xml file that lists the actual jars
00:23_atoLicenser: heh, well there's: rsync --list-only -a clojars.org::clojars
00:23_atothat's probably not what you had in mind though
00:23Licenser_alex: heh no not exactly
00:24_atowhat are you looking to use it for? for searching?
00:24Licenser_ato: I hoped for something that allows - exactly
00:24AntonyBlakeyalibino: 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
00:24Licenserand yes I know there is a web interface but it should be maven generic
00:25LicenserAntonyBlakey: i think I read your mail in the mailing list?
00:25_atoah, yeah there's no general way to list a maven repo as far as I know
00:25brian__noob question: (def f 1) , (def f (inc f)) , (prn f) , 2 f looks rather mutable to me, what am i missing?
00:25_atoit's unfortunate
00:25AntonyBlakeylicenser: probably
00:25LicenserAntonyBlakey: ah
00:26Licensersorry to say it :P it scared me ^^
00:26AntonyBlakeymvn -f project.clj
00:26AntonyBlakeythat's it
00:27AntonyBlakeyif you want to use more of maven (plugins etc) then it's hardly more effort
00:27LicenserI don't look for running something with maven but for a way to easiely find the right jar and install it
00:27Licensersadly I don't know maven :(
00:28somniumbrian__: 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
00:28AntonyBlakey I believe one of the IDEs has a 'find me this jar' or even 'find me this class' which will search maven repositories
00:29_atoEclipse appears to do it, I'm sure where its getting the list from though, it might be something the m2eclipse people are mainintaining
00:29brian__ok, but what happened to f? it doesnt seem to have everlasting life, and im having existensial doubbts
00:29Crowb4r_ato: netbeans does it as well.
00:29_atoaah
00:29_atoapparently Nexus has some API for it
00:30Licenser_ato hmm but if it is not general to maven it does not really help I think
00:30_atohttp://repository.sonatype.org/
00:30LicenserI mean if it only works on 'some' repos it isn't too helpfull
00:31_atoI guess it hits that
00:31Crowb4r_ato: you wrote clojars?
00:31_atoCrowb4r: yes
00:32Crowb4rgeesh, I feel like the lazy one around here.
00:32Licenserheh
00:33Crowb4reveryone active in here seems to have wrote something I use in clojure quite regularly. :p
00:33Licenserhmm question would be, I am sure we could make a clojars specific implemation that would work great but is that what we want?
00:34_atowell 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
00:34Licenserhmm but general would be nicer :P
00:35_atohmm, looks like you can just download their indexer and run it
00:35_atoI might give it a try
00:35Crowb4rLicenser: 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.
00:36Crowb4r_ato
00:36Crowb4runless he is not paying for bandwidth. :p
00:37Licenser:P well a central repo for clojure libs would be great
00:39_atobandwidth 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
00:39_atoand if it does grow that large then I'm sure there'd be plenty of companies willing to host it, so no big deal
00:40_atohttp://www.sonatype.com/people/2009/06/nexus-indexer-api-part-1/
00:40herm1tIs there an or-like form that treats empty strings as nil? (or "" "test") -> "test"
00:40Crowb4rDoes clojure have really any companies backing it?
00:40hiredmanthere is a method on String
00:41hiredman,(->> String .getMethods (map #(.getName %)))
00:41clojurebot("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
00:41Licenserhmm hmm
00:41Crowb4rhermit isempty?
00:42hiredman,(->> String .getMethods (map #(.getName %)) (filter #(.contains "mpty")))
00:42clojurebotjava.lang.IllegalArgumentException: Wrong number of args passed to: sandbox$eval--7763$fn
00:42hiredman,(->> String .getMethods (map #(.getName %)) (filter #(.contains % "mpty")))
00:42clojurebot("isEmpty")
00:42Licenser(empty? "")
00:42Licenser,(empty? "")
00:42clojurebottrue
00:43hiredman,(seq "")
00:43clojurebotnil
00:43Crowb4r,(empty
00:43clojurebotEOF while reading
00:43_ato,(first (remove empty? ["" nil "" "test"]))
00:43clojurebot"test"
00:43Crowb4roppd
00:43Crowb4ropps
00:44Crowb4r,(empty? " ")
00:44clojurebotfalse
00:44herm1tI 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.
00:44Licenserso generally the only universal way would be walking the entire repo and parsing http as I see it?
00:47Crowb4rSo, how many people here use clojure professionally?
00:48_atoah ha... http://repo1.maven.org/maven2/.index/nexus-maven-repository-index.gz
00:52Licenserhmm I have the feeling their index is huge
00:52_ato40 MB
00:54Licenseryea but that isn't a thing you can fetch often :P
00:54Licenserah it indexes all classes
00:55_atoit seems to be what m2eclipse uses
00:57Licenserbut seriousely every time someone querries for a jar
00:57_atonono, it caches it
00:57_atodownloads it once
00:58_atoI might replace clojars' dodgie search with this actually if it works well
00:58_atowish I'd looked into it earlier
00:58Licenserbut it is outdated once something new is pushed isn't it?
00:59_atoyeah, presumably it updates every now and then
01:00_atomight be better to use a web service for that reason
01:00Licenser*nods* well being able to search clojure libraries would be a huge improvement I think
01:01technomancyLicenser: speaking of search, you know about jarvana.com?
01:02Licensertechnomancy: nope
01:02technomancyit's just for maven central
01:02technomancybut it's pretty handy
01:02Licenserthat is kind of nice
01:03_atohmm nexus-maven-repository-index.gz for clojars is around 200 Kb.
01:04Licensertaht isn't that bad
01:04bmasonjarvana looks nice, just wish it supported more repos
01:28TakeVSo, Java arrays are faster than the default Clojure datastructures?
01:28TakeVdata structures*
01:29underdevTakeV: I've heard Rich Hickey say that it depends... but generally, probably yes
01:29underdevdepends on the usecase
01:30TakeVIs there a reason why?
01:30TakeVUnless you are using refs and you need the mutability, I guess...
01:31underdevi believe he said the reads were as good or better, the writes could be 4x slower
01:34TakeVAh, that makes a lot of sense.
01:37hiredmanjava arrays are as close to directly manipulating memory as you get on the jvm, of course they are faster
01:42TakeVHmm, so any game development should probably use the Java arrays.
01:55underdevso, a day in maven hell has really helped me understand and appreciate lein
01:55underdevproject.clj isn't a configuration file, it's a file containing a defproject macro, rt?
01:56underdevthe structure created by "lein new foo" is a maven convension
01:58underdevalso helped me make sense of swank-clojure, and how it works, and why its so damn handy\
01:59underdevvery cool ecosystem you got there, technomancy
02:07doseqtechnomancy made leiningan?
02:08doseqThanks! Although I wish it put things in a visible folder instead of some hidden .m2 thing.
02:09TakeVIs there a guide for using leiningan? Just put it in bin and do "lein compile"?
02:09doseqAs a Mac user I feel so dirty when programs use the unix standard file system.
02:09underdevi think its jochu who made swank-clojure and technomancy who made lein
02:10underdevi don't know, i'm just seeing his name all over both
02:10robinkunderdev: Correct
02:11robinkAlthough technomancy may now commit more to swank-clojure than jochu.
02:13underdevTakeV, lein i think suffers from a lack of docu.
02:13underdevi have a really good link though
02:13Crowb4rUFS!! AHHHHH
02:15underdevhttp://zef.me/2470/building-clojure-projects-with-leiningen
02:15_atohttp://github.com/technomancy/leiningen/blob/master/INTRO.md
02:16_atothere's also Sean's screencast: http://vimeo.com/8934942
02:16underdevjimminy crickets, where have you been all my life?!?!
02:17TakeVThanks.
02:17_atoand the readme contains a reference of the various commands and config options: http://github.com/technomancy/leiningen/blob/master/README.md
02:19underdevyou know what's great about me? my crappy attempts at helping seem to elicit worthwile help from others, if only out of frustration.
02:21underdevi try, but you can't fix stupid
02:24TakeVYou need emacs to use Lein? :\
02:24_atoTakeV: no
02:24TakeVHuh.
02:25_atothere's a lein plugin, lein swank for use with emacs, but you can use whatever editor you want
02:25_atolein just has a command-line interface
02:26underdevno, but the swank-clojurey goodness plays well with lein
02:26TakeVAh, alright.
02:26underdevand slime is amazing with swank-clojure
02:27TakeVYeah, though I couldn't ever get slime and swank-clojure to work.
02:27underdevoic
02:27TakeVI'm that guy who can't get anything to work. :P
02:28underdevi'm that ram that thinks he can butt a whole in a dam
02:29underdevit took me a loooong time to figure out the emacs stuff
02:29underdevbut soooo worth the effort
02:29tomojfor a normal clojure-only setup, it's supposed to be really easy now
02:29tomojno need to even edit .emacs
02:29TakeVYou'd think. >_>
02:30tomojTakeV: are you using something that resembles linux?
02:30doseqI know this is dickish but I will *never* use Emacs. I refuse, in the name of progress.
02:30tomojjust curious
02:30TakeVtomoj: Ubuntu.
02:30tomojstrange
02:31tomojshould work flawlessly
02:31underdev10 years of vim, i saw Lau's screencasts, and realized IM DOING IT WRONG
02:31TakeVKeeps saying that it can't find swank.
02:31_atoTakeV: do you have a file or directory ~/.clojure ?
02:31tomojunderdev: does lau do paredit wizardry in the screencasts, or what?
02:32underdevTakeV, yeah i'm on ubuntu. If care to, you might want to start by looking at the Emacs Starter Kit
02:32underdevit comes with elpa, and if you use the stuff in elpa together, it's pretty seemless
02:32TakeV_ato: Ah, no, I don't. I have clojure in ~/lib/clojure/clojure.
02:32tomojyou shouldn't have to put clojure anywhere
02:33_atook that's good
02:33underdeva few things... "i vill make a keyboard macro, and..."
02:33_atolast time I checked if you have something at ~/.clojure swank-clojure gets confused (for historical reasons it checks that)
02:33somniumvim doesnt have keyboard macros?
02:33TakeVEr, wait, I seem to have it...
02:34underdevvi is the one true editor. long live emacs.
02:35TakeVI like gedit. >_>
02:35TakeVActually, I kind of like that Eclipse plugin.
02:35underdevtomoj: but the paredit stuff is so great it makes me cry...
02:36tomoj:)
02:36underdevanyway, good night guys.
03:17LauJensenMorning crew
03:40doseqHi Lau :)
03:41doseqThanks for the blog links, I really enjoyed reading them.
03:44LauJensenGreat I'm glad to hear it :)
03:48hamzais it possible to remove a jar from clojars?
03:58_atohamza: 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
03:59LauJensen_ato: In that case you have a broken ClojureQL fork on there
03:59LauJensenWhich is also the only one which came up when I searched for ClojureQL, where clojars.org/clojureql (ours) might have been more appropriately
03:59LauJensenI also sent you a mail regarding this, but it bounced back after 8 days or so
04:00_atohttp://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
04:01_atoorg.clojars.snuxoll is the broken one?
04:01LauJensenI think so, it was a while since I tested
04:17phlaemhi, 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
04:17phlaemis there something I should have done before running the function? Because I am ending up in an endless loop
04:19mikemphlaem: if you just copied and pasted it from the website, it shouldn't do that. did you modify the code? check for typos?
04:20phlaemI have just copy/pasted yes and I used both the 1.1.0 binaries from the eclipse plugin binaries
04:20phlaemin both cases my repl is stuck and I don't get a result
04:21Chousukethere is an error in the example
04:21Chousukethe rest function calls should be calling next instead
04:22tomoj:(
04:22mikemChousuke: ah, good catch! in code I write I use rest and check with empty?
04:22Chousukeuse next
04:22Chousukeor check with (seq foo)
04:22Chousukeempty? is not very idiomatic
04:22tomojwhy did (seq foo) become idiomatic?
04:23Chousukebecause most clojure functions do it and because rhickey said so :P
04:23zmilabecause that was said by the Master
04:23tomojah
04:23tomoj:)
04:23Chousukeempty? itself is implemented as (not (seq x))
04:23tomojhah
04:27phlaemwhats the rest function good for anyway, if it's not returning the tail of the list?
04:28phlaembut it's working now thx :)
04:29mikemphlaem: the difference between rest and next is what they return for lists with only one element; next returns nil, rest returns ()
04:30Chousukerest also returns () for () :)
04:31Chousukewhich is why the example loops forever
04:31LauJensenBack 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?
04:31_atopartly it's historical (and that's probably the reason that example is wrong)
04:31Chousukeyeah
04:31Chousukerest used to do what next does now
04:31Chousukeit was changed to enable full laziness
04:32phlaem"<Chousuke> rest also returns () for () :)" I think that's a flaw
04:32somniumthe rest of nil is () too :)
04:32phlaemI would expect an exception in that case
04:32mikemLauJensen: you mean stuff them into one integer where bits 0-7 are R, 8-15 are G, etc?
04:32Chousukephlaem: it's by design
04:33Chousukephlaem: exceptions are icky
04:33LauJensenmikem: exactly
04:33LauJensenSo that I can pass it to a java.awt.Color. constructor, which takes such an int
04:33phlaemyes but I would rather fail hard, than loop forever
04:33Chousukephlaem: the loop is in your code, not in rest :)
04:34Chousukephlaem: anyway, rest returns a sequence of elements representing the tail of the sequence. if there are no elements, the sequence is simply empty
04:34phlaemyes, but rest enables it :(
04:34somniumis the only reason so we can cons onto a thunk without disturbing it?
04:34mikemLauJensen: here's some code I have which does something similar (4 bytes into one int): http://gist.github.com/356162
04:34Chousukephlaem: yes, but if you couldn't call rest on an empty thing, you would have to write special code to handle empty things
04:35LauJensenmikem: Thanks - Looks complicated :)
04:35phlaemwhich I have to do in the base case anyway?
04:35mikemLauJensen: byte-quad is a list, like (byte0 byte1 byte2 byte3)
04:35LauJensenmaybe I can turn it into a nice reducer
04:35_ato,(let [r 1, g 90, b 180] (-> r, (bit-or (bit-shift-left g 8)), (bit-or (bit-shift-left b 16))))
04:35clojurebot11819521
04:35_atomaybe somethin like that, might be backwards
04:36LauJensen,(let [r 255, g 2550, b 255] (-> r, (bit-or (bit-shift-left g 8)), (bit-or
04:36clojurebotEOF while reading
04:36Chousukephlaem: perhaps
04:36phlaemChousuke, I guess in non-recursive cases you are right, that would bloat the code
04:36LauJensen,(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))))
04:36clojurebot11819521
04:37ChousukeI think most things in Clojure are designed to throw as few exceptions as possible anyway
04:37LauJensen,(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))))
04:37clojurebot16777215
04:37LauJensen_ato: That should yield -1
04:37Chousukecalling first on an empty list is not an error either
04:37_atoLauJensen: eh? it's only 3 bytes though... an Integer is four bytes
04:38_ato,0xffffff
04:38clojurebot16777215
04:38LauJensen,(.getRGB (java.awt.Color/WHITE))
04:38clojurebot-1
04:38ChousukeLauJensen: it's probably padded with 0xFF for the last byte
04:38_ato,(.getRGB (java.awt.Color/BLACK))
04:38clojurebot-16777216
04:39LauJensenTrue
04:39LauJensen(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))))
04:39LauJensen,(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))))
04:39clojurebot0
04:39tomojthere's gotta be an easier way
04:40_ato,(.getRGB (java.awt.Color. 0 0 0))
04:40clojurebot-16777216
04:41LauJensen,(java.awt.Color. -16777216)
04:41clojurebot#<Color java.awt.Color[r=0,g=0,b=0]>
04:41tomojwhy not just use the int,int,int constructor?
04:41LauJensentomoj: I need to do some predicate testing, that'll be faster if I only have 1 int to test
04:41LauJensenThanks a lot _ato and mikem though
04:42tomojoh, this is the inner loop?
04:42tomojdrawing graphics or something?
04:42mikemLauJensen: i sure learned something :)
04:42LauJensentomoj: Yea
04:43LauJensenmikem: Me too - Havent done this stuff in 15 years, about the time when I presented a demo at 'The Party'
04: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))))
04:43clojurebot-1
04:43_ato^ if you need the padding
04:44LauJensenThanks!
04:46_atoThat's one of the few things that's much nicer when expressed in C: 0xff000000 | r | (g << 8) | (b << b)
04:46_atoerr.. that last b should be a 16 obviously ;-)
04:47_atothe lack of unsigned integers is also rather annoying for that sort of thing
04:49psykoticLauJensen: wow, The Party, that takes me back.
04:49psykoticLauJensen: i think last time i was there was in 96, it might have been the same year.
05:00doseqCan anyone translate this to make it clearer: (doc seq) => Returns a seq on the collection.
05:00doseqWhat does that actually mean?
05:02_atodoseq: http://clojure.org/sequences
05:03_atolet me know if that also doesn't make any sense ;-)
05:03doseqI just want clarification on the grammar of "on the collection".
05:04doseqBut thanks for the link... I don't really like the clojure.org docs.
05:05tomojdoseq: it means it's a seq which somehow gives the contents of the collection
05:05_atoa list is a seq it implements ISeq directly, so seq on a list returns the list
05:05tomojso for example
05:05tomoj,(seq {:foo 3 :bar 4})
05:05clojurebot([:foo 3] [:bar 4])
05:06_ato,(class (seq [1 2 3]))
05:06clojurebotclojure.lang.PersistentVector$ChunkedSeq
05:06tomojthat is a seq, it's "on" the map because it returns (sequentially) values from the map
05:06doseqSorry to bitch guys, I'm just so fed up with lazily written documentation that means nothing.
05:06doseq*deep breath*
05:06_atodoseq: Have you got the Programming Clojure book?
05:06tomojit's like you're attaching the sequential interface on top of the collection
05:07_atoif not, I higly recommend it
05:07tomojsince the seq just walks through the immutable content of the collection, I'd think
05:08doseqSo in that case "on the collection" means "by consuming the contents of the arguments and returning a 1-dimensional list"... is that about right?
05:09LauJensendoseq: yea, like it says "on the collection" :)
05:09doseqlol, OBVIOUS :D
05:10doseqYou 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?
05:10_atodoseq: not really. It's more like an iterator, it doesn't create a list.
05:11_atodocumentation patches are certainly welcome, you need to sign the contribtuors agreement though
05:11_atosee http://clojure.org/contributing
05:12doseqYup, 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.
05:13tomojI think that there is work being done on collaborative documentation which will become relevant
05:13_atoseq returns something that behaves like a cons-cell list, it's not necessarily an actual list
05:15doseqtomoj: something web-based you mean? Or the doc strings in the source itself.
05:16tomojuh, perhaps web-based at some point
05:17tomojthe 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
05:20doseqI'm just really interested in doing something helpful documentation-wise because the experience for newcomers could be better.
05:27psykoticdoseq: i feel you. the library documentation for clojure is awful.
05:28psykoticevery function should have a few examples. they could also double as tests.
05:30cemerickpsykotic: The documentation is generally pretty amazing, short of having examples. Have you seen the docs for other languages, even far more popular ones?
05:31doseqAs 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.
05:31psykoticcemerick: Python is pretty much my bar for documentation.
05:31doseqI see this circularity all over the place.
05:31cemerickpsykotic: I think clojure surpassed python's documentation quality long, long ago.
05:31psykoticyou are smoking crack
05:32cemerickwell argued. :-P
05:32kzarthe 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
05:32psykotickzar: what does that have to do with the official documentation?
05:33kzarnot a lot, just an anecdote I thought I'd share
05:33psykoticruby's is certainly much worse than clojure's but that's not much of a statement
05:33psykoticcemerick: look at the doc for reduce, for example.
05:34cemerick,(doc reduce)
05:34clojurebot"([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
05:34psykoticblock of text. you could convey the same thing better and much more concisely with a simple 'expression schematic' or an example.
05:35psykoticand reduce is among the better examples in that it's at least fairly complete, if not very well written
05:35doseqThis 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.
05:35cemerickpsykotic: 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.
05:36psykoticyou are an idiot
05:36cemerickI guess what I'm saying is, patches welcome. :-)
05:36psykoticbut that's okay
05:36cemerickpsykotic: this is a friendly channel. Keep it that way, please.
05:37psykoticthen keep your passive-aggressive "this isn't paint by numbers" shit in check.
05:38psykotici'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.
05:38cemerickpsykotic: 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.
05:39psykoticso, here's what i'm contributing.
05:39psykotici'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.
05:40doseqOk 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.
05:40psykoticif you give it the template (= (% (fn [x] (* x 2)) [1 2, 3]) [2 4 6]), it will return clojure.core/map
05:40psykoticand so on
05:41psykoticit uses a mix of white lists and black lists to handle pure/impure functions
05:41psykoticright now it works with everything in core and contrib
05:41psykoticit 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
05:42psykoticso, 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
05:42doseqpsykotic: so does that mean you can supply it with some answers and finds the question? Or am I misunderstanding it.
05:42psykoticyes
05:43doseqWow.
05:43psykoticit'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
05:43psykoticit works well in a language like clojure where most functions are side-effect-free.
05:43doseqLike a brute force thing.
05:43psykoticsure but we're talking about a few thousand candidates, it's no biggie.
05:44doseqSounds cool.
05:46psykotici 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.
05:53somniumpsykotic: 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.
05:54somniumpsykotic: any chance of getting a peek at the source in the near future?
05:56psykotici'm building it out to interface with my quickcheck-style contracts system, so it's in a state of disarray right now, but sure
05:56psykoticit isn't anything difficult though. most of the value is in the idea, not the implementation.
05:57somniumsure, its come up before, how to make a try_ruby for clojure. no one ever suggested brute forcing pure functions before afaicr
06:02ska2342Hi. If -> is the threading operator, is there already an established name for ->>?
06:02somniumIve 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)).
06:03somniumIt would be fun to experiment with that and an inference system
06:31kzarI 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?
06:31psykotickzar: it should be pretty painless if you install swank-clojure with ELPA.
06:32psykoticit's pretty much turn-key these days.
06:32psykotici use the adjective "pretty" advisedly, as i think there are still some issues with older versions of emacs.
06:33kzarpsykotic: Hmm that ELPA thing looks interesting, haven't heard of that before thanks
06:33kzarpsykotic: I'm using Emacs 23.1.1 so I should be alright I guess
06:33psykoticyeah, it's pretty neat, unfortunately it still doesn't have a whole lot of packages. their package submission process is pretty old school :)
06:33psykoticyup, it works great with 23
06:35kzarpsykotic: Sweet I like how ELPA installs, just eval a s-exp :D
06:36psykoticyeah, if a bit unsafe :)
06:37psykotic(it evals code over the network)
06:39kzarpsykotic: I'll trade being a bit unsafe for a week of my life not spent headbutting my computer
06:39psykotica trade-off well made
06:40psykoticthere's another thing called auto-install which install directly from emacswiki pages :)
06:40psykoticit 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 :)
06:41psykoticthe 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.
06:41psykotiche might as well require delivery by carrier pigeon at that point.
06:42kzarpyskotic: A slight irony in the one easy package installer being hard to install into
06:42psykoticbut i hear that's changing.
06:44kzarpsykotic: 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?
06:45psykotickzar: i believe you can just try to start swank and it will download the latest for you. yes, magic.
06:47kzarpsykotic: 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?
06:49psykotici 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).
06:50kzarpsykotic: Ah OK I'll figure it out I'm sure
06:50Gertmkzar: 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
06:51psykoticyeah, i'm looking at the source, it seems it wants to be "the" slime", rather than coexist.
06:52GertmI moved my emacs config to another name, rm -rf ~/.emacs.d/elpa, rm -rf ~/.slime, elpa install, then install swank-clojure through elpa
06:52Gertmthen it works :)
06:53Gertmhmm I just noticed I've got the habit of writing '-rf' instead of '-r'.. could be problematic in the future :o
06:55psykoticit's always fun when you insert a space and write ~/ .emacs.d/elpa instead :)
06:55Gertmheh
06:55kzarGertm: psykotic: Sweet OK, I'll brb because I've got to restart emacs
06:56Gertmoo rcirc, share you config will you :)
06:56Gertmyour*
06:58dm3how do you serve-file with compojure 0.4.0?
07:05kzarHmm so since I did that (package-install 'clojure-mode) and (package-install 'swank-clojure) both fail saying "Package x not available for installation" :/
07:06kzarMy IRC settings in my .emacs http://paste.lisp.org/display/97342
07:06Gertmthanks!
07:07kzarGertm: 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
07:07Gertmso I see :)
07:07Gertmit's nice and small
07:08kzarso if the ELPA thing fails you what's the next best option?
07:08Gertmdid you do 'M-x package-list-packages' ?
07:09Gertmthen enter that buffer and search for 'swank-clojure', press 'i' on it's line to mark it for installation
07:09Gertmthen hit 'x' to actually install
07:09Gertmafter that you should be able to do M-x slime
07:12kzarGertm: OK brb let me try this again
07:13avarI finally got swank-clojure / slime working with my .emacs without using the ELPA sillyness
07:33kzarSo 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.
07:33Gertmaha :)
07:34Gertmit's always a bit of a search
07:34kzarNow 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
07:34GertmI never installed lisp stuff through my package manager, neither will I with clojure
07:34Gertmhmm
07:34Gertmthat's strange
07:35kzarGertm: 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
07:35kzarGertm: I knew no Lisp when I did the Debian install for it so I probably did apt-get install slime at some point
07:36kzar(hmm maybe not 5 years, I'm not sure how many but quite a long time anyway heh)
07:41kzarGertm: Where does ELPA put the Clojure it grabs?
07:43Gertmkzar: I'm not sure, ~/.emacs.d/elpa/ or ~/.swank-clojure/
07:43GertmI think
07:43Gertm(I've only installed clojure and stuff yesterday, so I'm by no means an expert)
07:45kzarGertm: Yea you're right ~/.swank-clojure has it
07:46kzarbrb again
08:09patrkrisdoes 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"))
08:09patrkrisi get a nullpointerexception
08:09bobo_do you set it as visible?
08:10patrkrisno
08:10patrkrisit works fine if I do it from a leiningen REPL
08:10bobo_ah
08:17kzarGertm: phew I got it working
08:19kzarAgain 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
08:21kzarso 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
08:33LauJensen:q! emacs M-x slime (doto (JFrame.) .show)
09:06G0SUB,(re-seq (re-pattern "\bbar\b") "foo bar baz")
09:06clojurebotnil
09:06G0SUB,(re-seq #"\bbar\b" "foo bar baz")
09:06clojurebot("bar")
09:06G0SUBweird!
09:10_atonot so weird
09:10_ato,(re-seq (re-pattern "\\bbar\\b") "foo bar baz")
09:10clojurebot("bar")
09:12_ato,(first "\bbar\b")
09:12clojurebot\backspace
09:15chouser,(re-pattern "\\bbar\\b")
09:15clojurebot#"\bbar\b"
09:15chouser,(re-pattern "\bbar\b")
09:15clojurebot#"bar"
09:16chouserhm, it'd be nice if #"" didn't print unprintables like that.
09:16chousermy fault, I'm afraid. :-/
09:18_atowhat would it print instead?
09:19_atoif it printed #"\bbar\b" that would be very misleading ;-)
09:19_atosame with question marks or most other symbols
09:20_atospaces maybe
09:21chouser#"\010bar\010"
09:21Fossii like the utf blocks ;D
09:22_atoah.. of course
09:22chouseror maybe #"\x08bar\x08"
09:22_atoyeah, hex is nicer
09:23chouserand extends to the unicode \u0000 more coherently
09:23G0SUBmakes sense. thanks.
09:24G0SUB \\b it is, then.
09:24chouserG0SUB: why are you using re-pattern?
09:24chouser#"" is much nicer for regex than ""
09:24_atoG0SUB might be composing strings to make a regex?
09:25chouseryeah, sometimes an unforunte necessity.
09:25chouserunfortunate
09:25chouserthough sometimes you can get away with composing regex literals
09:27chouser,(re-pattern (str #"\b" (java.util.regex.Pattern/quote "bar") #"\b"))
09:27clojurebot#"\b\Qbar\E\b"
09:28_atonice
09:29chouseronly works if each #"" fragment is itself a complete and vaild regex though, so not always usable.
09:29chousercan't use #"(" and later #")" for example
09:31chouserhuh. java regex has a Printable group, but no matching predicate in Character
09:35G0SUB_ato, you got it right :)
09:35_atothe Printable group is ASCII only
09:35_atomight be why it's not in character
09:51licoresseIs there a metadata to use to mark a (def ...) as private?
09:52stuartsierrayes
09:52stuartsierra(def #^{:private true} foo ...)
09:52licoresseSo. do I get an exception if it is called outside the namespace it is defined?
09:53Fossiwhy would you?
09:53licoresseoh yes
09:53licoressean error from slime
09:53licoresseFossi: why make it private?
09:54Fossidon't know
09:54Fossii use def- and such a whole lot
09:54Fossidon't know what they do though
09:58maravillasis 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
09:59maravillasand 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
09:59underdevmaravillas: sounds sane to me
09:59ChousukeYou can just define private functions in the same namespace, it doesn't really matter
10:00Chousukebut optimally all functions in a single namespace should have the same "theme"
10:01maravillasyeah, 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:01underdevmaravillas: as a consumer i would really like that
10:02chouserI 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:02underdevmaravillas: and as a dev i'm adopting it.
10:04maravillashm...ok, thanks guys
10:05underdevit 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:05underdevfrom a consumers point of view
10:05underdevgood stuff maravillas
10:06maravillasyeah, that's probably a good call
10:07underdevand it would really clean up the testing
10:07licoresseusing map in doall to do sideeffects, is this kosher?
10:08licoresseit does not feel that way
10:08Chousukeprefer doseq
10:09licoresseok
10:09underdevoh, but the support lib ns wouldn't be included when a person use'd the core
10:09underdevi don't think
10:09underdevso you would have to doc that you would need both
10:10underdevi think
10:10chouserif ns C requires B and B requires A, then when C is loaded, A will be also
10:11underdevoic, never ran into it, but in a screencast (somewhat older) it mentioned that would NOT happen
10:11chouserhowever, 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:11underdevoic, yeah, i get it
10:12underdevbut the core *would* be access the lib, just not ns hosting the core
10:12underdevwhich is probably what you want anyway
10:13underdevthanks chouser
10:13chousersure.
10:14chouserfwiw, 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:17underdevi 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:17underdevit obfuscate that would be a bad thing
10:20doseqDo we call collection items "items", or elements?
10:21chouserdoseq: I think either is fine
10:21doseqI think I'll prefer items.
10:32RaynesI 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:33cemerickthose early logs are good readin' :-)
10:33chousercomplete newbie. "how do I run code?" right?
10:33somniumwhen was clojure first released?
10:33stuartsierrasomnium: First public release was in Fall 2007
10:34chouserRaynes: his logs are a copy of my logs. and of course my logs start when I first showed up here.
10:34chouserif anyone has any older logs, I'd be happy to integrate them.
10:34Rayneschouser: Indeed. It was the "how do I run code?"
10:35cemerickchouser: when did you move to a lower case 'C'?
10:35chousercemerick: oh, relatively recently, in the vague and unltimately vane hope it would help differentiate me from Chousuke
10:35chouservain
10:36cemerickhuh...and I thought you just didn't sleep.
10:36cemerick;-)
10:36ska2342somnium: I think one can consider http://sourceforge.net/mailarchive/forum.php?thread_name=7E06A48B-2A93-4FBD-ADA5-7C23D0F7B16D%40richhickey.com&amp;forum_name=foil-users to be the first public announcement :-)
10:36chousercemerick: :-)
10:36cemerickMan, 2/7/2008! :-P
10:37cemerickIt's funny how I waft over to that page every now and then.
10:39chouserit's intruiging to me long I was using clojure while still complaining about the syntax
10:39stuartsierraThe first thing every Lisp user does is complain about the syntax. It's a rite of passage.
10:39hiredmanpffft
10:40hiredmanthe syntax is beautiful
10:40somniumis there any benefit to the syntax other than macros? (compared to say, ML or Haskell)
10:41bsteubersomnium: uniform = less to learn, I think
10:42bsteuberI always got confused in haskell when I'm allowed to insert linebreaks or not
10:42underdevf* yeah
10:42underdeveverything else is noise now
10:44Rayneshiredman: Did you use a different nick before 2009-07-30?
10:44RaynesI can't seem to find your first appearance, unless this is actually it and you already knew Clojure when you joined the channel.
10:45hiredmanI think maybe november 08 should be my first appearance
10:46chouserhttp://clojure-log.n01se.net/date/2008-11-11.html " is this coljure swag, or libertarian swag?"
10:46hiredmanright
10:50doseqThe syntax makes more sense if you read a copy of the Lisp 1.5 Programmer's Manual.
10:51doseqThe 1.0 manual is good too but the 1.5 one is written to be more accessible.
10:51fogusdoseq: How so?
10:51doseqfogus: how does it make more sense?
10:53doseqThanks for your blog, btw, I enjoyed reading some of it the other day.
10:53fogusdoseq: Yes. Sorry I came to the conversation late, so I might have missed a point earlier
10:54doseqSomeone was just saying that it's common to question S-expression syntax.
10:55ska2342doseq: 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:55doseqOh, gotcha.
10:55doseqStill, it's a good book to read :)
10:56RaynesMorning, rhickey.
10:56rhickeyso if maps throw exceptions on duplicate keys, should sets as well?
10:56rhickeyRaynes: hi
10:57doseqI'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:58RaynesSets can be useful to filter duplicates.
10:59doseqrhickey: what would be the benefit of the exception?
10:59hiredmanwhy can't this just be simple
10:59hiredman:(
11:00ska2342rhickey: stupid question first: when exactly do maps throw?
11:00rhickeydoseq: 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:00fogusrhickey: yes.
11:00rhickeyska2342: they throw on my machine, at the moment
11:00doseqrhickey: thx.
11:00doseqhiredman: simple or easy, choose one :D
11:02ska2342,{:a 1 :b 2 :a 3}
11:02clojurebot{:a 1, :b 2, :a 3}
11:02Raynes,(->> "abcddefffgeeheff" (into #{}) (apply str))
11:02clojurebot"abcdefgh"
11:02doseqDoes 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:02rhickeyRaynes: we're not talking about into here, in either case
11:02hiredmandoseq: those are arg lists, not examples
11:03doseqhiredman: right, well notional examples.
11:03Raynesrhickey: I was confused about what you meant. I see.
11:03rhickeyRaynes: more about #{:a :b :c :b}
11:04doseqrhickey: I don't think it should throw an exception for keys if it doesn't for any other type.
11:04ska2342rhickey: 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:05rhickeynot just about reader syntax, also hash-set
11:06chouseryeah, 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:07ska2342anyway: consistency. I'm not sure what I'd expect from an apply hash-set ..., though.
11:08chouserthat's a good point -- maybe they should provide uniqueness instead of throwing
11:08chouserbah, gotta go.
11:09fogusI 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:10ska2342applying 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:17ska2342hng, 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:17fogusI 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:17S11001001well, a seq without duplicates where order doesn't matter is a set :)
11:18rhickeythere is the set fn
11:18rhickeyaargh, could someone please fix test so it doesn't always report exceptions at test_clojure.clj:77 ?
11:19hiredmanska2342: I imagine the step function returns a lazy-seq
11:20ska2342hiredman: it does.
11:20hiredmanso there you go
11:20fogusrhickey: 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:21ska2342hiredman: why? Do I have to reread the lazy stuff to see how it avoids blowing the stack?
11:21hiredmanska2342: lazy-seqs sort of flip the stack out sideways
11:22ska2342hiredman: sort of ... what?? ;-) what shall I read? LazySeq.java?
11:23hiredmanso normally in recursion without tco the stack grows down with each recursive call
11:24hiredmanin a lazy-seq those recursive calls are strung out as a datastructure
11:25hiredmannext gives you the next "recursive" call
11:25rhickeyok, explicit this, dupe checking on set and map keys up
11:27ska2342hiredman: 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:31Ankouhi, 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:31AnkouHowever, 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:31somniumska2342: 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:33ska2342I 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:37somniumska2342: yeah, in pseudo-clojure first call returns a thunk that holds {:first first-distinct-item :rest (fn [] (distinct xs...)) }
11:40licoressecode-coverage tools for clojure, anyone?
11:43cemerickthat's going to be a tough one
11:44maravillasnot 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:45licoresseLex 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:45licoressemaravillas: looking
11:45licoressehehe
11:45cemerickWe 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:46licoressethe same principle almost
11:54ska2342can someone elaborate on the fundamental difference between comp and ->
11:55hiredmancomp is a function, -> is a macro
11:56ska2342E.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:57somniumalso (-> x f g) => (g (f x)), ((comp f g) x) => (f (g x))
11:57Raynes$walton ->
11:57sexpbotRaynes: http://getclojure.org:8080/examples/-&gt;
11:57Raynesdefn: That stuff is extremely useful. I <3 you.
11:58cemerickmany people find -> easier to read, especially when there's java interop going on as well
12:01ska2342hm, 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:02cemerickyeah, -> and anon fns don't mix
12:02Raynes,(-> 1 (#(+ 2 %)))
12:02clojurebot3
12:03cemerickyeah, I wouldn't call that mixing well :-)
12:03somniumsome people even like (-> 1 ((partial + 2))) :p
12:03RaynesI do it quite a bit, actually. Not enough that I'd call it a problem.
12:03RaynesOnly for simple things.
12:04ska2342Being 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:04RaynesIt's more comfortable than )))))))))))))))))))0
12:05RaynesMinus that last zero there. :>
12:05ska2342Raynes: I happen to disagree, but nevermind
12:05ipostelnikusually, I use -> to avoid creating anon functions in the first place
12:05RaynesWell, fair enough. If that's your thing.
12:05ipostelnik,(-> 1 (+ 2))
12:05clojurebot3
12:06ska2342BTW (I asked this earlier) is there a common name for ->>?
12:06TakeV,(doc ->)
12:06clojurebot"([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:06ipostelnikI prefer to think of it is a pipeline operator
12:08ipostelnikas in "shell pipeline"
12:08ska2342ipostelnik: -> is threading and ->> is pipeline for you?? Or did I misunderstand?
12:12ipostelnikska2342, no I think of both of them as pipeline, just different order of arguments
12:13ipostelnikska2342, I rarely use ->>, when I have control over the method signature I generally design toward usability with ->
12:14ska2342ipostelnik: I don't use either of them, but for documentation purposes I'm looking for the *name* of ->>. -> is the "threading operator", but ->>?
12:14cemerickIt 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:15ipostelnik -> and ->> are both threading operators, the only difference is insertion point
12:16ska2342"tail threading op" (compare to tail recursion)?
12:44doseqI still don't get what ([x] [x form] [x form & more]) is actually saying.
12:45joshua-choidoseq: It's exactly like ([x & forms]), only it was separated into three probably just for optimization.
12:45doseqOh, so that space is an OR?
12:45stuartsierrayes
12:46doseqSo the space character means two different things.
12:47ska2342doseq: 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:48doseqOk so in order to read it you need to know what an arity-overloaded dfns looks like? I question that choice :)
12:49doseqBut thanks for the explanation, that helps.
12:50ipostelnikarity = number of args
12:50ipostelnika function can have different signatures based on the number of args
12:51doseqAm I right in reading it as: "(-> x) or (-> x form) or (-> x form [form ...])"
12:54ipostelnikyes
12:55div,(-> 1 (* 2) (+ 3) (* 2))
12:55clojurebot10
12:55fogusdoseq: It might be simpler just to think of it as (-> x [form...])
12:55doseqIndeed.
12:57doseqOh, 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:59ska2342doseq: some of them are generated, some are written in the functions metadata, IIRC
13:00doseqI'm writing all this up as part of a "Clojure for absolute beginners" type of thing.
13:12doseqIn this arg list, I can see that the ? means that something is optional, but how about the * and +?
13:12doseq([name doc-string? attr-map? [params*] body] [name doc-string? attr-map? ([params*] body) + attr-map?])
13:18thickeydoseq: I think the * means "one or more" and the + means "the previous form can be repeated"
13:18doseqThanks Tom.
13:19Fossii'd guess from regexs + is one or more, * is none or more
13:19doseqThat makes sense.
13:19ska2342params* in context of defn is obviously none or more :)
13:20thickeyyep
13:38slyphonanyone ever have a problem with inconsistent behavior between 'lein swank' and 'slime-connect' ?
13:38slyphonit seems like sometimes emacs gets into this state where it can't connect, but telnet can connect
13:40underdevslyphon: use it all the time, never had that problem
13:40slyphonhrm
13:40slyphonpoop
13:40slyphonthere too many possible things that could be wrong :/
13:40underdevslyphon: depending on the usecase, you can use swank-clojure-project
13:40underdevdoes that fail too?
13:41slyphonno, but i have a bunch of environment and java properties i need to set
13:41underdevoic
13:41slyphonyeah, i'll probably just try reinstalling emacs i guess
13:41slyphoncould be the particular port i'm using
13:41underdevOS?
13:41clojurebotmost horrible thing is http://tinyurl.com/b65o8e
13:41slyphonOS-X
13:42slyphonbut installed emacs w/ macports
13:42underdevgotcha
13:42underdevslyphon: are you using elpa?
13:42slyphonyeah
13:43underdevwhen people are pulling from HEAD from here and thar, stuff seems to break more
13:43underdevokay
13:44slyphonyes!
13:45slyphonpoor name choice
13:45slyphonor poor behavior
13:45underdevmy fault, but didn't realize wtf i've been doing wrong... :)
13:46underdevIT'S IN THERE! ITS RIGHT THERE!!!
13:46slyphonhahahahahah
13:51slyphontoo bad elpa cant install cedet
13:51slyphond
13:53tomoj,(contains? [1 2 3] 0)
13:53clojurebottrue
13:54fogusfogusbot> IllegalAssumptionException!
13:56SynrG,(contains? [1 2 3] 3)
13:56clojurebotfalse
13:56SynrGfun :)
13:56dakroneit's annoying that contains only works on maps
13:58tomojit works on other things too..
13:58dakronealright, thinks with k/v pairs
13:58dakrone*things
13:59chousermaps, sets and vectors -- everything Associative
13:59SynrG,(some (fn [x] (= x 0)) [1 2 3])
13:59clojurebotnil
13:59fogusdakrone: It works on vectors too. But the result is not what you're assuming it should be.
13:59chouser,(some #{0 3} [1 2 3])
13:59clojurebot3
13:59chouser,(contains? #{:a :b :c} :b)
13:59clojurebottrue
14:00dakroneyea, the whole point is that it's misleading for people who think it's going to do something else
14:00LauJensen,(contains? [1 2 3 3] 3)
14:00clojurebottrue
14:00hiredmanstrings too
14:00fogusdakrone: I think most here are sympathetic to what you're saying
14:00dakrone,(contains? [1 2] 2)
14:00clojurebotfalse
14:00dakroneis the big gotcha
14:01dakronefogus: yea, I shouldn't complain unless I'm suggesting a solution anyway :)
14:01chousersuggested solution: rename 'contains?' to 'has-key?'
14:01slyphonyes
14:02slyphonchouser++
14:02bsteuberor contains-key?
14:02slyphonbsteuber: that's *way* more typing!
14:02chouserthat suggestion isn't perfect, but I do think it's better than status-quo.
14:02LauJensen"kontains?" :)
14:02chouserbecause the statis is *not* quo.
14:03fdaoud,([1 2 3] 2)
14:03slyphonchouser: really? punning in latin?
14:03clojurebot3
14:03slyphonchouser: have you no shame?
14:03chouserslyphon: just quoting
14:03slyphon:)
14:03dakronechouser: I agree also
14:03fogus,(let [contains-but-not-the-way-that-you-think? contains?] (contains-but-not-the-way-that-you-think? [1 2 3] 0)
14:03clojurebotEOF while reading
14:04slyphoncontains-dwim!
14:04fogusYou get the point. (parens-fail)
14:04chouserhttp://www.youtube.com/watch?v=apEZpYnN_1g -- Dr Horrible's Sing Along Blog
14:04fdaoud,(doc contains?)
14:04clojurebot"([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:05fdaoudcan't say it's not doc'ed.
14:05fdaoud,(doc some)
14:05clojurebot"([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:08underdevwhat 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:09underdevnot complaining, 100% my bad, but docu doesn't make that obvious
14:10tomojit will not perform a linear search for a value
14:14brian__noob question -> user=> (def counter (let [count (ref 0)] #(dosync (alter count inc)))) ; user=> (counter)
14:14brian__1
14:14brian__@count
14:14brian__java.lang.ClassCastException
14:14dakronebrian__: you are declaring count as local only to the counter function
14:15brian__ok
14:15brian__thx
14:15chouseryour local 'count' is out of scope by the time you are back at the repl
14:15dakroneno problem, good luck
14:15chouserso you're trying to deref the builtin fn named 'count', hence the ClassCastException
14:15brian__yep
14:15brian__thx
14:25LauJensenWhats good about it cemerick ?
14:26cemerickMostly 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:27doseqhas-key? sounds cool. or key-in?
14:27LauJensenSounds cool
14:28LauJensencemerick: 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:28stuartsierrafogus: sounds painful
14:29fogusstuartsierra: I'm glad that I didn't have to explain that (oh so subtle) joke. ;-)
14:29stuartsierrafogus: good :)
14:32doseqNight all.
14:38rlbI 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:38rlbs/that,/that/
14:40rlbI'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:45chouserrlb: anyone can upload anything to clojars, I believe.
14:46chouserSo 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:47chouserThat 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:49cemerickLauJensen: "error keys"?
14:49chouser"arrow keys" I think
14:50LauJensencemerick: Arrows! :)
14:51fogusrhickey: 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:53cemerickLauJensen: I don't touch the mouse very often, no. I do use sexpr navigation a fair bit, but probably less than I could.
14:53cemerickI don't know what C-n, C-p, or M-v do, tho.
14:54LauJensenforward, backward, line above, next view (page down) etc
14:55The-KennyI use M-v and C-v a lot
14:56cemerickNo, I use mac-standard shortcuts for that.
14:56cemerickCmd- left, right, up, down, Option- for moving by "words", shift with either to select.
15:00rlbchouser: 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:01chouserrlb: 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:01rlbI 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:01chouserI have no idea about other maven repos
15:05rlbchouser: 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:07rlbIf 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:07cemerickcentral has some kind of keying requirement these days, though I'm not sure what practical impact that has.
15:07brian__noob question - is it possible to read/write a clojure data structure to disk?
15:07brian__outsde of a database/
15:08cemerickbrian__: prn and read will get you by if you're only using clojure data structures
15:08cemerickbeyond that, there's the undocumented-on-purpose print-dup
15:08brian__?
15:09brian__why is it undocumented/
15:09rlbIn 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:09cemerickbecause it's very much subject to future change.
15:09brian__ok
15:10rlbThough I'll probably poke at it a bit more...
15:12cemerickrlb: this seems relevant: http://www.sonatype.com/people/2010/01/nexus-oss-ecosystem/
15:21rlbcemerick: thanks
15:27divhow would i go about checking if an integer is a perfect square ?
15:27dive.g. 9 is a perfect square, but 8 isn't
15:28divif i (sqrt 8) i get a double, is there a predicate or something that checks if something is an integer
15:29chousersince doubles are inaccurate, I'd round to the nearest int, do int multiplication, then see if you're back where you started.
15:29chousermaybe there's a better way, but it seems like that should be accurate at least.
15:30rysjust check if the fractional part is zero?
15:31ztellman(= (Math/floor num) num)
15:32divyea, thx
15:32divthat will do it, i was expecting some kind of instanceof based predicate
15:32divso looking in the wrong direction :)
15:33chouser,(zero? (rem (Math/sqrt 10000000000000001) 1))
15:33clojurebotjava.lang.ExceptionInInitializerError
15:33chousereh. That's 'true' for me.
15:34chouser,(let [n 10000000000000001, i (Math/round (Math/sqrt n))] (= (* i i) n))
15:34clojurebotjava.lang.ExceptionInInitializerError
15:34chouserand that's false
15:38divhm
15:38divoverflow error ?
15:39Fareanyone wants to speak for the Boston Lisp Meeting?
15:39Farein June, July, August?
15:40wthiddenGiven some map M, with key K, what is wrong with: (get M K (throw (Throwable. (str "Key not found.")))) ?
15:41chouserwthidden: "get" is a function, so all args are evaluated before it's called.
15:41wthiddenArgh.... how sensible... thanks.
15:42chouseris it possible for M to have nil or false values?
15:42wthiddenno
15:42chouserok, then I'd suggest (or (M K) (throw ...))
15:43chouser'or' is a macro and won't evalutated expressions after if gets a "true" one
15:43wthiddenah simple and elegant, thanks chouser.
15:44wthiddenfor some reason i had it in my head get was a macro.
15:45wthiddeni should have swallowed what little ego I had/have an hour ago and asked for help.
15:46Fareor making stupid remarks.
15:47wthiddeni wish i was as smart as Fare
15:48wthiddenand it would be really cool if someone spoke about clojure again at the Boston Lisp meeting.
15:51Fareit would.
15:51Farecome 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:56LauJensenFare, are you paying travel expenses?
15:56FareUnhappily, this year's budget is 0.
15:56Fareso, no.
15:57Farebut I'm offering you beer.
15:57LauJensenHmm, so I'll have to weight a beer against about 2000 USD worth of plane tickets.. hmmm :)
15:57Crowbar7It must be a hell of a beer. :p
15:58stuartsierraYou could get me for the cost of train fare from NYC ;)
15:58LauJensenIf I did have business in the US I would be happy to hop aboard, but unfortunately I dont
15:58divmaybe it's a beer subscription
15:58underdevthe bad news: it's coors light. The good news: it's 6 metric tonnes of it.
16:00LauJensenFare: Dont miss stuarts offer, he gives good presentations as seen on Vimeo :)
16:04Farestuartsierra, I'll try to raise the fare. It's still like $200.
16:04stuartsierracheck dates first: when is this?
16:04Faresince you come from afar, it's pretty much whenever you want, starting in June
16:04LauJensenstuartsierra: remember, since I handled marketing, I'll be taking 20% - which means a little bit of walking for you :)
16:05Fareusually we meet on the last monday of the month, but you get to pick.
16:05Fare(I have speakers for April and May already)
16:05underdevthere's a clojure meetup in pittsburgh this wednesday; we'ld be happy to get a speaker!
16:10fdaoudstuartsierra: is it looking good for your book to come out mid-May?
16:13stuartsierrafdaoud: Hang on, are you in Boston with Fare?
16:13stuartsierraOh, the book.
16:13stuartsierraDunno. We're in copy-editing, but Luke still has a chapter to finish.
16:13fdaoudstuartsierra: no, I'm in Montreal
16:14fdaoudstuartsierra: thanks, sounds good
16:14tomojwait, you're writing a book too?
16:14stuartsierratomoj: yes, with Luke Vanderhart, for Apress
16:14fdaoudhttp://apress.com/book/view/1430272317
16:15fdaoudapress ebook prices are ridiculous. it's not normal that it's cheaper to get the paper book from Amazon (shipping included)
16:16Crowbar7I did exactly that
16:16Crowbar7it
16:16Crowbar7it's on pre-order
16:16fdaoudditto
16:17fdaoud43% off the list price
16:18BorkdudeIn what way will the book be different from Clojure in Action, The Joy of Clojure, Programming Clojure?
16:19BorkdudeAsked a question about it on SO: http://stackoverflow.com/questions/2578837/comparing-clojure-books
16:19stuartsierraLuke and I wrote it, so it will be different.
16:19stuartsierraBut seriously, the goal is to make a more detailed language reference, like the Rhino book for Javascript
16:20Borkdudelike a C# in a Nutshell kind of book?
16:20stuartsierradunno, never read those
16:25BorkdudeHmm, from Germany free shipping: 30,66 EUR for the book
16:25BorkdudeAmazon.de
16:27fdaoudwow, here in Canada it's the equivalent of 23.21 EUR
16:27underdevthat's like what $177 us dollars?
16:28fdaoud$41.41 USD
16:30fdaoud,(if [] "hi")
16:30clojurebot"hi"
16:30fdaoudruby: if [] "hi" end => "hi"
16:30fdaoudgroovy: if ([]) { "hi" } => null
16:31tomojI see $34.99 USD at apress and $31.49 at amazon
16:32bozhidarI don't generally like Apress books
16:32bozhidarand I was planning on skipping this one
16:32stuartsierrathat's ok, I don't mind :)
16:32fdaoudtomoj: you're not comparing the right thing, at apress it's for the ebook. paper book = $49.99
16:32bozhidarbut now that I know stuart is one of the authors
16:32bozhidarI'll definitely will buy it
16:32bozhidar:)
16:32stuartsierraWow, thanks.
16:33tomojfdaoud: ah I see
16:33tomojI think my team will probably be getting your book
16:33bozhidarI think that books written by those that have contributed to the community have the highest value
16:34fdaoudtomoj: don't you agree $34.99 for an ebook is exagerrated price
16:34tomojwe're forcibly bringing clojure to a few people I think :)
16:34tomojyou mean $34.99 is too expensive?
16:34tomojseems reasonable to me..
16:34LauJensencemerick: I've gone through your screencast now, and I'll admit, that was pretty slick
16:35fdaoudtomoj: too expensive for a PDF
16:36tomojhmm, programming clojure is $21.00
16:36tomojit amazes me they make a profit at that price
16:37bozhidartomoj: lower prices, higher volumes...
16:37cemerickLauJensen: tip of the iceberg :-)
16:37bozhidarsince it's the only book about Clojure at the moment I guess it's still selling very good
16:46divLauJensen, which screencast ?
16:47LauJensencemerick: got a link for div?
16:47cemerickdiv: http://muckandbrass.com/web/display/~cemerick/2010/03/25/Why+using+Maven+for+Clojure+builds+is+a+no-brainer
16:47divthanks
16:49bozhidarmentioning maven reminded me something
16:49bozhidaris it normal in a lein build to see every download attempted from every repo configured?
16:50bozhidarDownloading: org/apache/maven/maven-ant-tasks/2.0.10/maven-ant-tasks-2.0.10.jar from clojure
16:50bozhidarDownloading: org/apache/maven/maven-ant-tasks/2.0.10/maven-ant-tasks-2.0.10.jar from clojure-snapshots
16:50bozhidarDownloading: org/apache/maven/maven-ant-tasks/2.0.10/maven-ant-tasks-2.0.10.jar from clojars
16:50bozhidarDownloading: org/apache/maven/maven-ant-tasks/2.0.10/maven-ant-tasks-2.0.10.jar from central
16:50bozhidarin maven this certainly did not happen...
16:51stuartsierraI think it does happen in Maven actually
16:52bozhidarstuartsierra: not if you're repos are up and containing the artifact
16:53bozhidarI get this in the build for every artifact, otherwise I probably would have dismissed it
16:54bozhidarthe artifacts are downloaded and everything works fine never-the-less, but it still seems that something is off
16:54bozhidarmaybe I've spent far too much time with maven :)
16:54cemerickmaven certainly keeps track of where snapshot artifacts came from, which saves it from checking other repos
16:55trptcolinstuartsierra: 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:55stuartsierrano idea
16:56trptcolink, thanks
17:02LauJensenIsn't lein calling maven directly ?
17:07cemerickLauJensen: it's using its dependency resolution. Beyond that, I know nothing.
17:07danlarkinlein uses the "backend" maven java classes
17:09LauJensenk, thanks
18:16digashWhat is the "idiomatic enum" in Clojure?
18:16rhickeydigash: a keyword?
18:18digashahh, keywords can be namespaced in Clojure, sorry still stuck in CL mindset
18:26digashone thing that is problematic with keywords as enums that compiler does not complain about typos
18:49divhow would i go from (2 2 3 3 3 7) to ((2 2) (3 3 3) (7)) ?
18:50divit's okay to assume my list will be sorted
18:50divbasically, i have a function that decomposes a number into its prime factors, but I need to know their exponents
19:00tufflaxWhy doesn't (.start (Thread. (fn [] (println "hello")))) print anything in emacs but (println "hello") does? :P
19:00slyphonanyone use the mock library?
19:05divtufflax, when you start a new thread it outputs to the *inferior-lisp* buffer
19:05divonly the main repl thread outputs to the slime-repl buffer
19:06tufflaxok, can I change that so both of them output to the slime-repl buffer?
19:06divi'm sure you could, but I don't know how you would go about doing that.
19:07divI'm fairly new to messing around with clojure / emacs myself
19:07tufflaxhm ok
19:07tufflaxbtw, I don't have any *inferior-lisp* buffer open, how can I open one to see the output?
19:08tufflaxoh, i had one
19:08divif you do C-x C-b the inferior-lisp buffer is not ther ?
19:08diva right :)
19:08tufflaxdidn't show up in the manu though
19:08tufflaxmenu
19:09divhttp://www.mail-archive.com/clojure@googlegroups.com/msg23270.html
19:09tufflaxok, off to google...
19:09tufflaxthank you
19:09divthat may be a good starting point for redirecting output
19:09tufflaxok, will see
19:12tufflaxah, much better :D
19:25defn'lo all
19:26tufflaxhello
21:29TakeVIf 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:29chouser(-> myhash :avalue :amember)
21:30TakeVAh, thank you.
21:30dnolen,(doc get-in)
21:30clojurebot"([m ks]); returns the value in a nested associative structure, where ks is a sequence of keys"
21:30dnolenworks as well.
22:48brandonwwithout 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:49brandonwmostly i'm curious about the <repositories> and <dependencies> elements
22:49brandonwhow they would be converted to java repos and java deps, and if that is even needed
22:50cemerickbrandonw: clojure-contrib's pom is moderately simple: http://github.com/richhickey/clojure-contrib/blob/master/pom.xml
22:51brandonwawesome, thanks cemerick
22:51cemerickbrandonw: 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:53brandonwokay, so if a java .jar has no deps other than java itself, then it doesn't need any repositories or deps specified, right?
22:54brandonwor 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:56cemerickright
22:57cemerickand, 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:00brandonwah crap
23:01brandonwi accidentally published the jar to the root package name instead of my user namespace on clojars
23:01brandonwis it possible to delete a jar from your profile or something along those linse?
23:02_atobrandonw: bwapi-proxy?
23:03brandonwyes
23:03brandonwi 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_atoI'll remove it
23:04brandonwawesome, thanks :)
23:05cemerickbrandonw: your "user namespace"?
23:05brandonwuser group
23:05brandonwwhatever it is called, i can't remember i am a complete maven newbie :)
23:05cemerickare you referring to the project coordinates?
23:05brandonwthe groupid i think it is called
23:05cemerickok, right
23:05brandonwputting it in the scope of your user, instead of the root scope (where the project owner would typically publish it)
23:06cemericknot sure what you mean by scope either, but that's OK :-)
23:07brandonwless programming scope, more general definition of scope
23:07cemerickit'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:09brandonwyeah definitely
23:09brandonwwell
23:09brandonwrare in very popular projects
23:10brandonwand also rare when the repo you are publishing is primarily for a language that the original project was not designed specifically for
23:10brandonwit 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:11brandonwor whatever maven-compatible build tool one uses
23:12cemerickwell, 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:13brandonwright
23:15brandonware 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:16cemerickyes, there are tons of 'em
23:17cemerickcentral 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:17carkhis it possible to browse the available clojars ?
23:18cemerickcarkh: clojars.org/repo
23:18carkhah ok thanks
23:18carkhthere maybe should be a link to this from the main page
23:18cemerickbrandonw: getting things into central is becoming easier and easier, especially if you're signing your poms and artifacts.
23:19brandonwcemerick: 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:20brandonwi should rephrase and say the version they are currently hosting on google code is not in an immediately usable library form
23:21cemerickbrandonw: 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:22doseqDoes anyone know if contributor agreements can be faxed?
23:23cemerickdoseq: I remember Rich required that I send mine snail-mail.
23:23doseqk, yeah I figured that was the case. Thanks.
23:24doseqWhat country are you in?
23:24cemerickUS
23:24doseqAustralia here :)
23:24cemerickSo you should be all set by Thanksgiving! ;-)
23:27doseqI'll have to shell out for express delivery.
23:29_atoit took mine a month to arrive via regular snail mail (from Australia)