#clojure logs

2010-02-21

00:03Crowbar7:/
00:10hamza,(:trigger {:trigger (println "trigger")})
00:10clojurebottrigger
00:10hamzasomething like this?
01:07zenoliNeeds a lambda to keep the println from being eval'd when it's read, I think.
01:07zenoli,((:trigger {:trigger #(println "trigger")}))
01:07clojurebottrigger
06:54patrkrishave the STM implementation of clojure changed considerably since 1.0? I'm reading http://java.ociweb.com/mark/stm/article.html
06:54patrkris*has
07:09AWizzArdpatrkris: no big changes
07:09patrkrisAWizzArd: Yeah, just found out I can do a git diff 1.0..1.1.0 LockingTransaction.java :)
07:29Raynes"<dom96> case insensitivity in a programming language is good"
07:36AWizzArd“Good” is a relative word and as such expresses an opinion, not an objective fact.
07:37RaynesIn this particular situation, he was declaring that case insensitivity is a good thing.
07:37RaynesNothing to do with opinions.
07:37RaynesBut I can see how that could be otherwise interpreted, as you've just shown.
07:42defnMorning gents
07:59RaynesOops. I left the black tea pyramid in the cup for nearly 20 minutes. I'm not sure if I should drink it now.
08:01noidihehe
08:01noidithat probably depends on whether you brew it for the taste or the caffeine :)
08:02RaynesWell, I brew for both.
08:02RaynesThe problem is that I'm worried that if I drink this, my eyes will turn black and I'll be walking on the celing.
08:02Raynesceiling*
08:05noidisome tea you have there :)
08:08AWizzArdcan't you mix it with some hot water?
08:08RaynesI suppose, but I'm not sure how much would balance this out.
08:08RaynesI suppose drinking it wont kill me.
08:09RaynesBesides that, it's too delicious to not drink, and half of it is already gone.
08:49rrc7cz-hmhow do you have a defmethod which matches on multiple dispatch values? something like (defmethod x [:ul :ol])?
08:51AWizzArdHave your defmulti outputting those.
08:52rrc7cz-hmAWizzArd: that could get ugly fast with many values, but if that's the only way
08:52somniumrrc7cz-hm: multimethods use isa?, so you can use derive to setup relationships
08:53rrc7cz-hmI guess I could also make a macro which expands the defmethod into two, one for each
08:53rrc7cz-hmsomnium: that's a great idea
08:54somniumrrc7cz-hm: our BDFL has many great ideas :)
08:56rrc7cz-hmlol yeah
09:01dermatthiasanyone ever tried to call an agent update function via (send) in an agent update function? will this work?
09:07AWizzArdHallo dermatthias, yes, this works.
09:07rrc7cz-hmsomnium: how can you use derive when (namesace :ul) is nil? I tried (derive :ul ::list) but it's having a problem without the namespace. I tried qualifying ::list with my namespace, like foo.bar/::list, but that's throwing an invalid token error
09:08AWizzArdMr. Hickey himself did such a thing in has „Ants” example.
09:09dermatthiasah, ok. thanks. planing something similar right now, an "Invasive weed optimization" algorithm. I finally have to look into that Ants example...
09:15somnium,(doc derive)
09:15clojurebot"([tag parent] [h tag parent]); Establishes a parent/child relationship between parent and tag. Parent must be a namespace-qualified symbol or keyword and child can be either a namespace-qualified symbol or keyword or a class. h must be a hierarchy obtained from make-hierarchy, if not supplied defaults to, and modifies, the global hierarchy."
09:16AWizzArddermatthias: weed? :)
09:17somnium,(derive ::ul ::list)
09:17clojurebotnil
09:19rrc7cz-hmsomnium: if :: signals a local keyword, then it uses the current ns? but then why doesn't the global : work?
09:19somnium,(isa? (keyword (str (ns-name *ns*)) :ul ::list)
09:19clojurebotEOF while reading
09:20somnium,(isa? (keyword (str (ns-name *ns*)) "ul") ::list)
09:20clojurebottrue
09:21somniumthere may be a better way to make ns-qualified keywords, but that should work in the dispatcher in any case
09:21somnium,(namespace :foo)
09:21clojurebotnil
09:21somnium,(namespace ::foo)
09:21clojurebot"sandbox"
09:23dermatthiasAWizzArd: yeah, weed :) it's inspired by the distribution of weed and its seeds. everybody asks the same question here..."weed? ;)"
09:24AWizzArdgut :)
09:30rrc7cz-hmwhy would *ns* return the correct ns of my file when I do something like (prn *ns*) at the top level, but when I put it inside my multimethod dispatch fn it returns clojure.core?
09:30opqdonutmacro weirdness?
09:31rrc7cz-hmopqdonut: but wouldn't the macro expand the defmulti in my namespace?
09:32opqdonuthmm, it also might be that your dispatch fn is called from within clojure.core
09:32opqdonutI can't remember by which rules *ns* gets set
09:32somniumah *ns* is getting rebound, you can use the name of your ns "my-ns"
09:33opqdonutyeah
09:33rrc7cz-hmsomnium: yeah, I just was wondering why + it sucks to duplicate the ns
09:34krumholthi is the author of penumbra in this channel?
09:35rrc7cz-hmbut it _does_ work, and I'm quite happy about that
09:37somnium(def this-ns (ns-name *ns*)) works at top-level, *ns* must be getting rebound during macroexpansion
09:40rrc7cz-hmsomnium: that works nicely
09:41rrc7cz-hmsomnium: i just grab it right after the ns def and use that in the macro
10:24vyWhy does Clojure complains that "More than one matching method found: aset" for (doseq [[i j] (keys adjs)] (aset next (int (coord-to-idx n i j)) -1)) expression?
10:27AWizzArdIs coord-to-idx a multimethod?
10:27vy(defn- coord-to-idx [n i j] (+ (* i n) j))
10:28Chousukemaybe you need to cast the -1 too
10:29vyYup, that does the trick. Interesting. Should I submit a bug report?
10:29Chousukenah.
10:29ChousukeI think it's not a bug, just a java interop gotcha
10:30clojurebothmm… sounds like your out of heap space
10:30Chousukesometimes you need additional type hints so that the compiler can resolve the correct method.
10:30Chousukeclojurebot: botsnack
10:30clojurebotthanks; that was delicious. (nom nom nom)
10:34vyChousuke: But there are two alternatives for aset: One with 4 args, and one with 5 args. Why do I need a casting for -1?
10:34wlrclojurebot: it's "you're" not "your"!
10:34clojurebotThe bird, bird, bird, the bird is the word.
10:35wlr:)
10:35Chousukevy: The error is about a java method, not the function
10:42jcromartieboy, we sure are into this stuff to be sitting here on a Sunday morning (I'm making a lot of time-zone-related assumptions here)
11:41vyIs there an easier of turning a [[k0 v0] [k0 v0] ...] into a {k0 v0, k1 v1, ...} map than using (reduce #(let [[k v] %2] (assoc %1 k v)) {} [[k0 v0] [k0 v0] ...])?
11:41jcromartieyes
11:42jcromartie,(into {} [[1 2] [3 4]])
11:42clojurebot{1 2, 3 4}
11:42vyjcromartie: Thanks!
12:11Licenserodd thing:
12:11Licenser,(partition 4 '(1 2 3))
12:11clojurebot()
12:11Licenserbug or feature?
12:11Licenserand sorry :( hi everyone!
12:13Licenserokay feature
12:23vyHow can I place more than one expression in a cond entry? IIRC, there should be a "do" in Clojure. Where it went?
12:24vyOops! There it is.
13:06vy,(pos? 0)
13:06clojurebotfalse
13:06vyShouldn't 0 be positive?
13:08vyNevermind.
13:20Licenserhmm quiet tonight :)
13:21Licensera map that is a ref, and has ref's as keys, will a dosync on the map fail when only the key refs are modified?
13:22noidia map can't be a ref, but a ref can point to a map
13:23Licenserthat was what I mean, like (ref {1 (ref 1) 2 (ref 1)}) when I inc 1 and 2 in threads will there ever be transaction redos?
13:24Licenserproblem is I don't can think of a simple way to test it, I think it should not fail since the 'root' ref isn't changed but I'm not entirely sure
13:24noidithere shouldn't be
13:24noidibecause you're not modifying the map itself
13:24Licenser*nods* kk
13:26noidilet's call (ref 1) a, and (ref 2) b: the map's value is constantly {1 a, 2 b}, even if you modify the value a and b point to
13:27Licenserthat is what I was hoping for :)
13:27noidiat least that's the way I think things work :)
13:27Crowbar7So, I wrote this ircbot in clojure and he threads. However what would be the best way to have a module based system that loads the modules which contain the trigger and then return what is sent to the connection?
13:27Crowbar7threads on every instance of a trigger to be specific.
13:30Licensernoidi: so do I but I'm not sure since it still takes 50% longer then just using a single ref pointing to the map
13:35Licenserwoha good greif
13:36Licensernon paralell: 11389msec; paralell: 28244msec
13:36LicenserI am doing something hooribly wrong I fear
13:49opqdonutcan leiningen be easily used to compile a mixed java-and-clojure project?
13:55Crowbar7Hmm The clojurebot code is pretty awesome looking
14:04tomojopqdonut: http://github.com/antoniogarrote/lein-javac
14:04tomojhaven't tried it
14:04tomojmight help
14:10ordnungswidrighi all
14:10vyFYI: An optimized version of Floyd-Warshall's APSP (All-Pairs-Shortest-Paths) algorithm @ http://paste.lisp.org/display/95370
14:53Crowbar7,(* 1 2 3 4)
14:53clojurebot24
15:02AWizzArdordnungswidrig: good evening
15:08ordnungswidrighelau!
15:11ordnungswidrigdoes anybody know of some clojure-lucene glue code? I found mailindex on github which I took as a "template"
15:24redwyrm,((fn [x] (+ x 3) 2)
15:24clojurebotEOF while reading
15:24redwyrm,((fn [x] (+ x 3)) 2)
15:24clojurebot5
15:24redwyrmneat
15:26BorkdudeHello, Ive got some problems getting my classpath right in Clojure Box, somebody wants to help?
15:26ordnungswidrig,(#(+ % 3) 2)
15:26clojurebot5
15:26ordnungswidrig,((partial + 3) 2)
15:26clojurebot5
15:28BorkdudeHello, Ive got some problems getting my classpath right in Clojure Box, somebody wants to help?
15:29AWizzArdHallo Borkdude. Can you tell a bit more?
15:30BorkdudeYes, I've tried both setf and add-to-list to the variable swank-clojure-classpath in my .emacs
15:31Borkdudethe clj file i want to have in the classpath is on c:/temp/examples
15:31raekwhat is the recommended way of signaling errors in pre-deftype clojure? throwing an instance of an exception class written in ordinary java?
15:32AWizzArdBorkdude: in my .emacs file I have something like (setq swank-clojure-extra-classpaths '("/Users/ath/hg/src/" "/Users/ath/hg/build/" "/Users/ath/clojure/clojure.jar" "/Users/ath/clojure/swank-clojure/")) I have more entries, but those paths go into my CP.
15:33Borkdudehmm let me try
15:35AWizzArdwb ulfster, alles klar? :)
15:36ulfsteryeah, everything fine. tortured myself playing soccer
15:40BorkdudeAWizzArd: I have this in my .emacs now:
15:40Borkdude(setq swank-clojure-extra-classpaths (list "c:/temp"))
15:40Borkdudeand my file, snake.clj is in c:/temp/examples/
15:41Borkdudebut when I do (use 'examples.snake) it gives an error about the file not being found
15:42AWizzArdand what is the NS of snake.clj?
15:42AWizzArd(ns examples.snake ...) ?
15:45Borkdude(ns examples.snake
15:45Borkdude (:import (java.awt Color Dimension)
15:45Borkdude (javax.swing JPanel JFrame Timer JOptionPane)
15:45Borkdude (java.awt.event ActionListener KeyListener))
15:45Borkdude (:use clojure.contrib.import-static
15:45Borkdude [clojure.contrib.seq-utils :only (includes?)]))
15:46ordnungswidrig1re
15:55BorkdudeAWizzArd, any idea?
16:00AWizzArdHmm, that looks okay
16:00ordnungswidrig1perhaps it's the slash? Have you tried "c:\\temp" for the classpath?
16:00AWizzArdTry (System/getProperty "java.class.path")
16:01AWizzArdthe slash should not be a problem, I do the same
16:01AWizzArdEmacs and Java understand both, the slashes and backslashes
16:03BorkdudeAWizzArd: "c:/Program Files/Clojure Box/swank-clojure/src;c:/Program Files/Clojure Box/lib/clojure-contrib.jar;c:/Program Files/Clojure Box/lib/clojure.jar"
16:04Borkdudeit seems c:/temp is not there
16:08AWizzArdyour path seems to be missing
16:10Borkdudeyes, so clojure box is not picking up this: (setq swank-clojure-extra-classpaths (list "c:/temp"))
16:17dabdis there a generic way of maintaining the original collection type when applying a function that works on seqs? For example. if I call (distinct [1 2 3 1]) I get back a lazyseq but I would to get back a vector
16:23chouserdabd: (into (empty c) (distinct c)) ; usually works well
16:24AWizzArddabd: nothing that is already prepared, but you can write a function that takes distinct and its arg, and then converts that back
16:24chouserone exception is lists, since (into () s) will reverse the order of s
16:33dabdthe seq abstraction is nice but sometimes they are hard to work with. For example if I am working with a vector and conjoining elements to the end it, if I apply a seq function it will return a lazy seq and conj will start adding elements to the start.
16:36miltondsilvahi
16:38miltondsilvawhen using slime... I often get Unable to resolve symbol... switching the order of the def and calls to def seem to work... but if someone could give me a explanation... and a more convenient way to fix this I would be grateful.
16:41chouseryou must define a Var before you use it. Is that what you're talking about?
16:43chouserdabd: I haven't found that to be much of a problem. Vectors and lazy seqs are rather different things, and I usually I find the operations I want to apply group natrually so that conversion back and forth is relatively rare.
16:43miltondsilvayes... but.. I have def it...
16:44miltondsilvaexample... (defn b [] (a)) below this (defn a[] )
16:44miltondsilvait says
16:44dabdchouser: say you concat two vectors you need to do something like (into [] (concat v1 v2)) otherwise you will get a lazyseq which has diffrent semantics for conj
16:44miltondsilvaUnable to resolve symbol
16:45miltondsilvaif I do (defn a[] ) then (defn b [] (a)) it works...
16:46opqdonutmiltondsilva: as said, you need to define a symbol before you use it :)
16:47miltondsilvabut... can't I get around this? isn't there some way to load the file in such a way that all things are loaded and only then is the top level expression evaluated?
16:48opqdonutyou can use the declare form to switch the order of definitions: (declare a) (defn b [] (a)) (defn a [])
16:48opqdonutso for example for mutually recursive functions you must use that
16:48miltondsilvaok thanks :)
16:48opqdonutyou see, there is no difference between definitions and other top-level expressions
16:49opqdonuti seem to recall that most other lisps throw the error only when you try to use (call in this case) a nondefined symbol
16:51miltondsilvaok... I was thinking the structure of the code was a bit less restrictive (like java) but it's not a big deal
16:53miltondsilva(java is very restrictive I know.. but it is allowed to use things before declaring it)
16:53miltondsilvaagain, thanks :)
16:59chouserdabd: or just (into v1 v2)
17:02solussd,(str "welcome" "atrerus")
17:02clojurebot"welcomeatrerus"
17:15atrerusquestion for those using emacs/slime... how do you configure the classpath for general libs like clojure-contrib or ant?
17:15dabd,(distinct #{1 2 1})
17:15clojurebotjava.lang.UnsupportedOperationException: nth not supported on this type: PersistentHashSet
17:16dabdIsn't the distinct function supposed to work on collections? It returns an exception if applied to a Set
17:20dnolenatrerus: lein helps, managing the classpath manually is a serious pain.
17:20dnolenatrerus: you can use 'lein swank' and then connect to a repl with the classpath set
17:21atrerusok... is lein something specific to Clojure or is that a more general thing for emacs?
17:21chouserdabd: interesting. I think that's a bug, but I
17:21chouserbut I'm not sure where.
17:22dabdI was looking at the implementation of distinct but I can't see it either
17:22chouserdistinct relies on destructuring
17:23atrerusdnolen: what's a good page to read up on lein?
17:23chousertrying to destructure a set or map with a vector throws an exception because vector destructuring uses 'nth', and maps and sets don't support that.
17:23dnolenatrerus: check github
17:24chouserso I'm not sure, but my guess would be that distinct out to have another (or differently-placed) 'seq' call.
17:24chousers/out/ought/
17:24atrerusdnolen: thanks! I'll look into that.
17:24dnolenatrerus: leiningen
17:26dabdchouse: but calling distinct on a set makes as much sense as calling it on an integer right?
17:26dabdso ,(distinct 2)
17:26dabd,(distinct 2)
17:26clojurebotjava.lang.UnsupportedOperationException: nth not supported on this type: Integer
17:26dabdso (distinct 2) equally fails
17:27chouserhm, I suppose you're right.
17:27dabdditto to maps
17:28dabdbut it would be more elegant if it returned the set as is instead of throwing an exception
17:32chouserhm. ditto for maps?
17:35dabdhow do you remove distinct entries from a map if it doesn't have duplicate keys?
17:35dabdbased on values?
17:35dabdthat makes sense
18:14ankouhi, this question is somewhat slime related but since many clojuredeveloper seam to use slime... how can I manage projects? I know how to load a file but usually I want to load the main file of the project, how should I manage my project with slime?
18:21atrerusankou: I just asked the same and was referred to http://github.com/technomancy/leiningen/tree/56683c38627a9fd69c968d27292444e252f9ecfd/lein-swank#readme
18:22atrerusankou: reading up on it now
18:22Licenseris there a lein dep für c.c 1.1?
18:23atrerusLicenser: that page I just linked says they have an RC
18:23Licenserheh
18:25dnolenatrerus: ankou: you just need to install leiningen 1.1.0. Then you run "lein self install". Then when you define your project add "lein-swank" as a :dev-dependency. then "lein deps" and "lein swank". You can then run M-x slime-connect and just use the defaults
18:25dnolenhttp://github.com/swannodette/clj-nehe/blob/master/project.clj, to get an idea of what your project.clj should look like
18:25ankouokay I'll have a look at it. And another question, when there is an error how do I get the line number from slime? with C-C C-K it says: Unknown Location: Error: ... whereas enclojure actually gives me an exception with a concrete line number
18:26atrerusankou: dunno, slime generally gives me a line number for a failed compile...
18:28Licenserah 1.1.0 of cc isn't known to lein but 1.2.0
18:28ankouthe error is as simple as (defn main [] (map 'x 'y)) (main) since I just wanted to try how slime handels errors but it says unknown location
18:28dnolenankou: C-c C-l I think is what you want if you want errors with line numbers.
18:30dnolenankou: take that back, C-c C-k is right and that gives me line numbers.
18:31ankouC-c C-l gives me everything except for the line number. It looks exactly like the exception message of enclojure but without the line number(enclojure says Don't know how to create ISeq from: Symbol (defpackage.clj:2) followed by the backtrace whereas slime just misses the (file:n)
18:48Licensercould it be that the clojure contrib api isn't up to datE?
18:52dnolenLicenser: did you have a previous install of lein? Are you specifying clojure-contrib 1.1.0 in your deps?
18:52LicenserI sepcifue c.c 1.1.0 in my deps
18:52Licenserbut things like c.c.io are still c.c.d-c
18:53dnolenah, yeah I don't know if what's up on Clojars is up to date.
18:53Licenserwell if it says c.c 1.1.0 it should be 1.1.0 it's no snapshot or anything
18:53miltondsilvais it possible to access protected fields of class when using a proxy?
18:53Licenserif it's not 1.1.0 as in the API docs it should not be named 1.1.0 :P but get a different version number
18:56dnolenLicenser: you're right I can't import c.c.io, I'm using the latest versni of lein. Might want to mention this on the Leiningen ML
18:57Licenserhrm odd odd odd
19:20the-kennyWhat's the best way to do (f [:foo :bar] [42 23]) -> [:foo 42 :bar 23] (I don't want a map)
19:22the-kennyah, nevermind. interleave is the function
19:53lygarethey, y'all, hoping someone could help me with a problem, which I'm pretty sure is me not grokking the immutablity thing
19:53lygaretI've got a struct (defstruct window :event_handlers), which needs to hold a list of event handlers in the :event_handlers key
19:54lygaretmy goal is to be able to do something like (on-event my_window :event_handlers (fn [e] ...)) and have that function be added to the list of handlers.
19:55lygaretI'm just not sure how to go about doing that - I know I can't use assoc directly, unless I am going to put the new list back in the struct, but that's something else I'm not allowed to change.
20:11mudgewow, clojure
20:11mudgemy programming interest raptures
20:12mudgeand i sing and dance in functional unmutable persistent data structures
20:13mudgesorry, I couldn't help myself
21:17jcromartiemudge: nice
21:18mudgejcromartie: thanks
21:19jcromartiemy code is waxing existential
21:19jcromartie(def *god* (agent nil))
21:19jcromartieIt doesn't help that I'm listening to Tears for Fears at the same time.
21:19jcromartieI need a drink or something
21:20mudgeyea
21:20jcromartieand of course, nil becomes the world on the first send :)
21:20mudgehmm?
21:21jcromartieoh the "world" of a game
21:21jcromartiesimulation etc
21:21mudgeoh okay
21:21JayMmudge: i agree. i didn't know parentheses could be so beautiful
21:22scottbotwhat's the idiomatic way to schedule a function to be executed in a background thread every n seconds?
21:23jcromartiescottbot: I'm working on this right now, actually
21:23mudgeJayM: yea, i don't know what other people's big deal is about parentheses. They're curved and they balance symetrically, qualities of beauty.
21:24jcromartiescottbot: I'm using an agent
21:25jcromartiescottbot: basically, set up your agent, then send a fn that sleeps before sending itself
21:27JayMmudge: well put
21:31scottbotjcromartie: that's what I'm currently using, with a nil agent with send-off and Thread/sleep
21:31jcromartieyup
21:31jcromartiealthough make sure to understand the differences between send/send-off
21:31jcromartiesend generally keeps the thread count down
21:32scottbotjcromartie: upon reflection, send is what I want
21:33scottbotjcromartie: thanks!
21:37kwertiiTrying to install 1.1.0 tag from source. Ant works fine, but mvn install gives "[WARNING] JAR will be empty - no content was marked for inclusion!" and then just copies a tiny 1k jar file to the maven repo. what am I missing?
21:41jcromartiescottbot: are you using an anonymous/let-bound fn for your periodic fuction?
21:42jcromartieI'm not sure how to do it without a named var
21:44jcromartieor the Y combinator... :-/
21:47_mstjcromartie: sounds a bit like you might want letfn to allow your function to refer to itself?
21:48jcromartieletfn yes
21:48jcromartiethanks!
21:48jcromartieanother idiom question: how about a way to modify a value at a "key path" in a map?
21:48jcromartielike {:foo {:bar {:bat 5}}}
21:48jcromartieI want to make that 5 a 6
21:48jcromartie(for example)
21:50_mst,(assoc-in {:foo {:bar {:bat 5}}} [:foo :bar :bat] 6)
21:50clojurebot{:foo {:bar {:bat 6}}}
21:50jcromartieah, nice
21:50_mstor there's update-in if you want to provide a function to do the modification (like inc, for example)
21:50jcromartiethat should be in the cheatsheet :)
21:50jcromartiebeautiful
21:52jcromartiethat cuts down on so much code
21:54jcromartiethere could be an alter-in too
21:56_mstyou can compose it all together with something like (alter myref update-in [:foo :bar :bat] inc)
21:56kwertiiupdate, in case anyone was wondering: there is apparently no standard way to install a self-built Clojure jar into maven. (per http://www.mail-archive.com/clojure@googlegroups.com/msg21784.html)
21:56jcromartieah yes, that works nicely
22:14BrandonWit definitely seems like clojure core was very well thought out
22:14BrandonWi've already encountered a couple times when i implemented something, then went back to optimize it and instead looked at clojure core more closely
22:14BrandonWand found that it has a function that does the same thing, except more efficiently and concisely
22:14BrandonWand i still haven't used clojure all that much
22:24defnhello
22:37KirinDave_Does anyone know of any projects that have taken compojure and added on for a less bare-bones experience?
22:39qbgYes, I have defeated the transient vector with my (functional-like) mutable array deftype.
22:46defnKirinDave: Hmmm -- What do you mean by "less bare-bones"? As I've understood it Compojure was kind of beastly and was going to be split off into a couple different projects...
22:49cemerick,(with-meta (agent nil) {})
22:49clojurebotjava.lang.ClassCastException: clojure.lang.Agent cannot be cast to clojure.lang.IObj
22:49cemerickhrm
22:49cemerick,(supers clojure.lang.Agent)
22:49clojurebot#{clojure.lang.AReference clojure.lang.ARef clojure.lang.IDeref clojure.lang.IReference clojure.lang.IMeta java.lang.Object clojure.lang.IRef}
22:53Crowbar7So, I compiled the snapshots of clojure and clojure works fine, but I can't access the clojure-contrib libs at all.
22:54Crowbar7It always tells me nil when I try to require.
22:54Crowbar7any help?
22:54Crowbar7It shows up in my classpath
22:57dakroneCrowbar7: nil is the proper response when you do (require 'clojure.contrib.foo)
22:58dakroneso if you did (require 'clojure.contrib.seq-utils), the REPL will return nil
22:58dakrone,(require 'clojure.contrib.seq-utils)
22:58clojurebotnil
23:02dakroneand then you can reference it using the namespace
23:02dakrone,(clojure.contrib.seq-utils/flatten [1 2 3 [4 5]])
23:02clojurebot(1 2 3 4 5)
23:05Crowbar7ok
23:05Crowbar7thankyou
23:05defnAnyone have any suggestions for libraries that would allow me to automate form submission/surfing etc.
23:05dakroneCrowbar7: you're welcome :)
23:06Crowbar7dakrone: I'm really new to clojure and so I'm getting my feet wet with a homebrew irc bot.
23:06Crowbar7thank you for the help
23:08dnolendarkone: your clojure opennlp project looks pretty interesting. Can you use it extract name entities yet?
23:08KirinDavedefn: For example, more automation on the generation of the routing table.
23:08dnolendakrone: ^
23:08KirinDavedefn: More generous facilities for decorators.
23:08dakroneCrowbar7: have you seen this yet? http://nakkaya.com/2010/02/10/a-simple-clojure-irc-client/
23:08KirinDavedefn: Like right now, decorator order is kind of a pain to manage. If you write a decorator that depends on session stuff to be in place, yoi have to manage that by hand.
23:08defnKirinDave: ah -- sorry I don't have any suggestions for you -- the best bet I think would be to check out forks of compojure and see what you can come up with
23:08dakronednolen: you could use the proper-noun filter, but not specifically for names yet
23:09KirinDavedefn: Today I started writing code to, at compile time, scan the contents of a module and use that to generate a routing table.
23:09dnolendakrone: cool, yeah I'm interested in extracting named entities - people/organizations.
23:09KirinDavedefn: metadata in the module specifies what should be what.
23:10dakronednolen: you could do a proper-noun filter coupled with a good dictionary file, anything that doesn't exist is probably a name
23:10dakronealthough that's a really messy way to do it
23:11dnolendakrone: was curious because I've seen java opennlp examples that show names and organizations can both be identified using the write dictionaries.
23:11dnolenwrite -> right
23:12dakronednolen: I've only done a tiny part of the opennlp library so far, so there's probably one I haven't looked at yet
23:37Crowbar7How do you put variables inside of clojures regex?
23:39defnooo i know this one
23:40defnCrowbar7: I can't remember the name of the function now, but for some reason I remember it being in str-utils
23:40Crowbar7ok
23:40defnit let's you compose a regex of several different pieces
23:40defnso one of them could be a variable
23:40Crowbar7that will make html parsing easier
23:41defnyou know about enlive?
23:41Crowbar7no
23:41defnlook it up
23:41defnit might be what you're looking for
23:43Crowbar7So, clojurebot is pretty cool
23:43defnyeah, it's a neat project to play with
23:47Crowbar7Who wrote him?
23:47defnhiredman i believe
23:47dakroneyea, http://github.com/hiredman/clojurebot
23:47KirinDaveCrowbar7: Enlive is pretty damn awesome.
23:51KirinDaveDid clojure.contrib.def get dropped in contrib 1.1.0?
23:56atrerusif I want lein to compile my clojure code into the repl, do I have to specify something in the project file?
23:56defnatrerus: which version of leiningen
23:56defnerr oh, in the REPL
23:57atrerusdefn: 1.1... just grabbed from git today
23:57defni use swank-clojure
23:57atrerusright
23:57atrerussorry that's what I mean
23:57atrerusI fire off "lein swank" then M-x slime-connect
23:58atrerusbut I'm expecting the clj files in my src directory to be loaded...
23:58defnwhy not use M-x swank-clojure-project?
23:59atreruswould that give me the option to connect to the existing swank server?
23:59defnit spawns a new swank server with your dependencies and such on the classpath and the connects to it
23:59defnthen*
23:59atrerusah... so no need to start the swank server via the command line