#clojure logs

2011-10-20

00:01aperiodicsame error
00:02aperiodicthe docs for the dot special form state that if the first expr is not a symbol that resolves to a class name then it's presumed to be an instance member, so it tries to call an instance method
00:03aperiodicand the result of (OptionBuilder/withLongOpt "foo") seems to be some kind of instance
00:03aperiodicwhich doesn't quite make sense to me
00:04amalloyaperiodic: instead of me making wild guesses based on an imaginary OptionBuilder class, why don't you link me to the real javadocs?
00:05aperiodicamalloy: http://commons.apache.org/cli/api-release/org/apache/commons/cli/OptionBuilder.html
00:06amalloyhaha wow ew
00:06amalloythis is horrible
00:06aperiodicyeah
00:06amalloyno wonder nothing works
00:06aperiodicwhy are they all static?
00:07aperiodicpart of what's confusing to me is i don't understand what's happening on the java side
00:08amalloyon the java side, foo.bar() calls foo's bar instance method - unless one doesn't exist, in which case it calls a static method named bar on the class
00:08aperiodicah
00:08amalloyclojure doesn't put up with that shit
00:08aperiodichaha
00:08aperiodicso that's how the chaining somehow works
00:08amalloyyou can't thread here because there's no focus object to thread on
00:09amalloyyou could macro it away, to expand into (do (Optionbuilder/foo bar) (...))
00:09amalloybut this library is hideous, much though i love a lot of apache commons
00:09amalloyeg, it can't work for multiple threads
00:09amalloyif you can use something else, like tools.cli, try to do so
00:10aperiodicunfortunately, i don't think i can
00:11aperiodichadoop requires use of the hadoop generic options parser, which uses the commons cli lib
00:12amalloythat's not actually true - you can parse your own options if you want. but i never looked into how
00:12aperiodicif you don't mind explaining, why would (do (OptionBuilder/foo bar) ...) work?
00:13amalloyall of these static calls are mutating the global state in the OptionBuilder class
00:13aperiodicuggghhh
00:13amalloyand then you finally call create() to get something out
00:13aperiodicok
00:14aperiodicthanks for the help!
00:14amalloythis is the worst misunderstanding of the builder pattern ever
00:15aperiodici can't believe that mutating a class object is even allowed... yuck
00:15brehautit seems like the Option class provides basically all the same stuff, just without some trivial string parsers
00:16aperiodicbrehaut: i didn't see a way to add an option with an arg w/out the optionbuilder crap
00:16aperiodici'd like to be wrong
00:16brehaut(Option. …) ?
00:16amalloyaperiodic: i think brehaut is right
00:16brehautthen doto that a bunch of crap
00:17amalloy(doto (Option.) (.setFoo bar)...)
00:17aperiodicah
00:17aperiodicOption not Options
00:17aperiodicwell, that's good
00:18brehautthis optionbuilder class seems extremely misguided
00:18amalloybrehaut: if the methods were non-static it would make total sense
00:18patchworkhey #clojure, I have an app that I want to start many instances (ports) of that each have different db bindings. my db utilities are in their own namespace and should work with any given db binding.
00:18amalloybut as is, it's a total mess
00:18patchworkdo I have to pass the db binding I want to every function that uses a db call, even though these are always the same in a given instance? what is the best way to structure that communication?
00:19patchworkI want something like (start port db)
00:19brehautwithout details of your specific db library thats not really possible to answer
00:20patchworkaha, I am using the clojure sql bindings for postgresql
00:20patchworkI have some utilities that call the core functions from that library
00:20patchworkall calls are of the form:
00:20patchwork (sql/with-connection db
00:20patchwork
00:21patchworkwhere db is a map of connection configuration values
00:21patchworkthat is the map I want to specify for each port
00:21patchworkand not have to call sql/with-connection every time
00:22hiredmanwith-connection just needs to be in the outtermost call
00:22brehautwith-connection sets up a binding i believe, so everything that is evaluated within that (dynamic!) scope wont need an additional with-connection
00:22hiredman(uppermost?)
00:23patchworkAh! so then I compose my db calls however I want, and call them all at once inside a sql/with-connection with the right db map
00:23patchworkawesome
00:23patchworkthanks guys, I knew I was missing the approach here
00:25duck1123how long is it safe to hold that connection open for? Assuming you will always need it, can you run it for the entire length of the app?
00:25patchworkthat is a good question
00:27duck1123I'm assuming reconnecting isn't a concern with jdbc
00:54amalloyduck1123: whether it's true or not that seems like a crazy thing to assume without evidence
00:55duck1123well, I do keep a connection open for quite a while, but I'm not really stressing it yet
00:56duck1123I know in Ruby, I occasionally have to deal with MySQL dropping
01:04spoon16is there a filter indexed op?
01:05brehautspoon16: theres keep-indexed which is in the ballpark
01:06brehaut(doc keep-indexed)
01:06clojurebot"([f coll]); Returns a lazy sequence of the non-nil results of (f index item). Note, this means false return values will be included. f must be free of side-effects."
01:08spoon16thanks
01:08spoon16,(keep-indexed #(if (even? %1) { :index %1 :value %2}) [\a \b \c \d \e \f \g \h])
01:08clojurebot({:index 0, :value \a} {:index 2, :value \c} {:index 4, :value \e} {:index 6, :value \g})
01:09brehautspoon16: if you are using a degenerate if without an else clause, when is idiomatic
01:10spoon16thanks for the feedback
01:10spoon16makes sense
01:11brehaut,(macroexpand '(when (even? 1) :foo))
01:11clojurebot(if (even? 1) (do :foo))
01:14duck1123how much overhead does 'do carry?
01:14amalloyduck1123: should be zero runtime overhead, i would imagine
01:15duck1123yeah, I can see that being compiled away
01:15brehautdo is a special form right?
01:15amalloyduck1123: not just compiled away - there's nothing *to* compile away
01:15duck1123I've just never heard this "use when if you're not using an else clause"
01:15duck1123ok
01:16duck1123I get it, I've just never heard that before
01:16amalloyduck1123: i like that rule because after a while you start to get terribly twitchy every time you see an if without an else - great bug detector
01:16brehautive never heard it before either, but based on code ive read, it seems like a common idiom
01:17brehautamalloy: yes definately
01:17amalloyi've heard people say they prefer the opposite: use if unless you need the implicit do. i can see it might help them in the same way, but it doesn't seem as useful to me
01:17amalloyespecially since needing a do is super-rare, but not needing an else is common
01:17duck1123perhaps I'll have to adopt that. I'm looking at one right now
01:17amalloyhah, a bug due to (if foo bar)?
01:18brehautyeah i infrequently use the implicit do in a when
01:18duck1123I've used when only when I meant if do
01:22tomojhmm.. (do (do (do ... 5000 times ... (do body)))) overflows the stack
01:22tomojis that just a limit of eval?
01:22duck1123so many songs go like that
01:23amalloytomoj: a limit of the lisp reader, i believe
01:23cemerickthat's more an an idiom, IMO
01:23cemerickI wouldn't be disappointed if `if` were to throw an error if no else clause were provided.
01:24amalloycemerick: requiring an explicit nil? i suppose i could get behind that
01:24brehautid be fine with that
01:24amalloyit's too late, though, i suspect
01:24cemerickYeah, that's Clojure 2.0 material
01:24brehautit can be 1.4s breaking change to cause ennui on hacker news
01:25amalloybrehaut: ennui, really?
01:25cemerickennui is the steady state on HN, I thought
01:25amalloy$dict ennui
01:25lazybotamalloy: noun: Listlessness and dissatisfaction resulting from lack of interest; boredom: "The servants relieved their ennui with gambling and gossip about their masters” ( John Barth).
01:26cemerickvery apt
01:26brehautcemerick: it definately is
01:27amalloyi guess i don't hang around on HN enough
01:27brehautamalloy: conversely you hang aroudn on hn the right amount
01:28cemerick15 minutes while eating breakfast or lunch is just about perfect
01:28brehautit seems that these days its 30% whinging 30% calling people you disagree with fanboys
01:55spoon16how do I print the source of a function loaded in the repl?
01:58scottjspoon16: maybe (use 'clojure.repl) (source function)
02:05spoon16does destructuring work in ((fn [[x y] point] point) [1 2])
02:05spoon16,((fn [[x y] point] point) [1 2])
02:05clojurebot#<ArityException clojure.lang.ArityException: Wrong number of args (1) passed to: sandbox$eval29$fn>
02:06cemerick,((fn [[x y :as point]] point) [1 2])
02:06clojurebot[1 2]
02:07spoon16so the syntax is slightly different in defn and let, correct?
02:08cemericknope, exactly the same — argument vectors just don't have the values being destructured pre-defined (by necessity)
02:08cemerick(let [[x y :as point] [1 2]] point)
02:09cemerick,(let [[x y :as point] [1 2]] point)
02:09clojurebot[1 2]
02:09spoon16i see
02:09cemerickDestructuring is defined by let, and all destructuring forms (including defn) just reuse let internally.
02:09cemericks/destructuring forms/binding forms
02:09lazybot<cemerick> Destructuring is defined by let, and all binding forms (including defn) just reuse let internally.
02:10cemerick*local* binding forms, feh
02:10duck1123The upshot of that, if you use a let inside a macro, you can get destructuring for free
02:12duck1123that might be true in any case, but it's still fun
02:31spoon16how do I adjust the JVM params that clojure or leiningen use?
02:31amalloy$google clojure lein jvm options
02:31lazybot[clojure - JVM options using Leiningen - Stack Overflow] http://stackoverflow.com/questions/3757223/jvm-options-using-leiningen
02:31spoon16it's annoying when you do that ;)
02:31amalloyjinx
02:44amalloyhah. SO finally convinced me, out of morbid curiosity, to click on their "chat rooms" link. the mysql room is labeled "a room for MySQL Geniues"
03:15spoon16how can I lazily flatten a vector like [ [ 1 2 ] 3 ] so that the resulting sequence is ( 1 2 3)?
03:16spoon16apply concat
03:16spoon16is that better than reduce concat?
03:17raekyes
03:17spoon16why?
03:17clojurebothttp://clojure.org/rationale
03:17Chousukethere is a flatten function in contrib somewhere
03:18raekreduce concat has to make a lot intermediary lazy seqs
03:18archaicpretty sure flattens in core
03:18raekflatten flattens more than one level
03:19spoon16that's ok with me
03:19raek(reduce concat [[1] [2] [3] [4]]) becomes (concat (concat (concat [1] [2]) [3]) [4])
03:20raekbut (apply concat [[1] [2] [3] [4]]) becomes (concat [1] [2] [3] [4])
03:20raekthe nesting actually comes with a cost
03:20raekevery level will require one stack frame when forced
03:20raekso you can accidentally blow the stack with the formeer
03:20raek*former
03:22amalloyChousuke: it's in core, actually, though this saddens me. flatten is never the right answer
03:23brehautraek, concat produces a lazy-seq and reduce is a loop recur; im not sure i understand how that would blow stack
03:23amalloybrehaut: it will
03:23brehautim not saying it wont: im saying i dont understand why
03:23amalloy$google stackoverflow dbyrne prime sieve
03:23lazybot[recursion - Recursive function causing a stack overflow - Stack ...] http://stackoverflow.com/questions/2946764/recursive-function-causing-a-stack-overflow
03:24spoon16amalloy
03:24spoon16why not flatten?
03:25amalloybrehaut: as i understand it you can run into the same problem in haskell too because of the automatic lazy thunks everything turns into
03:26amalloyspoon16: what if your "base element" is a sequence of some kind? it will accidentally get sucked into flatten's vortex
03:26raekbrehaut: it can blow the stack when the outermost concat is forced (and not when the (reduce concat ...) expression is evaled)
03:26spoon16ok, I figured that… in my case it's not
03:26spoon16but makes sense to avoid it for that reason
03:27amalloyflatten isn't always wrong (i've used it a few times), but most of the time when it's used it's because someone hasn't properly planned out their list structure to begin with
03:27raek,(first (reduce concat (repeat 10000 [1])))
03:27clojurebot#<RuntimeException java.lang.RuntimeException: java.lang.StackOverflowError>
03:27raek,(first (apply concat (repeat 10000 [1])))
03:27clojurebot1
03:28spoon16what if you want to keep duplicates?
03:28spoon16nvm
03:28spoon16I see (first)
03:30Blktgood morning everyone
03:31amalloyraek: another good point is that the version with apply can handle an infinite seq
03:31amalloy&(first (apply concat (repeat [1])))
03:31lazybot⇒ 1
03:32amalloy&(first (reduce concat (repeat [1])))
03:32clojurebot,(let [testar (fn [x y] (if (= (reduce + (filter odd? (range 0 x))) y) (str y " is an square perfect")) )] (testar 10 25))
03:32lazybotExecution Timed Out!
03:36amalloyclojurebot: thanks for the assist
03:36clojurebotWe live to serve.
03:36aperiodicis clojurebot sentient?
03:37aperiodici mean, i knew lisp was well suited for AI, but...
03:38amalloywould we allow a sentient bot in here??
03:38lazybotamalloy: Definitely not.
03:38amalloythese guys never get old
03:39aperiodicclojurebot, open the pod bay doors
03:39clojurebotI'm sorry, Dave. I'm afraid I can't do that.
03:42spoon16is there a way to call a function defined as a nested function from the repl? (defn x [] (defn y [] "hello world"))
03:45clgvspoon16: yes, just call (y) after you called (x). the way you do it, the function 'y is defined in the namespace publicly and not just privately within the function 'x
03:45spoon16how do you define i privately?
03:45spoon16with let?
03:45amalloyjust don't do that. nested defns are evil
03:45amalloyyes, let or letfn
03:45clgveither let or letfn
03:45clgv+ amalloy, dont do it ^^
03:45spoon16do the doc thing :)
03:46clgvlet and letfn are fine
03:47clgvspoon16: if you need a function in several places then just define it with defn in the namespace. if it is only used privately, use letfn
03:47spoon16yeah
03:47spoon16clgv: thanks, reading the docs now
03:48spoon16you ever use let and letfn in the same function?
03:49amalloyexcitingly (to me, anyway) you can layer it whichever way you want: (letfn [(helper ...)] (defn main ...)), or (defn main [...] (letfn [(helper ...)]))
03:49spoon16that's cool
03:49clgvI didnt use letfn yet. I did define some private fns for lazy-seqs within a let
03:50amalloythe former creates a constant function once, reducing the amoung of "stuff" inside main and avoiding creating functions over and over (not that that's expensive). the latter lets you take advantage of the args to main inside of helper
03:59ChousukeI'm pretty sure the function isn't created "over and over" unless you create a closure.
03:59amalloyChousuke: i think it has to alloc an instance of helper every time main is run
03:59spoon16richhickey follows nobody on github
04:00amalloybut i could definitely be wrong about this
04:00amalloygoing to check
04:00Chousukeamalloy: probably, but that sounds rather inconsequential :P
04:01amalloyChousuke: like i said, not that it's expensive
04:01amalloyand it's just as inexpensive if you *do* create a closure
04:06patchworkhmm... how do I drop the database with clojure jdbc? postgres doesn't let me drop a database from inside a transaction, so do-commands is out
04:09patchworkis there a way to just execute a sql command directly?
04:14amalloywhew. i was running javap and getting crazy results - turns out i'm not crazy, i was running it on stale classfiles
04:23spoon16does clojure have a built in method for timing a operation execution (time (+ ))
04:23spoon16or something like that?
04:24amalloy*cough* ##(doc time)
04:24lazybot⇒ "Macro ([expr]); Evaluates expr and prints the time it took. Returns the value of expr."
04:24clgvhehe
04:26spoon16amalloy: I do search for something before I ask… you are often quicker to the right answer than google though… so I'm getting a little lazy
04:27clgvspoon16: dont google first. start here: http://clojure.github.com/clojure/branch-1.2.x/index.html or here: http://clojure.github.com/clojure/index.html
04:29clgvspoon16: or here http://clojuredocs.org/clojure_core since there might be examples attached
04:33spoon16I'll try to do better
04:39clgvyou'll find things a lot faster there especially if you already guessed the name (almost) right ;)
04:41amalloyyou can also try asking lazybot if you don't know what the name would be but you know how it should behave
04:41amalloy$findfn 2 4 16
04:41lazybot[]
04:41amalloy$findfn 4 2 16
04:41lazybot[clojure.core/bit-shift-left]
04:44clgv$findfn 2 4 16.0
04:44lazybot[]
04:45clgv$findfn 4 2 16.0
04:45lazybot[clojure.core/bit-shift-left]
04:45clgvdamn there is no powerfn in core^^
04:45aperiodicis the only difference between defmacro and defn that defmacro registers the underlying fn as a macro so it's recognized at macro-expansion time?
04:47tordmorclgv, why should there it has java.lang.Math
04:47clgvso that lazybot finds it ;)
04:47tordmor:)
04:54raekaperiodic: yes, but the underlying fn also takes two additional parameters
04:54raeksince 1.2
04:55aperiodicraek: what are those params?
04:55clgvaperiodic: one is env
04:56amalloyclgv: anyway, you don't need power when you have repeat
04:56amalloy&(apply * (repeat 3 4))
04:56lazybot⇒ 64
04:56clgvamalloy: thats probably not as fast ;)
04:57clgv&(time (apply * (repeat 3 4))
04:57lazybot⇒ "Elapsed time: 0.877114 msecs" 64 ; Adjusted to (time (apply * (repeat 3 4)))
04:57raekaperiodic: env, which is a map from symbols to a compiler-interal representation of local variables (you are generally only interested in the keys of this map)
04:57amalloyraek, aperiodic: &env
04:57raekaperiodic: and form, which is the code of the enitire call (makes it possible to retrieve the metadata of the call form)
04:57lobotomy&(doc mod)
04:57clgv&(time (java.lang.Math/pow 4 3))
04:57lazybot⇒ "Elapsed time: 1.221387 msecs" 64.0
04:57lazybot⇒ "([num div]); Modulus of num and div. Truncates toward negative infinity."
04:58clgvok unfair ^^
04:58clgv&(time (apply * (repeat 3 4.0))
04:58lazybot⇒ "Elapsed time: 0.590821 msecs" 64.0 ; Adjusted to (time (apply * (repeat 3 4.0)))
04:58lobotomy&(mod -1 4)
04:58lazybot⇒ 3
04:58amalloyclgv: Math/pow would be faster for a large power, i suspect
04:58raekI think you add those params like this: (defmacro foo [a b c &env &form] ...)
04:58clgvamalloy: thats possible
04:58amalloyraek: noooo, don't add them, they're implicit
04:58raekah
04:58amalloy(defmacro foo [a b] (keys &env))
04:59clgvyeah (debug-repl) uses them to provide the "context bindings"
04:59amalloyclgv: more importantly Math/pow works for non-natural exponents
04:59aperiodicraek: is manipulation of env how gensym is implemented?
05:00amalloyaperiodic: no, those two are unrelated
05:00raekno, gensym just uses a hidden counter
05:00amalloy(whether you're talking about (gensym) or foo# auto-gensys
05:02aperiodici can see the motivation for &form, but what about &env?
05:04aperiodicit's just the local bindings at the macro call-site?
05:04ziltiAfter a restart of my PC "lein help" finally lists swank as a task, and I can do "lein swank" on the command line which starts a swank server. But I still can't do "clojure-jack-in" in emacs.
05:05andrewcleggwait. findfn? does that do a brute-force search of all the functions in core or something?
05:05raekit allows you to implement a "break" macro that has access to local variables, I believe
05:06clgvaperiodic: env allows access to local bindings, see debug-repl here: https://github.com/GeorgeJahad/debug-repl
05:07aperiodicraek: sorry, "break" macro?
05:08ziltiPhew. I guess Slime is broken. Had to sigkill my emacs the second time now.
05:08archaicwhat os / emacs version you using?
05:08raekaperiodic: sorry, a macro that works like a breakpoint in a debugger
05:09raekthat allows you to inspect the actual values of the locals at that point
05:09aperiodicah, got it
05:09raek(defmacro dump-locals [] (let [syms (keys &env)] `(prn ~(zipmap (map keyword syms) syms))))
05:09fliebelraek: Is that a want or a have? It's a want for me :)
05:09fhdAny idea when a Leiningen version that uses Clojure 1.3?
05:09fhd... arrives?
05:10raek(let [a 1, b 2] (dump-locals) (+ a b))
05:10fliebelfhd: Cake already supports it... Don;t know about lein.
05:10raekthis will print the map {:a 1, :b 2} when evaled
05:10archaicpretty sure cake and lein both do
05:10fliebelraek: Sweet!
05:11raekfliebel: have you used swank.core/break ?
05:11Borkduderaek: very cool
05:11fliebelraek: No, I use a plain editor with a repl in y terminal.
05:12aperiodicclgv: ooh, that's a handy tool. thanks!
05:12clgvaperiodic: yes. I love that thingy^^
05:13fhdWell, Leiningen does support using Clojure 1.3 for my apps, but I need Leiningen itself to actually run in 1.3. I'm trying to use the lein-clojurescript plugin, which requires 1.3.
05:14fliebelDo any of you know how to get "lisp in small pieces" for a reasonable price? It seems to cost nearly €100 everywhere I look.
05:15fliebelI even tried to *gulp* torrent it, and failed miserably.
05:19Apage43fhd: i think lein's not going to update to 1.3 for a while as a -lot- of the existing plugins won't work on 1.3
05:20fhdApage43: Bah, means I have to keep using my own ugly exec-based ClojureScript plugin...
05:21clgvfliebel: have you checked used books on amazon?
05:21Apage43fhd: there's https://github.com/ibdknox/cljs-watch
05:21fliebelclgv: Still 70-80
05:22fhdApage43: Doesn't really help here, we need Leiningen for a simple CI setup in a Maven environment
05:22taliosclojure-maven-plugin works fine with 1.3 :)
05:23taliosOne benefit of me resisting writing it in clojure, and forking the JVM for compilation.
05:23fhdtalios: But there's no ClojureScript support yet, right?
05:23fhdtalios: I'm normally on Maven for Clojure projects, but I use Leiningen for this one because that was the only sane way to get a working WAR
05:23taliosalas no. I've not had the time to even -play- with ClojureScript yet.
05:24taliosfair enough :) For clojure only projects I still promote lein, its certainly the easiest to use.
05:24fhdtalios: Yeah, but it can get a bit ugly in a Maven environment, stuff like deploying to a Nexus that requires authentication.
05:24Apage43*shrug* cake might work
05:25ziltiIs there some contrib stuff to do http requests to a server or do I have to do it the java way?
05:25fhdApage43: Don't feel like switching build systems again :) Besides, AFAIK, cake doesn't really integrate with Maven, right?
05:25sunny_101Hey guys…I'm having trouble with string contains? function…(contains? 'you 'u) returns false
05:26taliosfhd: promise to buy me a beer if we ever meet and I'll take a look at ClojureScript support tomorrow night/this weekend ;)
05:26Apage43fhd: it generates a pom. I don't know much maven, not sure what else that involves.
05:26Borkdudesunny_101: check the docs for contains?, it is something different, it checks if a key is present in a collection
05:26sunny_101I tried to switch it around using double quoted strings, but still nothing
05:26clgvsunny_101: thats right symbol 'you does not contain symbol 'u
05:26Borkdude,(doc contains?)
05:26clojurebot"([coll key]); Returns true if key is present in the given collection, otherwise returns false. Note that for numerically indexed collections like vectors and Java arrays, this tests if the numeric key is within the range of indexes. 'contains?' operates constant or logarithmic time; it will not perform a linear search for a value. See also 'some'."
05:26aperiodicfhd: lein can deploy to nexus repos that require auth just fine
05:27Borkdudesunny_101: and 'you 'u are not strings but symbols
05:27clgvtry: ##(contains? "you" \u)
05:27lazybot⇒ false
05:27sunny_101Borkdude: Then why does (contains? "you" "u") not work?
05:28archaic"u" isn't a key present in the given collection "you"
05:28raeksunny_101: contains? only works for maps and sets
05:28Borkdudesunny_101: because a string is not a collection and u not a key
05:28clgvlol right^^
05:28raek,(contains? {:a 1} :a)
05:28clojurebottrue
05:28clgv(some "you" \u)
05:28clgv&(some "you" \u)
05:28lazybotjava.lang.IllegalArgumentException: Don't know how to create ISeq from: java.lang.Character
05:28raeksunny_101: it's better to think of it as "has-key?"
05:28Borkdudemaybe contains should be renamed, this question comes by so often..
05:28clgvnow: ##(some #{\u} "you")
05:28lazybot⇒ \u
05:29sunny_101Ah, I see! I was thinking in ruby trying to do "you".contains?('u')
05:29fhdaperiodic: Yeah, but it's a bit ugly: https://github.com/technomancy/leiningen/issues/276
05:30fhdaperiodic: And there is generally a lot of confusion with mirrors. The Maven guru here got really annoyed :)
05:30archaic,(contains? (set "you") \u)
05:30clojurebottrue
05:30fhdaperiodic: For the record, I think that's more a problem of the Maven Ant tasks than of Leiningen, but I'm not entirely sure.
05:32Borkdudesunny_101: use the function substring? from clojure.contrib.string
05:32sunny_101awesome got it working, thanks guys!
05:33aperiodicfhd: fair enough. we only set up a maven repo for our clojure projects, so we're not doing anything at all complicated
05:37Borkdudehow can you check which namespaces are 'used' right now?
05:37Borkdudeon a repl
05:37archaiccan someone tell me how a windows 7 file hierachy works.. im interesting if my code is actually portible or not,, i can't find one reference online to how even their base system is structured :S
05:38archaici havent used windows in a realllly long time
05:42archaicguess not many people do here either ;]
05:43Borkdudearchaic: I use(d) Windows, but I never had this problem, what are you trying to solve
06:09BorkdudeI'm reading Clojure in Action and take a look at the stubbing macro, but there's going to be the dynamic binding problem...
06:10BorkdudeYou can't dynamically bind vars that are non-dynamic
06:10BorkdudeI guess it must be hell to write a book on clojure and keep all your text and code up to date
06:12ejacksonYeah, in think CIA was written well prior to 1.34
06:12ejackson1.3
06:13Borkdudeejackson: it is still not published, so there's a chance of updates maybe
06:14ejacksonsisyphus
06:15Borkdudecan I search within one repository on the github website? I seem to be missing it
06:16ejacksoni would thing so...
06:17ejacksonyeah
06:17ejacksonin the front page of the project, search source code
06:20Borkdudeejackson: I seem to be blind... where on this page is it? https://github.com/marick/Midje
06:20ejacksonweird... not where it is on mine...
06:22ejacksonnone of my open source repos have it, but all my closed ones do.
06:22ejacksonbrilliant
06:23Borkdude(I'm searching the 'provided' macro btw)
06:23ejacksonBorkdude: I think you can use tags in the advanced search to do this
06:24ejacksonhttps://github.com/search
06:24ejacksonyup: https://github.com/search?type=Everything&amp;language=&amp;q=repo%3Amarick%2FMidje+provided&amp;repo=&amp;langOverride=&amp;x=18&amp;y=12&amp;start_value=1
06:27ejacksonin emacs mode you could do M-. in the source and it would like you to it, BTW.
06:28Borkdudeejackson: I think I'll do that then
06:29babilenBorkdude: Hmm, what about just using "git grep" on your local checkout? Or plain grep, or ack-grep (look into this!), or ...
06:32Borkdudebabilen: I haven't checked it out, I was just wondering how provided was implemented, to compare it with the stubbing macro from Clojure in Action
06:33babilenBorkdude: It sounds as if you are missing ^:dynamic
06:33babilen(for 1.3)
06:33Borkdudebabilen: but checking it out is probably the easiest way
06:33kijIf i want to do the same transformation on a list, a number of times? How would i do that ? I currently trying with 'dotimes but it returns nil.
06:33Borkdudebabilen: yes, so the stubbing macro doesn't work on all of the clojure core funcs
06:33babilenStrange that GH offers in-repository search for closed projects, but not open ones .. Maybe they don't want to generate huge indices?
06:34Borkdudebabilen: so I was wondering how they did it in midje
06:34babilenBorkdude: Sure! Happy hunting :)
06:36Borkdudechecked it out... now I get this error: Unable to resolve symbol: print-doc in this context, compiling:(swank/commands/basic.clj:180)
06:38Borkdudeah, lein test works though
06:38ejacksonBorkdude: I'm guessing here, but in 1.3 you need to use clojure.repl to get the doc functions, while in 1.2 you did not. This could be at issue here.
06:39Borkdudeejackson: what does this mean in project.clj: [org.clojure/clojure "[1.2.0],[1.2.1],[1.3.0]"
06:39Borkdudeejackson: choose any version? :)
06:39ejacksondunno, your guess is agood as mine
06:43Borkdudebabilen: any help on how to find the definition of provided via a git grip?
06:44Borkdudebabilen: grep that is
06:44Borkdudebabilen: there are a lot of results..
06:47Borkdude(r
06:47Borkdude(sorry)
06:57fliebelBorkdude: re lein: it's standar maven version ranges. google it, because I don't know any more tan that
06:58fliebeland I'm typing with one hand, because the other is feeding me.
07:01taliosBorkdude: maven version ranges define - as you may infer, a range of versions suitable to satisfy a dependency as part of your build. They use a standard math notation, where [ ] indicate an inclusive boundary, whilst ( ) is exclusive. So [1.2.0] means "1.2.0 - and ONLY 1.2.0", But [1.0.0,1.2.0] means "anything from 1.0.0 up to 1.2.0". And combining the types - [1.0.0,1.2.0) means "anything from 1.0.0, up to - but not including 1.2.0
07:02taliosI suspect, in your example of [1.2.0],[1.2.1],[1.3.0] that means "exactly one of either of these three, but nothing else". A more - non-linear range.
07:02Borkdudetalios: I see...
07:04taliosUsing ranges means you can automatically pick up new versions of libraries without having to rebuild/rerelease your own individual artifacts - it does however mean you move into less predictable, reproducable builds as the range can resolve to different things based on what maven repositories you have. ( different users MAY get different results - usually when not using maven central, or clojars ).
07:05taliosalso means you can potentially open yourself up to getting random transitive dependencies in your project, if a newer artifact in a range pulls different things in
07:06ejacksonfrom which I conclude, as usual, that Maven is much smarter than me.
07:07taliosejackson: more like - it "tries" to be - and sometimes fails, but tries to covers its tracks by not really telling you much :)
07:07ejacksonyeah, I got into it for a while, but have retreated to lein for now.
07:09talioslein has maven hidden under the covers, so some of that pain still lurks, and may be hidden even more :)
07:10taliosand speaking of hiding - its now gone midnight, so I must hide under the duvet and snore ;)
07:10ejacksoncheers.
07:14bendlasHey!
07:14bendlasWhy don't array type hints work on definterfaces
07:14bendlas?
07:15bendlasI tried with (definterface IName (^"[Ljava.lang.String;" getStrings []))
07:16bendlas^"[J" for longs doesn't work either
07:16bendlashttp://dev.clojure.org/jira/browse/CLJ-737 should have fixed that
07:16bendlascan somebody verify?
07:56clgvbendlas: String is no primitive and clojure didnt do anything for non-primitive hints back in 1.2 - I dont know if that changed
08:20bendlasclgv: ok, but primitive array hints like ^"[J" don't work either
08:20bendlasalso look at the attachment to the issue: http://dev.clojure.org/jira/secure/attachment/10119/definterface-array-fix-with-tests.patch
08:21bendlaswhere arrays of java.util.Maps are tested
08:40bprIs there a way to query the running lisp for a list of method implementions for a given multimethod?
08:42gu_hi, anyone with some experience with compojure?
08:51luciandoes anyone have a nice setup for solving 4clojure? the website editor sucks
08:55kijlucian: There should be an lein plugin I think. Is that what you want ?
08:56luciankij: yeah, that's be useful i think
08:56kijhttps://github.com/broquaint/lein-foreclojure-plugin
08:57luciankij: i'd like the problems as commented unit tests, and a way to submit results. that sort of thing
08:57luciankij: awesome, thanks
08:57kijNot really tried it, i've just finished the nth problem ;)
08:58lucianah. i gues i'm farther along than that :)
08:58luciani'm such a lisp newbie, though. i'm still having trouble
08:58lucianand for all of them i keep thinking "i could do this in python with a few lines"
09:01kijHeh, yea - well i still on the project euler mindset, constantly thinking - i should be able to bruteforce this.
09:01clgvlucian: you probably can in clojure as well^^
09:02lucianclgv: sure, i just don't know how (yet, anyway)
09:04luciankij: that lein plugin appears to be broken, i think because 4clojure changed
09:13luciankij: nope, i was wrong
09:15gu_hi, anyone with some experience with compojure?
09:15tdrgabigu_: what's your problem?
09:16duck1123~anyone
09:16clojurebotJust a heads up, you're more likely to get some help if you ask the question you really want the answer to, instead of "does anyone ..."
09:17gu_i described my problem and setup here: http://stackoverflow.com/questions/7836030/compojure-access-filesystem basically i don't know how to access files on the filesystem in compojure in a way that works both with leiningen and in a war file deployed under tomcat
09:20duck1123It's been too long since I've deployed anything to a war
09:21duck1123I think you can use getResourceAsStream to read the files, but I'm sure there's a better way
09:22gu_the problem is that the server can't find it
09:25duck1123try putting them in resources/public http://stackoverflow.com/questions/7816465/serving-static-files-with-ring-compojure-from-a-war
10:35pyrhi
10:35pyris there an autodoc version that's supposed to work with clojure 1.3 ?
10:36pyri'm trying out org.clojars.weavejester/0.9.0 but it blows up on smth i can't qui comprehend
10:36pyrwondering if it's missing a key in :autodoc in project.clj or just plain not working
10:37Gamlihello there - i have a question about the implementation of pmap. is there someone who knows a little about it and is interested?
10:45Gamlihm - i'll just try to put my question in an understandable way :)
10:45Gamlilet's say i have an expression like
10:45Gamli(doall (pmap f arguments))
10:45Gamliand arguments is a list of e.g. int (n_0, ..., n_i) and f has e.g. a complexity of O(2^n).
10:45GamliLets further suppose, i have 2 processors (pmap would start 4 threads) and arguments would look like '(1, 1, 1, 999999, 100, 100, 100, 100)
10:45GamliIs it now true, that this would result in the list hacked into two packages of size 4, where the packages are handled in parallel internally but the packages itself being handled sequentially?
10:45Gamlioh, sorry for the new-lines
10:48octewhat would be the easiest way to transform '(("a" 1) ("b" 30)) into {:a 1 :b 30} ?
10:50Gamli@octe - would that even work? ("a" 1) is a function call which should fail i think
10:51Gamliisnt it more like '('("a" 1) '("b" 30))?
10:51duck1123,(into {} [["a" 1] ["b" 30]])
10:51clojurebot{"a" 1, "b" 30}
10:52octea, cool thanks
10:52Gamlihm - sorry, but i just want to check, if my IRC-client works. did anyone read my question about pmap?
10:53TimMcsaw it
10:53Gamlior anything i write? ^^
10:53Gamliah, kk - thank you
10:53TimMclazybot: Do you hear anything??
10:53lazybotTimMc: What are you, crazy? Of course not!
10:54ejacksonnothing but the rain
10:54duck1123Gamli: pmap tries to stay just ahead of what is being used, so as elements are realized, it'll process more
10:56Gamli@duck1123 yes, but i think if e.g. the last element in a package (i think its called step in the code) is very hard to compute the following elements are not realized until the package is finished
10:57Gamlithis yields to 100% processor-load on a 72-core system if the last element in a package is hard to compute
10:57Gamli(so it should be 7200% ^^)
10:59duck1123Gamli: https://groups.google.com/d/topic/clojure/AtA-0LKYe9A/discussion
11:01jcromartieso lein repl runs with the default JVM memory settings?
11:01jcromartiewhich for me is apparently about 128MB
11:01jcromartieno wonder I was always running out of heap space trying to do anything interesting :P
11:24jolyLooks like Rich's "Simple Made Easy" talk just went up on InfoQ: http://www.infoq.com/presentations/Simple-Made-Easy
11:25jodaronice
11:25jodarowatching
11:37Gamli@duck1123 thanks for the link. i think pmap is just not what i was looking for since my main concern is to keep the processor load as high as possible.
11:43ljosIs there a way I can access the print-out that time gives?
11:45duck1123ljos: with-out-str, or you can use this that I wrote the other day. https://github.com/duck1123/ciste/blob/master/src/ciste/debug.clj#L13
11:46ljosduck1123: Thanks!
12:00cgrayhi, i'm having a weird problem... i'm using slime, and when i evaluate a certain clojure form, i'm getting an emacs backtrace
12:02cgraythe error is "error in process filter: condition-case: Variable binding depth exceeds max-specpdl-size"
12:02cgrayand the form is "(max-key #(play-boggle % full-dictionary) (all-2x2-boards))"
12:03cgraywhere all-2x2-boards is a function that produces a long lazy list
12:03duck1123cgray: I would make sure your swank-clojure and slime are up to date
12:03cgrayduck1123: i tried that last week and the whole thing broke :)
12:04duck1123I remember having that same problem, but I can't remember what the exact fix was
12:07duck1123I would also make sure that you have only 1 version of swank-clojure on your classpath. (but I don't think that's the issue here)
12:10cgrayoh heck, it should have been (apply max-key ... )
12:44micahmartinhttps://gist.github.com/1301599
12:44micahmartinThe above link is a potential Clojure 1.3 bug
12:44micahmartinIt's been driving me nuts for days figuring this out
12:45micahmartinAre there any Clojure pros who can take a look?
12:45micahmartincemerick: ??
12:45lazybotmicahmartin: Uh, no. Why would you even ask?
12:46micahmartinchouser: ??
12:46lazybotmicahmartin: Definitely not.
12:46micahmartinlazybot: ??
12:46lazybotmicahmartin: Definitely not.
12:47hiredmanmicahmartin: I am going to tell you what th problem is, then put you on ignore for being annoying
12:47hiredmanvars are not dynamic by default in 1.3
12:47micahmartinhiredman: yeah… I knew that
12:47micahmartinhiredman: now I'll ignore you for being arrogant
12:48cemerickmicahmartin: a REPL interaction and a description of what you're expecting as output would be helpful.
12:48chouseruse of declare and def inside forms like let and list is at the very least unusual, if not completely unsupported.
12:49cemerickYeah, once I saw (list (def …)), I tuned out.
12:49chousermicahmartin: but as cemerick said, I'm going to need more info about what you're trying to do
12:49cemerickdef/declare in let is fine, IMO; baby needs a closure sometimes
12:49micahmartincemerick: The problem is that in the last line throws an exception complaining that the var "something" is unbound.
12:50micahmartinchouser: agreed. But if I take these defs outside of the list, the problem does not raise it's head
12:52micahmartincemerick: gist with exception: https://gist.github.com/1301638
12:53chousermicahmartin: what did you expect #'something to be bound to?
12:54micahmartinchouser: in this example #'something is bound to an atom
12:55micahmartinchouser: and it is… (ns-publics) will show that it is bound
12:55micahmartinbut the form "@something" fails to see the binding
13:07cemerickmicahmartin: I simplified your example: https://gist.github.com/1301675
13:08micahmartincemerik: Nice. This is much better.
13:09cemerickThere's something wonky there, but I won't dig into it more. You might get some takers if you post it to the list.
13:09micahmartincemerick: Do you think this is a bug
13:09cemerickNo. Unspecified behaviour, perhaps.
13:10chouserthe problem is that the metadata is not transfered from the symbol to the var until the def (or declare) is run
13:10chouserthough the var is created at compile time
13:10cemerickI don't think that's it — it's not that the binding is failing.
13:10chouserso -- back to what I said earlier: use of declare inside list is not really supported
13:11cemericksure, but it's worth asking why
13:11chouserthe binding succeed on the var that has become dynamic
13:11cemerickif it's being evaluated, then it *should* have the same effect
13:11chouserbut q is defined using a non-dynamic var p
13:11chouseror perhaps: q is compiled using a non-dynamic var p
13:12cemerickYeah, I thought that perhaps q was capturing a different (temporary?) var than was visible to with-bindings, but some dumb debug printlns seem to indicate not.
13:14cemericki.e. if q returns #'p, you get back the bound var with the atom inside
13:17cemerickah, and (.isDynamic #'p) is true after the list is evaluated
13:17cemerickanyway…
13:58sritchie_hey all -- I think this might be a common one, but I'm seeing this when running a jar on a hadoop cluster: Attempting to call unbound fn
13:59sritchie_the error's coming from a macro that defines two functions back-to-back inside of a do form
14:00sritchie_here's the macroexpansion: https://gist.github.com/1301811
14:00sritchie_I'm AOT compiling, and I'm not sure what else I can do to prevent "Caused by: java.lang.IllegalStateException: Attempting to call unbound fn: #'backtype.lyoto.click-stats/human?__"
14:04scgilardiwould letfn be a better tool here?
14:11sritchie_scgilardi: I'll talk to nathanmarz about it -- he wrote the cascalog guts back at 1.1, and I don't understand this enough to say
14:11sritchie_scgilardi: probably a good route, though
14:12hiredmanthat exception happens when you take the value of an unbound var and call it as a function
14:14sritchie_hiredman: wouldn't AOT compiling that form bind human?__ before it's ever called by human?
14:16hiredmansritchie_: well, you need to check were the exception is being thrown, and trace backwards
14:16hiredmanfigure out how that bit of code got a reference to human?__
14:24cgrayis there a clean way to get the key in a map with maximum val? i've been doing (apply max-key #(map-name %) (keys map-name)), but that seems kind of verbose
14:25Chousukewell #(map-name %) is equivalent to map-name
14:26cgraygood point
14:26amalloyi prefer (key (apply max-key val) map-name)
14:26amalloyerrrr, parens wrong
14:26amalloy(key (apply max-key val map-name))
14:27Chousukeusing a sorted-map might help too :P
14:27cgrayChousuke: true, but iiuc, that's sorted on the keys
14:28Chousukemm, right
14:33amalloythough if you're getting the maximum value often, maybe you want a heap instead of a map?
14:33cgrayis that built in?
14:34ghiucan anybody check my problem with compjure i described here? http://stackoverflow.com/questions/7836030/compojure-access-filesystem/7838999#7838999 thanks
14:35cgrayamalloy: actually, that was a bad question :) i don't think i do... i'm updating more often than finding the max value
14:37hiredmanghiu: https://github.com/technomancy/leiningen/blob/1.x/sample.project.clj#L151
14:37hiredmanif you make your :resource-path "resources/" then what is described in the comment will work
14:39hugodfor anyone who is using ritz - I just added basic filtering of which exceptions break into the debugger (with an IGNORE restart, and a selector screen for editing) - feedback encouraged…
14:44ghiuhiredman: they get deployed, but not under /resources
14:44hiredmancorrect
14:45hiredmanthe comment doesn't say "resources"
14:45hiredman "public/some/file.txt"
14:45ghiuso i have to put all my files under public...
14:45hiredmanno
14:46hiredmanyou have a setup that works in dev, but not in production, the comment gives a setup that works in production but not in dev. if you combine the setting above with the setup from the comment it will work in both
14:47S11001001We do what leiningen-war does: it puts your resources under WEB-INF/classes so the classloader can get at them.
14:47hiredmanS11001001: sshhh
14:47hiredmanS11001001: you are not helping
14:48S11001001oh good, I was hoping to confuse someone today
14:52ghiui think the working production example works because resources are under src
14:53hiredmanno no
14:53hiredmandid you even try it?
14:53hiredmanif you do exactly what the comment says and add :resource-path "resources/" to your project.clj it will work
14:53ghiuthat's what i did
14:54hiredmanand?
14:54ghiu :main org.github.pistacchio.deviantchecker.core
14:54ghiu :resource-path "resources/")
14:54ghiuin the code i have this
14:54ghiu(def *data-file* "resources/data/data.dat")
14:55ghiuthat still works in dev
14:55hiredmanyou are not doing what I said
14:55hiredman"if you do exactly what the comment says"
14:55hiredmanthe filename in the comment does not contain "resources"
14:55hiredmanand it is loaed using io/resource
14:56ghiuOH!
14:56ghiuyou mean the comment on stack overflow?!
14:56hiredmanwhich comment did you think I meant?
14:57ghiui thought you were referring to the comment on the code you linked -_-
15:02ghiuhey, it worked, thank you
15:08ghiuthe only problem is that now public files are served in dev but not under tomcat...
15:13ghiuhiredman: any suggestion about it?
15:14hiredmanghiu: tomcat may swizzle the classloader or something, if you have everything setup right (double check) then the only thing that would explain it is some kind of classloader futzing
15:16simardI've followed instructions on http://en.wikibooks.org/wiki/Clojure_Programming/Examples/Creating_an_Applet but all I get in my browser is a gray rectangle, ie.: the applet doesn't start, and no error is generated..
15:16simardcould anyone get this example going ?
15:16ghiuhiredman: i think (route/resources "/") would just make it work, serving static files out of root/public, right?
15:17hiredmandunno
15:17amalloysimard: the technical term for that (because it's common enough to deserve one) is the Ugly Grey Box of Death
15:17Raynessimard: https://github.com/Raynes/webrepl is a little applet I wrote about 300 years ago. It worked.
15:17simardamalloy: akin to the blue screen of death
15:17RaynesMight be helpful.
15:18amalloyindeed
15:18simardRaynes: ok I will have a look, you meant 300+ days probably :)
15:18RaynesSeems like years.
15:27nchurchhello all
15:27nchurchdoes anyone know how to suppress side effects in a REPL
15:27nchurchor if there is a way?
15:27nchurchI mean if you have a function that prints something internally
15:27nchurchand you only want to see the result
15:27nchurchcan you wrap that function in something?
15:28cemerickbind *out* (and/or *err*) to writers that drop the output on the floor
15:28amalloyyou can't suppress side effects in general. suppressing printing is easy, though you should probably edit the function to not do printing instead
15:28nchurchthanks cemerick
15:28nchurchamalloy
15:29nchurchwhat I'm trying to do is run a bunch of pre-written functions
15:29nchurchsome of which have side-effects
15:29nchurchso I can't rewrite them
15:29amalloycemerick: if only such writers were built in, eh? java didn't include a NullWriter
15:29hiredmanscheme does
15:29amalloyin the rare occasions i've wanted to do this, i just use a (StringWriter.) and never call toString on it, but blech
15:29hiredmanit has a function that returns the equiv of a nullwriter
15:30cemerickamalloy: yeah, that's the easy escape route
15:30nchurchI wonder how often people come across this problem
15:30amalloyhiredman: sure. and you can create such writers in java (or use one from apache commons), but it's a bit disgraceful that java doesn't have one prebuilt
15:30nchurchit does seem useful to have some sort of null writer
15:31cemerickamalloy: (java.io.FileWriter. "/dev/null") if you want to depend on that working :-)
15:32amalloycemerick: true. kinda funny to have to make a bunch of system calls in order to do nothing, but c'est la vie
15:32cemerickhah; the windows equivalent is "NUL"
15:32cemerick(FileWriter. "NUL")
15:33cemerickNUL reminds me of IRQs
15:33amalloyi guess it's possible the FileWriter class could check to see if its file is /dev/null and not bother to make system calls in that case
15:34nchurchyeah, how would you do it system-independently?
15:34cemerickI wonder if anyone's attempted to implement a JVM "environment" — alternative implementations of all the native, side-effecting bits (file descriptors, graphics devices, etc), drop into bootclasspath, wackiness ensues.
15:34S11001001well, File.toURL does check the filesystem for the type of the file
15:35amalloynchurch: extend (not implement? ugh) Writer and implement write() to do nothing
15:35cemerickmaybe maxine does that…
15:35amalloythe same way apache commons does it
15:36nchurchactually, (java.io.StringWriter.) does seem to work
15:36nchurchwhat is the problem with it?
15:36cemerickyou're capturing all of the output in the stringwriter
15:36clojurebotExcuse me?
15:36Raynesclojurebot: You're not excused.
15:36clojurebotCool story bro.
15:36babilenHi all. I am looking for a good/fast/tolerant way to parse SGML documents like http://paste.debian.net/138339/ - I have the DTD - Any recommendations?
15:36amalloyclojurebot: not you, buddy. you're doing fine
15:36cemerickamalloy: It's likely extremely efficient; the file descriptor that the underlying FileOutputStream uses in that case surely just drops every .write call on the floor.
15:36clojurebotGabh mo leithscéal?
15:36nchurchcemerick:
15:37nchurchso it lasts beyond the binding? the junk accumulates somewhere?
15:37cemerickYou're just paying the cost of N method calls to get down to the FD
15:37cemericknchurch: no, the writer falls out of scope when flow exits the binding (assuming you're not holding onto it elsewhere)
15:37amalloyi don't have a clear idea of where FDs fit into the picture, so i'll take your word for it
15:37cemerickBut if your functions write 6GB of content to the StringWriter, you're hosed.
15:38nchurchoh
15:38nchurchI doubt it will
15:38nchurchI'm going to post this on the group in a bit
15:38nchurchfor the time being I think it will be fine
15:38cemerickamalloy: Every .write call ends up delegating to a native method in FileOutputStream
15:39tolstoyIs there any http basic auth built in to web-noir? Or even ring?
15:39brehaut“Guys, whose ready for some more category theory? woo!”
15:40cemerick~scala
15:40clojurebot{((x: Any, y: Any) => (f: Function2[Any, Any, Any]) => f(x, y))(1, 2)((x: Any, y: Any) => x)}
15:40cemerickwoo!
15:40brehautcleanup in isle three
15:41cemerickisle four has nicer beaches
15:41cemerick*sigh*, long day
15:42brehautnow i have no idea how to spell the word i mean
15:42cemerickaisle
15:43brehautthanks
15:47babilenHi all. I am looking for a good/fast/tolerant way to parse SGML documents like http://paste.debian.net/138339/ - I have the DTD, but no need to verify it. I found nathell's clj-tagsoup, but there might be better solutions.
15:58nchurchso about my last question (Cemerick, Amalloy)
15:58cemerick2cemerick: test meg, ignore
15:58nchurchthere's still some REPL weirdness
15:58nchurchhere's a gist:
15:58nchurchhttps://gist.github.com/1302148
15:59nchurchI can fix it by wrapping in a vec
15:59nchurchhttps://gist.github.com/1302155
15:59nchurchwhich is fine of course
15:59nchurchbut why is it like that?
15:59nchurchwhy would the REPL instersperse side effects into a printed seq even when *out* has been rebound
15:59nchurchbut then drop it when I wrap it in vec?
15:59nchurch(wrapping in seq doesn't work----the junk stays there)
16:00amalloy$findfn 1 2 3
16:00lazybot[clojure.core/bit-or clojure.core/bit-xor clojure.core/+ clojure.core/unchecked-add]
16:00amalloynchurch: you're aware this already exists, right?
16:00nchurchnope, I wasn't
16:00nchurchit was fun to write it anyway
16:00amalloyyeah, i agree
16:01nchurchI mean
16:01nchurchsince I didn't know findfn existed
16:01nchurchhow could I find it?
16:01amalloyhah
16:02amalloyanyway nchurch, the issue is that filter is lazy and vec forces it
16:02nchurchand seq does not
16:02nchurchI see
16:02amalloythe binding on *out* is only in place until filter returns a value - if that value is a lazy sequence, none of the prints have happened yet
16:02cemerick2nchurch: what amalloy said; wrap the filter in doall and you'll get a forced seq without a vector copy
16:03nchurchyup, that works
16:03nchurchit didn't \look like a lazyness problem to me
16:04nchurchbut I can see it in retrospect
16:05nchurchamalloy: where is findfn?
16:05nchurchI don't see it in the Clojure docs
16:05amalloynchurch: lazybot
16:09nchurchamalloy: i.e., it's on IRC
16:09nchurchis there a version of it for your own REPL?
16:10amalloynchurch: i think someone ported it from lazybot, but i don't know where. you can grab the source yourself, of course
16:10amalloy$whatis source
16:10lazybotsource is http://github.com/flatland/lazybot
16:14nchurchdo you know if there is a way of searching within a particular source repository on Github?
16:14nchurchI don't see the option in advanced search
16:15Raynesnchurch: https://github.com/flatland/lazybot/blob/newcontrib/src/lazybot/plugins/clojure.clj
16:15RaynesRelevant pieces are the… well… findfn pieces.
16:16pauldoowhere do I get clojure.contrib.string these days? (under 1.3..)
16:16TimMcclojurebot: Where did contrib go?
16:16clojurebotwell... it's a long story: http://dev.clojure.org/display/design/Where+Did+Clojure.Contrib+Go
16:16RaynesYou don't.
16:16Raynesclojure.string is the evolution of it.
16:17nchurchthanks Raynes
16:17pauldoohm - it doesn't contain 'substring?'
16:17brehautsubs
16:17nchurchI wonder why Github doesn't have search within particular repositories
16:17nchurchor at least not htat I can find
16:17pauldoosubs is for pulling out a substring, not testing if something is a substring of another thing
16:18Raynes&(.substring "foobarbaz" 3)
16:18lazybot⇒ "barbaz"
16:18brehaut,(subs "foobarbaz 3)
16:18clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: EOF while reading string>
16:18brehaut,(subs "foobarbaz" 3)
16:18clojurebot"barbaz"
16:18TimMc,(doc subs)
16:18clojurebot"([s start] [s start end]); Returns the substring of s beginning at start inclusive, and ending at end (defaults to length of string), exclusive."
16:19TimMcAw, I was hoping it would accept negative endpoints as well.
16:19pauldooRaynes: that's what I have currently, was trying to eliminate all reflection errors without resorting to adding type hints.. I was expecting clojure to contain a usable 'substring?' already...
16:19replacaclojure-swank question: when I connect with "clojure-jack-in", disconnect with "slime-quit-lisp" and then try to reconnect with "clojure-jack-in" again, I get "Connection closed". Is there a way to restart my clojure session without restarting emacs?
16:19RaynesWhere java isn't broke, don't fix it.
16:19replaca(Latest everything: clojure-1.3, clojure-mode 1.4, etc.)
16:20pauldooRaynes: yes I know - I was hoping there'd already be one, and learn a little more clojure contrib in the process.. :/
16:20brehautpauldoo: old contrib is largely dead code. new contrib is still very young
16:22amalloypauldoo: .contains
16:22amalloy&(.contains "test" "es")
16:22lazybot⇒ true
16:22amalloy&(.contains "test" "sdfa")
16:22lazybot⇒ false
16:23pauldooamalloy: as I said earlier, I've been trying to eliminate reflection warnings and not resort to type hints.. (ie., find equivalent functions that already exist that I perhaps didn't know of)
16:23pauldooamalloy: I can't get .contains to work without a reflection warning unless I use type hints
16:23amalloywell yeah
16:24amalloyi didn't catch that part of your question earlier, but now that i've found it i'll echo Raynes: "Where java isn't broke, don't fix it."
16:24amalloythat's why clojure doesn't have substring?, and why you should just use .contains
16:25Raynes"resort to typehints" doesn't make a lot of sense.
16:25RaynesIf you don't want reflection warnings...
16:26pauldooI'm mainly doing this as an exercise to find the clojure equivalents where they exist
16:26pauldooin a few cases already I was just calling the java methods because I wasn't aware of the clojure function that already existed
16:27TimMcpauldoo: If there is a Clojure function that seems to be redundant with a Java method, you should always check to see if the semantics are precisely the same.
16:27TimMcSometimes there are surprises.
16:34technomancy`amalloy: actually (doc subs)
16:34technomancy`but that probably wouldn't have been added if it were proposed today
16:34technomancy`since it adds nothing interesting
16:35technomancy`(defn subs ([^String s start end] (. s (substring start end)))) ; lulz
16:35amalloytechnomancy`: i think i agree with you, except that your "actually" suffix implies you're disagreeing
16:35amalloy*prefix
16:36technomancy`oh, I misread "substring?" as "substring"?
16:36pauldooI'm creating lots of 3 element vectors in my clojure program, and memory use is large. would using records with 3 fields be better ?
16:37pauldooor are there persistentvector classes hardcoded for each size up to some small N?
16:37amalloypauldoo: it would take up less memory. whether it's better depends on your program
16:38pauldooamalloy: so there aren't hardcoded persistentvector classes for each small N?
16:45hiredmanpauldoo: no, but that might be interesting optimization
16:46pauldooamalloy: looking at clojure source code, I think it'll be creating a java array of 3 elements, and wrapping it in a PersistentVector. Not too shabby, but still a few objects more than a record would use.
16:47pauldoogiven that my 3 objects are objects which have been internd (and I expect a huge lot of aliasing), maybe that's significant..
16:48pauldooI might poke at this later, could be significant for this use case… (ie factor 2x)
16:48amalloypauldoo: i don't think that's true. i think it allocates a 32-object array, but it's hard to tell
16:49pauldooamalloy: https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/LazilyPersistentVector.java
16:49bendlasFWIW, you could create a 3-tuple deftype, that looks and feels just like a persistent vector (i.e. upgrades to one, if you conj, ... to it)
16:49pauldooamalloy: http://clojuredocs.org/clojure_core/clojure.core/vec
16:50hiredmanpauldoo: what do you have in your vecotr?
16:50hiredmanvector
16:50hiredmanyou could try a primitive vector
16:50pauldoohiredman: 3 String instances. but I have lots of vectors, and the strings are shared a *lot* across vectors
16:51hiredman,(doc vector-of)
16:51clojurebot"([t] [t & elements]); Creates a new vector of a single primitive type t, where t is one of :int :long :float :double :byte :short :char or :boolean. The resulting vector complies with the interface of vectors in general, but stores the values unboxed internally. Optionally takes one or more elements to populate the vector."
16:51hiredmanah
16:51pauldooamalloy: I expect vec to call into clojure.lang.LazilyPersistentVector/create
16:52pauldooamalloy: and then toArray to be called
16:52amalloypauldoo: that's only relevant if you're creating a seq and then coercing it into a vector, right?
16:52amalloyrather than a literal like [a b c]
16:53hiredmandefinitly look at using a deftype or defrecord
16:53pauldooamalloy: true, but I think that's the case, I'm doing lots of list comprehension type stuff to get my 3 element vectors. then calling vec to fully evaluate and create a more compact representation
16:53amalloya vector is not really more compact, is it?
16:53pauldooand vec does the full evaluation thing, and makes it as if you typed the vector literal
16:54pauldooamalloy: probably is more compact than (take 3 (map etc etc et))
16:54pauldooamalloy: especially if you don't fully iterate the result, and the closures are big, etc..
16:55amalloycould be
16:55pauldooamalloy: I saved a lot of memory by just wrapping with a call to (vec …)
16:55amalloyhave you tried wrapping doall instead?
16:56amalloyi don't actually know which way that would go, but it's interesting
16:56pauldooamalloy: no, I haven't
16:56pauldooI expect the vec to be the smallest, otherwise it'd be kinda broken
16:57pauldooanyhoo, got to head off
17:21todunI'm trying to get into macros in clojure. anyone know of good sources (screen-casts, tutorials) out there? thanks.
17:22jcromartietodun: I'd recommend starting by experimenting with backquote at the repl
17:22brehauttodun: do you have a thing you think you need a macro for?
17:22jcromartie,(let [x 1 y 2] `(+ ~x ~y))
17:22todunjcromartie: ok. thanks.
17:22clojurebot(clojure.core/+ 1 2)
17:23jcromartie,(let [xs [1 2 3]] `(+ ~@xs))
17:23clojurebot(clojure.core/+ 1 2 3)
17:23jcromartieetc.
17:23todunbrehaut: yes. build a macro that makes clojure behave like a different language.
17:23jcromartieget a feel for quoting and unquoting
17:23jcromartie:P what kind of language?
17:23todunjcromartie: more like the length of code needed. it is called rebol.
17:24jcromartie(BTW, that's definitely the point of macros: adding something that you can't do right now)
17:24jcromartieah ha
17:25raektodun: a fun exercise can be to write a macro that translates arithmetic expressions from infix form to clojure prefix form
17:25todunjcromartie: makes sense.
17:25jcromartietodun: in the case of REBOL, what features do you want to bring over?
17:26brehauttodun: are you wanting to write a rebol compiler or interpreter?
17:26todunraek: sounds fun. any ideas where I can find info on learning macros the quick and dirty way?
17:26jcromartiedon't start out by thinking in terms of eliminating parens :)
17:26brehaut(and i hate my self for that extremely imprecise sentence)
17:26raekso that (macroexpand '(infix (a + (b * c)))) becomes (+ a (* b c))
17:26jcromartiebecause honestly REBOL looks almost like lisp already
17:27raektodun: macros are implemented with ordinary clojure functions. so if you can turn the list '(a + b) into the list '(+ a b), you're almost done
17:28todunjcromartie: raek brehaut ok.
17:28todunno need to read anything then
17:28raekthe defmacro macro and the ` ("syntax-quote") syntax will probably be new for you, though
17:28jcromartieREBOL looks like it gets most of its utility from the built-in functions
17:29jcromartiethere's no reason it couldn't be a Clojure library
17:30raektodun: a start can be to read the syntax-quote section of http://clojure.org/reader and then http://clojure.org/macros
17:30todunjcromartie: ok. sounds like a fun exercise. hopefully not time consuming
17:30raekjust remember that syntax-quote is just a shorthand to write the code data structures
17:31raekand can be used and played with outside macros
17:32todunraek: I've never heard that term before...code data structures...or were you refering to data structures like list, arrays..etc?
17:32jcromartietodun: since Lisp code *is* data
17:32jcromartietodun: macros are implemented as functions that take code and return code
17:33amalloy(and that code is shaped like any other data: it's lists, vectors, maps, and symbols
17:33jcromartie,(macroexpand-1 '(-> 123 str reverse))
17:33raektodun: yes. in lisps the code is represented with the data structures you normally use in the language
17:33clojurebot(clojure.core/-> (clojure.core/-> 123 str) reverse)
17:33jcromartie,(clojure.core/-> (clojure.core/-> 123 str) reverse)
17:33clojurebot(\3 \2 \1)
17:34todunjcromartie: I can rephrase you then and say macros are implemented as functions that take data and return data,no?
17:34jcromartieyes
17:34raekso (+ a b) is a list of three elements: the symbol +, the symbol a and the symbol b
17:34jcromartie,(eval (list '+ 1 2))
17:34raektodun: yes! that is exactly the point :)
17:34clojurebot#<Exception java.lang.Exception: SANBOX DENIED>
17:35jcromartieerp, no eval allowed in clojurebot :)
17:37raektodun: assume "foo" is defined as a macro. when the compiler sees (a (foo x y) b), it will call the foo macro with 'x and 'y as arguments. the return value of the macro, say "(if (zero? x) y x)", will be used in place of the (foo x y) call
17:37todunraek: uhm ok.
17:37raekresulting in (a (if (zero? x) y x) b) being evaluated
17:38raekthe output of the macro is also scanned for other occurences of macros
17:38raeka simple example is cond
17:39todunraek: I thought cond is a special form?
17:39jcromartiemacroexpand-1 is your friend, too... todun
17:39jcromartienope
17:39jcromartie,(meta #'cond)
17:39clojurebot{:macro true, :ns #<Namespace clojure.core>, :name cond, :arglists ([& clauses]), :added "1.0", ...}
17:39raek(cond c1 e1 c2 e2) will expand to (if c1 e1 (cond c2 c3)) and then (if c1 e1 (if c2 e2 (cond))) and then ((if c1 e1 (if c2 e2 nil))
17:40jcromartie,(macroexpand-1 '(cond x :foo y :bar))
17:40clojurebot(if x :foo (clojure.core/cond y :bar))
17:40jcromartienote the need for further expansion ;)
17:40raektodun: well, macros are like user made special forms.
17:40todunraek: jcromartie ok.
17:41raektodun: I might have said that 'cond' is a special form, but that's not entierly correct.
17:41raekit has special rules of evaluation, though (like a special form)
17:42todunraek: ok.
17:43todunraek: ...and thanks for the links :-)
17:46tolstoySo does (require [clojure.string :as str]) not work at the repl?
17:46raektodun: an example of an implementation of cond: https://gist.github.com/1302476
17:47brehauttolstoy: (require '[clojure.string :as str])
17:47raektolstoy: you need to quote the whole thing: (require '[clojure.string :as str])
17:47tolstoyAh, thanks.
17:47tolstoySheesh. The simplest things. ;)
17:47raekthis is because require is an ordinary function, so without the quote clojure.string would be treated as a class literal, for instance
17:47gfredericksI think if use and require were macros beginners would have a slightly easier time
17:48raekindeed
17:48gfredericksas it is you practically have to grok the difference between macros and functions before doing your hello world
17:48tolstoyAfter a while you get the hang of what to try and then, based on what worked, start to learn what's really going on.
17:48raektodun: as you see, syntax-quote works like a templating language for clojure code
17:49todunraek: need to google that...but templating languages?
17:50raeksorry, "template language" is probably the correct term :-)
17:51raek~ allows you to "fill in" values in a quoted value
17:51clojurebotI don't understand.
17:51raek,(let [a 1] '(inc a))
17:52todunok. thanks. brb.
17:52clojurebot(inc a)
17:52raek,(let [a 1] `(inc ~a))
17:52clojurebot(clojure.core/inc 1)
17:52raekit is especially useful when building complex expressions
17:55glob157-1Is there a general framework for crawling feeds and sites that's been written in clojure
17:55michaelr525hello
17:55brehautglob157-1: enlive will cover sites for you
17:55brehautat least at the scrapping level
17:59brehautglob157-1: frinstance, if i want all the a links on the homepage of my site its as simple as (use 'net.cgrand.enlive-html) (map #(get-in % [:attrs :href]) (select (html-resource (java.net.URL. "http://brehaut.net&quot;)) [:a]))
19:14TimMc$findfn ""
19:14lazybot[clojure.core/with-out-str clojure.core/print-str clojure.core/pr-str clojure.core/str clojure.contrib.string/as-str]
19:52technomancy`thinking about doing a blog post on the hidden gems of clojure; anyone got nominations?
19:53technomancy`(specifically libraries and tools, although built-in functions could be fine too)
19:53duck1123have the threading macros been overdone
19:54duck1123or juxt
19:54chewbrancathis is less of a tool or library and arguably more of a quality of lisp, but one of my favorite parts of clojure is all the cool language research going on
19:55llasramIn core, but none of the Clojure books I've read thus far mentioned `seque'
19:56technomancy`oh, nice
19:57technomancy`my current candidates are clj-stacktrace, lein-multi, and difftest
19:57technomancy`probably slingshot too
19:59technomancy`or you could just wait for my blog post
19:59technomancy`nah scratch that; it'll probably be a while
20:00duck1123some good picks there
20:00technomancy`maybe lobos if it turns out to be awesome; I haven't investigated it yet
20:00duck1123I'd like to see more attention given to what you can do with lamina
20:01technomancy`yeah, that's probably due its own post though
20:01chewbrancalobos is nice, I'm keeping an eye on korma as well https://github.com/ibdknox/Korma, but its only a few weeks old
20:01gfredericksten years from now the cool thing will be to name your library with a sentence describing what it does
20:02chewbrancawhat would clojure be called then? ;-)
20:02technomancy`joegallo: typo in the robert-bruce readme: "whose determination was inspired by the sight a spider"
20:02duck1123too many libraries will be renamed to "pure awesome"
20:03gfrederickshmmm what _does_ clojure do?
20:03technomancy`I like how that one fibonacci node.js server had a faq involving "Q: Is it good? A: Yes."
20:03technomancy`left a bit to be desired on the accuracy side, but it made up for that in style.
20:04gfredericksduck1123: the ones that do IO would have to be "impure awesome"
20:06TimMcclojurebot: nathanmarz is <reply> nathanmarz can beat the CAP theorem by simulating the rest of the network in his head!
20:06clojurebotAlles klar
20:10gfredericksclojurebot: TimMc?
20:10clojurebotCool story bro.
20:12technomancy`need to test partition tolerance? just sever the corpus callosem!
20:12brehautTimMc: relevant to your interests https://twitter.com/#!/devops_borat/status/125974500620763137
20:31aperiodicis there a guide to using the bots?
20:32aperiodicspecifically $findfn?
20:36amalloyaperiodic: not really. they both have some kind of help, but not very thorough
20:37amalloy$findfn 'a 'b "ab" ; this is basically it, though. N inputs, one output: what functions return the rightmost thing when passed the rest?
20:37lazybot[clojure.core/str clojure.contrib.string/as-str]
20:37jodarowhats the most latestestest way to parse xml
20:37jodarodata.xml?
20:37clojurebotdatatype is see datatypes
20:38amalloyjodaro: the cloud!
20:38jodaroheh
20:38jodaropre-cloud though
20:38amalloyask siri?
20:38jodaroandroid
20:38aperiodicamalloy: i was wondering about inputs and outputs for that, thanks
20:39aperiodicamalloy: is their source available?
20:39amalloy$whatis source
20:39lazybotsource is http://github.com/flatland/lazybot
20:39amalloy~source
20:39clojurebotsource is http://github.com/hiredman/clojurebot/tree/master
20:42jodarooh
20:47aperiodic$findfn [:foo :bar :baz] :bar 1
20:47lazybot[]
20:48brehaut,(.indexOf [:foo :bar :baz] :bar)
20:48clojurebot1
20:49amalloyaperiodic: in the shallow sense you probably want .indexOf
20:49amalloybut in a more general sense you probably don't want to do this after all. indexes are no fun
20:49aperiodicoh, right
20:50aperiodici'm aware that it's a code smell, but it's used once in some ancillary code to set up a computation, and it's simple
20:51aperiodicunless
20:51aperiodicis there any sort of predecessor-of fn?
20:51brehautaperiodic: as a guideline that clojure's datastructures only have functions for operations that have reasonable performance garuntees
20:52amalloybrehaut: i don't think that's true. count, nth, last, some...
20:52S11001001,(.indexOf [:a '(:b)] [:b])
20:52clojurebot1
20:58TimMcbrehaut: Whoa! That's fame right there.
20:59gfredericksbrehaut: my impression was more that clojure preferred functions with consistent performance guarantees
20:59aperiodici have to remember to try to think of how to do something in java if i can't find a way to do it in core/contrib... it's a reflex that i haven't yet developed, and my not having used java in a while doesn't help
21:00brehautgfredericks: thats a better way to state it
21:01S11001001~(do "well" (keep-indexed (fn [i o] (and (= o :bob) i)) [:alice :bob :parker :bob]))
21:01clojurebot,(let [testar (fn [x y] (if (= (reduce + (filter odd? (range 0 x))) y) (str y " is an square perfect")) )] (testar 10 25))
21:01gfredericksI think that's what I've taken from the conversations about why there's no proper contains? function
21:02nathanmarzTimMc: that's pretty random
21:07amalloygfredericks: except nth is fast if possible and slow otherwise
21:11TimMcnathanmarz: I was just reading the CAP post today. Good stuff.
21:12duck1123link?
21:12clojurebotyour link is dead
21:13duck1123got it http://nathanmarz.com/blog/how-to-beat-the-cap-theorem.html
21:17nathanmarzthanks
21:30Nanakhielmun rakastettu Chousuke, ilman sua en voi elää, ei ole elämä
21:43TimMcnathanmarz: I sent the link to my coworkers. I liked a lot of the ideas, especially the garbage collection bit.
21:44gfredericksamalloy: that is a good counterexample. My adjusted impression is that clojure prefers functions that defy my attempts to summarize them.
21:45amalloygfredericks: in fairness, nth really doesn't fit in with the rest
21:45amalloyespecially with the (nth coll idx) instead of (nth idx coll) ordering
21:46gfredericksamalloy: count is also biperformant isn't it?
21:46amalloyyeah
21:47gfrederickssurely there's a few more...
21:47aperiodicdon't most coll fns have the coll as the first arg? how is nth different in that regard?
21:48gfredericksaperiodic: map, filter, reduce...
21:49S11001001I think into is instructive here
21:50S11001001takes a compound data structure as first arg, and sequence as second
21:50aperiodicgfredericks: assoc, conj, get...
21:50S11001001conj is more of a data structure function, whereas map is a sequence thingy
21:51amalloyS11001001: right, that's the distinction i've heard (i think this was rich's idea but not 100% sure)
21:51gfredericksaperiodic: if, do, fn...
21:51amalloyif it deals with collections it takes the coll as its first arg; if it only cares about sequences it takes that last
21:51aperiodicthose don't have anything to do with collections!
21:52gfredericksaperiodic: I know, there didn't seem to be any good response so I resorted to nonsense
21:52amalloyaperiodic: you wouldn't do too badly if you ignored everything gfredericks says that sounds like nonsense
21:52aperiodichaha, duly noted
21:52gfredericksthere oughta be an irc client feature for it
21:53aperiodici can see how nth is weird given amalloy's characterization
21:55aperiodici remember reading about an irssi plugin that colored responses by some hueristic for usefulness
21:55brehautaperiodic: all mine come out the same color as the background
21:56aperiodicbrehaut: you might just have zen mode enabled
22:47simardI'm running M-x clojure-jack-in , with swank-clojure 1.3.3, an upgraded lein, an emacs 24.0.90, and I'm testing the hello-seesaw application from within emacs. Whenever I close the java frame, I get a "Lisp connection closed unexpectedly: connection broken by remote peer"
22:48technomancy`simard: often swing is set to do System/exit when the window gets closed
22:48simardoh
22:48simard:on-close :exit ... :)
22:49jcromartieso somebody on HN says they can't do "spikes" with Clojure the same way as with Python or C
22:49jcromartieI wonder what that means
22:49jcromartieespecially in relation to C
22:49jcromartiesince when is C a good rapid prototyping language?
22:51simardtechnomancy`: thank you
22:51technomancy`no problem
23:14jodarospikes?
23:17jodarosecond earthquake of the day here
23:18simardWhat's the preferable way of doing some opengl rendering with clojure ? I would rather avoid any clojure lib wrapping underlying opengl java library functions for now.. I'm thinking of using one of either jogl, lwjgl, j3d, etc.
23:20jkkramersimard: penumbra is a wrapper, but you could check out its code to see how it's using the underlying libs
23:20jkkramerhttps://github.com/ztellman/penumbra/
23:24nappingshould /msg lazybot mail retrieve mail?
23:25simardjkkramer: hum yes penumbra's docs are out of date I'm afraid
23:25simardcloning, lein deps, lein compile fail
23:26simardie.: No namespaces to :aot compile listed in project.clj.
23:26jkkramersimard: lein compile
23:26jkkramersimard: see https://github.com/ztellman/penumbra/wiki/getting-started
23:26jkkrameroh
23:26simardwell, yes :)
23:26jkkrameryou did that. reading fail, sorry
23:27simardI had this project to work once though, I don't feel like struggling again with it right now, but it uses lwjgl, and so does Minecraft... so I might have a try at that
23:37amalloynapping: yes, it should, but he's a little broken right now. try $mail
23:38nappingThanks, I just noticed the $ in the README
23:46simardtechnomancy`: may I suggest that you add a comment in "lein help uberjar" to use (:gen-class) in the (ns ...) of the file containing the (-main) function ? (see: http://groups.google.com/group/leiningen/browse_thread/thread/286ad643bee7b2ad )
23:46simardI had to do this to have lein uberjar + java -jar ... working
23:47simardotherwise, a "Could not find the main class: ... Program will exit." error type ensues
23:47technomancy`simard: sure; makes sense
23:47simard:)
23:47simardgood night
23:57amalloytechnomancy`: just re-noticed my answer at http://stackoverflow.com/questions/5983427/how-to-install-clojure-on-ubuntu-10-04-from-github-repo-with-no-clojure-jar/5984183#5984183 and i realized maybe i'm linking to the wrong branch of your repo. should i point people at master or something else?
23:58technomancy`amalloy: better to use the "stable" branch
23:58technomancy`master right now is in some degree of turmoil and kind of on hold until the next 1.x release lands
23:59technomancy`now if only other people were so conscientious about their old posts =)