#clojure logs

2009-11-14

00:01G0SUBhmm, after calling (shutdown-agents) I can't send functions to any agent, even the ones created after calling shutdown-agents. Is there any way to restart the agent system?
00:01G0SUBwhat's the rationale behind using that function?
00:03_atoG0SUB: it's so that you can kill the agent threads on exit. If you've been using agents and exit without shutting down their threads the JVM can hang
00:05G0SUB_ato: so that's only when I want to shutdown the whole jvm after doing some task?
00:05_atoyes
00:05G0SUB_ato: makes sense. thanks.
00:11shooverGoSUB: why did you want to call it?
00:26_atohttp://www.google.com/trends?q=clojure%2C+jruby&ctab=0&geo=all&date=all&sort=0
00:26_atointeresting
00:26_atoaccording to that Clojure just surpassed jruby in google searches
00:44tomojI so wish google gadgets were in clojure
00:45tomojwith the STM
00:45tomojI don't have a clue what the fuck the concurrency semantics are for wave gadgets
00:45tomojthe land of refs, atoms, and agents is so simple and easy...
00:46maravillasmaking anything in particular, or just fiddling?
00:46tomojwell, both I suppose
00:46tomojI'm working on a wave implementation of the game "springfield"
00:47tomojwhich is, everyone takes turns saying state capitals, and the first person to say "springfield" wins
00:47maravillasheh, i see :)
00:47tomojbut I realized turn-based was un-wave-y, and now that it's not turn-based, concurrency issues are much more likely I think
00:48tomojand I have no idea what's going to happen if two people make a guess at the same time
00:48tomojgoogle seems to just say that gadgets should not rely on a linear and predictable state, whatever the fuck that means
00:48tomojSTM transactions and snapshots are so awesome!
00:49tomojat least we can write our robots in clojure
02:27somniumhow to hint overloaded interface methods with deftype?
02:29somniumnm, on assembla, not getting it working though...
03:44michaeljaakahello
03:44michaeljaakaWhat is wrong with that?
03:45michaeljaaka(doto (proxy[Thread][] (run[] (
03:45michaeljaaka dotimes [_ 10 ] (
03:45michaeljaaka (println "Hello World ")
03:45michaeljaaka ))
03:45michaeljaaka )) (.start))
03:45michaeljaakaREPL gives
03:45michaeljaaka#<CompilerException java.lang.IllegalArgumentException: Method 'doto' redefined (NO_SOURCE_FILE:407)>
03:45michaeljaakauser=>
03:52_atomichaeljaaka: you have an extra pair of parens around the println
03:52_ato(run[] (dotimes [_ 10 ] ((println "Hello World "))))) <-- if you write it like this it's more obvious
03:54_atodunno what your doto being redefined is about though, you should be getting a null pointer exception
03:55_ato(cause println returns null and you try to call it with the extra set of parens.. you can't call null)
03:58michaeljaakaI'm just plaing with abstract classes and interfaces
04:00michaeljaakawow
04:00michaeljaakathanks
04:00michaeljaakaIt works now
04:01michaeljaakaI'm using proxy to make sure that I undestand how to use it in diferent situations
04:01michaeljaakaI have a code in Java to be integrated with Clojure
04:01michaeljaakathat is why I'm more thinking in terms of java than clojure
04:01michaeljaakabut once I interface the code in Java with Clojure
04:02michaeljaakaI will be more playing with thinking in terms of Funtional Programing
04:03michaeljaaka_ato: thanks again, it just works like a charm
07:05spuzgod, such miserable weather today
07:05spuzat least it's a good excuse to stay indoors :)
08:40cgrandrhickey: hi! I'm just starting to experiment with deftype. Shouldn't specifying ILookup opts out IKeywordLookup?
08:42rhickeycgrand: It should, but doesn't opt out of IKeywordLookup, which is used for keyword call sites. This is a bug
08:42rhickeygot a small test case?
08:43cgrandnot yet, I want to try to implement persistent vectors
08:45cgrandand had a problem with ILookup (on my side) so I dug into the source and saw that as a potential bug when implementing maps
08:57lisppaste8cgrand pasted "IKeywordLookup not opted out" at http://paste.lisp.org/display/90382
08:59cgrandrhickey: ^^ test case
09:02cgranddo you want a patch or you fix it yourself?
09:02rhickeycgrand: almost done
09:02cgrandgreat!
09:08rhickeycgrand: ok, it's up
09:09rhickeyI'm still not happy with this auto-impl stuff
09:12chouserbecause of how it must be implemented?
09:21rhickeychouser: it just seems icky and hardwired. Because of the inheritance in the interfaces, it can get tricky to tell when someone is implementing something via implication
09:22rhickeyI wonder also if nothing/full-map is sufficient granularity
09:22rhickeyand as we spoke of before, if you implement map you lose keyword lookup for fields, so we need to expose that
09:23rhickeycurrently IDynamicType/getDynamicField
09:26rhickeyhrm. looks like protocol fn docs aren't even flowing through anymore
09:37chouser3
11:09BjeringHello, I have a newbie question re the state of clojures performance
11:09BjeringI made this (horrible I know, its on purpose...) fib function: (def fib (fn [x] (if (<= x 1) 1 (+ (fib (- x 1)) (fib (- x 2))))))
11:10Bjeringand (fib 40) takes 40 sec on my machine
11:10BjeringWhile the Java version:
11:10Bjering public static int fib(int n)
11:10Bjering {
11:10Bjering return n <= 1 ? 1 : fib(n - 1) + fib(n - 2);
11:10Bjering }
11:10BjeringTakes 2 sec
11:11BjeringAm I doing something wrong or did I just use something that isnät that well optimized in Clojure=
11:11Bjering?
11:14chouserBjering: numbers are boxed by default in Clojure. Check the interop page and the google group for discussions of primitive number types and math.
11:15chouserOr, better yet, find a more interesting problem to solve first (rather than fib), and then optimize that if needed.
11:24spuzBjering: have a look at: http://clojure.org/java_interop#toc35
11:24Bjeringchouser: Thank you, found this http://www.mikeperham.com/2008/12/13/clojure-vs-ruby/ and tried the version with (int n), doubled the speed. I agree I should fins a more interesting problem, just getting started! :)
11:24spuzAnd also read the sections about primitives and coersions
11:24Bjeringspuz, will check
11:32slyrusso, I had made an aborted attempt to ask this the other day, but swank-clojure doesn't seem to be working for me. Well, that's not strictly true, the *inferior-lisp* buffer works, but the REPL doesn't.
11:32slyrusanyone else seeing similar?
11:33slyrusshould I not be using slime-fancy?
11:36the-kennyslyrus: It works with slime-fancy. Does *inferior-lisp* display any errors?
11:36slyrusthe-kenny: no, although it occurs to me I might be loading the wrong slime. hang on a sec...
11:38slyrusnope, same problem...
11:38slyrusIf I type: 3, I get 3 back. If I type (+ 3 4) it hangs.
11:38the-kennySounds strange
11:39slyrusyeah, and only in the slime fancy repl. in inferior-lisp, it's fine.
11:40the-kennyhm.. I used the fancy-repl with Common Lisp, I haven't changed anything in the config, but my clojure-repl isn't fancy... If I had this problems, I would try to disable the fancy-stuff.
11:51Qvintvsis there a function like take that works from the back of the collection instead of the front?
11:53devlinsf,(reverse [1 2 3])
11:53clojurebot(3 2 1)
11:55Qvintvshrm, well I suppose I could do (reverse (take n (reverse col)))
11:57Chousuke(doc butlast)
11:57clojurebot"([coll]); Return a seq of all but the last item in coll, in linear time"
11:57Chousukehmm
11:57Chousukethere was something else too.
12:36hamzaAre clojure numbers always BigInteger? is this a correct way to determine is a varible is a number (instance? java.math.BigInteger obj) ?
12:36rhickey,(doc number?)
12:36clojurebot"([x]); Returns true if x is a Number"
12:37hamzathanks you..
12:37hamza*thank
13:00spuzis there a parallel version of doseq?
13:40djorkI have implemented something like Clojure's proxy with Lua in Objective-C
13:40djorkLua *and* Objective_C
13:41djorkthanks for the inspiration to all of Clojure's many geniuses
13:44hamzais there a way to turn a map in to vector [key1 val1 key2 val2...] reverse the effect of (apply hash-map [:a :b])?
13:47devlinsf,(vec {:a 1 :b 2})
13:47clojurebot[[:a 1] [:b 2]]
13:47devlinsf,(into [] {:a 1 :b 2})
13:47clojurebot[[:a 1] [:b 2]]
13:48devlinsf,(apply concat (vec {:a 1 :b 2}))
13:48clojurebot(:a 1 :b 2)
13:50ambientheh, the best criticism of Haskell i've seen so far: "if I have to understand category theory to write a program that
13:50ambientdoes IO, IT IS A NON STARTER!
13:51hamzadevlinsf: thank you..
13:52ChousukeI think calling monads monads and trying to explain them through category theory is the problem :P
13:52spuzI'm not sure what category theory is but it would seem to me to be the same as complaining that you have to understand functions to write a program. If that's a feature of the language then guess what, you have to learn about it :p
13:52ambientthe first way i understood functions was go here, then come back
13:53ambientit's pretty easy-peasy
13:54spuzI think my point is that different languages demand different background knowledge but ultimately you're always going to have to engage your brain at some point even in the simplest of languages
13:54ambientwell, C was quite straight-forward for me to learn without any programming or mathematics background
13:55ChousukeC doesn't have functions though. it has procedures.
13:55ambientit's mostly just loops 'n jumps
13:55Chousukefunctions are a very special kind of procedure :P
13:55ambientcorrection, jumps 'n conditions
13:56gravityspuz: Have you written any haskell?
13:56spuzgravity: a long time ago, very breifly, I guess I never got as far as category theory, or at least I didn't understand it :p
13:56ChousukeSometimes when reading the haskell tutorials I get the feeling everyone involved in developing the language is a theoretical mathematician.
13:58spuzIf some code is well broken down into functions that do well defined things, would you call that well factored code? well modularised?
13:58spuzwell functionalarised?
13:58ChousukeI mean, as far as I understand, monads define how to compose a class of operations.
13:58ambienti don't think there is a visible line that separates computer science from math, it's more of a continuum
13:59Chousukewhich makes a lot of sense, to me.
13:59Chousukeit's just a bit difficult to visualise how it all works :/
14:00spuzambient: I agree though I think the way people's brains are wired can be pretty distinct between mathematicians and computer scientists which can make crossing over painful
14:00gravityChousuke: That's really all they do. The various monad tutorials give a lot of metaphors to visualize it (like assembly lines and whatnot)
14:01Chousukegravity: yeah, but it's still difficult to bring to the "real" world :P
14:01gravityChousuke: Yeah, I agree, which is why I stopped trying to beat my brain against haskell :-)
14:01Chousukethe maybe monad is easy to understand, but anything beyond that...
14:02ambienti can't really justify spending a lot of time learning Haskell when from the practical standpoint other platforms and languages _seem_ so much more productive.
14:02Chousukethe fun thing is that I have succesfully written monadic Clojure code once but even though it worked and was pretty nice I don't think I could understand why anymore.
14:02Chousukeit just doesn't stick :/
14:03Chousukehaskell probably is productive once you get into it.
14:03ambienta probability that i'm not willing to bet on
14:04gravityThere's a number of libraries for clojure that use monads, like the parser combinator library. I'm not sure how good they are though.
14:04spuzheh, reading about monads, they seem to relate to what I was looking for just now. It seems they provide a 'functional' way of doing regular imperative sequential work
14:04Chousukeambient: yeah. the real problem seems to be that haskell is completely unusable until you start getting it :P
14:04ambientclojure is exactly what i want from a language, except faster than the best ever optimized C code :P
14:04spuzmaybe 'monadic' was the word I was looking for :p
14:05Chousukeyou can't even experiment with it because the compiler yells at you.
14:05Chousukeit's nice that the compiler can tell that a program makes no sense but sometimes you need to see it fail to understand why :P
14:08Chousukespuz: they provide a functional way because using a monad, you can define how operations are composed... and for imperative code, the monad "just" has to impose sequentiality. it kind of works around the problem that some things aren't really "functional" at all.
14:08spuzChousuke: I see
14:13ambient(my quote was from this rant: http://www.xent.com/pipermail/fork/Week-of-Mon-20091109/054578.html)
14:21hiredmanclojurebot uses fnparse
14:21hiredmanseems ok
14:24hamzahiredman: what for clojurebot uses fnparse? i always thought its just a read eval loop?
14:28hiredmanclojurebot: where do you use fnparse?
14:28clojurebotwhere is your source code
14:28hiredmanhamza: it uses fnparse for factoid lookups and definitions
14:29hamzaoh ok.
14:29arjis there any updated instructed on how to use slime? I just tried installing and I get a bunch of wierd errors
14:29arjseems like all the emacs+slime+ubuntu guides are outdated
14:30ambientwhat kind of weird errors?
14:30gravityarj: I used the instructions on the clojure wiki
14:30ambientthe easiest method for installing clojure/emacs for me on ubuntu would be: emacs > ELPA > clojure-mode from ELPA > M-x clojure-install
14:30ambientrequires: ant & git
14:31gravityambient: That's what I used as well.
14:31hiredman~emacs
14:31clojurebotemacs is best configured for Clojure with instructions at http://technomancy.us/126
14:31gravityarj: I had to undo the ubuntu tutorial stuff with that method as well to make things work properly
14:31arjthanks
14:36ambienti might've to clone drscheme for clojure :/
14:41ScriptorHi everyone, I'm having some trouble installing vimclojure
14:42ScriptorI compiled clojure-contrib with the -Dclojure.jar flag, but it still gives a ClassNotFoundException when I try to compile vimclojure for the prettyprinter
14:42ambient-Dclojure.jar=../clojure/clojure.jar ?
14:43ambientor wherever your clojure.jar is located
14:43Scriptoryep, did that
14:43Scriptorso clojure-contrib compiles fine
14:43ambientvimclojure should compile just fine if you have the .properties file right (iirc)
14:44ambienthow that can be done is in the readme
14:44Scriptoryes, I did that as well
14:45ambientwell, that should be working then :/
14:45Scriptorused the absolute paths to clojure and contrib,
14:45ambienti used relative ones
14:45ambient../clojure/ etc
14:46ambientclojure.jar = ../clojure/clojure.jar for example
14:46arjI don't get it, so I got slime working. And when I do a C-c C-k I just get: compilation finished and nothing in the repl?
14:47ambientarj did you do M-x slime?
14:47Scriptorok, I just changed it to relative paths, still doesn't work
14:47arjambient: yes
14:47ambientarj try running your functions from the repl
14:47arjI just have (+ 1 2)
14:48arjand that works fine ;-)
14:48ambientC-x b *SLIME <tab> :p
14:48ambientit doesn't print everything in the repl iirc
14:48gravityarj: Try something like (println (+ 1 2))
14:48arjit just says 0 compiler notes
14:49arjaha that works
14:49arjthanks gravity!
14:49gravityarj: No problem.
15:23spuzHi all, I've posted an article about my clojure mandelbrot app: http://developmentjungle.wordpress.com/2009/11/14/rendering-the-mandelbrot-set-in-clojure/
15:23spuzAny feedback would be greatly appreciated!
15:35ambientwell, the layout is very nice, and the article is descriptive, informative and has a nice logical progression
15:36ambientyou might be interested in this: http://github.com/ztellman/penumbra/blob/master/src/examples/mandelbrot.clj
15:38erikcwI'm trying to get my feet wet with Clojure. To start, I'm trying to import a Java class for demo purposes. The class is not part of a package. Just "public class Demo" with a few methods inside. Why (import '(Demo)) everything seems to go fine (I get nil returned), but then when I try (.aMethod Demo) I get Unable to resolve symbol: Demo in this context. What am I missing?
15:39krumholterikcw, is aMethod static?
15:40krumholtthen you would have to do (Demo/aMethod)
15:40krumholtif not you would have to create an object of Demo (.aMethod (new Demo))
15:40hiredmanerikcw: (import 'Demo)
15:41somniumis it necessary to quote java classes?
15:41hiredmanif Demo was in a java package like java.io you'd do someting like (import '(java.io Demo))
15:41erikcwkrumholt: no, it's not static
15:42hiredmansomnium: no
15:42hiredmanbut import, until recently, was a regular function
15:43hiredmanso (import Foo) would try to resolve Foo and fail, because the whole point of import is to set it up so Foo resolves to the java class
15:44erikcwI removed the parens form the import and it started working
15:44somniumin ns macro?
15:44hiredmansomnium: in the ns macro you never needed to quote
15:44somniumat repl (import com.klass.Foo) creates a Foo in current ns
15:44somniumnever saw quoted java class before today :)
15:44hiredman"... import, until recently, was .."
15:45somniumhow recently is recenty?
15:45hiredmanthe last two months maybe?
15:46hiredmansomnium: usually you see :import directives in the ns macro, which, as I said, never required the quote
15:46hiredmanerikcw: usually java classes are in a package
15:47erikcwhiredman: this was practically a hello world... :-)
15:47erikcwI'm still in Python land
15:48hiredmanerikcw: hello world is java -jar clojure.jar -e "(println \"Hello World\")"
15:48hiredmanno import needed
15:49erikcwwell, it wasn't exactly hello world, but it didn't seem like enough for a package either. I'm just trying to figure out all the Java interop stuff
15:50hiredmanerikcw: java interop is, essentiallly, transparent, so I wouldn't bother "learning" it, just use it when you need it
15:51hiredmanusing import on Demo is kind of silly anyway
15:51erikcwwhat would be the preferred way of getting into my Demo class?
15:51hiredmanyou can just write Demo in your code and it will refer to the class Demo
15:51hiredmanlike in java, import just aliases the package qualified name to a shorted name
15:52hiredmanjava.io.File => File
15:52hiredmanDemo => Demo is silly
15:52erikcwbut when I restart the REPL and try (new Demo) without the import, I get an "Unable to resolve classname" error
15:52hiredmanyou never have to use import at all if you don't mind writing out long class names
15:53erikcwbut I would need to put Demo in a package right?
15:53hiredmanerikcw: and after import it works?
15:53hiredman,File
15:53clojurebotjava.lang.Exception: Unable to resolve symbol: File in this context
15:53hiredman,java.io.File
15:53clojurebotjava.io.File
15:54hiredman,(import 'java.io.File)
15:54clojurebotjava.io.File
15:54hiredman,java.io.File
15:54clojurebotjava.io.File
15:54hiredman,File
15:54clojurebotjava.io.File
15:54hiredmancould be a default package issue (which is where classes with no package get stuffed)
15:55erikcw,default.Demo??
15:55clojurebotjava.lang.ClassNotFoundException: default.Demo??
15:57chouserclojure doesn't really support the default package
15:57hiredmanlike I said, don't bother with java interop until you have a real use for it, because it won't be an issue
15:57hiredmanuntil you need something from some apache library or something
16:00hiredmanperformance issues are not the samething as interop issues
16:00ambientif java style arrays are considered as interop (and I'm going that) when without them, writing idiomatic clojure, the program would be a lot less performant
16:01ambient*doing
16:01hiredmanit's not "java style arrays" they are java arrays
16:01ambientok
16:01hiredmanand using them, reading them, writing them, is all easy as pie
16:02ambientnot really
16:02ambientit seriously clashes with functional programming style imo
16:02hiredman,(into-array [1 2 3])
16:02clojurebot#<Integer[] [Ljava.lang.Integer;@1fdc6f6>
16:02hiredman,(into-array Integer/TYPE [1 2 3])
16:02clojurebot#<int[] [I@1c803ae>
16:03hiredmanambient: well, that is an impedance mish mash that I don't think can be done away with
16:03ambientthis is what i'm doing at the moment: http://bitbucket.org/amb/clojure-snippets/src/tip/src/amb/synth/engine.clj
16:03ambientand think that's pretty bad
16:03ambientit might be just my limitations
16:05hiredmanwhat is bad about it from an interop stand point?
16:05hiredmanthere are java arrays as first class values
16:05ambientyou said it, the impedance mish mash
16:05hiredmantaking part in the macro system
16:05hiredmanetc
16:06hiredmanI mean, what else could you possibly want?
16:07ambientif i knew the answer to that question, i'd already done it
16:07ambientbut im not satisfied with this current solution
16:07hiredmanhave you looked at changing stuff like osc-type-sin to an inline function?
16:07ambientit's not clojure, i think i just have to think about this problem a bit more
16:07hiredmanI hate to see math traveling across function calls
16:08ambienti can't really make it functional because its realtime and every value could be changed at any given time
16:08ambientit constantly takes in user input
16:09hiredman*shrug*
16:11hiredmanyou've seen rich's recent talk thats up on infoq?
16:11ambientthe jvm lang summit?
16:12hiredmanyeah
16:12ambienti heard there were light-weight java classes coming at some point in the future for clojure
16:12ambientyeah i watched it
16:13hiredmanso clojure is for describing processes, not for writing “functional” programs
16:14hiredmanit's that functions are the most composable way to describe parts of a process
16:14ambienthe also talked about discretizing the world into steps, which is exactly what im doing
16:15ambientbetween each step, the state can be changed by the user and then fed unto functions
16:15ambientit's just that i'm doing that 44000 times a second at minimum
16:17somniumambient: are the 'light-weight java classes' deftype or lighter still?
16:17somniumthese rumors
16:17hiredmana java class is a java class
16:18hiredmanthe only difference would be the amount of ceremony involved in defining one
16:18somniumtrue
16:18ambientsomnium probably
16:18somniumI wish gen-class was lighter weight
16:18somniumoften some ugly java apis want you to subclass some mutable thing that they're packages can mash all over
16:18hiredmansomnium: write some macros
16:20hiredmanhttp://gist.github.com/34229
16:20somniumI've been unable to get equivalent performance with gen-class :(
16:20somniumremotely equivalent even
16:20slyrus_ahh... thought i was losing my mind for a moment there. the changes that cause slime/swank-clojure to break are in slime, not in swank-clojure
16:21hiredmansomnium: gen-class is not a performance construct
16:21slyrus_2009-10-28 is good, slime HEAD isn't...
16:21hiredmanit is for interop
16:21somniumI know, I guess that's what I wish there was, though maybe its better it doesnt exist
16:21hiredmangen-class generates a stub for each method that in turn calls the clojure function that backs it
16:21hiredman~performance
16:21clojurebothttp://clojure.org/java_interop#toc46
16:21somniumbecause people would use it for evil
16:22hiredmandeftype and reify will both generate methods directly (no stubs)
16:22somniumbut you can't subclass concrete types
16:22hiredmanwill and do, I should say, if you are following the new branch of clojure
16:22somnium? using edge but reading assembla
16:23somniumI guess it hasn't caught up? assembla says only interfaces
16:23hiredmanedge?
16:23somniumnew
16:23somniumhow many branches have defprotocol right now?
16:23somniumthat one
16:23hiredmansomnium: the will and do was not a reply to you, but a continuation of what I said earlier
16:24hiredmansomnium: where do you need to extend a concrete superclass?
16:26hiredmanI think there are a few possible work arounds for that case
16:27somniumI can get by with an interface, but it still would have to mutable, so I already bit the bullet on tiny .java file
16:27somniumjust added a toclojure button that makes a shiny persistent map when the mashing is over
16:27hiredmansomnium: it is very easy to get to mutable stuff in clojure
16:28hiredmanof course there are the thread safe constructs like atoms and refs and agents
16:28somniumyes, but not easy to write fast performant classes that let other apis mash on them
16:29hiredmansomnium: reify lets you create volatile fields
16:29hiredmanor at least it did at some point
16:29slyrus_looks like addc5be70a489cdc8ed555a2fed7273040da196e is the offending slime commit
16:29hiredmanyou can also just close over an array
16:30somniumwell, I shouldnt really complain, 80 lines of java and everything else in persistent datastructures isn't a bad deal
16:30somniumif deftype/defprotocol gets fast enough maybe clojure-encoders will be fast enough to bypass the 90 class hierarchy in the driver some day
16:31hiredmanyou really shouldn't complain until you've reify+volatile fields or closing over an array
16:31hiredmantried
16:31spuzambient: thanks
16:32somniumwasnt aware of volatile fields
16:32spuzI know there are plenty of other examples of the mandelbrot fractal in clojure. I've not seen that one before though
16:32somniumgoogling now
16:32hiredmansomnium: it's on the new new assembla page
16:33hiredmanbut I don;'t know if they made the final reify cut
16:33ambientspuz it's plotting mandelbrot with the gpu :)
16:33somniumhiredman: its on the new new page but no mention in reify, that I see...
16:34somniumsuggested resource?
16:34hiredmanreify as mentioned on the datatypes page doesn't saying anything about volatile locals
16:34hiredmansomnium: the reify docstring
16:35hiredmangithub hates firefox for some reason
16:35spuzambient: I expect it's several thousand times faster than my version then :)
16:37somniumis reify in a package?
16:37somniumer ns
16:37somniumother than core?
16:38chouserit's in the 'new' branch
16:38somniumI have, from yesterday, with deftype and defprotocol
16:39somniumbut reify isn't there
16:40hiredmanlooks like reify in Compiler.java has a slot for fields, but it is not used
16:40hiredmanbuild is called with null
16:40hiredmanhttp://github.com/richhickey/clojure/blob/new/src/jvm/clojure/lang/Compiler.java#L5431
16:41hiredmanGRRR
16:41hiredmanwhy does github not work in firefox these days?
16:42hiredmanI cannot even select text
16:42hiredmananyway, there is a comment that says "//todo - setup volatiles"
16:42hiredmanso we'll see
16:45slyrus_great... of course the patch that breaks slime/clojure is a 2661-line monster...
16:46somniumslyrus_: once a month or so I try to upgrade slime with a fresh .emacs.d, it hasn't gone well for a while
16:46somniumslyrus_: hopefully its coming to elpa soon
16:47slyrus_what is elpa?
16:47somniumemacs lisp package archive
16:48somniumisn't that the recommended way to get clojure these days on emacs?
16:48spuzhiredman: You mean half that page is missing? I don't think it's just github, the clojure api page is cut off half way through as well on firefox.
16:48ambientit's an old firefox bug afaik
16:49hiredmanspuz: no, I mean I can see the text, I just cannot select it
16:49hiredmanand there is no syntax hilighting
16:49ambientperhaps they have disabled with javascript?
16:49ambient+it
16:49spuzhiredman: strange, I can see nothing but whitespace after line 1908
16:49slyrus_somnium: recommendend shmecomended... I'd like things to work out of the HEADS of various repos, at least most of the time.
16:49slyrus_That was true until 10/31..
16:50hiredmanspuz: I have a similar issue with core.clj
16:50ambientyeah, doesn't work for me either. just blackness after 1/3 of the page
16:50hiredmanblackness?
16:50hiredmanI get whiteness
16:50ambient*shrug*
16:50hiredmanall of Compiler.java is there
16:50hiredmanI just cannot select and copy any of the text
16:51sdeobaldIs there a clojuresque way to append to a list? Like: http://gist.github.com/234800
16:51hiredmansdeobald: don't
16:51sdeobaldOr should one always use a vector in that case?
16:51hiredmanlists are for prepending
16:52sdeobaldRight.
16:52hiredmanvectors are for appending
16:52sdeobaldCool.
16:52hiredmanyou could actually make list appending lazy, I guess
16:54sdeobaldYeah, I was wondering if that existed as a library function (or contrib) -- though it makes sense that it doesn't.
16:55hiredmanthe other issue with github is if I allow all of github's javascript on the only computer I have with flash installed, firefox locks up for a minute or two
16:55hiredmansdeobald: I doubt it
16:56sdeobalds'cool. This is one of the many known issues of working through sicp in clojure, I guess. :)
17:07hiredman
17:08kanaksdeobald: you could use concat to lazily append the second onto the first. But if you're appending extensively, it's time for a different data structure. :)
17:11ambientbah, i have a problem with git "error: Entry 'ClojureCLR/...' not uptodate. cannot merge" tried git reset --hard and git checkout . but wont work :/
17:12ambienttrying git pull gives that error
17:15ambientaah, it might be just that git is broken on windows
17:41rhickeyprotocol call site caching is up!
17:41rhickeywill be in effect when no :on interface is specified
17:41rhickeychouser: please try with your finger trees
18:01chouser"queue" test: letfn+reify 2151, defprotocol 6234, now 5380
18:02chousersplit test: letfn+reify 2351, defprotocol 3824, now 3552
18:04hiredmanare there no obvious bottlenecks?
18:04chouserconcat test: letfn+reify 1699, defprotocol: 1958, now 1679
18:05chouserthat's it for the tests I've been running regularly
18:05hiredmanlike if you run it through a profiler do you see certain hotspots?
18:06chouserhiredman: I had done that in working it down to the "letfn+reify" versions mentioned above.
18:07chouserThere are a few areas I can proabaly still target, esp. on the split test
18:07chouserI haven't done any profiling since switching to defprotocol.
18:08hiredmanI am just wondering if defprotocl might have a set of hotspots
18:08chouserI've been entrusting rhickey with that end of things. ;-)
18:09hiredmanso say we all
18:10somniumam I crazy? I just built new and reify is not in 'user
18:10chouserit's a special form
18:11somnium... so no doc string?
18:11somniumah, ok
18:11chouserI guess not. but (reify) should return an object
18:12somniumit does
18:12somniumhiredman: where can I find the doc string you mentioned to read?
18:13dpthfltrjust an idea.. someone should make a clojure DSL for the OpenLaszlo platform. That would be sooo badass and would be something that other non-java languages couldn't do as well.
18:14dpthfltrthere.. I dropped a killerapp idea on you guys now I'll go away for 6 months and when I come back hopefully it'll be ready ;)
18:14somniumooh, I didn't know pandora was openlaszlo
18:14dpthfltrwalmart.com too
18:15dpthfltrit uses an XML/JS based language so it's all web standards, no bogus custom language like Adobe uses
18:15somniumdpthfltr: I tend to visit pandora more often than walmart.com ;)
18:15ambienthi folks, im having trouble in converting from java code to clojure: http://paste.pocoo.org/show/150687/
18:15dpthfltrit's declarative programming. You code it once in this XML DSL and then it compiles a javascript and a flash version
18:15ambienttrying to generate anonymous object that has a callback function
18:16somniumdoesn't adobe have something like that?
18:16ambienthere's the reference: http://code.google.com/p/jrtaudio/source/browse/trunk/examples/src/OscillatorBank.java
18:16dpthfltrno adobe doesn't have anything like that... they push Flash everything they don't support native JS
18:16somniumhmm, walmart site looks like any rails/django, pandora is badass though
18:16hiredmansomnium: it was a guess
18:17somniumok
18:17somniumhiredman: just made me think I was crazy for half an hour :)
18:17hiredmansorry
18:19somniumnp
18:21ambientim trying to understand proxy. shouldn't this work? (.foo (proxy [] [] (foo [] 1)))
18:22hiredmannope
18:22hiredmanproxy doesn't let you create new methods
18:22hiredmanreify does
18:22ambientso it's only for actualizing interfaces? ok
18:22ambient(doc reify) ==> :(
18:22clojurebotExcuse me?
18:22ambient,(doc reify)
18:22clojurebotTitim gan éirí ort.
18:23hiredmanclojurebot doesn't have the special handling needed for special form's docstrings anyway
18:24ambienti just did git pull for clojure today and (doc reify) is missing from my repl also
18:24ambientso im guessing gen-class is what i'm looking for
18:24hiredmanit's possible that doc's special handling of spcial forms has not been updated for reify
18:25hiredmanwhich makes sense, because the special handling of special forms just points you to the clojure website, which doesn't document reify anyway
18:25hiredmanambient: reify is only on new branch
18:27ambient"implements one or more interfaces" can it implement zero interfaces and just construct an anonymous class?
18:27hiredmanlast I check it could
18:27ambienteg. would (.foo (reify [] [] (foo [] 1))) work?
18:27hiredmanchecked
18:27ambientok
18:28ambientty
18:29chouserbut I think that requires runtime reflection. That is, it works but will never be as fast as java interop can be
18:31hiredmanjava.lang.NoSuchMethodError: clojure.lang.RestFn.<init>(I)V strikes again
18:32chouserno, that doesn't work... Can't define method not in interfaces: foo
18:32hiredmanhmmm
18:33somniumoddly, the inferior lisp buffer blows up when I load new branch, but slime gets started somehow anyway and it seems to work
18:33somnium*shrug*
18:34qedcome back clojurebot!
18:34hiredmansomnium: you might need to recompile contrib
18:35hiredman,(reify [] (.toString "foo"))
18:35clojurebotjava.lang.ClassCastException: java.lang.String cannot be cast to clojure.lang.IPersistentVector
18:35somniumyeah, I started doing that since yesterday
18:35hiredman,(reify [] (.toString [] "foo"))
18:35clojurebot#<sandbox$eval$reify__3467 foo>
18:35hiredman,(reify [] (.toString [] "foo") (.bar [] :baz))
18:35clojurebotjava.lang.IllegalArgumentException: Can't define method not in interfaces: bar
18:35hiredmanI see
18:36wooby,(doc reify)
18:36clojurebotPardon?
18:37hiredmanis there some interface generating compliment to deftype?
18:38chousergen-interface is as close as we've got at the moment
18:38chouserthere will be something with more deftype-like syntax I think
18:39hiredman,(deftype Pair [a b])
18:39clojurebotDENIED
18:40hiredman*zing*
18:40rhickeychouser: thanks - where are those tests?
18:40rhickeyone thing that will not be sped up by the call-site caching is higher-order use of protocol fns
18:41chouserrhickey: sloppily noted here: http://github.com/Chouser/finger-tree/blob/master/notes.txt
18:41rhickeyis that the case in the first 2 tests?
18:41hiredmanhmm
18:42chouser(reduce consl (EmptyTree nil) ...)
19:09chouserrhickey: so if might it be worthwhile to generally replace (reduce consl ...) with (reduce #(consl %1 %2) ...) when consl is a protocol method?
19:10qedhttp://github.com/technomancy/leiningen/blob/master/README.md
19:10hiredman:(
19:12ambientif i feed a clojure function to a gen-class constructor, what is its type?
19:12chouserclojure.lang.IFn
19:12ambientcheers
19:13chouserthough I guess you can take your pick:
19:13chouser,(supers (class #()))
19:13clojurebot#{java.lang.Object clojure.lang.IMeta clojure.lang.AFunction clojure.lang.Obj java.io.Serializable clojure.lang.AFn java.util.concurrent.Callable java.lang.Runnable java.util.Comparator clojure.lang.IFn clojure.lang.Fn clojure.lang.IObj}
19:35chouserputting the protocols :on interfaces is faster than not, but not as fast as the call-site caching
19:38arjI have a simple question, how do change the classpath of the repl in Emacs?
19:39ambientyou mean namespace? (ns my.new.namespace)
19:40somniumarj: or add-classpath?
19:40somnium,(doc add-classpath)
19:40clojurebot"([url]); Adds the url (String or URL object) to the classpath per URLClassLoader.addURL"
19:40arjI have a library in the current folder that I want to add
19:40arjlike the java -cp
19:41somniumarj: M-x clojure-project / swank-clojure-project make it easier
19:41arjok I'll try
19:41somniumbut (add-classpath "~/libs/foo.jar") will work by hand
19:41somniumer, probably no shell expansions I guess
19:42ambientif you want to make it permanent to ~/.emacs then "(dolist (d (list "c:/stuff/lib" "c:/more/stuff")) (add-to-list 'swank-clojure-classpath d))
19:42ambient"
19:42arjaha
19:42arjthanks!
19:44arjdamn this clojure stuff is insanely cool :-)
19:48ambientseems i can't have gen-class and other random clojure code in the same file?
19:48ambienttrying to gen-class and after write clojure code to use that class fails
19:48somniumambient: did you compile it?
19:49_atoit should work okay if you compile it
19:49ambientyeah but the gen-class is different from the file name and namespace
19:49somniumI think the :name parameter determines the final classname
19:50ambientim using (gen-class) instead of (ns foo.bar (:gen-class))
19:50_atoah, I haven't tried that combination
19:50ambientso the problem is that (compile amb.synth.rt-impl) wouldn't find the class needed
19:51ambientwhen the file it resides in is amb.synth.audioloop-rt
19:52_atohmm.. I would have thought (compile amb.synth.audioloop-rt) would do it
19:52ambientit gives classnotfound
19:55ambienthere's the code http://paste.pocoo.org/show/150699/
19:56DraggorHow do I load a java class?
19:59somniumambient: hmm, it looks like you could put gen class in the ns (which I've gotten to work, no idea about out of ns)
19:59ambientyeah, it's what i'm trying to do now
20:00somniumambient: are the defs at the top to be the state?
20:00ambientnot of the gen-class, no
20:00somniumif you have state you need to an -init somewhere to set it
20:00scottjIs there a more idiomatic way to write (for [_ (range 3)] (rand-elt "abcdefgh")) than that and (take 3 (repeatedly #(rand-elt "abcdefgh"))) and (map (fn [x] (rand-elt "abcdefgh")) (range 3))?
20:00_atoambient: hmm... your code is actually working for me
20:01_ato(once I stripped the references to stuff I don't have)
20:03_atoambient: http://gist.github.com/234896
20:04somniumscottj: maybe (def *random-letters* (repeatedly #(rand-elt))) and then (take n *random-letters*)
20:04somniumor (dotimes [_ n] ...)
20:05ambient_ato ok, i got to try that and start from there
20:05somniumIve never seen for or map used with their bindings ignored
20:09ztellmanjust finished a clone of asteroids, if anyone's interested: http://github.com/ztellman/penumbra/blob/master/src/examples/asteroids.clj
20:12ambientwere there some problems in naming files "rt-impl.clj" ?
20:12ambientlooks like (use foo-bar) tries to look for foo_bar.clj
20:13ambientand thus... naming audioloop-rt.clj might screw up gen-class
20:13qedwhat is rand-elt?
20:15scottjqed, random element from collection
20:15qedis that in a special library or something?
20:16scottjqed, clojure.contrib.seq-utils
20:17_atoambient: ah yeah. I think it's because java doesn't like hyphens in class names, so you should put namespace foo-bar in foo_bar.clj
20:18ambienti wonder how do i reset namespaces in emacs/clojure/slime?
20:18ambientsometimes there are leftover functions that annoyingly interfere
20:19_atoM-x sime-quit-lisp M-x slime ?
20:19ambienttried M-x slime, nope
20:19_atos/sime/slime/
20:19ambientcool, slime-quit-lisp works, thanks :)
20:20somniumyou can use ns-unmap if there's only one or two
20:21technomancyambient: re-invoking M-x swank-clojure-project will do it if that's how you launched it.
20:21_atohmm... looks lie there's also a slime-restart-inferior-lisp
20:21ambientnah, not using swank-clojure-project
20:21ambienteven though i perhaps should
20:21technomancyyou should, unless you're either hacking clojure itself (or contrib) or are just playing around with Clojure.
20:22somniumI love being to able to jump from a project in new to 1.0 in seconds
20:23somniumtechnomancy: don't know how I used clojure without it
20:24technomancysweet.
20:29technomancy_ato: yeah, that doesn't pick up on new jars in lib/, so I don't use it as much
20:32Draggoris this a valid string for add-class? "file./somedir/another/"
20:32Draggoradd-classpath*
20:34_atoI doubt it
20:34_atoDraggor: "file:///somedir/another"
20:35Draggor_ato: Sorry, my typing is failing, but I don't want to use an aboslute path. Maybe "file://./somedir/another/"?
20:36_atoI don't think you can use a relative path
20:36DraggorIs there a way to get the current working dir from clojure?
20:36_ato(System/getProperty "user.dir")
20:37DraggorThank ye sir
20:39briancarperIs it still possible to install swank-clojure without using ELPA and clojure-install and such?
20:40briancarperI'd like to download it to a folder of my choosing and throw some lines in ~/.emacs and have it work. But this seems difficult and undocumented.
20:48technomancybriancarper: the master branch of swank-clojure is still un-elpa-ified
20:48technomancyunfortunately it takes a while for things to propagate to the elpa repos; once it makes it in it will be much more straightforward
20:50briancarperI'd almost rather things be less straightforward. :( I don't like when things are auto-downloaded and stashed away in places I can't find.
20:50technomancybriancarper: the problem is the autoloads for the combination of clojure, swank, and clojure-test-mode are nontrivial
20:50technomancyso it's only straightforward if you don't mind loading them all at emacs boot time, which is not a good general solution.
20:52briancarperYeah, I've noticed the order is hard to get right.
20:54technomancythere's not much magic behind elpa, it just puts packages in ~/.emacs.d/elpa/PACKAGE-NAME-VERSION/
20:54technomancyand then it compiles and sets up autoloads
20:54technomancybetter get used to it anyway; it's going to be part of Emacs 24.
20:54briancarperWhen it downloads Clojure itself, where does that end up?
20:55technomancythe new version puts its jars in ~/.swank-clojure/
20:55briancarperAh, OK.
20:56ambientweird. (ns amb.synth.foo (:gen-class :methods [[callback [] Integer]])) (defn -callback [this] 0) and then trying to (compile 'amb.synth.foo) returns IOException
20:56ambient"system cannot find the path specified"
20:59ambient*sigh* such fun
21:07briancarperambient: Do you have a "classes" directory for compiled files to be put into?
21:08ambientyeah, i created it but it might be in the wrong place
21:09ambientit would help if i knew where clojure tried to put them
21:10briancarperI think it's "classes" relative to the current working directory. Check *compile-path*.
21:10technomancyambient: just check the value of *compile-path*
21:10ambient"classes"
21:12ambienti should probably find out what is current emacs working directory instead of project root or classpath
21:14technomancyambient: ,cd from slime-repl should do it
21:15st3fanis there a simple way to iterate over a map like python does, with for key,value in map.values() ?
21:16ambienttechnomancy yeah, putting classes dir to emacs bin directory seems to work, but... i think there might be a better way D:
21:16briancarperst3fan: (for [[k v] some-map] (do-something-with k v))
21:16ambientthere must be a way to change emacs slime-repl working directory on startup
21:16st3fanah that was the syntax i was looking for! :)
21:17briancarperambient: Every time I start Emacs I M-x cd into the right project dir, then immediately start Slime from there.
21:18ambientbriancarper heh, i already do M-x color-mode-arjen and various rituals
21:18ambienti'd rather automate the whole thing
21:34Gulhi, still learning (at the very beginning), looking for an example of a simple spider (thread pool of 10 connections) for crawling a list of uris, i would be glad if anyone could point me to a simple example
21:45Jetienis there anybody out there?
21:45hiredman~ping
21:45clojurebotPONG!
21:55ambientso how do i set the default directory in .emacs?
21:56gcvambient: I think you can just (let ((default-directory "/your/path")) ...)
21:57ambienti dont know how would that work? isn't it usually setting some variable to foo, instead of let
21:58ambientM-x cd is (swank:set-default-directory "foobar") but that doesn't work like that in .emacs
21:59gcvSo you're trying to change the current directory for the buffer you're visiting?
22:00ambienti just want a way to keep the default location in which clojure created gen-class classes c:/code/clj/classes
22:00ambientso the working directory of emacs should then be c:/code/clj
22:03gcvat a guess I'd say that forcefully setting the default directory will screw things up for you. I think there's a better way to achieve what you want, trying to think of it now...
22:04gcvah
22:04gcvI think I have it
22:05gcvhttp://technomancy.us/126 has a mention that setting -Dclojure.compile.path should do the trick for you. just set it to your absolute path, and you should be good to go.
22:07gcvon another subject, is anyone around who is really good with syntax-quote and unquote?
22:07gcvI'm trying to transform ['a 'b 'c] into [~'a ~'b ~'c] for intentional variable capture purposes.
22:15hiredmangcv: do you have an example?
22:16technomancygcv: tried ['~'a '~'b '~'c] ?
22:16gcvhiredman: here's what I really want: (map (fn [x] ?????) ['a 'b 'c])
22:17gcvfill in the question marks
22:17hiredmanand what is the output of map?
22:17gcv[~'a ~'b ~'c]
22:17hiredmanit would have to be eval
22:18gcvyuck, really? I've been so heavily warned off against eval I didn't even think of it.
22:18hiredmanno
22:18hiredmannot eval
22:18hiredman,'a
22:18clojurebota
22:19hiredman,`~'a
22:19clojurebota
22:19hiredmanno difference
22:19st3fangcv, show the full code
22:20hiredmanso what you want makes no sense, so it's time to widen the scope of the inquery
22:20gcvokay, this needs a little explanation
22:20gcvyes :)
22:20gcvokay, I'm really really sick and tired of parsing out my own arglists for keyword arguments, so I set out to write something that handles keywords like Common Lisp's lambda lists
22:20gcvdefnk is cool and all, but doesn't work with multimethods
22:20gcvor (fn [...] ...) forms
22:20hiredmangod
22:21hiredmanjust use map destructuring
22:21hiredmanI am tired of defnk and apply hash-map nonsense
22:21gcvyes, map destructuring is a decent alternative, but isn't quite as DRY as I'd like
22:22hiredman,((fn [{:keys [a b]}] [a b]) {: 1 :b 2})
22:22clojurebotInvalid token: :
22:22hiredman,((fn [{:keys [a b]}] [a b]) {:a 1 :b 2})
22:22clojurebot[1 2]
22:22gcvAnd you had to write each symbol twice
22:22chouserno
22:22gcvone other wrinkle
22:22hiredmanuh
22:22hiredmanwhat?
22:23gcvsorry, if you want to specify defaults, you have to write each symbol twice, once in :keys and once in :or
22:23hiredman,((fn [a b] [a b]) 1 2)
22:23clojurebot[1 2]
22:24hiredmangcv: ok, where is your implementation of this?
22:24gcvI want (1) to specify defaults, and (2) to be able to specify an extra optional symbol to be set to an indication if the keyword was passed in. In short, I want it to work exactly like Common Lisp :)
22:25hiredmanactually, forget it, it's bound to be a complicated macro, and I have no motivation for this, maybe someone else will look at it
22:25gcvhiredman: okay, no worries, thanks anyway
22:27gcvhttp://paste.lisp.org/display/90409
22:30st3fancool! http://github.com/technomancy/leiningen/blob/master/README.md
22:58technomancyst3fan: let me know how it works for you if you try it
22:59technomancyI haven't even announced it and it seems there's a lot of interest, so I guess it's addressing a pain point for clojure developers
23:00crossi'm trying to build neman.cells, but having some trouble. does anyone know of a pre-built jar somewhere?
23:01technomancyyay; slime/swank-clojure got uploaded to elpa.
23:05gcvtechnomancy: does leiningen support going against non-canonical Maven repositories?
23:07technomancygcv: yeah, I just added that
23:08technomancyit includes build.clojure.org by default, but you can add more in project.clj
23:08technomancynot documented yet, but you just add :repositories {"myrepo" "http://my.repo.org&quot;} to defproject
23:09gcvvery very nice. thanks for taking this on.
23:09technomancysomebody had to do it. =)
23:11scottjHow do the new branches on clojure and contrib work? Does everything go there first, or just new features, and when are they moved into master?
23:12scottjDo you guys use the new branches for active development? Is there often breakage between core and contrib and slime and swank when following new?
23:13_atoscottj: the "new" branch doesn't actually mean new as in "new things" in means "new" as "new-new" (a feature which was later renamed to reify)
23:13hiredmanthe new branch of contrib is brand new
23:14gcvscottj: fwiw, the latest slime and swank-clojure work just fine with Clojure from the 'new' branch.
23:14_atoscottj: but yes experiement features that might change completely or may never actually make it into clojure are developed in branches
23:15hiredmanthe new branch of contrib is for contrib contributors to play with features from the new branch of clojure
23:16_atosmaller changes and bugfixes go into master, so you can generally rely on master being reasonably stable
23:16_ato(in the sens of API stability)
23:18technomancyclojure.contrib.logging has a really lousy format by default: Nov 14, 2009 8:16:51 PM clojure.contrib.logging$fn__5081$impl_write_BANG___5089 invoke INFO: Compiling leiningen.uberjar
23:18technomancy
23:18technomancyany way to tidy that up without pulling in something like log4j?
23:19technomancynever mind; there's really no reason to use anything more complicated than println in this case. =P
23:19hiredmanI think that is java.util.Logger's format
23:20hiredmantime classname method name loglevel message
23:20_atowhich I think you can override by subclassing java.util.logging.Formatter
23:21hiredman:(
23:21technomancyyeah, println wins for this. =)
23:21_atoyeah, definitely
23:21hiredman(binding [*out* *err*] (prn :foo))
23:23_atotechnomancy: does compiling something with a different version of clojure.jar to the one leiningen is running in work?
23:24_atoeg. I was thinking about a case where you might want to compile against 1.0 but leiningen is running 1.1 or vice-versa
23:25technomancy_ato: currently unsupported, but I think it could be added without too much difficulty with lancet's "java" task.
23:25_atoah good point, so that'd let ant do the trouble of setting up the classloaders and whatever is necessary
23:26technomancyyeah, that part doesn't sound like fun to implement
23:26hiredmantechnomancy: because of the way clojure's compiler currently works, if you compile again from the same java process, your compiled classes will be overwritten with garbage
23:27hiredmanthis is something to keep in mind with build systems
23:27technomancygood to know
23:27_atoI like the way you're using the ant maven tasks as well. I used the maven API directly in clojars-web and it's horrible
23:27_atoall that weird plexus stuff
23:27technomancy_ato: isn't it a mess?
23:27technomancyivy was not quite as bad, but still a headache
23:28technomancyhiredman: the differing clojure versions problem means we'd need a separate java process eventually anyway, but I haven't gotten around to that yet
23:28_atoit's crazy.. not only do you need to do the usual javaish factory stuff, you have to now lookup factories in a magical container thing
23:28technomancy_ato: I completely failed to load Maven.main from within Clojure at all.
23:31_atoI didn't try maven.main, I was just trying to use the repository deployment stuff and ended up looking at what the maven-deploy-plugin does
23:31_atoalthough half of it is implicit cause things get autowired all over the place by plexus
23:32_atohttp://github.com/ato/clojars-web/blob/master/src/clojars/maven.clj
23:32technomancy_ato: so maven has this idea that some dependencies are "test scoped" and don't apply in production
23:32technomancybut I'm thinking that a separate list of dev-time dependencies is clearer
23:33technomancysince they really are two separate lists: things this code needs to run vs things you need to install to be able to hack on it.
23:33technomancydoes that make sense to you?
23:34_atohmm... can you give me an exxample of a dev-time dependency? do you mean like unit-testing frameworks?
23:35technomancyyeah, swank-clojure is the textbook example
23:35technomancyor other leiningen plugins
23:35_atoah right, and like nailgun for vimclojure and such, okay gotcha
23:36_atoshould that be something that is specified in the project, or should it be implied by using lein swank?
23:37technomancyI'm thinking of moving lein swank into a plugin
23:37technomancyso you'd add leiningen-swank to your dev deps if you wanted to use it
23:38_atohmm okay. I'm a bit 50-50 on that. I don't really like the idea of having to modify your project.clj just to run swank on it
23:39technomancyyou have to do that either way... really the question is rather the dev-time dependencies should be a separate list, or if the main deps list should have a "scope" attribute.
23:39_atoI'd put it in a seperate list
23:40technomancyit's not "the maven way", but I think it's clearer
23:40_atoless boilerplate that way, you just have to specify the scope once for each type of scope, instead of for every dependency
23:40_atoyeah and it also groups together things that are dev-only vs normal deps
23:40gcvhiredman: turns out I was chasing the wrong problem earlier. got it working now
23:41gcvcheck out http://paste.lisp.org/display/90409#3 for a flexible way to handle keyword arguments. works with defmethod and plain fn forms.