#clojure logs

2010-10-01

00:00hiredmanI started working on getting it easier to run but, uh, haven't gotten anywhere with it
00:01hiredmanthe way I run it is from a repl (require 'hiredman.clojurebot)
00:02amalloyheh, i meant a sarcasm highlight; getting clojurebot running is too ambitious for me
00:02amalloyi just want to learn how to play with him better
00:03amalloyso far i've found *dispatchers*. i can't be that far from finding out what commands he accepts
00:04hiredmanthe commands all live inside files in src/hiredman/clojurebot/
00:04amalloyyeah, i'm seeing that
00:04hiredman~scala 1+1
00:04amalloyslight bug at line 269 of core.clj, btw
00:04amalloyclojurebot: how much do you knot?
00:04clojurebotI know 638 things
00:05hiredmanoh, hah
00:05hiredmanwell
00:07amalloyi'm not sure i get the regex at 270 either
00:07amalloy(5+10)
00:08amalloyclojurebot: (5+10)
00:08clojurebotexcusez-moi
00:08amalloyanyway, thanks. i'll clone it and look around for add-dispatch-hook
00:09amalloyclojurebot: (5 + 10)
00:09clojurebot5 (for large values of 2)
00:25TeXnomancyhiredman: what kind of stuff did you get working in the subclassloader?
00:26TeXnomancythis is what I get testing clojure-http-client: http://p.hagelb.org/subclassloader-test-http.html
00:26TeXnomancyprobably not a great test as it involves a lot of contrib stuff I guess
00:29hiredmanjust the lein tests I guess
00:30TeXnomancyI added in a (.printStackTrace t) in the catch in eval-in-project and now I get java.lang.ClassNotFoundException: clojure.test
00:31hiredmanhuh
00:31TeXnomancyalso: is there a reason you set the bootclasspath of the subclassloader to the same value as the parent?
00:31hiredmanmaybe I should go back to the drawing board
00:31TeXnomancyseems like that could cause issues with clojure version mismatches
00:32hiredmanuh, are you putting clojure on the bootclasspath?
00:32TeXnomancyyeah, to speed JVM boot
00:32hiredmanit's because those are the classes used to boot the jvm, so presumably they are needed
00:33cais2002clojurebot: lunch time now
00:33clojurebotwhat time is it?
00:33TeXnomancyhiredman: oh... right; that's a quirk of Apple's repackaging of the JVM
00:33hiredmanI would think that sax parser is in a jar somewhere on the bootclasspath
00:33cais2002clojurebot: lunch time
00:33clojurebotexecution timeout is 10 seconds
00:34cais2002clojurebot: that's too short for most human
00:34clojurebotTitim gan éirí ort.
00:34TeXnomancyhiredman: actually the sax exception was what I got with some screwing around of my own; if I reset back to what you had then I get clojure.test not found in lein's tests as well as clojure-http-client
00:35TeXnomancyif I drop the bootclasspath I get the sax exception in http but not in lein
00:35TeXnomancyprobably because of contrib usage in the former
00:35TeXnomancyso we probably want to set the bootclasspath to everything except clojure
00:37TeXnomancyhmm; didn't realize the bootclasspath was so heavily populated
00:38TeXnomancyI don't remember quite what the quirk was with OS X's bootclasspath, but there were some issues about aqua gui stuff failing somehow related to the bootclasspath
00:38TeXnomancydan might remember
00:39TeXnomancyhiredman: also: what's with the pr-str/read-string roundtrip?
00:40hiredmanjava.lang.IllegalAccessError: class sun.reflect.GeneratedMethodAccessor9 cannot access its superclass sun.reflect.MethodAccessorImpl (lancet.clj:118)
00:40hiredmanfun
00:40hiredmanTeXnomancy: because inside the classloader the classes for things that are not java.* should be "different"
00:41TeXnomancygotcha
00:41hiredmanputting in a require of clojure.test got rid of the classnotfoundexception
00:43TeXnomancyhiredman: oh duh... the old version uses clojure.main -i @clojure/test.clj
00:43TeXnomancywhich obviously won't work here
00:43hiredmanah, well
00:47TeXnomancybugger; because everything's wrapped in a binding we can't rely on the special-casing of top-level do where you can require and use a var in the same form =\
00:47TeXnomancyweak sauce special case
00:50scottjIf you want some code to run only when your app is first started, not whenever you reload your code (interactive dev), is there a better way than (defvar run-on-start-only (do ....)) ?
00:50hiredmansun. may need to be added to list of classes allowed through
00:51TeXnomancyprogress; getting java.lang.IllegalAccessError: class sun.reflect.GeneratedMethodAccessor10 cannot access its superclass sun.reflect.MethodAccessorImpl, compiling:(NO_SOURCE_FILE:0)
00:51TeXnomancyscottj: defonce is my weapon-of-choice for that
00:51TeXnomancyhiredman: pushed updated classloader branch
00:52hiredmanexpected: nil actual: java.lang.LinkageError: loader constraint violation: when resolving method "clojure.core$memoize$fn__4542.<init>(Lclojure/lang/IPersistentMap;Ljava/lang/Object;Ljava/la
00:52hiredmanng/Object;)V" the class loader (instance of java/net/URLClassLoader) of the current class, clojure/core$memoize, and the class loader (instance of <bootloader>) for resolved clas
00:52hiredmanwhoops
00:52hiredmanok
00:52hiredmanwill take a look
00:52TeXnomancyended up taking advantage of the do trick by taking an optional init form for eval-in-project
00:53TeXnomancy"the do trick" being what Laurent described in the "Evaling forms that require" thread on the mailing list
00:53TeXnomancywhich I am tempted to call "The Steve Gilardi problem" but will not. =)
00:55hiredman"The Gilardi Senario"
00:58TeXnomancythat's actually much better
01:00hiredmanugh, so what I think is happen is clojure's reflector is trying to reflect on a class via java's reflection, but java's reflection knows nothing about it because it's not visible
01:00hiredmanhappening
01:00hiredmanthat may nix the whole dog and pony show
01:01TeXnomancynot the ponies!
01:11TeXnomancymaybe I should start paying attention to what people are saying about osgi
01:12TeXnomancybut I can't really make head or tail of anything I've read about osgi... not even sure what it is.
01:12TeXnomancykinda like asdf
01:12duncanmhmm
01:12duncanmla la la
01:13duncanmi'm looking into the combinatorics package, but i'm looking for a way to get all 'cycles' of a sequence
01:14duncanmlike, [0 1 2 3] could be [0 1 2 3] [1 2 3 0] [2 3 0 1] [3 0 1 2]
01:14TeXnomancywhen I read about OSGi it's kind of like the last panel of http://achewood.com/index.php?date=08022002
01:17TeXnomancyduncanm: worst possible way: (set (repeatedly 1000 #(shuffle [0 1 2 3])))
01:17TeXnomancythanks, I'll be here all week
01:18amalloy,(let [list [0 1 2 3]] (map #(take 4 %) (take 4 (iterate #(drop 1) list))))
01:18clojurebotjava.lang.RuntimeException: java.lang.RuntimeException: java.lang.IllegalArgumentException: Wrong number of args (1) passed to: sandbox$eval8345$fn
01:18amalloygrr
01:19amalloy,(let [list [0 1 2 3]] (map #(take 4 %) (take 4 (iterate #(drop 1 %) (cycle list)))))
01:19clojurebot((0 1 2 3) (1 2 3 0) (2 3 0 1) (3 0 1 2))
01:19duncanmhere's a way
01:19duncanm(defn all-cycles [s] (for [i (count s)] (take (count s) (drop i (cycle s)))))
01:20TeXnomancymine's shorter
01:20amalloyhah
01:20duncanmamalloy: mine's similar to yours, but i think it's a bit simpler?
01:20amalloyduncanm: your way is better
01:21amalloyi always forget that (for) exists
01:21TeXnomancyyou want (range s), not (count s)
01:21duncanmTeXnomancy: oh right
01:21TeXnomancyerr--(range (count s))
01:22TeXnomancyclojurebot: for?
01:22clojurebotfor is not a loop
01:22amalloyer what? i think he's assuming s is a seq
01:22TeXnomancyclojurebot: I thought for was underused.
01:22clojurebotNo entiendo
01:22TeXnomancyclojurebot: your dumb
01:22clojurebotExcuse me?
01:22amalloyclojurebot: (5 + 8)
01:22clojurebotPardon?
01:22TeXnomancyjust kidding!
01:23amalloyaw man. he gave the best answer ever earlier
01:24TeXnomancyclojurebot: the best knock-knock joke is <reply>Oh, I know the best knock-knock joke! It goes like this... OK, you go first:
01:24clojurebotIn Ordnung
01:38ashleywHi, can somebody help me with this please: http://pastie.org/1192755 I've tried to :exclude (spit) to no avail. What am I doing wrong?
01:40ossarehashleyw: use require instead.
01:43ashleywossareh: thanks!
01:45ossareh:-3 )
02:01lenwmorning all - just looking for some advice - need to persist stuff to a db and not entirely keen on doing all the low level sql - contrib sql style - is clj-record a good alternative or is there something better ?
02:04ashleywEverything seems to be in order (as per the duck-streams api), but I'm getting an error on this: http://pastie.org/1192776
02:06raekashleyw: for prefix lists, use parentheses
02:06raekyou also need to use :use, if you want to use reader without namespace qualification
02:07raeksince 1.2, much of the duck-streams features has been moved to clojure.java.io
02:07raekhttp://clojure.github.com/clojure/clojure.java.io-api.html
02:08raek:require only loads the lib, but do not "refer" it. (i.e. you still need to call the functions with the full namespace: clojure.contrib.duck-streams/reader)
02:10raek(ns server.core (:gen-class) (:use (clojure.contrib server-socket duck-streams)))
02:11raekalso, there should be parenthesis around the use :use ... things
02:11ashleywOkay, but see above to my question 30 mins ago, how do I refer to the lib without having that conflict error?
02:11raekyou should only get a warning
02:12raekbut the answer is: use clojure.java.io instead
02:12raekspit has moved into core, reader has moved into clojure.java.io
02:13raekbut if you really want to use c.c.duck-streams, (:use (clojure.contrib server-socket [duck-streams :only [reader]])) is more ideomatic
02:14ashleywor :only [reader writer]?
02:14ashleywor :only (reader writer)
02:14raekexclude is used in the same way
02:15raekhrm, maybe the round parens are actually more ideomatic there
02:15raekboth works, I think, but the latter is what clojure.org/libs uses
02:16raekso you should probably go for that
02:19ashleywthanks, everything works now :D Also could you have a quick look at this please and tell me if I've got anything seriously wrong syntax-wise: http://pastie.org/1192791
02:20ashleyw(it's the first thing I've written totally on my own…)
02:36raekashleyw: looks good :)
02:37sandGorgonashleyw, I think apply should be changed to reduce to be more idiomatic. in this case + is a special case that can consume any number of arguments, so it doesnt matter. so (apply + (1 2 3 4 5)) is (+ 1 2 3 4 5). But if you had a function that could ONLY consume two arguments then reduce would give u the equivalent of (+(+(+ (+ 1 2)3)4)5)
02:37raekyou might want to look at 'for' as a replacement for 'map' + anon fn
02:39LauJensenGood morning! :)
02:43sandGorgon.
02:44lypanovwazzzup LauJensen
02:46ashleywraek + sandGorgon: thanks. Reduce definitely seems to be the better option as you said sandGorgon. :)
02:53ashleywsandGorgon: so like this? http://pastie.org/1192824
02:59LauJensenAh, Euler detected
02:59LauJensenashleyw: That looks like proper use of reduce
03:00LauJensen(reduce + (filter #(or (zero? (mod % 5)) (zero? (mod % 3))) (range 10)))
03:01LauJensenI think something like is also worth considering, because it expresses the nature of the problem clearly, you have a list, you need a subset, then the sum
03:01LauJensenBut its a matter of taste, both reads naturally
03:04ashleywCool. But what's happening with (mod % 5), where's it getting the % from?
03:05LauJensen#() takes an argument called %
03:05LauJensenIts just syntactic sugar
03:06ashleywAh...where can I find more info on #()?
03:06LauJensen#() = (fn [%] ())
03:07ashleywThat simple, huh, cool :)
03:19hsaliakhi , does anyone know if remvee's clj-android is still up to date and working? The reason I ask is that the github page still asks people to use the fork of clojure when 1.2 now works perfectly fine on eclair and froyo
03:36AWizzArdMoin moin
03:44esjallo
03:53scottjanother month, another arch screenshot thread. included some clojure promo material in mine: https://bbs.archlinux.org/viewtopic.php?pid=834004#p834004
04:08zmila,(map #([%]) (range 3))
04:08clojurebotjava.lang.IllegalArgumentException: Wrong number of args (0) passed to: PersistentVector
04:09zmila,(map (fn [x] [x]) (range 3)
04:09clojurebotEOF while reading
04:09zmila,(map (fn [x] [x]) (range 3))
04:09clojurebot([0] [1] [2])
04:09bartjzmila, you are missing an argument
04:09bartjzmila, you can type faster than me :)
04:09bartjzmila, gah, I meant a paren
04:09zmilacopy-pasting not typing :)
04:10zmilai wonder, why i can't use #([%]) in map
04:12bartj, (map #(conj [] %) (range 3))
04:12clojurebot([0] [1] [2])
04:12scottjbc (fn [x] [x]) != #([%]), it equals #(vector %)
04:14AWizzArdzmila: it gets translated from (map #([%]) (range 5)) into (map (fn [x] ([x])) (range 5))
04:14AWizzArdYou try to call the function [%]
04:15AWizzArdClojures vectors *can* be called, but this is a different issue, and not what you want.
04:15AWizzArdyou want:
04:15AWizzArd,(map vector (range 5))
04:15clojurebot([0] [1] [2] [3] [4])
04:15zmila,(map #(vector %) (range 3))
04:15clojurebot([0] [1] [2])
04:16zmilaoh, yes! even simpler ^)
04:16AWizzArdthe #() is not needed, you can directly pass in the fn itself
04:16zmilai see
04:16zmila
04:16zmilathx
04:16AWizzArd,(map vector (range 5) [10 20 30 40])
04:16clojurebot([0 10] [1 20] [2 30] [3 40])
04:34lypanovwhats the "richest" web thingy for clojure?
04:34lypanovi'm used to rails.
04:34scottjconjure
04:35scottjcompojure/ring/moustache are more popular, but they're sinatra like
04:46lypanovscottj: know of anything mustache like?
04:47lypanov(for templating)
04:47lypanovah
04:47lypanovignore. enlive is better.
04:48raekenlive rocks.
04:48bobo_indeed
04:48raekRing + Moustache + Enlive is my favourite combo
04:49AWizzArdSo, you want to generate html?
04:49lypanovraek: thats what i'm looking at also
04:49lypanovraek: are there any tuts on that combo?
04:51raekwell, there's this http://github.com/swannodette/enlive-tutorial and the ones by LauJensen on http://www.bestinclass.dk/blog.html
04:51raekI like Moustache because it is easy to compose routes in an hierarchial way
04:53raekalso, http://moustache.cgrand.net/syntax.html is neat
04:54esjyes, its very tidy indeed.
04:54raekit is a library with very clear boundaries
05:02_na_ka_na_,(get {(long 15} :found} 15)
05:02clojurebotUnmatched delimiter: }
05:03_na_ka_na_,(get {(long 15) :found} 15)
05:03clojurebotnil
05:03_na_ka_na_guys I'm confused by the map behavior
05:03_na_ka_na_see
05:03_na_ka_na_http://gist.github.com/605953
05:04_na_ka_na_somewhere in my code the key is getting converted to Long
05:04_na_ka_na_and if I try to find it i cant
05:05_na_ka_na_,(get {(long 15) :found} (long 15))
05:05clojurebot:found
05:05_na_ka_na_do i need to convert everything to long ?
05:06_na_ka_na_,(= 15 (long 15))
05:06clojurebottrue
05:07_na_ka_na_,(get {(long 15) :found} 15)
05:07clojurebotnil
05:07_na_ka_na_anyone?
05:07clojurebotPlease do not ask if anyone uses, knows, is good with, can help you with <some program or library>. Instead, ask your real question and someone will answer if they can help.
05:07raekthe 1.3 branch is supposed to fix this problem, but I don't know what the best way to solve it in 1.2 is...
05:07_na_ka_na_is it a bug?
05:08raekthere should be discussions about this in the google group
05:08raekwell
05:08raekit is an unfortunate consequence of how things work currently, if I have understood things correctly
05:09jlris this on the 1.3 snapshot?
05:09jlroh raek's got it
05:09_na_ka_na_i'm sure this will lead to a lot of subtle bugs in 1.2 :(
05:09_na_ka_na_i mean people who use 1.2
05:10raekthere used to be branches called num, equal and equiv. I think I heard that they got merged into 1.3
05:10jlrthere's a good explanation about the behaviour, looking for it
05:11jlrhttp://dev.clojure.org/display/doc/Enhanced+Primitive+Support
05:14raekI think the new 1.3 behaviour will be to make numbers longs by default
05:16cais2002hi guys, is there an existing function that does this (split-by #(= 0 (mod %1 3)) [1 2 3 4 5 6]) => ((1 2 4 5) (3 6))
05:16jlr_na_ka_na_: specifically re: maps look down in that link under heading "Objective - normalize arithmetic semantics between boxed and primitive numbers", it says hash maps and sets now use = for keys, and right above talks about the new behaviour (including "all long-or-smaller integers are boxed as long"
05:17clojurebotant clean and rebuild contrib
05:18mrBliss,(clojure.contrib.seq-utils/separate #(zero? (mod %1 3)) [1 2 3 4 5 6])
05:18clojurebot[(3 6) (1 2 4 5)]
05:19mrBlisscais2002: ^^
05:19cais2002mrBliss: looks good, thanks
05:42rrc7czone of the things I love about strictly typed languages like Haskell and Scala is the Maybe/Option type that forces callers to deal explicitly with nonexistance as a return value. Are there any tricks to enforce a similar caller constraint in Clojure?
05:45rrc7czdesign by contract a la post conditions helps deal with protecting against nonexistance as a return value, but it doesn't enforce anything on the caller in cases where you want to return nil. The only thing I could think of was making my own Maybe type, then adding a type hint in my fn defs. Has anyone done anything like this?
05:46mrBlissrrc7cz: clojure has nice support for preconditions (but you probably knew this already) http://blog.fogus.me/2009/12/21/clojures-pre-and-post/
05:48rrc7czmrBliss: yeah, I actually found out about them before they were in the documentation because I posted a Stackoverflow question about design by contract in Clojure. Finding out there was native support for it was awesome
05:49rrc7czmrBliss: i'm actually a huge fan (and user) of DbC in Java and Clojure, but as I mentioned, this doesn't actually enforce callers to deal with nonexistence (nils) as return values; it only restricts the domain of valid function IO
05:51mrBlissrrc7cz: I think enforcing callers to deal with nils is quite problematic in a dynamic language.
05:53raekone common way is to return nil when given nil (if that makes sense for that function)
05:53rrc7czmrBliss: on the other hand, so are NPEs. I think there needs to be a balance.. I can imagine a public API layer requiring more enforcement than perhaps internals, which might get away with pre/post to spot bugs
05:54rrc7czraek: but how does that enforce the caller deal with nil return values instead of blowing up with an NPE?
05:54raekhrm, I see your point...
05:55raek(also, 'fnil' is an interesting function)
05:57rrc7czraek: i didn't know about fnil. You're right, it does look very interesting.. thanks for the tip
05:57raekbut it doesn't help with enforing constraints on the caller...
05:57raekwhich, as mrBliss said, probably isn't possible in Clojure
05:58raekbut fnil is a cool way to "patch" a function that can't handle nils
05:58rrc7czraek: well, I think it's possible, just not native. By that I mean I can make my own Maybe type, then type hint the return type of my fns as Maybe
05:58AWizzArdSince when is Java 6 Update 22 out?
06:00rrc7czbut how can you type hint a return value? it's easy on parameters, but I don't see in the docs how to do this on a return value. Perhaps it would be part of 1.3's ^:static stuff?
06:01raekI think I recall that it hasn't been possible before
06:01raekthere was something about putting the metadata on the param vector
06:02rrc7czraek: yeah, I don't see it listed as supported. I guess in that case you guys are right: there's no way to enforce the caller to handle nils
06:02mrBlisstype hints don't enforce anything, except when used on static functions like you mentioned. (If I remember correctly)
06:02raekhrm, maybe that was for #"def(type|record)"
06:23quizmewhen i do "lein deps" ring 2.0 gets installed. to install ring 3.0, would I have to upgrade leingingen? "lein upgrade" ?
06:25mrBlissquizme: change the version number of ring in your dependencies (project.clj file)
06:25quizmeohhh
06:25quizmekk
06:25quizmethanks
06:27quizmethat's brilliant
06:58cemerickRaynes: double queen rooms are sorta standard :-)
07:03esjcemerick: coming to the US for the first that was really unexpected.
07:03esj"but I only need half of half of that !"
07:03cemerickesj: In general, we think along the lines of "How much space is there? OK, I'll use all of it!" ;-)
07:04_na_ka_na_what contrib jar do i use with clojure-1.3.0-alpha1 ?
07:04cemerickesj: coming to the US from....?
07:04esjand there is so much space to go around.
07:04esjcemerick: in my case the UK via SA.
07:04rrc7czesj: I got you beat, I'm coming all the way from Prague ;-)
07:04esjbah, SA via the UK
07:05esjrrc7cz: South Africa ?
07:05rrc7czCzech Republic
07:05rrc7czesj: so I don't have you beat; I thought you were coming from UK
07:05rrc7czSA would be much farther to fly
07:05esjrrc7cz: hehe.
07:05rrc7czhell of a hike :-)
07:06esjit would be a lot of fun though
07:07cemerickI'll have to add nationality to the next State of Clojure survey
07:08cemerick_na_ka_na_: presumably there's a clojure-contrib-1.3.0-alpha1?
07:09esjcemerick: naaah - nationality is as outmoded as mutability :)
07:11cemerickesj: You, sir, are ahead of your time.
07:11cemerickAnd probably overly optimistic, but that's good. :-)
07:34_na_ka_na_cemerick: lein fails to download it
07:35_na_ka_na_cemerick: it fails with an exception trace
07:39cemerick_na_ka_na_: looks like there may not be an alpha-1 contrib: http://build.clojure.org/snapshots/org/clojure/contrib/complete/
07:39cemerickTry 1.3.0-SNAPSHOT, and see how you fare.
07:52_na_ka_na_cemerick: thanks for the tip, i'll try that .. I tried to build from master. . but it failed :(
07:53_na_ka_na_no even SNAPSHOT fails
07:54cemerick_na_ka_na_: can you paste your project.clj?
07:54cemerickalong with the stack trace
07:54_na_ka_na_(defproject temp "" :dependencies [[org.clojure/clojure "1.3.0-alpha1"] [org.clojure/clojure-contrib "1.3.0-SNAPSHOT"]])
07:56cemerick[org.clojure.contrib/complete "1.3.0-SNAPSHOT"]
07:59_na_ka_na_cemerick: even that fails .. http://gist.github.com/606104
08:01narkisrGood morning (night etc..), is there a way to exit repl when using lein interactive?
08:01_na_ka_na_cemerick: I think this is working org.clojure.contrib/complete "1.3.0-alpha1"
08:01narkisrIv tried C-D and C-C
08:01narkisr(System/exit 0) not working either
08:03_na_ka_na_cemerick: no, even org.clojure.contrib/complete "1.3.0-alpha1" fails
08:12cemerickoh, complete is a pom, not a jar
08:15cemerickThat doesn't seem right at all.
08:18abrenkorg.clojure.contrib/complete "1.3.0-SNAPSHOT" should work
08:19abrenkjust browse http://build.clojure.org/snapshots/org/clojure/ and have a look what's there
08:28abrenkokay, the snapshot repo seems to have a defunct maven-metadata.xml
08:28abrenkit specifies build 42 as the most recent one but that isn't really there
08:30abrenkhttp://twitter.com/stuartsierra/status/25436736752
08:32abrenkspecifying a classifier "bin" works
08:34abrenk [org.clojure.contrib/complete "1.3.0-SNAPSHOT" :classifier "bin"]
08:35cemerickPerhaps the notion of "complete" contrib should be dropped entirely. It's already large, and going to get larger.
08:35AWizzArdIt would be great if the single jars could be offered in one big zip, in one folder.
08:35AWizzArdCurrently that complete .zip includes all the jars, but in funny folders.
08:35abrenkshould be okay if it's just a pom having dependencies on all the other, small libs
08:36AWizzArdI need a script to flatten that folder structure, so I can put clojure-contrib/* on my CP.
08:36abrenkAWizzArd: mvn dependency:copy-dependencies
08:36AWizzArdabrenk: what is the command for Ant? :)
08:36AWizzArdNo Maven here.
08:37abrenkI feared so...
08:37cemerickAWizzArd: still no network either?
08:37AWizzArdI don't find it good to offer Contrib in a Maven-friendly .zip only. It would be helpful to have a basic version, just the plain .jar files.
08:37abrenkAnd I have to admit that to figure out how to get to the complete jar you'd have to know maven pretty good
08:37cemerickwell, that could be made trivially simple
08:37AWizzArdAlso Contrib should not be Ant or Ivy specific, or have a Leiningen specific format, or one for Gradle.
08:38cemerickI wouldn't doubt that it's complex to warn people off of wanting the full boat
08:38cemerick(which *no one* uses)
08:38abrenkis stuart still working to get the build right?
08:38LauJensenZzzz, is the #maven? :)
08:39abrenkand is there like a google docs document listing all the needs and wishes?
08:39AWizzArdThe full Contrib would be nice, as it can be CPed with a * placeholder
08:39cemerickHe's the one who's on point last I knew, though the scope of the modularization is being explanded AFAIK.
08:39abrenkI understand all the complains about maven like the discussion yesterday...
08:40abrenk...but I think if everything would just be working fine for everyone there wouldn't be any complains
08:40abrenkI'd be willing to take a shot at the build process on my machine
08:40cemerickThings are in flux. 1.3.0 is decidedly not in a released state. Pain should be expected.
08:41abrenkif only to realise that indeed it's not fixable ;-)
08:42AWizzArdWhen starting my repl from an ant task it is okay to include all of Contrib in the CP, and also during compilation. Only during the jar stage I will specify exactly which jars to put into my Überjar.
08:47abrenkwould be nice if these requirements and nice-to-have's were listed somewhere. I mean we have for osgi and nrepl etc. why not for the build-related stuff?
09:18cemerickthe osgi notes are there because I saw a lot of people working on the problem alone
09:18cemerickthe nrepl notes are there because that's a fundamentally political problem, not a technical one
09:19cemerickbuild processes are a tricky thing -- adding another cook to the kitchen makes things very difficult, if not impossible
09:19cemerickabrenk: ^^ If you'd like to help, I'd suggest offering it on the clojure-dev list, and see what SS says.
09:23chouserI just found myself thinking: "maybe the style of solution we've discussed for nrepl would work for build too"
09:24cemerickchouser: did you catch the upshot from last night's discussion?
09:24chouser"pom.xml is canonical, but a simplified tool could be used to build clojure and/or contrib for our needs without all the steps"
09:24chousercemerick: ah, maybe not. will read.
09:24chouser"so if I could just understand maven well enough to see what parts could be reused, and which could be left out ..."
09:25chouser^^^somebody shoot me
09:25cemerickchouser: you're scaring the shit out of me this morning though :-)
09:25LauJensenchouser: who were you quoting?
09:25chouserLauJensen: my own crazy crazy thoughts
09:25LauJensenhehe
09:26LauJensenHad a good nights sleep? You dont quite seem yourself this morning
09:27chouseractually, I'm rather sick, though better than yesterday
09:27stuartsierraMaven is like theodicy. You try to take just a piece and eventually realize it's inescapable
09:27cemerickchouser: maven is definitionally modular. It doesn't know how to do a `clean` or even talk about dependencies without plugins for such things.
09:27chouserstuartsierra: like a prison
09:28fogus_more like the gulag
09:28stuartsierrabut with more output
09:29esj"you can check-in any time you like, but you can NEVER build"
09:30esjoh dear, that was even worse that I thought :(
09:30LauJensenhehe, no it was funny :)
09:31lpetit"trying to make money with open source leads to legacy open source"
09:33esjlpetit: somebody tell facebook.
09:34LauJensenesj: face..what? ooh you mean that legacy app? :)
09:34esjonly my granny uses THAT now
09:34lpetit?
09:35lpetitI escaped the facebook hype from the beginning. Am I a looser ?
09:35lpetit:)
09:35LauJensenlpetit: If you are, then we both are ... which is likely I guess :)
09:35esjlpetit: far from it.
09:40cmiles74 I coded up a stomp parser, if anyone has a moment I'd really be thankful for any feedback on my implementation. :)
09:40cmiles74http://github.com/cmiles74/clj-stomp/blob/master/src/com/nervestaple/stomp/common.clj
09:42chousercemerick: ok, read up on nrepl
09:42stuartsierrawhere is nrepl, by the way?
09:42lpetitnREPL on github
09:42cemerickstuartsierra: http://github.com/cemerick/nREPL, with notes linked at the bottom of the readme
09:43stuartsierracool, thanks
09:43LauJensencmiles74: That looks like an attempt at imperative programming in Clojure. If you ask me there are 15 excessive swap!s and some odd constructs like (if (not (and (not (and (....)))...
09:44chousercemerick: do you want to allow for ides that have sent a partial expr (from the user's "repl" window) still be able to execute commands necessary for autocomplete and such?
09:44stuartsierracemerick: It's a plain java.net.ServerSocket?
09:44cemerickstuartsierra: as of now, yes
09:44stuartsierraok
09:45cmiles74LauJensen: This is the first parser I've codd in Clojure. I don't want to use regular expressions bumt still need to build up the frame components...
09:45lpetitcmiles74, LauJensen: there certainly is a smell , just by counting the nbr of ! / lines of code
09:45cemerickchouser: a tool that provides for autocomplete would presumably have code that searches available vars and matches against a partial string -- not simply sending partial expressions....?
09:46cmiles74The other thing I tried was emitting a sequence of characters and a symbol to denote what part of the frame it bleonged to, then assembling those. But in that case I loose the lazy rendering of the body.
09:46LauJensencmiles74: You're using atoms to build lists, which is something we always try to do functionally, like (reduce conj '() [1 2 3]), where instead you do (reduce #(swap! some-global %) [] .....)
09:46chousercemerick: yeah, I was afraid my description was too weak. ok, more words...
09:47cemerickchouser, stuartsierra: I'm currently working on a final decision re: stomp. I'm leaning towards pushing on that for now, at least until a clojure stomp client and broker are available in a quasi-stable state.
09:47RaynesFunctions should never get that long.
09:47RaynesEver.
09:47chouserwould an IDE that supports autocomplete perhaps have some code on the server side (or perhaps send such code as needed) to look up available namespaces, vars, class methods, etc.?
09:48LauJensenRaynes: well, sometimes they should
09:48chousersending something like (autocomple-options-for "split-")
09:48RaynesLauJensen: When?
09:48chouserand expecting a nice readable vector of strings in return
09:48LauJensen~source for
09:48lpetitLauJensen: hmmm, good idea for a heuristic for a warning in ccw : ratio of ! at the end of symbols per lines of code, and if threshold reach => publicity for conjlabs if user located in europe. Are you with me ? :)
09:48cmiles74Does anyone know of a recursive descent parser coded in Clojure that takes a different tactic?
09:48LauJensen~source doseq
09:48LauJensenRaynes: Just to mentioned a few examples coded by Rich himself
09:49cemerickchouser: yes; the thought is that there will be (a) some standard tooling helpers that would be available for all in a separate project, and (b) in general, tools will check for/load in whatever code they need for their functionality as soon as they connect to a new repl.
09:49lpetitchouse:r definitely
09:49lpetitchouser: ^^
09:49LauJensenlpetit: Thats a sweet idea - Could you do a little popup with a link to conj-labs.eu if you detect a code smell? :D
09:49RaynesThe Clojure coding standards on the assembla wiki explicitly mention that you shouldn't write functions as long as doseq.
09:49LauJensenRaynes: Do you think Rich is ignorant of the standards?
09:49chousercemerick, lpetit: ok, good.
09:49chouserso, then...
09:49lpetitLauJensen: yeah. Now let's talk financers :)
09:50LauJensenlpetit: cemerick will pay you once you get to the US, now implement!
09:50cemerickheh
09:50RaynesI'm sure he had a part in writing them. I don't remember there ever being a message sent out that doseq is a canonical example of a well-written macro that would be nice to see.
09:50lpetitahah
09:50stuartsierracmiles74: The JSON parser in contrib is an example of a recursive-descent parser in Clojure
09:50chouseris it likely such an IDE might also have a repl pane where user's input is sent line-at-a-time such that it can support interactive behavior like (println :got (read-line))
09:51lpetitbut definitely, this could be seen as a feature. User assistance
09:51LauJensenRaynes: "Never" means "Not ever". Here's a case where Rich broke your rule, ie your rule is both broken and crushed.
09:51RaynesIt isn't my rule, and that macro was written long before those standards were ever thought of.
09:51LauJensenRaynes: Just give it up, Rich has code-killed your argument
09:51RaynesI imagine that clojure.core is a little different.
09:51cemerickchouser: I'm also pondering my *in*/*out* approach. It's a tricky little bastard.
09:51chouseryou can blame doseq on me. I something like doubled its size.
09:52RaynesYou're a bad troll. :\
09:52cemerickI firmly believe (read) is a red herring.
09:52LauJensencemerick: Whats a red herring?
09:52chouserhm
09:52cemerickIf you're using nrepl, then you're using a tool.
09:52cemerickThus, it can either check for a complete expression before sending, or require ctrl-enter or whatever to force a send.
09:53cemerickEither way, I feel like that's a UI issue.
09:53chousercemerick: you think interactive use of *in* doesn't need to be supported
09:53chouser?
09:53cemerickI wouldn't go that far.
09:53chouseroh
09:53cemerickI think it's a 1% case that will end up complicating my implementation significantly.
09:53cemerick0.0001%, perhaps.
09:54cemerickI've yet to see any real code that (read)s from stdin that isn't a repl itself.
09:55lpetitcemerick: probably everybody which writes unix admin tools in java and likes to go for coffee everytime he launches one
09:55lpetits/romm/room
09:55chouserLauJensen: http://lmgtfy.com/?q=wikipedia+red+herring
09:56LauJensenchouser: I've already googled it, but thanks for being a wannabe
09:56lpetitWe french guys currently and definitely seem to have a problem with romm(s) (ahah)
09:56lpetitsorry
09:56chousercemerick: (read) is one thing, (read-line) is something else.
09:56cemerickreally?
09:56LauJensenchouser: and (read-lines) is something else entirely again
09:57cemerick(read-line) pulling from stdin screams "command line tool" to me, which is a non sequitur w.r.t. nREPL, no?
09:57chouserwell, isn't that exactly the kind of thing cake is up to
09:58chouser[disclaimer: I have yet to use *any* of the tools nrepl is meant to replace.]
09:58cemerickYeah -- which ninjudd and I have butted heads over already.
09:59cemerickThis is all sorta moot, insofar as I'll (very, very reluctantly) support *in* anyway
09:59stuartsierraWhat would stdin mean in a remote context anyway?
10:00chouser*in* on the remote server would be connected to something like *in* on the client? why not?
10:00cemerickstuartsierra: binding *in* to a PipedReader that had content shoved into it from follow-on messages coming from the connected client.
10:00chouserwhat he said
10:00stuartsierrahm, ok
10:00cemerickJust the thought of it just screams "WRONG" to me, but…
10:01RaynesI'm so happy I never decided to write anything like that.
10:01stuartsierraAnybody had this problem with Ring: ...
10:02stuartsierraA handler throws an exception...
10:02stuartsierraWhich gets caught by wrap-stacktrace...
10:02stuartsierraWhich throws a NullPointerException...
10:02stuartsierraWhich hides the original exception?
10:02RaynesI think I have.
10:02stuartsierraI'm trying to make a test case but failing so far.
10:02RaynesI don't remember how.
10:03stuartsierraOne problem I know is that wrap-stacktrace only catches java.lang.Exception, not java.lang.Throwable
10:04stuartsierraBut I think the NullPointerException is actually in clojure.stacktrace, and therefore my fault.
10:06stuartsierraclojure.stacktrace/print-trace-element applies a regex to the class name in a StackTraceElement
10:06stuartsierraWhich will throw NullPointerException if the class name is null...
10:06stuartsierraWhich is theoretically impossible, but I swear I've seen it happen.
10:09cemerickchouser: was it you that was talking with Rich about the difficulties of separating expressions-requiring-discrete-responses from random content on *in*?
10:10chousercemerick: possibly, yeah.
10:10LauJensenstuartsierra: shouldnt that be a pre-condition of print-trace-element then, that the class is non null ?
10:11chouserI believe I was raising concerns and he was asserting it was possible.
10:11stuartsierraLauJensen: StackTraceElement claims the "class" field can never be null.
10:12LauJensenstuartsierra: Even still?
10:12chouserI wonder if anyone's done research on topic classification of english text with IRC-post-sized pieces.
10:12stuartsierraLauJensen: what do you mean?
10:12chouserI'd love to have auto-threading or topic grouping of IRC logs
10:12cemerickchouser: that sounds absolutely delicious
10:12chouserbut intermingled conversations, non-sequitors, etc. strike me as overwhelmingly difficult to deal with.
10:13stuartsierrachouser: Yeah, what does "lol" refer to? :)
10:13esjchouser: ouch ! dejumbling the multiple concurrent conversations active at one time would be a nightmare !
10:13LauJensenstuartsierra: In practical terms it is already a pre-condition, just one you dont think will happen. If you add it as an explicit :pre condition, you'll have lost nothing but gained certainty next time (if) it breaks
10:13stuartsierraI think that will have to wait for strong A.I.
10:13chouserthen again I wouldn't have guessed unsupervised part-of-speech tagging was possible at all, let alone in 300 line of Clojure.
10:13cemerickgiven timestamps and handle references, I'll bet a little bayesian training would go a *long* way
10:14LauJensenchouser: I know of one such system, but Im afraid its proprietary
10:14chouserstuartsierra: exactly. though, in that particular case it may not matter much.
10:14stuartsierraLauJensen: I can avoid the error just by calling `str`, but I'm trying to find a case where that field can be null as an example.
10:14cemerickLauJensen: Dude: http://aria42.com/blog/?p=48
10:15cemerickI get the sense that Aria's a beast -- and he's coming to UMass next year. :-)
10:15esjimpressed: Gibbs samplers et al.
10:16chousercemerick: so I guess if every message from the client has a unique id, the repl server can tag each return-value response with the input-message-id that triggered the eval
10:16LauJensencemerick: wow, that'll take a while to consume
10:17chousercemerick: that could be many-to-many if the client were undisciplined
10:21LauJensenAre the 1.3 snapshot artifacts ready to go with static functions?
10:24stuartsierraLauJensen: as far as I know, yes
10:24LauJensenkthx
10:26cemerickstuartsierra: You asked about serversocket earlier -- feel free to toss any protocol/transport comments over the wall.
10:27stuartsierranone yet
10:27stuartsierraI want to explore Netty and/or other NIO frameworks
10:27stuartsierraalthough you could probably drive the whole thing over a message queue library
10:28cemerickYeah, that's been in the hopper :-)
10:29cemerickI need to wait on that front until there's a e.g. clojure stomp client and broker ready to use.
10:29cemerickThat's one yak too far for me right now.
10:30cemerickWhen they appear (in a CA-suitable way), I'll move.
10:30stuartsierraWhy STOMP in particular?
10:30esjcemerick: I've been playing today with Jim Duey's conduit.rabbitmq and its super easy.
10:30cemerickstuartsierra: AFAICT, it's the most widely-supported, in terms of clients.
10:30LauJensenesj: cemerick doesn't buy into 'easy', he wants 'big' and 'enterprise'
10:30stuartsierraah
10:31esjyou two boys !
10:31cemerickalso simple enough to have a pure clojure impl
10:31chouseractually, the opposite in this case.
10:31cemerickLauJensen: bollocks
10:31LauJensencemerick: sorry :|
10:31cemerickesj: I need to keep the dependencies down in this context.
10:31chouserthough rhickey didn't like my analogy
10:31esjcemerick: no worries, just thought it mention its awesomeness.
10:32cemerickThanks for the tip; I'm thankfully not touching any MQs anymore these days aside from my abuse of couchdb. :-)
10:34LauJensenwhich contrib artifact goes with org.clojure/clojure "1.3.0-master-SNAPSHOT" ?
10:36LauJensenoh... no single contrib artifact anymore
10:36cemerickchouser: where can I find this ansi terminal wonkery you have for coloring stuff?
10:37stuartsierraLauJensen: there's a "complete" jar but it doesn't work as a dependency yet
10:37LauJensenstuartsierra: any timeframe for when that will be up ?
10:38stuartsierraas soon as somebody figures out how to make it work ;)
10:38cemerickstuartsierra: Oh?
10:38stuartsierracemerick: In the modularized contrib build, there's a "complete
10:38stuartsierra"complete" module that depends on every other module.
10:39cemerickright, but that's a pom
10:39stuartsierraBut it doesn't work as a Maven/Leiningen dependency. Can't figure out why.
10:39LauJensenstuartsierra: I thought you were the go to guy ?
10:39stuartsierraLauJensen; I was and I failed utterly.
10:39LauJensenstuartsierra: ah ok. How about we restart and try accomplishing it with Cake instead?
10:39stuartsierrawhat's Cake?
10:40LauJensenstuartsierra: Its a new build system, a little similar to lein on the outside, but has a different task system and its now based on Ivy instead of Maven (almost)
10:40LauJensenAlso supports a persistent JVM and its totally cross platform
10:40stuartsierraHm. I'm suspicious of anything that deviates from the Maven model.
10:41stuartsierraBut anyone is welcome to give it a shot.
10:41stuartsierraWe might end up splitting contrib into separate repositories anyway.
10:41LauJensenhehe
10:42AWizzArdAh, hi stuartsierra. I did not follow the discussion, but earlier today I mentioned that it would be great if there were a .zip of Contrib, that just contains all .jar files, in a flat folder.
10:43AWizzArdThat would make it more friendly for other systems than Maven.
10:43stuartsierrayeah, that's doable in the current Maven setup, just needs implementing
10:43AWizzArdCurrently when I download the .zip I need to run through a script that copies/moves out the jars into a folder that I can CP with the * placeholder.
10:44AWizzArdstuartsierra: when you say that Contrib might be split into separate repos, do you then mean "real repos" or just branches of the current one?
10:44stuartsierrareal repos
10:44hugodIt would also be nice to have a source jar for clojure, so slime could jump to java source from stack traces
10:45stuartsierraJust an idea; no planning yet.
10:45LauJensenYou're suspecious of anything that deviates from the Maven model which has failed you so horribly?
10:45stuartsierraYes. :)
10:45stuartsierraI love my abuser.
10:45LauJensenstuartsierra: Are you cemericks cousin or something? :)
10:45stuartsierraNo, we're just both cantankerous north-east elitists. :)
10:46LauJensenhehe
10:46AWizzArdBtw, I noticed that most jars contain plain .clj files. I have no problem with that, I just wondered why it is not AOTed .class files.
10:46stuartsierraAWizzArd: binary-compatibility
10:46cemerickstuartsierra: I'd say we're pragmatists, but OK.
10:46stuartsierraheh
10:47stuartsierraAWizzArt; AOT-compiling means the JARs only work on the version of Clojure they wre compiled with.
10:48stuartsierraBut seriously, Maven made the modularized contrib build *possible*. I wouldn't have attempted it with anything else.
10:48stuartsierraBut it's still too big and unweildy, so I want to split it up further.
10:49chousercemerick: http://gist.github.com/606301
10:50AWizzArdIs it that it depends on the *version* of Clojure, or is it even the concrete clojure.jar that makes the contrib jars incompatible when AOTed?
10:50cemerickyikes
10:50LauJensenAWizzArd: the concrete jar
10:51AWizzArdLauJensen: mama mia, that is indeed problematic then.
10:51chousercemerick: too much \033 for you? :-)
10:51AWizzArdLauJensen: Do you know why that is so?
10:51cemerickchouser: INSANITY
10:51stuartsierraNot necessarily the concrete JAR, but anytime the Clojure compiler changes, it breaks AOT-compiled classes
10:51chousercemerick: try it though -- it's pretty
10:51LauJensenAh, Clojure is catching up: http://www.google.com/trends?q=python%2C+clojure&amp;ctab=0&amp;geo=all&amp;date=all&amp;sort=0
10:51AWizzArdok
10:51LauJensenAWizzArd: No
10:51stuartsierraThis was a big problem going from 1.0 to 1.1, but may still be a problem with newer releases.
10:52chouserLauJensen: "Python eats Australian family dog" "23-foot python found basking in sun" "Monty Python Reunion! Monty Python Reunion! Monty Python Reunion!"
10:52stuartsierraUncompiled Clojure source code is more resilient to changes in the compiler.
10:52LauJensenchouser: I think you meant that for twitter :)
10:52AWizzArdstuartsierra: yes, that I understand
10:52cemerickchouser: I'm sure it is. I just prefer (.setStyleRange some-text-area-widget style-obj-to-make-text-red)
10:53fogus_http://www.google.com/trends?q=python+programming,+clojure&amp;ctab=0&amp;geo=all&amp;date=all&amp;sort=0
10:53AWizzArdI just thought that even if just one tiny bit changed in the clojure.jar that AOTed contrib is incompatible then.
10:53chousercemerick: heh, ok.
10:53stuartsierraAWizzArd: I don't think it's quite that bad.
10:53AWizzArdgood :)
10:53chouserI have a version with prettier source code -- sets some constants so I can do like #(println RED % NORMAL)
10:54cemerickchouser: Are there many like you? (i.e. people that use cmd line repls semi-exclusively)
10:54AWizzArdstuartsierra: btw, do you know a bit about Clojures DynamicClassLoader?
10:54stuartsierraa very little bit
10:54chouser...but it's part of a larger thing for work, so shouldn't share
10:54AWizzArdok
10:55cemerick*ahem* http://www.indeed.com/jobtrends?q=scala%2Cclojure%2Cpython&amp;l=
10:55AWizzArdBecause there is potentially an implication for using Clojure to program Applets or Web Start Apps when Contrib contains .clj files.
10:55cemerickbuzz is a leading indicator, but nothing real on its own
10:55chousercemerick: beats me. I wonder if it would work with emacs inferior mode or whatever that's called.
10:56LauJensenWhich lein-swank artifact goes with clojure-1.3 ?
10:57chousercemerick: if there are others like me, they probably keep quiet to avoid ridicule.
10:57cemerickchouser: Would it make sense for me to make nrepl's main emit such codes on any unix?
10:57cemerickscrew it, fly that flag
10:58chousercemerick: most commands that can generate ansi color codes only do so optionally, so that would probably be best.
10:58AWizzArd~max people
10:58clojurebotmax people is 313
10:58chouserdoes anyone know how many people have registered for clojure-conj so far?
10:59cemerickchouser: lots
10:59chouserstuartsierra: you're our mole in corporate HQ, right? Heard anything?
10:59chousercemerick: excellent. :-)
11:00stuarthalloway155
11:00stuartsierraAnd I'm not physically in corporate HQ most of the time, so I don't have the latest gossip.
11:00stuarthallowaystuartsierra: it's on the f**ing radiator :-)
11:00cemerickoh, and I thought the number was hush-hush for some reason
11:00stuartsierrastuarthalloway: whatever ... ;)
11:00stuartsierraso did I
11:00cemerickNow I have one less reason to bug stuartsierra :-P
11:01stuarthallowayI just asked big boss Alan if it was a secret and he said no
11:01cemerickstuartsierra: are you still in NYC?
11:01stuartsierrayes
11:01chousergonna be fun
11:01cemerickI had no idea -- thought you had moved.
11:01cemerickstuartsierra: I would have rung you up two weeks ago had I known.
11:02cemerickchouser: you'll make it for more than one day? ;-)
11:02chouseralready been there once in a dream, but there were only about a dozen people. rhickey gave me stern advice, peering over spectacles.
11:02cemerickand here I had wagered 265
11:02cemerickThis is why I don't bet on games or horses.
11:03LauJensenchouser: "peering over spectacles" ?
11:03chousercemerick: oh yeah, I'm all over this one.
11:03cemerickExcellent.
11:03cemerick(said in proper Burnsian affect)
11:03cemerickwith*
11:04cemerickLauJensen: it's his default position: http://farm4.static.flickr.com/3229/2613013337_ecc41f4123_o.jpg
11:04cemerick:-D
11:04chouserheh, yeah, something like that.
11:06stuartsierrastuarthalloway: Just added a bug on clojure-dev
11:07abrenkstuartsierra: doesn't [org.clojure.contrib/complete "1.3.0-SNAPSHOT" :classifier "bin"] work as a lein dependency for the "complete" artifact
11:07stuartsierranot correctly
11:07stuartsierraIt downloads all the individual module JARs *and* the "complete" uberjar.
11:07abrenkstuartsierra: as I said earlier: I'd be willing to give it a try to fix the maven build
11:08stuartsierrago for it
11:08abrenkis there a list of requirements?
11:08stuartsierramake it work :)
11:08stuartsierrawell, ok...
11:08LauJensencemerick: ah, thanks for clearing that up :)
11:08stuartsierra- must be able to build/deploy all modules with 1 command
11:09abrenkokay, I'll just have a go at it and flex my maven muscles and maybe write some stuff down while at it
11:09stuartsierra- must be able to depend on a single module to get all of contrib
11:09stuartsierra- should build a complete uberjar for non-maven-aware environments
11:09stuartsierrapoint 2 is currently the problem
11:10abrenkThanks. I'll take a look at it.
11:11cemerickstuartsierra: did you try shade?
11:11stuartsierracemerick: no, not yet
11:11cemerickthat's what will get you point 2 cleanly
11:12cemericki.e. without carrying along the submodule dependencies themselves for downstream projects
11:13stuartsierrahm.
11:13abrenkstuartsierra: at the moment a classifier=bin dependency only pulls down the single "complete" jar
11:14stuartsierraWhat I hoped was that depending on a module with <packaging>pom</packaging> would get you all of its transitive deps without trying to download its jar.
11:14cemericknope
11:14cemerickpom artifacts can only ever be parents
11:14stuartsierraoh. Wish I'd known that.
11:14cemerickor, they can be dependencies, but that's a no-op
11:14cemerick(effectively)
11:14abrenkbut looking at the snapshot repo it seems wrong that build 41 is just a pom and build 42 is just a jar.
11:18stuartsierraabrenk: I made a lot of mistakes, flailing aroudn trying to get 1.3.0-alpha1 out the door.
11:19slyrus_fogus_: the lisp interpreter aside, the html layout on lithp is brilliant
11:20fogus_slyrus_: It's not mine. It's generated by a tool named Pycco
11:20slyrus_ah, ok. still, it makes me want that for all of my code.
11:22fogus_slyrus_: Indeed
11:23abrenkstuartsierra: the build is started by hudson? what's the mvn command line that is run?
11:24stuartsierraabrenk: mvn --fail-at-end clean install
11:24abrenkthanks
11:25stuartsierrastuarthalloway: BTW something broke clojure.contrib.jmx at Clojure commit cc8372f12074b4cccbdd9cde3cfacfae069c57d3
11:26stuartsierrahttp://build.clojure.org/job/clojure-contrib/218/org.clojure.contrib$jmx/console
11:26AWizzArdA nice read: http://norvig.com/lispy.html
11:33cemerickchouser: a decent half-feature would be for the logs to add a class attr to every <p> containing the handle's name, with a filter input field fixed at the bottom of the page.
11:33chousercemerick: so as to see posts only from one user?
11:33cemerick~3 lines of jquery, sorta-kinda threading
11:33clojurebotGabh mo leithscéal?
11:34cemerickor many, e.g. "cemerick,chouser,rhickey,ninjudd" in my case right now
11:34chouseroh, I see. hmm.
11:34cemerickfilter + reset buttons. It'd be shiny
11:35cemerickExtra credit for finding the closest matching msg on-screen at the time of the filter, and scrolling to that line after hiding the non-matching msgs.
11:36chouserI'm planning on getting rid of the up/down arrows. I think that's a failed featuer.
11:36chouserfeatuer.
11:36chouserfeature
11:37cemerickThey seem to do random things :-)
11:37chouser:-P yeah
11:37cemerickchouser: It'd be great if spaces in msgs were turned into nbsp's as well.
11:37chousernooo
11:37cemerickheh
11:37cemerickalready down that path?
11:38chouseryou want each post to be just one line?
11:38cemerickchouser: OK, what I mean is, any space in a block of more than one space replaced with nbsp
11:39cemericke.g. this was an outline: http://clojure-log.n01se.net/date/2010-09-30.html#19:45e
11:39chouseroh, to maintain multi-space spacing. yeah, I should try to do that.
11:40cemerickI simply don't see how *in* and commands can be delineated from a single stream.
11:41abrenktechnomancy: is it possible to specify a dependency of <type>pom</type> (in pom.xml) in project.clj?
11:42lpetitcemerick: right. Or would have to find a special char eg in the unicode charset, etc., but that's horrible
11:43cemericklpetit: Rich was saying it's possible yesterday, but I don't see it.
11:43lpetitcemerick: Rich is like Socrates ...
11:44cemericka tool committed to being synchronous could just start sending on *in* after each send of code
11:44cemerickBut I think he was implying something more transparent than that.
11:45lpetitwhy were you placing this on the table again, btw ?
11:45cemerickI'd like to support it as long as it doesn't impinge upon any of the other priorities.
11:46cemerickI think cake could do exactly what I just mentioned
11:46cemerickninjudd: ping?
11:49lpetitok
11:49BahmanHi all!
11:49lpetitwasn't it one of, hum hum, earlier suggestions ? ;-)
11:50cemericklpetit: it, what?
11:50lpetitnevermind
11:51lpetitaborted auto-satisfaction tentative
11:53abrenkstuartsierra: how/when's the assembly plugin called?
11:53stuartsierraabrenk: I think I deleted that; it's in older commits in the "complete" pom
11:53abrenkstuartsierra: ah, okay
12:02ninjuddcemerick: yo
12:02lpetitninjudd: hello!
12:03ninjuddcemerick: what's up? (reading the logs now)
12:03ninjuddlpetit: hi
12:03lpetitninjudd: I hadn't understood you're the one behind cake. Great work !
12:03ninjuddlpetit: oh. well thanks
12:03ninjuddhehe. hum hum is right
12:03lpetitninjudd: when do you drop the ruby dependency ? :)
12:04ninjuddcemerick: i mentioned that exact idea to rich, but he didn't seem to much like it
12:05ninjuddlpetit: well, i need some fast client script. it's either ruby or perl, and my ruby is much less rusty
12:05cemerickninjudd: If I'm thinking of the same exchange, you were talking about timing though, right?
12:06chouserninjudd: someday we'll get you some fast-startup clojure runtime, ok? You can port the client to that then.
12:06cemerickthe clojure->scheme->C idea came up a few night ago again
12:06chousercemerick: yes
12:07chouseroh, I misread. "good"
12:07lpetitninjudd: once you have a running background jvm, couldn't the cake binary just be a lightweight wrapper in shell(unix)/bat(windows) to talk to the background jvm ? (maybe I'm saying nonsense)
12:07ninjuddcemerick: only in the context of solving the multi form paste problem. the main debate was about whether to have separate command and in streams
12:07cemerickninjudd: and your position is?
12:08cemerick(waaaay too many logs to scan over here)
12:08ninjuddthat you need separate streams and that it is possible
12:08LauJensenninjudd: lpetit: No whining about the Ruby code, it works wonders
12:09lpetitLauJensen: well, harder to leverage from third party tool such as ccw, he ?
12:09cemerickninjudd: to pair send code requests with corresponding segments of *in*?
12:09ninjuddlpetit: it could, but i'd prefer to write it once in ruby than twice in bash and bat. ruby is more platform independent than either of those, obviously
12:09LauJensenlpetit: use Emacs
12:09lpetitviolons ...
12:09cemerickLauJensen: sorta like asking RMS to use Eclipse, no?
12:09lpetitLauJensen: no thanks, I'm not stuck in the 20ies :-p
12:10LauJensencemerick: sorta, but that way around it would be silly, no ? :)
12:10ninjuddcemerick: i was thinking that they don't need to be paired, but they could by clearing *in* after every command i suppose
12:10ninjuddcemerick, chouser: did you see that i added stream support to clj-stomp?
12:10cemerickyes
12:11chouserninjudd: hm, I didn't.
12:11lpetitninjudd: Oh you too have written a stomp port !
12:11cemerickninjudd: you need to fix your (.read *in* buf 0 len) call -- you won't always fill that buffer in one call
12:12ninjuddcemerick: what a nightmare it was to get buffering correct. took my a few hours to figure out that the default implementation of read(buf,offset,len) in InputStream reads everything until EOF
12:12TeXnomancyabrenk: I think :type "pom" in the dependency vector does it
12:13ninjuddcemerick: you aren't supposed to fill the entire buffer if the data isn't available yet
12:13abrenkTeXnomancy: thanks, I'll try that.
12:13TeXnomancymay be new in 1.4.0-snpashot
12:13abrenkit's at least not in sample.project.clj
12:14LauJensenEnjoy the weekend everybody
12:14TeXnomancyabrenk: right, because it hasn't been released yet
12:14lpetitLauJensen: you too, bye
12:14ninjuddcemerick: the only case i can think of where that is correct is non-interactive input (i.e. files)
12:14cemerickninjudd: I'm confused: you *need* to fill that buffer in read-body, no?
12:15ninjuddcemerick: no
12:15cemerickall right nm
12:15cemerickat least right now
12:15duncanmla la la
12:15lpetitstarsky & hutch ?
12:15ninjuddcemerick: http://download.oracle.com/javase/1.4.2/docs/api/java/io/BufferedInputStream.html#read(byte[],%20int,%20int)
12:16ninjuddcemerick: Buffered input stream returns less than the requested number of bytes if the underlying stream does not have them available, but it always returns at least 1 byte and no more than len
12:17cemerickninjudd: right, what I'm saying is, if a message comes along that's *large*, it won't all be available in one read
12:18ninjuddi read all available bytes unless the len passed is shorter than that
12:19cemerickbut you need to read length bytes, not all available bytes
12:19ninjuddread is allowed to return less than len bytes
12:20ninjuddReads up to len bytes of data from the input stream into an array of bytes. An attempt is made to read as many as len bytes, but a smaller number may be read, possibly zero. The number of bytes actually read is returned as an integer.
12:21cemerickninjudd: I understand the spec. The underlying stream may block before you've read as many bytes as specified in the frame's headers.
12:22ninjuddcemerick: you mean the socket?
12:22cemerickor the inputstream from whatever transport is being used, yes
12:23ninjuddcemerick: i see. you're saying that i shouldn't read the whole frame at once
12:23cemericknot at the moment, no
12:24cemerickI'm saying this is not always going to be true: (== (.read *in* buffer 0 length) length)
12:25ninjuddcemerick: oh. we're talking about two different things.. haha
12:25cemerickread-body, http://github.com/ninjudd/clj-stomp/blob/master/src/stomp.clj#L58
12:25ninjuddcemerick: i was talking about my implementation of .read in stomp/streams.clj
12:26cemerickoh
12:26cemerickno
12:26ninjuddcemerick: sorry. my fault. still too early for me
12:26cemerickread-body, dammit, read-body! :-D
12:27ninjuddii thought: "cemerick must be crazy calling input-read read-body, but i won't say anything..."
12:28ninjuddcemerick: got it. i think that explains why hornetq seems to hang sometimes. thanks!
12:28cemerickninjudd: too perfect :-)
12:29ninjuddi was worried that hornetq was just buggy, but i hoped it was something in my code
12:29cemerickBugs are never in others' code, only ever in one's own.
12:30cemerickExcept when they're not, and then you're screwed.
12:30ninjuddtrue. especially when your code is 3 days old and their code has been around for quite a while
12:31cemerickninjudd: but while we're on the topic, returning a lazy seq of chars in body would be ideal (what I think cmiles74 is aiming for).
12:31ninjuddcemerick: i bet this is responsible for stompserver and CoilMQ not working too. seems that they only worked if i set ack:client
12:32cemerickninjudd: do you have a CA lodged?
12:32ninjuddyeah, i sent cmiles74 a message to see if he'd like to combine our efforts and tackle a pure-clojure broker too
12:32ninjuddcemerick: yes
12:32cemerickgood on both points
12:34ninjuddcemerick: how would i make it a lazy-seq of characters? it seems that receiving the next frame before the lazy-seq is realized will break things
12:37cemerickninjudd: change (receive-frame s) to (locking s (receive-frame s))
12:38ninjuddcemerick: oh, nice
12:39cemerickthough send- and receive-frame should be taking inputstreams or readers, not the socket
12:39cemerickfor transport independence
12:40ninjuddcemerick: right, i just noticed i need to change that to make it a lazy seq anyway
12:41ninjuddcemerick: i have to run now, but i'll check in these fixes in a few hours. thanks for the help!
12:41cemericksure
12:41cemerickninjudd: FYI, I'm pushing ahead for now with my sockets; once a stable 1.1-ready client and broker are available, I'll switch over.
12:41cemerickhopefully you and cmiles74 and whoever else can beat it down
12:42ninjuddcemerick: i was just going to ask if you are still stuck on the 1.1 bit
12:42cemerickI'm not personally, but I think it's unavoidable.
12:43ninjuddcemerick: i think i can write it so that the majority of the code is the same for a protocol and non-protocol version
12:43cemerickDefinitely a drag, but them's the breaks for a little while, anyway.
12:43cemerickYeah, I wouldn't expect it to be too painful.
12:43ninjuddsince the heavy lifting is in send-frame and receive-frame
12:43cemerickninjudd: all contributors need to be CA-settled FYI
12:44cemerickthere should be a "get your CA done now" table at the conj
12:44ninjuddcemerick: ok, do you know if cmiles74 is? should i get a separate CA from contributors? or does the clojure one apply?
12:44cemerickninjudd: nrepl will be going into contrib, so the usual one applies
12:45cemerickI don't know if cmiles74 is yet, I'll bother him later :-)
12:45ninjuddcemerick: ok
12:45ninjuddbe back in an hour or so
12:53Raynescemerick: I was talking about 1.1 yesterday. I didn't realize it was still in widespread use.
12:53RaynesI haven't seen many projects still using it.
12:53cemerickmost clojure projects aren't open source
12:54cemerickas long as stu's book is selling well, tools will need to support 1.1
12:54cemerickor, tools that want to maximize their usage, I guess
12:54RaynesStu's book was aimed at 1.0 AFAIK.
12:57RaynesWe are talking about SH, right? Not SS.
12:58RaynesD'oh well. Good thing I don't have important projects. I don't thing I've got any code that I still work with that isn't on 1.2 now.
12:58Raynes:p
12:59cemerickRaynes: I think you might be right
13:02cemerickIn any case, not having futures or promises is a dealbreaker for nrepl
13:02cemerickdnolen: there's a big difference between the closed-source guys that are active in the community and those that aren't
13:03cemerickThere are plenty of people still using 1.1, and they've never been in channel or on the google group.
13:03cemerickor, *posted* to the gg, that is
13:03dnolencemerick: but are there a ton of closed-source guys that aren't active in the community? I'm honestly curious. Don't those people need support?
13:04cemerickapparently not
13:05cemerickgood thing too -- if you *had* to be as engaged as we were to use clojure effectively....
13:05cemerickwe'd be like CL :-P
13:06dnoleninteresting, the Invisible Clojurians
13:06cemerickI mean, there's what, 3500 people on the gg?
13:06dnolen4200+
13:07cemerickwhatever -- that's surely not the entire userbase
13:07cemerickor even the majority of it, I'd wager
13:07ninjuddi tend to agree with dnolen. besides, nREPL will be a compelling reason for them to upgrade to 1.2
13:07cemerickheh
13:08dnolenI taked OS X stance - basically forced upgrade
13:08dnolendrag em kicking and screaming
13:08cemerickif defrecord and protocols aren't compelling enough, nREPL isn't going to be the feather that pushes them over the line
13:09ninjuddthen they probably won't use nREPL anyway
13:10dnolenClojure is just cutting edge tech, people who adopt it are early adopters - but what do I know. A real survey would be informative.
13:10cemerickdnolen: If all of the toolmakers say, go 1.2, I'll go 1.2
13:11cemerickThey're the direct users *shrug*
13:11dnolencemerick: which dev envs are not 1.2? ccw? vim-clojure?
13:11cemerickccw and enclojure actively support < 1.2 (all the way back to 1.0, I think, but I can't cope with that)
13:11cemerickdon't know about the others
13:12ninjuddpeople can always use old versions of the tools if they really must use 1.1
13:12cemerickninjudd: tool versions are totally unrelated to deployment targets
13:13ninjuddi intended to have cake support 1.1, but i started using clojure.java.io and didn't realize i broke it for a month at least
13:14ninjuddcemerick: not totally. repl and swank and test have to run in the project classpath
13:14cemerickyou mean in cake?
13:15defndid somebody say cake?
13:18ninjuddand swank and lein and anyone who wants nREPL to connect to their project
13:25anonymouse89is there a way, when using map, to get the index of the item in the list being mapped?
13:26cemerickanonymouse89: see map-indexed
13:27anonymouse89cemerick: do you happen know of an equivalent for pmap?
13:27abrenkstuartsierra: http://github.com/abrenk/clojure-contrib/commit/d6b88cba1065c4ae9c7df2c0966147dd428c1c41
13:28stuartsierraabrenk: thanks! will try this out later today
13:28cemerickanonymouse89: (pmap your-parallelized-fn (map-indexed vector some-seq))
13:28abrenkstuartsierra: I will add a couple of comments.
13:28chousercemerick: CA table at the conj -- brilliant
13:29chouserjust a stack of blank forms and a drop-box.
13:29cemerickabsolutely
13:29abrenkstuartsierra: there are some other possibilities. perhaps we could discuss those on monday?
13:29TeXnomancy,(#'while :form :env :test :body) ; <= is this behaviour intentional or undefined?
13:29clojurebot(clojure.core/loop [] (clojure.core/when :test :body (recur)))
13:29stuartsierraabrenk: Monday I'll be back on client work.
13:29abrenkstuartsierra: are you around on the weekend?
13:29chouserTeXnomancy: undefined
13:30stuartsierraprobably not
13:30TeXnomancychouser: good to know; thanks.
13:30abrenkokay, then some time in the future
13:30chouserTeXnomancy: subjuct to change without notice
13:30TeXnomancyfascinating though
13:30chouserTeXnomancy: you're not technomancy are you.
13:31TeXnomancychouser: I had an account on someone's IRC bouncer that I haven't figured out how to turn off; it keeps taking technomancy and forcing me back to my alternate nick
13:31TeXnomancyI really am, honest.
13:31chouserTeXnomancy: heh, ok.
13:32TeXnomancyI remember reading about Jim Weirich in this situation and someone was like, "If you're really Jim Weirich, implement the Y-combinator in Ruby from memory" and he was all --- bam! here you go.
13:33TeXnomancyI don't think I could do that, but you can ask me questions about Chesterton or Achewood to be sure.
13:33hiredmanTeXnomancy: who is a special boy!
13:33TeXnomancyphillipe!
13:34hiredmanlegit
13:34anonymouse89cemerick: thanks for the help!
13:34TeXnomancyhttp://freezepop.net/listen/songs/Freezepop_Here%20Comes%20a%20Special%20Boy.mp3
13:36pyrtsaHey, what's the shortest way to filter out all nil's (or alternatively falsey values) from a collection?
13:37chouserkeep
13:37pyrtsaGreat, thanks.
13:37TeXnomancychouser: keep leaves false in
13:37TeXnomancy=(
13:37chouseractually, that depends. keep is like filter+map
13:39hiredman(remove (comp false? boolean) …
13:39pyrtsaIs there no function in clojure.core or clojure.contrib that tests for trueyness or falseyness?
13:39hiredman,(boolean nil)
13:39clojurebotfalse
13:39hiredman,(boolean false)
13:39clojurebotfalse
13:39hiredman,(boolean 1)
13:39clojurebottrue
13:39pyrtsaAh, right.
13:39hiredmanetc
13:39pyrtsaSo (filter boolean xs) would work as well.
13:40hiredmanpoor remove, almost never used
13:41TeXnomancyfilter identity is the same, I think
13:41TeXnomancyspeaking of which, identity should be the default predicate for filter/remove/every?, right?
13:41pyrtsaTeXnomancy: I was just about to suggest that.
13:42chouserTeXnomancy: yeah
13:42TeXnomancyISTR suggesting it on the mailing list a month or so ago; didn't go anywhere. I guess a ticket would be the next step.
13:42chouserI'm not sure it'd be useful on remove, but yeah. take-while
13:43pyrtsaPossibly it should be the default for any function taking a predicate and collection.
13:43TeXnomancyactually yeah, if you have it on filter it's not needed on remove
13:43pyrtsa(That was a bold statement by me, I know.)
14:01laurusIs there a way to clear all user-defined variables, etc. from a REPL without restarting it?
14:01stuartsierralaurus: remove-ns gets you part way there
14:02laurusstuartsierra, your book is fantastic, by the way!
14:02stuartsierralaurus: thanks!
14:02stuartsierragot to go now
14:02laurusWow, that was awesome.
14:02laurusDidn't expect to get help from the author of the book I'm reading! :)
14:03laurusAt user=>, I see ::foo is equivalent to :user/foo. But isn't :foo also equivalent to :user/foo? Or am I missing something.
14:04technomancy,(= :foo ::foo)
14:04clojurebotfalse
14:04laurustechnomancy, right, but why?
14:04laurusIsn't everything namespaced anyway?
14:05technomancy:foo is "bare"; not every keyword has a namespace
14:05laurusDoes that apply to other data types as well?
14:05technomancyvars are the only thing that has to have a namespace, I think
14:06laurusAh, right, I forgot there's a big difference between a var and a floating piece of data.
14:06laurusSo in other words, vars get "auto-namespaced", but data doesn't.
14:07cemerickvars are defined within an ns
14:07technomancykeywords and symbols are the only things that may optionally have namespaces, I think. symbols are auto-namespaced only if they're inside a backquote.
14:07technomancyoh... and for the purposes of this and every other discussion, we pretend with-local-vars does not exist.
14:07technomancybecause seriously
14:08cemerickheh
14:08laurustechnomancy, I've never heard of that function, so that's fine with me! :) Hehe
14:09laurusEr, wait a minute...
14:09chousersymbols and keywords don't really have namespaces as such, just prefixes
14:09chouser...that can be used to find namespaces
14:09laurus:user/foo refers to a keyword called foo in the user name space. But how can someone look that up unless it is bound to a variable?
14:10cemerick:user/foo *is* that keyword
14:10chouserkeywords aren't looked up anywhere. each keyword is its own value
14:10laurusHmm, I think this book needs more examples.
14:11lauruschouser, so what is the point of "namespacing" a keyword?
14:11technomancykeyword praemium suum est
14:12chouserlaurus: so that it's less likely to get confused with other people's keywords when they show up in the same place
14:12laurusOh, so it's more for the programmer than for the system then?
14:12cemerick,{:size 5 :foo/size 6}
14:12clojurebot{:size 5, :foo/size 6}
14:13chouserlaurus: mainly for when you're messing around with other peoples objects -- add your own key to some other lib's hash-map, or some metadata to an object that lots of libs might want to add metadata to.
14:14chouserthe original case was the global 'isa?' hierarchy
14:14cemerickwithout that, you'd be doing :size 6, :my-size 12
14:15lauruscemerick, but does :foo/size actually refer to the keyword :size in the foo namespace?
14:15laurusOr does it just refer to a keyword called ":foo/size"
14:15cemerickit definitely has two components, though it doesn't really carry a namespace reference
14:16cemerick(name :foo/name)
14:16chouserlaurus: in reality, just the latter.
14:16cemerick,(name :foo/name)
14:16clojurebot"name"
14:16cemerick^^ a string, not a namespace
14:16lauruschouser, okay. That's a little confusing ;)
14:16laurusThanks for the clarification.
14:16chouserbut because we have the double-colon shortcut, and just out of convention, it's good to use your own namespace as the prefix of your qualified keywords
14:16amalloylaurus: if you like getting help from the author of books you're reading, you should get the Joy of Clojure - chouser's on irc a lot more than stuart sierra
14:17lauruschouser, thank you! That makes a lot of sense now.
14:17chouserstuart sierra is probably an asset to his employer.
14:17amalloyhaha
14:17laurusamalloy, well it's not out yet in paper form :p Also, the Joy of Clojure isn't introductory is it?
14:17lauruschouser, heh
14:17jolyI just ordered JoC; really looking forward to getting into it this weekend
14:18chouserjoly: cool, thanks!
14:18amalloylaurus: i read it as my first clojure book, after maybe two weeks' experience with common lisp. it was a little heavy, but not overwhelming
14:19amalloychouser: honestly i'd be willing to sacrifice some of SS's usefulness to his employer
14:19laurusamalloy, oh, I see. I had some basic experience with Emacs Lisp but that's it. Also the Joy of Clojure looked more chatty than Practical Clojure, not that that's necessarily a bad thing
14:19chouserwell, his employer is Clojure/core now, right, so it's a win either way. :-)
14:20amalloychouser: is it? i guess that's okay then
14:20chouserlaurus: but it's chatty with a bibliography! :-)
14:21lauruschouser, really, bibliography?
14:21laurusSounds like it might be useful, I might check it out after I finish Practical Clojure when I can see the paper version. I'm not a big fan of reading books on the screen
14:21chouseryeah, fogus_ has that thing chock-full of references to papers and books I really ought to get around to reading.
14:21rlbMight want to add a mention in the docs that sort and sort-by are stable (assuming that's guaranteed)...
14:22lauruschouser, neat, that's great. I wish more books were like that.
14:23laurusIt's interesting that (get) doesn't return a java.lang.IndexOutofBounds exception when you specify an index that is out of bounds of what you're passing as the first argument :P
14:23chouserbut nth does
14:24laurusOh, right.
14:25abrenkMy version of the clojure-contrib build now produces a dependency for a single, large uberjar (named "standalone") and a dependency for multiple, small jars (named complete). See the last two commits on http://github.com/abrenk/clojure-contrib/commits/abrenk-build.
14:26laurusI see I can use hash-map and sorted-map functions to specify the underlying implementation of a map. How do I specify an array for the underlying implementation?
14:27amalloy,(array-map)
14:27clojurebot{}
14:27laurusamalloy, oh, hah, thanks.
14:27amalloylaurus: surprise! :)
14:28cemerickabrenk: nice -- interesting you used assembly instead of shade
14:28abrenkcemerick: perhaps I should get to know "shade"...
14:28abrenkcemerick: never heard of it
14:29chouserlaurus: note that conj on an array-map may return a hash-map
14:30lauruschouser, thanks for the warning.
14:30abrenkcemerick: the second commit using the dependency instead of assembly plugin is nicer for the user because no need to specify a classifier
14:30cemerickyes, definitely preferable
14:31abrenkI'll take a look at the shade plugin later on. Need to get something to eat and then enjoy the friday evening.
14:32cemerickabrenk: What you have may be superior
14:36abrenkcemerick: I don't know when stuartsierra will have time to look at this. Feel free to merge into clojure-contrib.
14:36cemerickabrenk: I'm not a committer
14:36cemerickit'll require a submitted patch, in any case
14:36abrenkIs there a copyright on build scripts...? *ggg*
14:37cemerickabrenk: do you have a lodged CA?
14:37abrenknot yet
14:37cemerickyou'll need to do that before submitting patches
14:37technomancyabrenk: according to the FSF legal team, contributions under 20 LOC are not copyrightable
14:37abrenkI should do so, also re: my clojure.test contributions
14:37cemerickhttp://clojure.org/contributing
14:37technomancybut that doesn't apply to Clojure =\
14:38cemerickall you need is a 21-liner to slip through...
14:38abrenktechnomancy: thank god I copied over a hundred lines of dependencies... ;-)
14:38technomancyfun
14:39AWizzArdflatten is lazy yes?
14:39AWizzArdhmm yes, returns the result of filter
14:39AWizzArdbtw, that filter could be replaced by remove
14:40AWizzArdthen the call to complement could go away
14:50ninjuddcemerick: hmm, looks like your locking trick won't work because the lazy seq may never be realized
14:50amalloyAWizzArd: remove is implemented as (filter (complement pred) coll)
14:50clojurebotReader syntax of collections has gotchas
14:51cmiles74I took everyone's comments (which I really appreciated :)) on my STOMP parser to heart and took another stab at it. I think this looks a lot better, if anyone could spare a glance at it I'd appreciate it. This is the first parser I've coded up in Clojure.
14:51cemerickninjudd: hrm, crap. You're right.
14:51ninjuddcmiles74: there you are. did you get my message on github?
14:51amalloyAWizzArd: er...which is an argument in favor of your point, not against it. sorry, not really thinking
14:51cmiles74ninjudd: I did, I'm reading it over right now. :)
14:52cmiles74ninjudd: I would gladly help you with your project. :) It was also very nice of you to say kind things about my stomp parser code.
14:54ninjuddcmiles74: have you had a chance to look at my code? how hard to you think it would be to merge the two projects?
14:55ninjuddcmiles74: at least they have the same name ;)
14:55cmiles74ninjudd: ha!
14:55cmiles74I will look at it next. I feel better about my parser, the first pass I knew was pretty weak.
14:56cmiles74I don't have a lot of code, I can't imagine it'd be too hard. :P
14:56ninjuddcmiles74: the fun part is going to be writing the broker ;) have you started on that at all?
14:56cmiles74ninjudd: I haven't, but I've been reading through the Netty documentation and it does look nice.
14:57cemerickninjudd, cmiles74: gozirra might be a good reference impl to look at, if only because it's very small :-)
14:58cmiles74ninjudd: I work for a hospital, I have to write a lot of little applications to route or alter these messages that go from system to system (i.e. radiology over to registration, etc.) I've been writing my own socket code for these and I'm starting to get to point where I need my own protocol. Stomp sounds better than memaking something up.
14:58clojurebothttp://clojure-log.n01se.net/date/2009-10-13.html#12:02
14:58ninjuddi was planning to just use ServerSocket, because that's what i've used in the past, but i'd like to learn Netty
14:59cemericknREPL can't require netty
14:59cmiles74ninjudd: I hadn't heard of Netty before but it does do some nice things. It would be a dependency, however.
14:59chouserif you use netty you might as well use an existing stomp implementation
14:59cemerickI mean, just FWIW
15:00cemerickor, hornetq for that matter :-)
15:00cmiles74If we use Netty, it will be easier to change the transport layer out from under the service. For instance, supporting the STOMP client and server over webscoket as well as TCP.
15:01ninjuddcemerick: well then you have to let us use protocols so we can swap out different socket implementations
15:01dnolendown with 1.1
15:01ninjuddcemerick: you choose: 1.1 support, or no Netty dep ;)
15:01cmiles74cemerick: Why can't nREPL require Netty?
15:02cemerickYou guys can use whatever you want, but I'm not letting protocol or transport concerns influence nREPLs deps
15:02cmiles74cemerick: I'm not trying to talk you into anything, I'm just curious.
15:03cemerickcmiles74: see Deployment Considerations here: http://bit.ly/nreplnotes
15:03AWizzArd,(.getClassLoader Object) ; why is it like this?
15:03clojurebotnil
15:03ninjuddcemerick: i agree that we should be able to just depend on ServerSocket, which is why we should use protocols
15:03cemerickeh, we already went 'round on that
15:03AWizzArdShould it not be the bootstrap CL?
15:04ninjuddright, where did we leave it? need input from the tools developers on whether they are ok with dropping 1.1?
15:04chouseris the performance requirement such that we need protocols instead of multimethods?
15:04cmiles74Doesn't Horent use Netty as well?
15:05chousercmiles74, ninjudd: I think the ideal would be swappable implementations
15:05cemerickninjudd: I heard grumbling about dropping 1.0.
15:05ninjuddchouser: it isn't a performance thing. more of an expression/elegance thing
15:06cemerickI'd rather save my powder for convincing tool leads to adopt the thing.
15:06chouserno dep, pure clojure, feature-lean client and server that can each interoperate with each other or with the featureful implementation such as provided by hornetq
15:06ninjuddwho wants to write a 1.1 implementation of defprotocol using multimethods?
15:06cmiles74chouser: You are correct, I was just typing something like that. :) In the case of nREPL on someone's desk inside Eclipse or whatever, we could use our own.
15:07chouserninjudd: any elegance protocols have over multimethods can be matched by a simple macro
15:07cemerickMan, protocols are, what, 6 months old and they're already must-haves?
15:07chousercmiles74: 'zactly
15:07ninjuddchouser: perfect, so you're volunteering?
15:07laurusWhy doesn't rseq work on a quoted list?
15:07chouserninjudd: I have such a macro.
15:08chouseryou want it?
15:08cemerickha
15:08ninjuddchouser: absolutely
15:08chouserI wrote it for illustration purposes for my Strange Loop talk. I didn't think anyone would actually want it.
15:09chouserninjudd: http://gist.github.com/606678
15:10laurus,(rseq '(1 2 3 4))
15:10clojurebotjava.lang.ClassCastException: clojure.lang.PersistentList cannot be cast to clojure.lang.Reversible
15:10laurus,(rseq (seq '(1 2 3 4)))
15:10clojurebotjava.lang.ClassCastException: clojure.lang.PersistentList cannot be cast to clojure.lang.Reversible
15:10laurusWhy does this happen?
15:10cemerickfor some reason, that exchange made me cast vader:obiwan::ninjudd:chouser http://www.icanhasinternets.com/wp-content/uploads/2010/09/darthobi.jpg
15:10ninjuddchouser: awesome. so simple
15:11chousernote the "protocol name" in there (DataRow in the example) is completely ignored. Included only to be arg-for-arg with defprotocol
15:11chouserninjudd: yup
15:11ninjuddi'm vader?
15:11ataggartthat's pretty cool
15:11cemerickjust in my head
15:11cemerick:-)
15:11chouserheh
15:12chouserlaurus: there's no way to lazily walk a list from the far end
15:12chouserlaurus: so they don't support rseq
15:12ninjuddmaybe Anakin
15:12lauruschouser, hmm, okay, I'll just take your word for it and not dig deeper
15:12laurusThis isn't an important concept to go more in depth into is it?
15:13chouserlaurus: it's a small aspect of an important concept
15:13chouserit more often comes up as "why is (seq? [1 2 3]) false?"
15:13laurusWell a vector is not a sequence, right?
15:13chouserrighto
15:13alexykninjudd: do you have a separate channel for protobuf?
15:14laurusBut why does rseq have to lazily walk the list? I tried to convert the list into a sequence manually there.
15:14ninjuddno, i just use #jiraph
15:14chouserlaurus: ISeq also doesn't support rseq. You can use 'reverse' if you want, instead of 'rseq'
15:15laurus,(seq? '(1 2 3 4))
15:15clojurebottrue
15:15laurusSo why doesn't rseq work on that seq?
15:16chouserrseq is for collections that have order and can be efficiently walked from right to left
15:16laurusOh, okay. So it doesn't just simply "reverse a sequence."
15:16chouserno, that's what 'reverse' does
15:16chouser,(reverse '(1 2 3 4))
15:16clojurebot(4 3 2 1)
15:17chouserreverse is O(n) -- walks the whole seq so it can get to the last item and start by returning that. non-lazy.
15:17chouserthus you can understand the cost when you call it.
15:17laurusHmm, okay. I guess I thought all sequences were "the same" regardless of what kind of collection they came from in the first place.
15:17raekwhich is most ideomatic: foo->bar or foo-to-bar?
15:17chouserrseq's docs explicitly state constant time, so must be supported by the underlying collection.
15:18raekI noticed that the former appeared in JoC...
15:18laurusSo underneath each sequence is actually the original collection is what you're saying?
15:18chouserlaurus: generally, yes, or at least a portion of it.
15:19lauruschouser, interesting. Thanks for that detail!
15:19chouser...or the code to produce it.
15:19laurusRight :) Heh.
15:19chouserif all you have a seq, that seq still promises to give you the rest of the data if you call rest enough times. So all the data (or the code to produce it) has to be there.
15:20laurusRight.
15:21chouser,((juxt class identity) [1 2 3])
15:21clojurebot[clojure.lang.PersistentVector [1 2 3]]
15:21chouser,((juxt class rseq) [1 2 3])
15:21clojurebot[clojure.lang.PersistentVector (3 2 1)]
15:21chouseroh
15:21chouser,(class (rseq [1 2 3]))
15:21clojurebotclojure.lang.APersistentVector$RSeq
15:21chouser,(class (seq [1 2 3]))
15:21clojurebotclojure.lang.PersistentVector$ChunkedSeq
15:23laurusIt's interesting that (first "ant") returns \a and not "a".
15:25AWizzArdI am currently fighting with those multiple variants of seqs for my serializer
15:26chouserAWizzArd: I would hope their concrete classes wouldn't matter.
15:26AWizzArdchouser: well, I will for now implement a serializer which can serialize them all, but then return a PersistentList when deserializing.
15:28AWizzArdI started off by implementing one that returns exactly the same class again, such as PersistentVector$ChunkedSeq or APersistentMap$KeySeq or APersistentMap$ValSeq or LazySeq
15:28chouserhm
15:28AWizzArdthat was too much work, and most likely not too useful
15:30chouserI'm sure it has something to say on this matter
15:30AWizzArdI see, so I should maybe also have a look on this
15:31chouserwell, rhickey promotes it frequently. I've started reading it before, but never yet finished.
15:32dnolenhuh, never realized clojure.set has basic db style operations
15:32AWizzArdAnd from what you have read so far, would you say that when you serialize a clojure.lang.APersistentVector$RSeq you want such a thing back?
15:33chouserAWizzArd: I don't see how I could care.
15:34chouserI might care that I get back something that implements ISeq, Counted, Obj, IndexedSeq, Iterable, Sequential, etc.
15:36labatitudeI want to use clojure.xml/parse, which takes a stream, but I have a string. How can I make my string into a stream?
15:36labatitude(I've done this before but forgotten again.)
15:38hiredmanByteArrayInputStream
15:38AWizzArdchouser: if I want to save Clojure images I should probably really save all those concrete classes
15:40AWizzArdBut for now I want to come closer to publish that lib soon, and will just return PersistentLists.
15:42labatitudehiredman: I'm getting "java.lang.String cannot be cast to [B"
15:42labatitudedoes this look like the right way?
15:42labatitude (java.io.ByteArrayInputStream. "<?xml version='1.0'?><stuff>And more</stuff>")
15:42hiredmanuh
15:43hiredmanthat's because you need to turn the string into a byte array first
15:43hiredman~jdoc String
15:43hiredman~jdoc java.io.ByteArrayInputStream
15:43labatitudeok, its all in java. I'll go read that right now. Thanks
15:49hugodcemerick: the *in* thing I mentioned is now working in swank-clj, fwiw
15:49cemerickok
15:49AWizzArdchouser: much more I am worried about deeply nested collections
15:49cemerickhugod: trying to keep feature-competitive? ;-)
15:50AWizzArdMy current approach is (like Clojures printer) recursive serialization. This would fail for a list that is nested deeper than 16k levels.
15:50cemerickhugod: more on-point: if you might be interested in writing a swank adapter for nREPL, that'd be stellar.
15:51labatitudehiredman: working now, thanks.
15:51hugodcemerick: there are some differences eg. message id's are client generated in swank
15:52cemerickhugod: that's no problem -- I had originally allowed for user-generated IDs in the API
15:52cemerickhugod: Any swank-compatability-related changes that would be helpful, I'll make.
15:53hugodcemerick: my main drive is to get jpda working at the moment. The *in* thing is something supported by swank but that wasn't in swank-clojure
15:54cemerickI understand.
15:55cemerickhugod: What I'm saying is, if at all possible, I want to encourage SLIME compat.
15:59alexykis there a standard process of updating 1.1 code to 1.2? e.g., can use/require seq-utils be just dropped, and same for other things folded into core?
16:07stuartsierra~seen abrenk
16:07clojurebotabrenk was last seen in #clojure, 89 minutes ago saying: technomancy: thank god I copied over a hundred lines of dependencies... ;-)
16:09cemerickstuartsierra: he pushed something he said was working well
16:09stuartsierrayes I saw.
16:09stuartsierraMy question is: does he have a CA?
16:09cemericknope
16:09stuartsierradrat
16:10cemerickhe has other patches lingering, so hopefully we can make fun of him until he relents :-)
16:10cemerickstuartsierra: not sure if you saw this before: there should be a lodge-your-CA-here table at the conj. Pass it on to the right folk.
16:10stuartsierrawill do
16:10cemerickno one should leave on Friday without being settled
16:11stuartsierraConj boss Alan officially notified.
16:13cemerickwooby: sorry, should've gone to you directly :-/
16:13stuartsierranicknames confuse me
16:13cemerickhandle out of sight, out of mind :-(
16:13stuartsierrareal names are hard enough
16:13charliekiloztellman , sorry to bother with a stupid question : I'm playing around with aleph and are tying to figure what the preferred way is to add functionality in the communication ... I tried wrap-channel, but that does not seem to work (see http://gist.github.com/606776)
16:14ztellmancharliekilo: messages for tcp servers are ChannelBuffers
16:15woobygood progress on the conj front today btw, t-shirts and goody bags ordered
16:15ztellmantrying to put that in a str will cause issues, I think
16:15ztellmanlet me play around with it a bit
16:17cemerickninjudd: do you still have a use case for an incremental progress API if nREPL is going to support streaming *out*, *err*, System/out, and System/err?
16:18charliekiloztellman: ah, ok ... I thought it did automagic conversion ... is 'wrap-channel' the right function in this case or is there a better/preferred way?
16:18ztellmancharliekilo: wrap-channel is the right function
16:18ninjuddcemerick: no, i think i just needed that for streaming
16:18cemerickok, back burner for now then
16:19ztellmancharliekilo: there's some more automagical conversion stuff sitting on my computer that I haven't submitted yet
16:19cemerickninjudd: any issues with my reusing some of cake's multiplexing bits?
16:19ztellmanonce that's in, I think you'd see "Response: <ChannelBuffer ...>"
16:20ninjuddcemerick: the multi-outstream stuff?
16:20abrenkstuartsierra: The CA is coming out of the printer right this moment.
16:20cemerickand such, yes. Not sure if I can reuse it as is, but I figured I'd ask ahead of time.
16:20stuartsierraabrenk: awesome
16:21ninjuddcemerick: go for it.
16:21charliekiloztellman : gotcha ... I think that points me in the right direction ... I will keep an eye out for it in the next commits
16:21charliekiloztellman : thanks
16:22ninjuddcemerick: the most confusing part about that is how it supports an atom for the root binding of *outs* and *errs*
16:22ztellmancharliekilo: once I check that stuff in tonight, this should do what you want: http://gist.github.com/606792
16:22ninjuddcemerick: that makes it so futures and Threads will print to the most recently registered stream
16:24charliekiloztellman : thanks
16:25ninjuddcemerick: though i think rhickey said yesterday that any code that relies on printing in a future without establishing *out* is broken, so you may just be able to remove that part
16:26cemerickvery, very true
16:26cemerickI have a couple of ideas, but they're longshots
16:26cemerickAllowing clients to opt into listening to System/out and err on a per-connection basis is the next best fallback.
16:26cemerickAnd desirable otherwise, anyway.
16:27ninjuddcemerick: it would also me nice if you could just bind *out* and it would take care of System/out for you. but you'll have to deal with decoding and encoding the characters
16:27cemerick*out* related a requested code eval and listenting to System/out have to be kept separate
16:29ninjuddcemerick: not sure i follow
16:30cemerickI don't ever want System/out to get into content sent back as *out* -- clients that would prefer to show them separately wouldn't be able to do so.
16:30ninjuddcemerick: i see. that makes sense. but System/out should still be separate per thread
16:31cemerickfor futures and such you mean?
16:31ninjuddno, just for code that prints directly to System/out
16:32ninjuddjava code
16:32cemerickwhy separate per thread?
16:32ninjuddwell that is what multi-outstream does
16:33ninjuddcemerick: otherwise you could get some other thread's System/out in your repl
16:33ninjuddcemerick: very confusing when it happens
16:34cemerickOh, I see what you're saying.
16:39hugodcemerick: sorry, phone call - I don't see a big difference between nrepl and swank-clj
16:39cemerickThat's good.
16:40cemerickhugod: or, are you saying you're not sure why we're not just using swank-clojure? ;-)
16:42cemerickninjudd: The thing about the wonky System/out stuff that cake does is, e.g. (future (.println System/out "fooey"))
16:42hugodcemerick: kind of, yes
16:43ninjuddcemerick: just bind the root of *outs* to the original System/out
16:43cemerickhugod: no clojure client, tied to whatever the SLIME people want to do with it
16:45cemerickand, as things go along, nREPL will be STOMP-ified, and a lot more flexible
16:45hugodcemerick: well, a clojure client would need writing anyway
16:45cemerickhugod: think: distributing code to N nodes...
16:46ninjuddcemerick: like i said the wonky stuff with letting the root be an atom and using the most recently registered stream can be removed if you want
16:46ninjuddor optional
16:46technomancywe could fork the swank protocol. we kinda already do that by saying "only this one revision from early 2010 is supported"
16:46technomancyfor the record, hugod is rather more of an authority on swank than I am; my understanding of the protocol is rather superficial
16:47ninjuddtechnomancy: don't you lose the benefit of nREPL and Stomp if you wrap the server with a swank compatibilty layer?
16:48hugodyou could put stomp into swank clojure easily enough
16:48ninjuddseems like the best way to go is to write an elisp nREPL client
16:48technomancyI haven't been keeping up with the nrepl discussions; just responding to hugod's comments.
16:48lancepantzi would be a fan of moving away from the swank protocol all together, even though i understand that would be throwing away a lot of work, either that, or atleast document it better
16:48lancepantzi could find no documentation of the protocol and the code was a mess
16:49cemerickninjudd: being able to use SLIME is the motivator in that case
16:49cemerickI doubt many people are very motivated to write elisp to replace it.
16:49hugodI am working on adding jpda support and have refactored swank-clojure significantly in my swank-clj repo
16:51ninjuddcemerick: you're probably right. making swank-clj a stomp client will be much less work
16:52cemerickninjudd: swank-clj is a server
16:52ninjuddcemerick: i know
16:54ninjuddcemerick: but it will also have to be a stomp client to communicate with nREPL. or were you thinking of talking to nREPL library functions directly?
16:54cemerickninjudd: it seems like the simplest paths would be to write a swank wrapper for nREPL, or write an nREPL client in elisp, and hook it into SLIME somehow
16:56AWizzArdIs there a problem with the current slime repl?
16:56ninjuddcemerick: i suppose i am proposing a third option: writing a swank library that communicates with nREPL using stomp
16:57cemerickso you'd need two servers?
16:57ninjuddaye
16:57cemerick*shrug*
16:57ninjuddthree if you count the broker
16:57ninjuddindirection ;)
16:57ninjuddvery flexible from what i hear...
16:57cemerickwell, in that scenario, nREPL is a client too
16:58AWizzArdWhy so many servers? The current emacs + slime setup seems to be working well?
16:58cemerickAWizzArd: But does nothing for those using other tools.
16:58lancepantzAWizzArd: the issue is that it only works in emacs
16:58AWizzArdyes
16:58cemerickAWizzArd: see the Premise here: http://bit.ly/nreplnotes
16:58AWizzArdokay, I will read it :)
16:59lancepantzthe talk is about a replacement that works with all tools
16:59ninjuddcemerick: yes, there are no servers anymore. just clients and brokers ;)
16:59AWizzArdMy current naive thought is that all others could just try to use swank then. But I will see what I find behind that link :-)
16:59cemerickI'm happy with whatever makes the emacsen happy, fundamentally.
17:00ninjuddcemerick: but you'd probably be happier if they use your external network api rather than try to hook into you implementation directly
17:00cemerickninjudd: yeah, the value is in the tool interop, not in the actual REPL impl
17:01ninjuddcemerick: if the swank-clj implementation calls your functions directly, you will be stuck never changing them
17:01cemerickI can't see why swank-clj would ever do that. No value there.
17:02cemerickactually, once nREPL is using STOMP, then an elisp stomp/nREPL client may be the only reasonable option
17:02cemerickThat's either really good or really bad.
17:02ninjuddthat's what i said!!!
17:02cemerickno it wasn't -- it doesn't involve swank-clj at all
17:03ninjuddthe first thing i said, before i proposed the intermediate server/client/swank/stomp bridge idea
17:03cemerickanyway, my speculating on what's best for emacs users is fairly absurd
17:03cemerickoh, right
17:03cemerickyes
17:03cemerickI was agreeing with your initial suggestion :-D
17:04hugod:), I just want to use slime
17:04cemerickright -- no one gives a hoot about protocols :-)
17:04lancepantzworld are colliding omg!
17:04fbru02can i ask an OT question ?
17:04lancepantzs/world/worlds/
17:04sexpbot<lancepantz> worlds are colliding omg!
17:04ninjuddi really think the server/client/swank/stomp bridge will be the easiest to implement
17:05cemerickThat is, until they make it so that you can't connect to my app that uses REPL server A, and I can't connect to your app that uses swank-clj.
17:05hugodthe protocol is half the story - there are also all the functions that get called in the repl
17:05cemerickninjudd: what about embedded REPLs in deployed apps though?
17:06ninjuddcemerick: good point. i guess you would have to run a swank-bridge on your local box
17:06cemerickyack
17:06cemerickOr, hey, whatever. Peace, man.
17:06ninjuddcemerick: your .emacs could start it up for you ;)
17:07ninjuddcemerick: i checked in the fix to read-body http://github.com/ninjudd/clj-stomp/commit/72be202f05106388348bda5b0d636742fd746ae5
17:07cemericknifty
17:07ninjuddcemerick: thanks again! looks like that fixed my locking problem with hornetq
17:07cemerickfbru02: ask away
17:08ninjudd(stompserver and coilmq still appear to not implement ack:auto correctly though)
17:08cemerick~ask
17:08clojurebotNo entiendo
17:08cemerick~Ask?
17:08clojurebotGabh mo leithscéal?
17:08ninjudd~ask?
17:08cemerickbah
17:08clojurebotI don't understand.
17:08ninjudd~what is asking?
17:08cemerickIt used to have a nifty line for that
17:08clojurebotPardon?
17:08cemerick$ask
17:08cemerickoh well
17:08ninjudd$8ball what is asking?
17:08sexpbotninjudd: Concentrate and ask again.
17:09ninjuddhahaha
17:09technomancy~anyone
17:09clojurebotPlease do not ask if anyone uses, knows, is good with, can help you with <some program or library>. Instead, ask your real question and someone will answer if they can help.
17:10ninjuddpoor fbru02. what's your question man?
17:11fbru02cemerick: ninjudd and all : sorry to interrupt
17:12fbru02we and a friend are going to Strangeloop and the conj from Uruguay (me) Argentina (him)
17:12fbru02which is the best place to spend the days in between conferences ? St Lois or Durham?
17:14brianstamand~ask
17:14clojurebotHuh?
17:14brianstamand~what is seq
17:14clojurebot'Sea, mhuise.
17:15scottjfbru02: how many days?
17:15ninjuddfbru02: i've never been to either. how are you getting from St. Louis to Durham?
17:16fbru02ninjudd: by car
17:16fbru02scottj: i guess it is around 6
17:16scottjI would go somewhere else
17:17fbru02maybe forget the car thing and fly NYC ?
17:19scottjyeah or w/ car you could do DC or something else in NC
17:19ninjuddfbru02: if you're a baseball fan, you could go through Cincinnati and see the Reds in the NLCS ;-)
17:20fbru02ninjudd: i don't know anything about baseball it is not that popular around here
17:21scottjbeware of MLS :)
17:21fbru02scottj: i might be getting picky but DC is the only city i know really well in the states, when i was a kid i was sick and went to DC 15 times (from south america)
17:22scottjfbru02: oh yeah don't go there then. for 6 days you can fly anywhere in the US easily
17:24cemerickfbru02: Chicago is not too far from St. Louis, in relative terms anyway.
17:25fbru02ninjudd: scottj cemerick are u guys going to conj or strange loop ?
17:26scottjconj
17:26cemerickconj
17:26clojurebot(conj {:a 1} (when true {:b 2}))
17:26ninjuddconj
17:27ninjudddefn: you're going to strangeloop, right?
17:45ninjuddthe best part about fbru02's question was that it wasn't about <some program or library> at all
17:47ninjuddis there no :or destructuring form for vectors?
17:48hiredmanif you want associative destructuring features you need to use associative destructuring
17:49ninjuddit would be useful for optional arguments (defn foo [required & [opt1 :or 4 opt2 :or 8]] ...)
17:49hiredman,(let [{n 0 :or {n :a}} [:a]] [])
17:49clojurebot[]
17:49hiredman,(let [{n 0 :or {n :a}} [:a]] [n])
17:49clojurebot[:a]
17:49ninjuddhiredman: oh, right!
17:49ninjuddbrilliant
17:49hiredman,(let [{n 0 :or {n :a}} []] [n])
17:49clojurebot[:a]
17:50ninjuddhiredman: thanks
17:50alexykninjudd: how can I set java.library.path in cake?
17:51ninjuddalexyk: 'project.library.path = /whatever' in .cake/config
17:51alexykninjudd: only in .cake/config? no way per-project?
17:52ninjuddalexyk: if it was in project.clj, then everyone would have to have the exact same lib directory location as you
17:53alexykyeah
17:53ninjuddalexyk: cake automatically adds lib/native/arch/osname
17:54alexykok
17:54alexykas you can guess, I'm redoing tokyocabinet :)
17:54ninjuddthough that is more for native deps extracted from jars
17:54alexykbut what was there is obsolete
17:54ztellmanwhat time/day are people flying back from clojure conj?
17:55ztellmanI'm making travel arrangements, and I don't know if 7pm on the 23rd would cut things too close
17:55ninjuddalexyk: just add [tokyocabinet "1.23-SNAPSHOT"] to your dependencies
17:55ninjuddztellman: i am flying back at 7:15pm on the 23rd
17:56alexykninjudd: I'm running in -server -d64, and 32 bit failed
17:56alexykso I recompiled new one, seems to build ok on Mac
17:56ztellmanninjudd: do you know when things are actually finishing up on the 23rd?
17:56ninjuddztellman: though i made my arrangements before i heard there was a secret after party ;)
17:57ninjuddztellman: 5:30pm
17:57ninjuddalexyk: what problem are you having with the tokyocabinet on clojars?
17:58alexykninjudd: actually didn't try that... I needed jnilib and built locally
17:59ninjuddalexyk: if you're using cake, give the clojars one a try. should seamlessly extract the native deps from the jar and add them to your library path
18:00alexykninjudd: not only I'm using the cake, I'm swearing by it!
18:00alexykanybody driving to conj from Boston area? NH/MA?
18:01alexykcemerick: how are you getting to conj?
18:01ninjuddfor some reason i imagine cemerick driving to the conj on a motorcycle
18:02alexykninjudd: it would be a long drive, and Western MA hicks are notorious for their roadblock extortions
18:03alexykthe Scala patrol is especially bad
18:03ninjuddWestern MA hicks, you say?
18:03alexykyep
18:03ninjuddi can't imagine
18:04alexykwell it's a leap of imagination, inspired by late-night driving :)
18:04alexykand truck-stop brawls
18:10alexykninjudd: why can't I run cake repl under rlwrap?
18:10ninjuddcake repl uses Readline internally, no need for rlwrap
18:11alexykninjudd: how do I search backwards, C-r?
18:12ninjuddalexyk: yes
18:12ninjuddalexyk: we don't use rlwrap because then you can't have completion or multi-line history entries
18:13alexykok
18:16alexykninjudd: C-r does nothing for me... How does cake find readline?
18:16ABSI'm getting started with Clojure. While setting up my tooling on emacs (primarily slime), I wondered how more experienced folks use completion for Java members.
18:17ABSOr even the extent to which code completion is supposed to work.
18:17ninjuddalexyk: cake should warn you if it cannot find readline
18:17ABSThe only pattern I have managed to successfully get completions on thus far is (Class/staticMember) eg (System/getProperti[Tab] completes to (System/getProperties) as one would expect.
18:17ABSNothing else seems to complete for me eg can I easily see the members of the java.util.Properties instance returned by the previous call in my simple example?
18:18ninjuddalexyk: do you have something in ~/.inputrc or ~/.editrc that is changing your input mode?
18:18alexykninjudd: nope
18:18alexykbut my readline is in macports, am not sure cake sees it
18:19ninjuddalexyk: does readline work for irb?
18:19alexykalthough arrow-up works
18:19dnolenABS: Slime has an inspector, you should be able to inspect Java objects with it.
18:19ninjuddalexyk: if up arrow works, then readline is working
18:19alexykC-r doesn't work... will have to investigate
18:19ABSYes, the inspector's nice. I have taken a look at it.
18:19ABSI was wondering if rapid typing-time completions work?
18:21ABSor can be made to work with some effort?
18:23dnolenABS: hmm dunno.
18:23ninjuddalexyk: could have something to do with libedit on OS X
18:23ninjuddalexyk: http://bogojoker.com/readline/
18:24ninjuddhttp://bogojoker.com/readline/#libedit_detection
18:24technomancyABS: it might be able to leverage type hints where those are found, but I don't think it could get method completions on objects for which it doesn't know the type
18:24alexykninjudd: thx! have to play to get my C-r back
18:25ninjuddtechnomancy: right. you type the method before the object it is called on
18:25technomancyyeah, propagating type hints from the arglist through to all its usage inside a defn may be nontrivial
18:26ninjuddalexyk: http://hints.macworld.com/article.php?story=20080313113705760
18:26ABSdnolen: Thanks.
18:26ABStechnomancy: I see. Makes sense.
18:27ninjuddABS: i use emacs dumb completion M-/
18:27ninjuddit uses the list of strings in the file as possible completions
18:28ninjuddworks pretty well in a lot of cases
18:28ABSninjudd: Yes, dabbrev works well for me too.
18:29alexykninjudd: thx, the hint saves irb!
18:29ninjuddi always though dabbrev stood for dumb abbrev.. heh, it is dynamic abbrev
18:29alexyk...and cake repl
18:29ABSninjudd: :-)
18:30ninjuddalexyk: great! want to add the fix to the cake wiki?
18:31alexykninjudd: sure
18:31alexykdo you need to add me on github to it?
18:32ninjuddalexyk: should be open http://github.com/ninjudd/cake/wiki
18:32alexykok
18:32ninjuddneeds some love
18:32alexyka bit later will love it a bit :)
18:43raekhrm, I try to use enlive templates stored in resources/
18:43raekit doesn't work, but if I place them in src/, it works
18:43raekboth should be on the classpath
18:44raekwhat am I doing wrong?
18:46raekhrm, nevermind... it magically started to work :)
18:47KirinDaveHey guys.
18:47KirinDaveIt's late in the day and I'm having a problem with a method that really should be easy
18:48KirinDaveI'm sure that it's a trivial mistake
18:48KirinDavehttps://gist.github.com/8288dd764083f099d0d0
18:48KirinDaveThat doesn't seem to be updating internal structures
18:51ninjuddKirinDave: won't (assoc :headers (or headers (:headers response))) replace what you did in the previous two lines if map has :headers in it?
18:51KirinDaveOh yeah, huh.
18:51KirinDaveSee, simple mistake.
18:51ninjudd:)
18:52KirinDaveI'm so tired.
18:52KirinDaveBeen working nonstop on this port of webmachine.
18:52KirinDaveI've almost got everything in place.
18:52KirinDaveAll that's left to do is finish up the edges of the graph.
18:53KirinDaveAnd finish the state threading so handlers can modify things.
18:53ninjuddKirinDave: is it open source?
18:53KirinDaveIt will be soon.
18:54KirinDaveLet me get it actually going end-to-end on http requests and we'll opensource it.
18:54ninjuddcool. i'll keep my eyes out for it
18:54KirinDaveIt's really nice the way it's working out
18:54KirinDaveFor example, here is some of the graph
18:54KirinDavehttps://gist.github.com/2aff4d471c06d1c0d02f
18:54KirinDaveMost of the nodes in the graph are just dead simple.
18:55KirinDaveAnd once I update to 1.3, I'll do the ^:static thing and think about performance.
18:55technomancyso banksimple is the company that's secretly working on a web framework, not relevance... secrets revealed!
18:55KirinDave(like that method I showed does way too much work. :\)
18:55KirinDavetechnomancy: Yeah secret is out.
18:55KirinDaveSomeone tweeted it like immediately.
18:56KirinDaveAnd now every 20 minutes I get an email or dm from someone asking for work.
18:56KirinDaveAhh, startup world.
18:56ninjuddKirinDave: this looks great.
18:56technomancyKirinDave: someone had a thread a few weeks back on the clojure mailing list something like "Do you think Relevance is secretly working on building a web framework? I hope so!"
18:56technomancybut now we know the truth
18:56KirinDaveNo secret.
18:56KirinDaveWe need a REST API framework
18:56KirinDaveI think clojure is the best bet for this.
18:57KirinDaveI saw scala-webmachine and it's pretty opaque.
19:01KirinDaveI have to say I love Clojure's # convention for gensyms
19:01KirinDaveThis is the first time I've been doing serious macro hacking in Clojure and it's WAY more convenient that common lisp's method.
19:01KirinDaveThis is so much more readable without having an extra let body: https://gist.github.com/c9e6eb3c117db6eb7dca
19:14ninjudd,(meta (with-meta (iterate inc 1) {:type ::foo}))
19:14clojurebot{:type :sandbox/foo}
19:14charliekiloztellman, stupid aleph understanding question: for a client that connects to a tcp server and (slowly) uploads binary data, a pipeline will start receiving and processing (partial) messages immediately and *not* wait until e.g. the client disconnects, correct?
19:14ninjudd,(meta (drop 10 (with-meta (iterate inc 1) {:type ::foo})))
19:14clojurebotnil
19:14ninjuddhmm
19:15ztellmancharliekilo: each packet will come through individually, yes
19:15ztellmanare you not seeing this behavior?
19:15ninjuddi feel like i've asked this before. should drop remove meta from a lazy-seq?
19:17hiredmanninjudd: the seq before the drop and wafter are not the same seq
19:19ninjuddhiredman: assoc, for example, doesn't remove meta though.
19:19ninjuddthe maps are not the same map in that case
19:23charliekiloztellman, yep, thats what I see ... currently trying to port a Netty-based Clojure application (which has a ChannelUpstreamHandler that forwards the complete message when client disconnects) to the much cleaner aleph .. probably have to rething my approach
19:24ztellmancharliekilo: it's not hard to accumulate everything
19:26charliekiloztellman, just to make I'm not completely off track, the accumulation would need to happen in the pipeline, not channel, right?
19:27ztellmancharliekilo: http://gist.github.com/607061
19:27ztellmanyes
19:28ztellmanthat's off the top of my head, mind you, that may have a thing or two wrong with it
19:29charliekiloztellman, thanks, that makes sense ... and sorry about all my obvious questions
19:29ztellmancharliekilo: if they're not obvious to you, they're not obvious
19:29ztellmanI'm trying to get the documentation as clear as possible, every question you have helps me understand how to make it better
19:32charliekiloztellman, then I will continue asking if its not obvious to me and buy you a beer or two at clojure-conj (assuming you will be there)
19:33ztellmancharliekilo: I'll be there, and keep the questions coming
20:04ninjuddhow do i pull upstream branches into a forked repository?
20:04ninjuddusing git
20:20ninjuddi think i got it. this helped http://japhr.blogspot.com/2010/09/new-upstream-branch-into-my-fork.html
20:29technomancywould a patch to extend clojure.contrib.generic.comparison to java.util.Date be accepted?
21:05tomojanyone know of any clojure stuff which imports any common 3d model format?
21:05tomojI suppose I could look for java projects
22:47TeXnomancyLicenser: hey, let me know if you're can help with merging the lein-search plugin into leiningen or if you'd like me to do it
22:51TeXnomancyactually, gotta go; maybe take it to a mailing list thread
23:13bhenrywhat's the idiomatic way to format a date object?
23:16hiredmanwith style
23:24bhenryhiredman: perhaps you can guide me towards style away from this
23:24bhenry(defn display-date [d]
23:24bhenry "takes a db date and turns it into a format easily entered/read"
23:24bhenry (str-join " " [(str-join "-" (map pad-to-2
23:24bhenry [(+ 1900 (.getYear d))
23:24bhenry (+ 1 (.getMonth d))
23:24bhenry (.getDate d)]))
23:24bhenry (str-join ":" (map pad-to-2
23:24bhenry [(.getHours d)
23:24bhenry (.getMinutes d)
23:24bhenry (.getSeconds d)]))]))
23:24KirinDaveDude.
23:25KirinDavePlease. Please. Please use gist.
23:25bhenryit's not that long man : P https://gist.github.com/0339a85497a2076275e1
23:26hiredman~google simpledataformat
23:26clojurebotFirst, out of 37000 results is:
23:26clojurebotSimpleDateFormat (Java 2 Platform SE v1.4.2)
23:26clojurebothttp://download.oracle.com/javase/1.4.2/docs/api/java/text/SimpleDateFormat.html