#clojure logs

2009-10-07

00:00rongenresomnium: i'd use that to reduce all the vectors?
00:01arbschtsorry, I'm not familiar with R dataframes. can you describe the structure?
00:01rongenreum. Basically a named set of equal-length vectors
00:01rongenrethey function a lot like a relational table
00:03arbschtcan you give an example of what you want to accomplish in clojure?
00:06rongenreSay it's account information. User name, password, last login, stuff like that. I want to find everyone who logged in in the last 30 mins.
00:06somnium,(filter (fn [x] (some #(> % 7) x)) '([1 3 5] [2 4 6] [3 5 7] [4 6 8]))
00:06clojurebot([4 6 8])
00:07somniumrongenre: some composition of filters and preds should get you where you want
00:08rongenreIs there a way.. if I get the indexes of values in one vector to extract the values in all the other vectors? Like nth which takes a vector of indices as an argument
00:09rongenreOr alternately a boolean vector which I can apply to another one of the same side and pull out those which are true. That's kind of like a filter.
00:09somniumsure
00:11somnium,(map (fn [[x y z]] [x z]) '([1 2 3] [4 5 6] [7 8 9]))
00:11clojurebot([1 3] [4 6] [7 9])
00:12rongenreGotcha. So if I could make [x z] take a vector of booleans I'd be good.
00:12somniumI'm sure there's more than one way
00:12rongenreThat's helpful though, thanks
00:12arbschtrongenre: if you described your actual problem, we might be able to give an idiomatic solution :)
00:13clojurebot"There is no problem in computer programming which cannot be solved by an added level of indirection." -- Dr Maurice Wilkes
00:13rongenreLet me go make it up..
00:17slashus2,(mapcat vals (keys (clojure.set/index #{[1 2 3] [4 5 6]} [0 1])))
00:17clojurebot(5 4 2 1)
00:18slashus2rongenre: Something like that?
00:19rongenresay I have this: (def *db* {:c1 (vector (range 10)) :c2 (map (fn [x] (rand)) (range 10))})
00:20rongenreI want to find the c1 values where c2 < 0.2
00:20rongenresorry, (vec (range 10))
00:24rongenreslashus2: does that make sense?
00:26somnium, (filter (fn [[x y]] (< y 0.2)) [[:a 0.1] [:b 0.2]])
00:26clojurebot([:a 0.1])
00:26slashus2,(filter #(if (< (second %) 0.2) [(first %) (second %)]) (apply zipmap (vals {:c1 (vec (range 10)) :c2 (map (fn [x] (rand)) (vec (range 10)))})))
00:27clojurebot()
00:27slashus2or that...
00:27somnium(map (fn [[x y]] x) '([:a 0.1]))
00:28somniumif you split it out into separate transformations and filters
00:28somniumit should compose in a very understandable way
00:28slashus2The zipmap thing works I suppose.
00:29slashus2So as a combination of our solutions..
00:29slashus2,(filter (fn [[x y]] (< y 0.2)) (apply zipmap (vals {:c1 (vec (range 10)) :c2 (map (fn [x] (rand)) (vec (range 10)))})))
00:29clojurebot([3 0.08506635579071331] [6 0.03744368136130927] [9 0.05586704315213442])
00:30rongenrenice. Let me look at that more.
00:34konrhmmm, I have two functions defined, (defn foo [] 1) and (defn bar [] (foo)), but if I declare bar before foo, evaluating the file will raise an exception. Is this a way around this?
00:35somniumkonr: put them in the right order?
00:35konrsomnium: well, besides that :P
00:39slashus2declare?
00:40slashus2(declare foo)
00:41konrhmm, this will work! Thanks!
00:42slashus2You are welcome.
00:52Makoryu,(doc 'declare)
00:52clojurebotjava.lang.ClassCastException: clojure.lang.PersistentList cannot be cast to clojure.lang.Symbol
00:52Makoryu,(doc declare)
00:53MakoryuPffft
00:53clojurebot"([& names]); defs the supplied var names with no bindings, useful for making forward declarations."
01:43namornick namor
01:43namoroups
03:05LauJensenMorning gents
03:07Fossihi
04:03snowwhitehow do i use compojure in the existing clojure project?
04:08snowwhiteping
04:11LauJenseneh?
04:12LauJensensnowwhite, could you clarify?
04:14snowwhiteLauJensen, Thanks, just got the solution
04:21adityohey snowwhite
04:21snowwhitepong
04:22snowwhiteadityo, pong
05:28LauJensenAny regex junkies here today?
05:35voldernLauJensen: just ask your question
05:38LauJensen,(re-find #"<([A-Z][A-Z0-9]*)\b[^>]*>(.*?)</\1>" "foo bar <title>quux</title> baz 1 2 3")
05:38clojurebotnil
05:38LauJensenWhy am I not trapping quux ?
05:39jdznice, regexps. used for parsing. i'm not reading your next blog entry lau, no way.
05:39LauJensenhaha
05:44raek#"<([A-Za-z][A-Za-z0-9]*)\b[^>]*>(.*?)</\1>"
05:44raek,(re-find #"<([A-Za-z][A-Za-z0-9]*)\b[^>]*>(.*?)</\1>" "foo bar <title>quux</title> baz 1 2 3")
05:44clojurebot["<title>quux</title>" "title" "quux"]
05:45raeksmall letters... :)
05:48LauJensenaaah, good catch, thanks
05:48LauJensenso we got it worked out and as usual, no thanks to jdz :)
05:49jdzi'm not taking part of increasing the number of regexp-wielding monkeys in the world.
05:56raek,(re-find #"<([A-Za-z][A-Za-z0-9]*)\b[^>]*>(.*?)</\1>" "foo bar <p>quux</p><p>foo-foo foo-bar</p> baz 1 2 3")
05:56clojurebot["<p>quux</p>" "p" "quux"]
05:57raekah, (.*?)
06:08crios_,(eval (list '+ 2 8))
06:08clojurebotDENIED
06:08crios_well, anyway: is there a shorter way to do it?
06:08Chousuke(+ 2 8)? :P
06:08clojurebot*suffusion of yellow*
06:09crios_yes Chousuke :) besides that
06:09crios_I mean, executing a dinamically created list
06:09crios_I was guessing ((list '+ 2 8))
06:09crios_but it does not work
06:09Chousukeno, you need eval
06:10Chousukethough using eval is often suspicious. what are you doing :)
06:10Chousuke+? :P
06:12crios_well, sort of studying, following some Scheme example: http://mitpress.mit.edu/sicp/full-text/book/book-Z-H-16.html#%_sec_2.3.2
06:12crios_there you find: (define (make-sum a1 a2) (list '+ a1 a2))
06:13Chousukeah, well, studying eval is okay I guess.
06:14Chousukehelps you understand why you shouldn't use it too often :P
06:15crios_yes; just wondering why that Scheme example works without an explicit "eval" function, but maybe there is some different approach to the "executing step"
06:15Chousukehmm
06:15jdz,(let [l '(2 8) f '+] (apply f l))
06:15clojurebot8
06:16jdzhuh?
06:16Chousuke'+ is a function, but it's not + :)
06:16jdzoh, right
06:16Chousuke,('+ '{+ 1})
06:16clojurebot1
06:16jdz,(let [l '(2 8) f +] (apply f l))
06:16clojurebot10
06:16Chousuke,('+ '{- 1} 2)
06:16clojurebot2
06:17jdz,'+
06:17clojurebot+
06:17jdz,(apply '+ :foo)
06:17clojurebotjava.lang.IllegalArgumentException: Don't know how to create ISeq from: Keyword
06:17jdz,(apply '+ '(:foo))
06:17clojurebotnil
06:18Chousuke'+ looks itself up in whatever associative thing you give it
06:18jdzhmm, clojurebot should add evaluation numbers so we can refer to them in the chat :)
06:18Chousukeor returns its second argument (which is nil by default)
06:20jdzi'd probably expect that from keywords, but from ordinary symbols...
06:20crios_So, if you were implementing in Clojure the some "derivate" example in http://mitpress.mit.edu/sicp/full-text/book/book-Z-H-16.html#%_sec_2.3.2 (Representing algebraic expressions), would you use "eval" ?
06:20crios_or some other trick?
06:20Chousukecrios_: the (+ a1 a2) list in that code is not evaluated at any point. it's just a data structure used by the derivation function
06:21crios_yes, but when actually doing the (deriv '(+ x 3) 'x)
06:21crios_it is evaluated
06:22Chousukewhere is deriv defined?
06:22Chousukeoh wait, duh
06:23Chousukeno, it's not evaluated :)
06:23Chousukeif it were, there would be a call to eval
06:24crios_it is defined in "The differentiation program with abstract data"
06:24crios_and used when sum? is true
06:24crios_sum is true when the operator is +
06:25crios_it seems to me that in Scheme you (in that example) don't need to call an "eval"
06:25jdzcrios_: it seems to you wrong
06:26Chousukecrios_: it never looks for the function +. all it deals with are symbols
06:26crios_jdz: :) I was guessing it, but why?
06:26jdzcrios_: if there is no need for eval in scheme code, you don't need it in Clojure code
06:27Chousukeoh damnation, my emacs is broken
06:27crios_Chousuke: so you mean it never really do a real sum?
06:27crios_ok, I understood :)
06:27Chousukecrios_: yeah.
06:27jdzcrios_: you can define function make-sum like (define (make-sum a1 a2) (list 'this-is-a-plus-symbol a1 a2))
06:28jdzcrios_: and change the sum? function accordingly
06:28Chousukecrios_: deriv only transforms the list '(+ x 2) to '(+ 1 0)
06:28crios_ok, I see that. Pardon for causing confunsion
06:28crios_thanks
06:29Chousukeyou can eval those to get the sum, but that's not relevant to deriv :)
07:44pixelmanhow can i check if a variable exists?
07:45pixelmanlike (isset? *debug*)
07:48pixelman,(resolve '*debug*)
07:48clojurebotnil
08:07bennshow do i install swank-clojure manually ?
08:08eevar2benns: git clone
08:08bennseverything i found out so far says to run clojure-install from emacs
08:08bennseei mean the configuration bit
08:10bennsi mean who came up with that crap anyway
08:11bennsi don't want to download clojure/etc/etc i have them installed
08:11eevar2my .emacs looks something like this: http://pastebin.com/m64f9ee22
08:11bennsok thanks
08:12noidii followed these instructions to install slime/clojure http://riddell.us/tutorial/slime_swank/slime_swank.html
08:13noidijust used my own paths instead of dumping everything under /opt
08:14noidinothing ubuntu specific in the tutorial, despite the title
08:19G0SUBwhat's the best way to recursively modify the values of a map (they themselves can be maps)? (I am fine with creating a new map)
08:25chouserit's good that you're ok with that, because maps are immutable, so you must create a new one.
08:27bennshow do i start clojure from emacs ?
08:27bennsi have other lisps in slime-lisp-implementations
08:27ambientM-x slime
08:27bennsslime runs clozure cl
08:27ambientah, then I don't know. i have only clojure installed
08:27bennsthe guy who wrote swank-clojure should be hanged
08:29chouser,(letfn [(double-value [m] (zipmap (keys m) (map #(if (map? %) (double-value %) (* 2 %)) (vals m))))] (double-value {:a 1, :b 2, :c {:d 3, :e 4, :f {:g 5}, :h 6}}))
08:29clojurebot{:c {:h 12, :f {:g 10}, :e 8, :d 6}, :b 4, :a 2}
08:29chouserG0SUB: ^^^
08:30eevar2benns: did you read the docs? -- http://github.com/jochu/swank-clojure mentions something about running clojure alongside cl
08:30bennsi did that
08:31bennsbasically swank-clojure-config is broken
08:31bennshe should simply say what configuration options exist and let _me_ set them up
08:31bennsinstead of assuming things that do not exist
08:32ambientwell you could fix it if you know so much about it for the benefit of the rest of us?
08:34bennsno dude i won't waste my time with this pile of crap
08:34bennsif he can't be bothered to release stuff that works, i won't do his job for him
08:35bennsi have 4 cl implementations working perfectly with slime and swank-clojure fucks everything up because he can't be bothered to document his own stuff
08:45danleibenns: what I do is: just compile swank.clojure.jar, use swank.swank/start-server in the clojure repl, and connect via slime-connect. (ymmv)
08:47bennsthis is an option, but clojure-mode depends on swank-clojure being loaded
08:47bennsso i can't even get the first without the second
08:47danleibens, a sec
08:47G0SUBchouser: wow. thanks.
08:48danleibenns: I require (in that order) clojure-mode, swank-clojure, and swank-clojure-autoload in my .emacs. that's all I have set-up, and it works
08:49danleibenns: and I don't like clojure-install either, I compiled swank.clojure.jar via maven
08:49G0SUBchouser: so that calls the function recursively. that's stack consuming, right?
08:50chouserG0SUB: yes
08:51G0SUBchouser: ok. thanks for reminding me about zipmap. that's awesome. many thanks.
08:51chouserbut it consumes stack relative to the depth of the map nesting, not relative to the size of each map
08:51chousernp
08:52G0SUBright.
08:54chouserand it's necessary to keep the partially-complete higher-level maps somewhere while working on lower-level ones. Using the JVM stack is by far the most convenient.
08:56chouserif you maps can be deeper than the JVM stack allows (and increasing the size of the JVM stack isn't acceptible), you have to build up an accumulator either with tail-recursive calls or 'reduce'. More code, harder to get right, and likely slower.
08:59bennsdanlei: the problem i have here is that he assumes i do not have slime installed and configured
08:59bennsi tried clojure-installed, not even that works
09:03danleibenns: hm. I'm not sure why it won't work. I use jochu's clojure-mode and swank-clojure repos, both are up-to-date. If you want to take a look at my .emacs, it's at http://github.com/danlei/emacs/ if you want to take a look. I can assure you, I never ran clojure-install, just what's in my .emacs and compiled swank-clojure with maven ... hth
09:09bennsdanlei: how do you start clojure instead of clisp though ?
09:09bennsM-x slime starts ccl here
09:09bennsM-- M-x slime clojure does not exist
09:09danleibenns: as I said, I use swank-connect exclusively
09:10pixelmanhow can I loop a collection and have access to the current index? I want to track progress
09:15danleibenns: s/swank-connect/slime-connect/
09:17jdzpixelman: how do you loop?
09:18pixelmanjdz: dorun, but now I am re writing with loop/recur it'll work
09:18pixelmanjdz: I was searching for a construct like rubys .each_with_index
09:18jdzpixelman: well, if you use map, like (map my-function collection)
09:19pixelmanjdz: I want to prinnt out 45% done etc.
09:20jdzpixelman: then you can instead do (map my-function-that-takes-item-and-index collection (iterate inc 1))
09:20Chousukemap is probably not the best choice though
09:20chouserclojure.contrib.seq-utils/indexed
09:20Chousukebecause it's lazy
09:21jdzChousuke: well, i saw pixelman uses dorun at the moment
09:21pixelmanchouser: indexed will fit the bill!
09:22pixelmanjust noticed today the documentation for clojure contrib
09:22pixelmanhttp://richhickey.github.com/clojure-contrib/seq-utils-api.html#seq-utils/indexed
09:22pixelmanI like that it's possible to click to the source
09:37bennsok i managed to make it work
09:37bennsthanks danlei
09:38danleibenns: slime-connect or M-- M-x slime?
09:38danleibenns: welcome
09:38bennsM-- M-x slime
09:38bennsor M-x slime-clojure
09:38liwpbenns: did you have to fix something in swnak-clojure or was it just a pain to configure it?
09:38bennsas this is the scheme i'm using with the rest of the lisps
09:38danleiI see
09:38danleidid you have to do something besides what's in my .emacs, if yes, what?
09:39bennsi will paste the relevant bits
09:39danleithanks
09:42bennshttp://paste.lisp.org/display/88333
09:43bennsthe clojure binary is the one he gives with modified classpath to include swank-clojure
09:43bennss/binary/script
09:47danleibenns: ok, ty
09:55jdzhttp://paste.lisp.org/display/88333#1
09:57Chousukehm. something has gone wrong with my emacs
09:57Chousukethe option key seems to have stopped working
09:58Chousukemakes it kinda difficult to write clojure code, as I can't type [ or { :P
09:58bennsjdz: it would be good if he would put these examples in the docs for swank-clojure
10:07jfieldshow do I take an argument passed to a macro and make it a string? I tried (defmacro foo [x] `(println "~x")) but that printed ~x
10:08chousertry 'str'
10:08jdzjfields: why do you want a macro?
10:09jdzoh, nvm. misunderstood the question.
10:09jdzi think.
10:09jfieldsjdz I'm being lazy for a function that I use all the time and I don't want to type the quotes anymore.
10:09jfieldschouser cool. thanks.
10:21ngocHi, how to create interdependent namespaces?
10:21ChousukeI don't think you can.
10:22cemerickngoc: you'd have to control the load order explicitly, which is generally a sign you're doing something wrong
10:22cemericke.g. factor out the base functionality into its own ns, and have the two existing ns' refer to it
10:23ngocFunctions in namespce a use functions in namespace b and functions in namespace b use functions in namespace a
10:23chouserright. stop doing that :-)
10:23cemerickthen it sounds like there shouldn't be two namespaces
10:24cemerick~max
10:24clojurebotmax people is 182
10:24chouserngoc: it could probably be made to work, but it seems likely there's a better way
10:25cemerickwe have one spot where there's an interdependency -- in that case, namespace a sets up an empty atom which is reset by a dependent namespace when it loads
10:25cemericknot ideal, but it had to happen, and I regret it immensely :-|
10:31ngocI think "resolve" form can be used to evalutate namespace/function dynamically?
10:32cemerickyes, that's the fn used to look up vars dynamically
10:32Chousukebut do you really want that?
10:32cemerickit's definitely intended to be used sparingly
10:33Chousukeand I really wish we had some "canonicalize" function for symbols :P
10:33Chousukeand keywords
10:33cemerickoutside of the normal interning?
10:34ngocI "factor out the base functionality into its own ns, and have the two existing ns' refer to it" <-- but the functions in the new one has to call functions in the 2 others, so the problem remains?
10:34Chousukecemerick: I had a need to figure out the full namespace-qualified form of a given. turns out it's not exactly trivial
10:34Chousukea given symbol
10:35cemerickngoc: the objective is to eliminate the ns interdependencies. If that can't be done, why have just one namespace?
10:37cemerickI mean, why *not* have just one namespace?
10:37Chousukecemerick: the way to do it is try resolve first, then if it succeed, extract the namespace and name strings from the var and reassemble them into a symbol, or if it fails, see if the symbol has a namespace part that is an alias for some other namespace, and if so, expand it. unless you're done by now, you either need to add the current namespace to the symbol OR leave it as it
10:37Chousukeis...
10:39cemerickI remember writing a fn to get a ns-qualified symbol from a var.
10:39cemerickIt wasn't pretty.
10:39ChousukeI still haven't implemented this fully for my syntax-quote macro because I (obviously) can't use any functions that depend on macros using syntax-quote... :P
10:39cemerickChousuke: by 'alias', do you mean symbol mappings in ns declarations?
10:39ngoccemerick: OK, if in a same namespace, function f1 calls f2, and f2 calls f1, some kind of "forward definition" is used?
10:40Chousukecemerick: the :as stuff, yeah
10:40Chousukengoc: declare works
10:42triddellok, I'm the one who wrote the tutorials at http://riddell.us for clojure, slime/swank, etc. They are out of date right now but I'm trying to update them this morning. question: what repository is everyone pulling swank-clojure from these days?
10:44eevar2triddell: git://github.com/jochu/swank-clojure.git
10:45eevar2clojure-mode is git://github.com/jochu/clojure-mode.git
10:46ChousukeI use technomancy's repos for both
10:46triddelleevar2: ok, I thought I saw something about technomancy forking it and other using that
10:46eevar2^^ seems some do
10:47danlarkinI believe technomancy has been a more active maintainer
10:48Chousukethe repos do merge periodically though
10:49triddellbut is his mostly for the clojure-install method of installation, where he keeps versions in sync
10:50triddellmy install is manual and just takes each repos current HEAD
10:51triddellwhich could have mixed results depending on when it's done
10:51triddellwell, I'll just try with jochu today and see if that works
10:53danlarkinit seems jochu maven-ized swank-clojure, which I don't really get
10:56Chousukewell, most of it is clojure, isn't it? it could be used with apps other than emacs
10:58danlarkinHm I suppose that's true
11:00Fossitriddell: a hint on your (excellent, thanks) page that there is now clojure-install would be great
11:10tmountainthe first two articles on hacker news are both clojure related ... gaining some mindshare !
11:14cemerickyeah, things have really picked up lately...of course, right as I had to step away! :-/
11:17tmountainI wonder what the numbers look like regarding downloads of Clojure over the past year
11:39ngocIs it true that ;;; is used for namespace comments, ;; for function comments, ; for comments inside functions?
11:42Chousukengoc: that's the convention
11:43ngocSometimes I see that ;; is used for comments inside functions. Is this worse than ;?
11:43ngoc; ?
11:43stuartsierrangoc: emacs will right-align comments starting with ;
11:56ngocHow often are you all using gotapi.com? Is there any plan to add Clojure doc to it?
11:56stuartsierradon't use it
11:57ngocIs there a better place? (find-doc keyword)? :D
11:57chousernever heard of it
11:58stuartsierraevery web-based javadoc search I've tried is slower than google
11:59chouserI like (javadoc x)
11:59ngocIs there an easy way to join elements of an array together?
12:00chouserngoc: into a string?
12:00mtmI've been using kiwidoc.com (caveat: written by a friend of mine)
12:00ngocyes, like ["a", "b"] and ", " into "a, b"
12:00danleitechnomancy: are you there?
12:01chouserngoc: that's a vector not an array, but either way you can use str-utils/str-join, str-utils2/join, or apply str/interpose
12:02technomancydanlei: yeah, hi
12:02ngocIs a vector a fix-sized array?
12:03chouserngoc: no
12:03chouserngoc: a vector is an indexed persistent collection
12:04chouserngoc: http://clojure.org/data_structures#Vectors
12:05danleitechnomancy: hi, I tried to set up swank-clojure under windows, and it appends "/src" to my swank-clojure-path, which I set to [...]/swank-clojure/target/classes/, which breaks everything for met. (since slime-lisp-implementations tries to call java -cp [...]/swank-clojure/target/classes/src/, which won't work
12:05ngocThere are str-utils and str-utils2. Will str-utils be removed in the future?
12:05danleitechnomancy: I do appreciate that clojure-install makes things easier for newbies, but somehow it's getting in my way pretty much (I remember that I had this working some time ago)
12:06stuartsierrangoc: probably, time unspecified
12:07chouserstuartsierra: I don't think I've heard a single person suggest they'd like str-utils to stick around, so that's good.
12:08stuartsierra'k
12:09chouserI guess they might come out of the woodwork if 'require'ing it started to print warnings. :-)
12:10ngocIs there a way to create a normal Java array? Or is a vector must be created first, then casted into Java array?
12:10stuartsierra,(doc make-array)
12:10clojurebot"([type len] [type dim & more-dims]); Creates and returns an array of instances of the specified class of the specified dimension(s). Note that a class object is required. Class objects can be obtained by using their imported or fully-qualified name. Class objects for the primitive types can be obtained using, e.g., Integer/TYPE."
12:10chouservectors and arrays aren't really related
12:10arohnercan I get quick opinions on a name I'm thinking of for a clojure library?
12:10arohnerscriptjure
12:10tmountainisn't there an issue with namespace collissions and str-utils2?
12:11stuartsierratmountain: it's a feature :)
12:11danleitechnomancy: worse than that, under cygwin it even prepends "/home/danlei/" to my set-up paths ("c:/cygwin/home/danlei/.../blabla" -> "/home/danlei/c:/cygwin/..."), can't it just leave my paths as I set them?
12:11chousertmountain: yeah, don't 'use' it. (require '[clojure.contrib.str-utils2 :as str2])
12:11tmountainstuartsierra: ahh, of course
12:11tmountainas an aside, I'm a big fan of str-utils... use it all the time
12:23triddell1FYI: I've updated my clojure and slime/swank tutorials: http://riddell.us/blog/2009/10/07/tutorials-updated.html
12:23triddell1I still see a lot of reference to them and they were very out of date
12:25chousertriddell1: updating old docs isn't fun, but I'm sure it'll help a lot of people. thanks for doing it!
12:29triddell1chouser: np, this route maybe passe with most people using the clojure-install method but there's no sense in having a broken tutorial out there for those new to clojure
12:31danleitriddell1: ah, using s-c-extra-classpaths for swank-clojure :)
12:31danleitriddell1: that's an option
12:32triddell1danlei: yes, that is the part I needed to figure out today!
12:33triddell1danlei: wasn't sure what another would be
12:33triddell1danlei: option that is
12:33danleitriddell1: well, basically it's jumping through hoops, I guess
12:34danleitriddell1: look at slime-swank-implementations, it adds the path itself, but /wrong/ (at least for me)
12:34danleitriddell1: so basically, this /shouldn't/ be neccessary
12:36danleitriddell1: oh, slime-lisp-implementations, i meant
12:36abbehi everyone
12:36abbehow to generate API documentation like the one on clojure-contrib site ? is it downloadable ?
12:37triddell1danlei: yes, the path changed for swank.clj and it wasn't in the classpath... this is the only way I could fix that (or atleast the first way I found)
12:37danleitriddell1: yes
12:38abbeI think its gen-html-docs, is there any script using that ?
12:38triddell1danlei: but yes, it shouldn't be necessary
12:38danleitriddell1: in my opinion, just setting swank-clojure-path should suffice
12:38abbeoh, got it, from gh-pages branch
12:38danleitriddell1: but for me, it adds a /src at the end of the path, which gets passed as -cp in slime-lisp-implementations, which breaks it
12:39danleidanlarkin: so your hack is the rescue :)
12:39danleidanlarkin: oops
12:39bennswhy does it add stuff in slime-lisp-implementations by itself
12:39bennsthis is what broke it here
12:39danleibenns: to be convenient, I'd say
12:39danlarkindanlei: my hack?
12:40bennswel that's fine if it describes how to do it manually
12:40bennsbut as it is now it doesn't
12:40triddell1danlei: good!, ping me later if you find this step unnecessary
12:40danleidanlarkin: sorry, name got copletet wrongly
12:41danleitriddell1: well, it *should* be unneccessary, but atm it is neccessary :)
12:41triddell1danlei: right, in the future though :-)
12:41danleitriddell1: at least it words
12:41danlei*works
12:41danleitriddell1: ok
12:43technomancydanlei: sorry, was on the phone
12:43technomancyyou're using jochu's fork?
12:43danleitechnomancy: np, we're talking about jochus anyway, but I
12:43danleitechnomancy: yes
12:44technomancyman... I tried to look at that yesterday, but I couldn't get it to work either. =
12:44technomancy=\
12:45danleitechnomancy: adding it to extra-classpaths, as tridell1 did gets around the problem
12:46technomancyshouldn't be necessary in my fork, but if you got it to work that's cool
12:46danleitechnomancy: C-h v slime-lisp-implementations helps a lot there
12:46technomancythe automated install uses my fork now since there was too much confusion about these kinds of things
12:48danleiit's really a mess, at least if you don't use clojure-install
12:50danleie.g. it wants it's swank-clojure-jar-path set, even If I just want to connect via M-x slime-connect, ohterwise it barfs. that's weird (doesn't even matter what the path is set to)
12:51technomancyheh; I don't even have a swank-clojure-jar-path
12:52danleieither swank-clojure-jar-path or wank-clojure-binary must be set, if I remembercorrectly
12:52danleianyway, at least it works .. somehow
12:55ngocHi, thanks all for all your help these days. I was able to create a very simple chat server as a Clojure exercise: http://github.com/ngocdaothanh/telchat. I'm newbie, comments are very welcome.
13:19avitalHello friends. Is [] just a reader macro for (vector)? It seems not: If I eval the following: (ns clojure.core) (defn vector [& rest] "YES") (vector 1 2 3) I get "YES" but if I then eval [1 2 3] I get [1 2 3]. Is there any way to modify []'s behavior? What actually is [] then?
13:24Chousukeavital: no, it's not. it's a real vector
13:24danleiavital: it's a "reader form" and there is no way to modify it I knew of
13:24Chousuke,(read-string "[]")
13:24clojurebot[]
13:24Chousukeso it's not (vector)
13:25Chousukeif it were (vector ...) then you should be able to do (defn foo (vector a b c) ... ) but that of course fails :)
13:26avitalRight.
13:26avitalI'll try to explain what we're trying to do.
13:26avitalWe'd like to allow for a purely functional way to do something similar to logging but not exactly that. It is part of work we are doing on a google wave robot.
13:27avitalOur idea was to have all functions always return results with metadata containing the "log" information
13:27avitalThen we wrap all functions with something that concatenates all the logs of the arguments and returns a result with that concatenated log as its metadata
13:27avitalThis way we hoped that any function call would end up returning the full log in its metadata
13:27Chousukeproblem 1: not everything can have metadata ;/
13:27avital(Of course there are issues with primities, etc - we are aware of this.)
13:30avitalAs far as I understand, if we make an assumption that all values in our program are not primitives then other than reader forms, this solution would work.
13:30avitalEven macros would magically work because they eventually call functions and if we redefine vector, map, ... that would work.
13:31Chousukethat sounds like way too much magic
13:31Chousukebut you can't modify the reader. it's written in java and exposes no hooks to itself
13:32Chousukeyou'd need your own reader
13:32danleior chosuke's ;)
13:32Chousukeif it were complete :P
13:32avitalRight, I get it that it's impossible but I'd like to understand this in a quasi-theoretical way
13:32danlei:)
13:33Chousukeavital: so what are you actually not understanding here?
13:34avitalIs there a purely functional way to do something that is like logging, but is _not_ logging (meaning I can't use print). I want it to be purely functional because it is actually applicative and i need to be able to unit test it etc (so I don't want to use thread-local vars).
13:34avitalNot in clojure
13:34avitalThis is a general question about functional programming
13:35avitalI'm sorry if this seems like a strange question the way it's posed but this is truly a specific issue we are having now, we can work around it now but we are going to have difficulties with it.
13:35avitalWe'll end up using thread-local vars but that will make testing more difficult.
13:35Chousukewell, for haskell there is the monad that allows you to "write" arbitrary information to an accumulator.
13:35Makoryuavital: Sure, there's a monad-based solution some Haskell folks came up with
13:36Chousukewith clojure you could do the same, but you'd probably have to pass around the accumulator explicitly
13:36Chousukeunless of course, you use the clojure monad library :)
13:36Makoryuavital: Are you familiar with the concept of monads?
13:36avitalMakoryu: Not enough - isn't it just a wrapper for side-effect causing code?
13:37Chousukeno
13:37Makoryuavital: Nope
13:37avitalOk I'll go read a bit.
13:37Makoryuavital: The fact that Haskell has an IO monad (which is exactly that) is incidental to the idea of monads in general
13:37avitalDoes this accumulator monad have a name?
13:38Chousukemy current high-level definitions of monads is that they provide a way to define how functions in a category are composed
13:38Chousukeand probably something else too
13:38Chousukeit's like function composition, except you get to define what the composition operation is
13:39noidithis might be a stupid idea, but maybe you could put your log information in a map stored in a ref, which uses the "things" as keys?
13:39Chousukeand thus you can do all kinds of things like enforce serial execution or whatever
13:40noidiso that you could check (@log return-value-of-a-function) for the logging information
13:40danleilike monad-comprehensions -> list-comprehensions
13:40avitalnoidi: It should not be shared between threads
13:41Chousukeavital: put it in a ref with a nil root binding
13:41Chousukeer
13:41Chousukeregular def I mean
13:41noidiavital, threads can shere refs
13:41noidishare
13:41avitalChousuke: That will work, and will probably be what we'll end up doing but that will make it non-functional and this harder to test.
13:41avitalnoidi: No, I meant I don't want our log data to be shared between threads
13:42noidiah, I missed the "not" :)
13:42avitalAgain, this is not really logging - it is the list of operations to return to the wave server. It is actual applicative code and must be unit tested
13:46noidiI haven't really understood monads (yet), but from the little I did understand, they might be what you want
13:46noidilike Chousuke and Makoryu suggested
13:47avitalYes, I am reading about it now and it seems to be exactly what we are looking for.
13:47avitalSo where is this clojure monad library again? ;)
13:47noidihttp://onclojure.com/2009/03/05/a-monad-tutorial-for-clojure-programmers-part-1/
14:00ambientit's also in clojure.contrib afaik
14:08technomancystuartsierra: did you catch the second patch for #194?
14:09technomancyfirst one had the tests not really testing anything
14:13stuartsierraclojurebot: #194
14:13clojurebotGabh mo leithscéal?
14:14stuartsierratechnomancy: got it; will test later
14:14technomancyok, cool
14:15chouser~ticket #194
14:15clojurebot{:url http://tinyurl.com/y8nhyty, :summary "clojure.test use-fixtures function composes fixture functions repeatedly", :status :test, :priority :normal, :created-on "2009-10-07T17:54:39+00:00"}
14:42phpwneranyone in south florida? a CTO buddy of mine is looking for a hire
14:47phpwnerPM me
14:57ambientphp work for 7 bucks an hour ;)
15:00mgarrisscan i ask a function what it's arity is?
15:02pixelmanhow can I get read-line to work from emacs?
15:03pixelmanI type many newlines but not much happens
15:14phpwnerambient: no clojure work for probably $30-40/hr
15:14kotarakmgarriss: not programmatically. You get the arglists in the docstring however
15:15mgarrissbummer
15:15kotarakmgarriss: why do you need to know?
15:15chousermgarriss: also can reflect on the invoke methods of function class
15:16mgarrisskotarak: i'm writing something that randomly puts together a function out of fn and data symbols i pass it
15:17mgarrisschouser: is that a java call?
15:18chouseryeah, it's a bit of a mess. somebody put together a nice function
15:19kotarakmgarriss: and you need to know how much arguments to pass to the fn?
15:20mgarrisskotarak: yeah
15:21mgarrissthe fn that builds the new fn needs to know the arity of the fn's it can choose from
15:21mgarrissi think i'm going to just enforce an arity requirement on the passed in fn's
15:22mgarrissbut that kind of sucks
15:22kotarakmgarriss: it depends.
15:23kotarakmgarriss: What's the purpose of the random generation?
15:23chousermgarriss: http://groups.google.com/group/clojure/browse_thread/thread/d9953ada48068d78/1823e56ffba50dbb?q=argument+count+group:clojure#1823e56ffba50dbb
15:24chousergah. sorry, that's a horrible url
15:25mgarrissi'm rewriting an old aLife sim i wrote in c++, each "cell" in the sim had a byte string that was interpreted as a mini language, new cells might mutate that little program. clojure/lisp allows me to write the little programs in clojure itself. i'm excited about it
15:25Chousukeheh
15:25Chousukegenetic programming, huh?
15:25mgarrissyeah
15:26mgarrissi think it cold be very cool in clojure
15:26mgarriss*could
15:26phpwnerneed clojure programmers in sofla. pm me
15:27mgarrisschouser: awesome, thanks for the link
15:31nathanmarzhey all
15:31nathanmarzare there any continuations-based web application frameworks being developed in clojure?
15:45mgarrissthat arities fn works well
15:55kotarakdnolen, cgrand: did you continue your discussion on template inheritance? My idea (stolen from eg. blogofile) was to have two types of templates, pages and snippets. Pages basically nest and are put into the place of a <content/> tag in the parent page template. Snippets may be used in arbitrary positions with maybe a <snippet name="xxx"/> to invoke the xxx snippet at that position. After each snippet (or page template) is expanded a special
15:55kotaraksnippet expands and snippet tags.
15:55ambienti have a dream, dream in which clojure runs flawlessly on both .NET and JVM, using portable code
15:55kotarakdnolen, cgrand: I'm not sure this really works, but I'll probably give it a try.
15:56chouserambient: and the browser and on the iPhone.
15:56dnolenkotarak: not yet, still thinking about it myself. but I was thinking along those lines as well.
15:57eyerisI get a compilation error while trying to compile current clojureql from gitorious against clojure 1.0.0. Has clojureql moved away from clojure 1.0.0?
15:57kotarakeyeris: good question. I wouldn't think so. Let me check.
16:00technomancynathanmarz: clojure doesn't have continuations
16:01kotarakeyeris: nope, works for me with 1.0.
16:01kotarakeyeris: what specific problem do you have?
16:01eyerisI will paste the stacktrace. Give me one sex.
16:01eyerissec*
16:03eyerishttp://pastebin.ca/1602299
16:03eyerisMaybe it's expecting me to have Derby installed?
16:03kotarakyou need the Derby jar.
16:03kotarakYes. You need it for compilation.
16:03kotarakOr you manually disable the backend in the build.xml.
16:04eyerisWhere do I put the derby jar?
16:05kotarakInto the lib directory.
16:05kotarakIf you use Ivy it's fetched for you.
16:10eyerisAfter upgrading my code to the newest clojureql, my (ns (:require...)) fails with this dump: http://pastebin.ca/1602318
16:11kotarakeyeris: I had such errors with messed up builds. Try a clean and then a compile. Also check that, there is not a second clojure.jar with a different version.
16:14emacsenAnyone here going to the Clojure class in Reston
16:14kotaraktoo far away
16:15leafwactually only 30 min from here -- what class is that?
16:15leafwif we mean Reston, VA
16:15emacsenhttp://pragmaticstudio.com/clojure
16:15kotarakyes, class with Rich and the book Stuart
16:15emacsen"The book Stuart" hehe
16:16leafwxD
16:16leafwfor $1500 I know enough already.
16:16ambientthe channel 9 clojure talk is really nice
16:17kotarakemacsen: well, there are several Stuarts. Eg. Stuart Sierra.
16:18emacsentrue
16:18emacsenchannel 9?
16:19emacsenlike NY Channel 9?
16:19emacsenWWOR
16:19ambienthttp://channel9.msdn.com/shows/Going+Deep/Expert-to-Expert-Rich-Hickey-and-Brian-Beckman-Inside-Clojure/
16:19emacsenOh. I was more in favor of something on Channel 9
16:20emacsenmaybe a Rich Hickey, Uncle Floyd show
16:20technomancythat guy liked to talk about how much he knew about obscure languages. =)
16:20technomancybut yeah, it was pretty good
16:32eyerishaha!
16:32eyerisIt works!
16:32eyerisThank kotarak
16:32kotarakeyeris: what was the problem?
16:35kotarakman, clojure's compilation model sure is resistant to easy handling.
16:35chouserkotarak: in what way?
16:36kotarakbecause you have to specify namespaces.
16:36chouserinstead of files?
16:36kotarakYou either have to specify them manually, or you need some discovery mechanism.
16:36kotarakYes
16:36kotarakI'm currently writing a Gradle plugin.
16:37kotarakWhere Java and Groovy just say "Look there is this src dir. Compile the stuff there.", I have to jump through hoops with Clojure.
16:37kotarakCompile could figure out the namespaces itself.
16:38kotarakI could read all files and check the first form for ns or in-ns. But that would be best done with Clojure. Maybe I should use Clojure to write the plugin....
16:39leafwkotarak: I agree. Compiling clojure is still a pain.
16:39LauJensenztellman, you here?
16:39ztellmanLauJensen: yeah
16:39LauJensenztellman, your tetris game throws this: Can't take value of a macro: #'penumbra.opengl/color
16:39LauJensenI just got it from Github - am I doing something wrong?
16:39ztellmanum, I changed around some stuff in opengl.clj
16:39eyerisYeah, it's especially strange that it requires a namespace as an argument because the files are named the same as the namespace.
16:39kotarakeyeris: not necessarily
16:40kotarakYou can also (load) subfiles.
16:40ztellmanchanged color into a function that targets color-3 and color-4
16:40kotarakeyeris: I actually used this in several projects now.
16:40ztellmansearch for color-3 in src/penumbra/opengl.clj
16:40ztellmanmy guess is that it's not there, for whatever reason
16:41eyeriskotarak: What I mean is that the argument to compile, while a namespace, will always match the filename path.
16:41chouserkotarak: I think you could (binding [*compile-files* true] (load-file "foo.clj"))
16:41LauJensenztellman, You gotta fix that, you just got linked by disclojure.org :)
16:41kotarakchouser: ??? I don't understand.
16:42ztellmanLauJensen: I think the problem is limited to you
16:42ztellmanother people have already gotten it working
16:42LauJensenso a git clone will fix it?
16:42ztellmanthat's my belief
16:42LauJensenpull even
16:42chouserkotarak: look at the source of 'compile' -- you could do what it does, but load a file by name instead of namespace.
16:43woobyhi, i've got this simple web server working: http://gist.github.com/203329
16:43kotarakchouser: but how about the (load) case? I have to load the master file and ignore the children.
16:43woobyhowever, when a client disconnects abruptly a socketexception is thrown that kills it... and i'm not sure how to fix it
16:44LauJensenztellman, I wasted your time, sorry, git pull solved it
16:44ztellmanLauJensen, no problem at all
16:44Guest70798hi there, i need some help with setting up emacs with clojure
16:44ztellmandon't hesitate in the future to bother me about this kind of stuff, next time I really might have broken something
16:44LauJensen:)
16:44Guest70798i installed everything right, slime mode is working
16:45Guest70798only my setq swank clojure extra classpaths command
16:45Guest70798is not working
16:47technomancyGuest70798: if you're working with the latest git version, the variable changed to the less verbose swank-clojure-classpath
16:47hiredmanwooby: use try/catch to handle the exception
16:47Guest70798technomancy
16:47technomancyalthough extra-classpaths should still be aliased to the new variable
16:47Guest70798gotta be that
16:47Guest70798ah ..
16:47Guest70798i'm gonna test
16:48Guest70798but has the setq command to be placed in a special place in the .emacs ?
16:48Guest70798or just hanging in there ?
16:48technomancyGuest70798: as long as it gets executed before you launch slime you're OK
16:48kotarakchouser: I'll just go about it and read the first form for every file. If it's in-ns, ignore the file, otherwise compile it. Does that sound reasonable?
16:49Guest70798yay
16:49Guest70798techno, the aliasing wasn't working apparently
16:49Guest70798now i have my full cp
16:49Guest70798thank you very much
16:49technomancyGuest70798: thanks for letting me know; I'll see if I can fix that.
16:49Guest70798great :)
16:50chouserkotarak: you're trying to compile every .clj file in a directory tree, with no further direction or configuration?
16:52kotarakchouser: I want to hook up as much as possible in the existing gradle infrastructure. There everything is file based with the usual includes/excludes clauses based on filename. And I don't want to specify the namespaces manually all the time.
16:52woobyhiredman: cool, got it, thank you
16:53hiredmansomeone should spin out a nice namespace extraction library
16:53ambienthmm, what I'm missing? both clojure.jar and clojure-contrib.jar are in classpath: java.io.FileNotFoundException: Could not locate clojure/contrib/def__init.class or clojure/contrib/def.clj on classpath: (opengl.clj:9)
16:54kotarakhiredman: there is c.c.find-namespace
16:54hiredman,(doc find-namespace)
16:54clojurebotExcuse me?
16:54hiredmanoh
16:54hiredmanright
16:54kotarakc.contrib.f-n
16:55hiredmanwell dang
17:02gosub80hi
17:02gosub80i was playing with clojure
17:03gosub80and there is something I can't understand
17:03gosub80can anybody explain to me why (remove #(Character/isDigit %) "test123") works while (remove Character/isDigit "test123") raise an exception?
17:04hiredmanCharacter/isDigit is not a clojure function
17:04chouserunfortunately. :-/
17:04hiredmanit is a java static method
17:05gosub80ok, but then why works inside the anonimous function?
17:05hiredmanso generally it is not a value, so you cannot really pass it to other functions
17:05gosub80uhm
17:05gosub80so it resolves as a function only as the first element of a list?
17:06hiredmannot really
17:06hiredmanbut more or less
17:06rstehwienhmm, this works for me in slime
17:06rstehwienuser> (remove #(Character/isDigit %) "test123")
17:06rstehwien(\t \e \s \t)
17:06rstehwienuser>
17:06hiredmanrstehwien: correct
17:06gosub80yes, for me too
17:07hiredmanCharacter/isDigit never is a function
17:07hiredmanand it never "resolves" as one
17:07gosub80so why it behaves as one in #(Character/isDigit %) ?
17:07rstehwienah but I wouldn't be able to pass it around as a "real" clojure function?
17:07gosub80is a trick in the reader?
17:08rstehwienunless I wrapped it
17:08hiredmanyes
17:08hiredman,(. Character (isDigit \1))
17:08clojurebottrue
17:08gosub80ok
17:08gosub80so, another question...
17:09gosub80is there a standard function to turn a sequence of characters into a string?
17:09kotarakJava methods were born a second class citizens...
17:09hiredman,(apply str (seq "foo"))
17:09clojurebot"foo"
17:09hiredmankotarak: I guess you could turn them into values via reflection
17:17gosub80I think it would be prettier if map, filter and reduce returned strings when applied to strings, like in Haskell, but this is just an helper function away
17:18chousergosub80: that's interesting. how would map in (map f1 (filter f2 "mystring")) know it's supposed to return a string?
17:19kanakhi, can anyone tell me how to add my directory to swank-clojure's classpath?
17:19technomancykanak: (add-to-list 'swank-clojure-classpath "/path/to/foo.jar")
17:20technomancyuse swank-clojure-extra-classpaths on older versions of swank-clojure
17:20kanaktechnomancy: how do i know if i'm using an older version?
17:20technomancykanak: if swank-clojure-classpath is defined in Emacs, you're using a newer one
17:20gosub80chouser: in Haskell the String type is just syntactic sugar for [Char], a list of Char
17:21chouserHaskell has a static type system
17:21kanaktechnomancy: thanks. Is "~/Code" allowed or do i need to expand the "~" part?
17:21gosub80I know
17:23gosub80there should be two internal String types, one as a Java String and one as a list of chars, freely and transparently interchangable
17:23gosub80i don't know if something like this is even possible :)
17:25Chousukeit's not :p
17:25Chousukebecause you can't have another string type that is compatible with String
17:26Chousukeso you'd lose a lot of interoperability with Java if you started using something that's not String
17:26chouserit would also break complexity guarantees of the various collection types.
17:27chouser(next x) is O(1), but if it returned a String it would have to be O(n)
17:27hiredmanchouser: well, if you did have two types, it would return the [String] type
17:28hiredmaner [Char]
17:28chouseror if it returned a string-like thing that wasn't a String, turning it into a String could perhaps be transparent, but it would not be free
17:28hiredmanCharSequence
17:28hiredman~ticket search CharSequence
17:28clojurebot("#112: GC Issue 108: All Clojure interfaces should specify CharSequence instead of String when possible" "#98: GC Issue 94: \t (ancestors ClassName) does not include tag ancestors of ClassName's superclasses ")
17:28chouserin order to be consistent you'd have to be able to do the same thing with vectors and maps
17:29hiredmanchouser: really?
17:29chouserthere's no way to do (-> (next my-vec) (conj my-vec)) and end up with a vector in O(1)
17:30chouser...without retaining the earlier part of the vector anyway.
17:31chouserhiredman: if (map foo "astring") returns a string, shouldn't (map foo [1 2 3]) return a vector?
17:31hiredmanchouser: it wouldn't return a String it would return a StringSequence or some nonsense
17:32hiredmanwell
17:32chouserthat you could call String methods on, right?
17:33hiredmanchouser: hey, I'm not say this would work and I am not advocating it, I am just saying, the lynch pin is merely compatibility with Java's String, if there was a run around that, this would all just sort of fall together
17:34Chousukehmm
17:35Chousukebut for (map foo "string") to return a CharSequence, you'd have to know that foo is Char -> Char :/
17:35gosub80what I was thinking was:
17:35hiredmanOh
17:35Chousuke(instance? CharSequence (seq "foo"))
17:35Chousuke,(instance? CharSequence (seq "foo"))
17:35clojurebotfalse
17:36Chousukehmm
17:36Chousukemaybe that should be fixed.
17:37Chousukethough... is it useful? :P
17:37hiredmanthat would be kind of cool
17:37hiredmanexcept everyone specifies String everywhere
17:37Chousukehow often would you call seq on a string and pass it onto something excepting CharSequence...
17:37Chousukeespecially since a String is a CharSequence
17:37hiredmanNever
17:38hiredmanand nothing takes CharSequences
17:38Chousukeyeah :(
17:38gosub80if strings, in the general sense, are sequences they should be naturally operated on with functional operations, like maps and reduces. The fact that they return sequences of chars instead of other strings is just to retain interoperability with Java.
17:39Chousukeinterop with Java is important :)
17:39Chousukepracticality trumps purity in this case
17:41gosub80yeah
17:42chousermy point is that each collection type has functionality that depends on its internal representation, which it may not be able to provide with the same performance profile after you've done seq'y stuff on it.
17:42gosub80but maybe there is a way to retain interop and not lose purity :)
17:45gosub80chouser: I do agree, in the end if you need to convert this hypotethical string representation to Java String, there is a performance hit.
17:51gosub80to have a transparent HypotheticalCharSequence, Java String should not be a Class, but an Interface :)
17:52technomancythere's not really a way to get a seq for items that come from a resource that must be closed, is there?
17:52technomancyI guess if you force the user of the seq to fully consume it you could close it once you detect the last item
17:53technomancybut without that contract you'd end up leaking resources
17:56hiredman~ticket #2
17:56clojurebot{:url http://tinyurl.com/l6lcfw, :summary "Scopes", :status :new, :priority :normal, :created-on "2009-06-15T12:35:58+00:00"}
17:56hiredman:/
17:57Chousukegosub80: I guess making String an interface would prevent many useful optimisations :/
17:58Chousukefor example string interning.
18:35mgarrissis there any wrappers for basic AWT work? i just need to build an image and be able to grab a mouse click
19:03technomancystuartsierra: do you think it'd be possible to have some kind of use-fixtures invocation that would run once for every new "testing" block?
19:03technomancywe're using the nested style a lot at work now, and fixtures would clean it up a fair bit
19:04stuartsierrahmm
19:05technomancyyou'd have to tweak the testing macro a bit... not sure how that would work
19:05stuartsierraMaybe. I'd have to think about it.
19:05technomancydo you use that macro?
19:05stuartsierraalmost never
19:05stuartsierraI just put it in there to keep the RSpec fanatics quiet. :)
19:05technomancyI hate asking for features that the maintainers never use. =)
19:06technomancyit's awesome how simple the implementation is though
19:06technomancyjust doesn't play well with fixtures
19:06technomancyit'd be easy if you didn't mind wrapping the body in a new function
19:06stuartsierraThat was my next question
19:06technomancythat would be the only way you could do it, actually
19:07stuartsierraAre you calling other test functions inside (testing ...) or just assertions?
19:07technomancydefinitely more than just calls to "is" if that's what you mean.
19:08stuartsierraI mean something like (deftest foo...) (deftest grouped (testing "foo tests" (foo)))
19:08technomancyoh, I see. no, I don't do that.
19:08stuartsierraok
19:08technomancybut I don't know if it's fair to disallow it just because I don't use it myself
19:08stuartsierraSo would the fixture be attached to a particular (testing ...) block?
19:09technomancyI was thinking of it like one level deeper than :each
19:09technomancyrunning for every testing block
19:09stuartsierraOh, I see.
19:10stuartsierraBut (testing...) can be nested!
19:10technomancyyeah, I'm not sure if that really makes sense
19:10technomancyit's probably not a problem for clojure.test
19:11stuartsierraAt one point I tried to figure out how to do multi-level hierarchies of tests, with fixtures attaching at any level.
19:11stuartsierraI gave up because it seemed too complicated.
19:11technomancyI can see that.
19:11stuartsierraAnd I couldn't find any other test framework that could do that.
19:12stuartsierraEven RSpec only does fixtures at the class level.
19:12technomancyyou could make it so adding fixtures inside a testing block makes it run for all enclosed ones
19:12technomancybut it's probably not worth it.
19:12stuartsierraI think it would have to be a new construct...
19:13stuartsierra(deftest foo (with-each-feature feature-fn (testing ...) (testing ...) (testing...)))
19:15stuartsierra(with-feature :each|:once feature-fn & exprs) would eval exprs wrapped in the given feature-fn.
19:15stuartsierraI mean with-fixture
19:38iceyis there a clojure web framework that is particularly well suited for ajax / comet / web *application* style development? (or one that's better suited for that style of development than others)
20:37replaca_getting ready to start the bay area clojure group meeting in SF!
20:38ju|ionext one in MV?
21:07replaca_ju|io: I think so. The idea is to alternate
23:53itistodayIs Rich's "A deconstruction of object-oriented time" talk available in video from?
23:53itistoday*form?
23:54hiredmanwhich talk was that?
23:54itistodayhttp://news.ycombinator.com/item?id=829268
23:55hiredmandoesn't sound familiar, so maybe no
23:55hiredmanthe jvmlang talks were supposedly videoed and will be made available
23:56itistodaydoes hickey frequent this channel often? perhaps he knows?
23:57hiredman~seen rhickey
23:57clojurebotrhickey was last seen quiting IRC, 6396 minutes ago
23:57hiredman,(int (/ 6396 60))
23:57clojurebot106
23:57itistoday,(int (/106 24))
23:57clojurebotInvalid token: /106
23:57hiredmanso like four or five days ago
23:57itistoday,(int (/ 106 24))
23:57clojurebot4
23:58itistodaythanks :-)
23:58hiredman~seen rhickey_
23:58clojurebotrhickey_ was last seen joining #clojure, 6442 minutes ago
23:58itistodayany reason he has two names?
23:58itistodayor is that some irc thing meaning I'm away or something?