#clojure logs

2009-06-04

00:00durka42i believe your paste but cannot duplicate the results
00:00durka42even running with -server
00:00hiredmanthat may just be how hotspot works
00:01durka42do you know what the command to run java is?
00:01durka42hotspot is spooky, by definition :)
00:01stuhood~source time
00:02arohner_I'm calling just "java -cp ..."
00:02arohner_I guess I should use -server
00:02arohner_let's see if it still happens...
00:02hiredmanarohner_: what is your java -version?
00:02arohner_llen@hydra:~$ java -version
00:02arohner_java version "1.6.0_0"
00:02arohner_OpenJDK Runtime Environment (IcedTea6 1.4.1) (6b14-1.4.1-0ubuntu7)
00:02arohner_OpenJDK 64-Bit Server VM (build 14.0-b08, mixed mode)
00:02arohner_ubuntu 9.04 64-bit
00:03durka42hmm, openjdk
00:03hiredmanarohner_: looks like you are already running the server vm
00:04arohner_oh, right
00:04durka42i have b7, so maybe there's new stuff
00:05durka42er
00:05durka42build 1.6.0_07-b06
00:08hiredmanthose version numbers don't appear to be comparable
00:09iceynot to change subjects or anything, but the dead tree version of programming clojure turned out REALLY nicely
00:16arohner_empirically, it takes the JVM about a second to throw away the optimizations
00:16arohner_i.e. (do (dotimes [i 10] (perf-test) (Thread/sleep x) (dotimes [i 10] (perf-test)))
00:17arohner_if x is less than 1000, there is no loss in performance
00:20ezyangWhy does clojure have set/select instead of set/filter?
00:23hiredmanhmmm
00:23hiredmanI have b10
00:25hiredmanI just rebuilt openjdk using openjdk
00:27arohner_durka42: there is
00:27arohner_they're behind the ADC login
00:27arohner_kjata:~ arohner$ java -version
00:27arohner_java version "1.6.0_13"
00:27arohner_Java(TM) SE Runtime Environment (build 1.6.0_13-b03-206)
00:27arohner_Java HotSpot(TM) 64-Bit Server VM (build 11.3-b02-82, mixed mode)
00:27arohner_that's on my OSX box
00:32durka42arohner_: thanks, i'll check it out
00:32durka42tomorrow
00:49ataggart,(instance? Object "")
00:49clojurebottrue
00:51ataggart(doc seq?)
00:51clojurebot"([x]); Return true if x implements ISeq"
00:55ataggart(doc sequential?)
00:55clojurebot"([coll]); Returns true if coll implements Sequential"
00:55ataggart(sequential? [])
00:55ataggart,(sequential? [])
00:55clojurebottrue
00:55ataggart,(sequential? "")
00:55clojurebotfalse
00:59hiredmanstrings are java strings so there is no way to open them up and have them implement clojure interfaces
01:00ataggartya, but they're seqable, so I was just playing to see if sequential? applied
01:00ataggartreading the google groups stuff
01:00hiredmanthey are sequable because seq knows how to make sequences from them
01:00ataggartyup
01:01ataggartjust seeing if that predicate applied or not
01:01ataggartit doesn't. I have no opinion on it, just playing
01:01hiredman,(ancestors String)
01:01clojurebot#{java.lang.CharSequence java.io.Serializable java.lang.Object java.lang.Comparable}
01:01ataggartoh wait
01:02ataggart,(map str "hello")
01:02clojurebot("h" "e" "l" "l" "o")
01:02ataggartwell
01:02ataggartis that map being clever and I really do need to call (seq "foo") is I want to use a strign as a seq?
01:03hiredmanmost sequence functions call seq on their arguments
01:03hiredman,(first "hello")
01:03clojurebot\h
01:03ataggartya, just looked at the source
01:03ataggartthat's probably a good habit to get into
01:03ataggartinstead of assuming one is being passed a seq
10:13Chouser,(expression-info '(+ 5 (float 10)))
10:13clojurebot{:class java.lang.Number, :primitive? false}
10:13Chouser,(expression-info '(+ (float 5) (float 10)))
10:13clojurebot{:class float, :primitive? true}
10:38kefka,(+ 1 2 3)
10:38clojurebot6
10:38kefka(Just making sure I'm connected.)
10:39Chouserkefka: Beware -- this may be just a halucination.
10:43ozzileeI'm trying to write a macro that outputs a (POST "url" ...) form inside of defroutes in Compojure, and I'm hitting a wall. The macro is trying to resolve "params" which is only bound inside POST, after the macro is expanded.
10:43ozzileeI'm not even sure where to go from here.
10:44Chousukeozzilee: show what you have for now.
10:45Chouserozzilee: http://clojure-log.n01se.net/macro.html
10:47ozzileeOk, let me simpify it a bit first...
10:47ChousukeChouser: maybe you should submit that thing to the lisppaste folks so they can add it to the site :D
10:59lisppaste8ozzilee pasted "resolution" at http://paste.lisp.org/display/81354
11:00ozzileeThe macro itself is fine, except that params is a voodoo variable from compojure that I'm not sure how to deal with.
11:00Chouserah! try ~'params instead of plain params
11:02chillitomguy's is there a way I can download the online documentation so I can work offline?
11:02Chouserchillitom: for api stuff, you can just use 'doc' and 'find-doc' in the repl. You want the other pages too?
11:05chillitomas much as I can get
11:05chillitomany good pdf's or tutorials you can point me at would be great too
11:06ozzileeChouser: No dice, it's still trying to resolve params somewhere.
11:06Chouseruser/POST is a bit odd -- isn't POST a macro or something in a compojure namespace?
11:07Chousukedo you have it required? :)
11:09ozzileeWait, nevermind that did work. I did '~params instead of ~'params.
11:09ozzileeI was using `~ somewhere else and didn't read your suggestion closely enough. That's something else entirely.
11:10Chousuke~'foo is generally bad in macros but sometimes you need it.
11:10clojurebot'Sea, mhuise.
11:10Chousukeoops
11:10Chouserheh
11:11Chouserclojurebot: foo?
11:11clojurebotnamespaces are (more or less, Chouser) java packages. they look like foo.bar; and corresponde to a directory foo/ containg a file bar.clj in your classpath. the namespace declaration in bar.clj would like like (ns foo.bar). Do not try to use single segment namespaces. a single segment namespace is a namespace without a period in it
11:11Chouseroh, my.
11:11Chouserclojurebot: ~'foo?
11:11clojurebotexcusez-moi
11:11Chouserhm
11:11Chousuke~'foo
11:11clojurebot'foo is generally bad in macros but sometimes you need it.
11:11Chousukeclojurebot: forget 'foo
11:11clojurebotI forgot 'foo
11:12Chousukeit's good that it looks ugly so whenever you see ~'foo in a macro you know to stop and reconsider whether it's really needed.
11:13ozzileeIt's basically a trick to stop Clojure from trying to resolve the symbol, yes?
11:13Chousukeyeah
11:13Chousukethus causing the macro to be nonhygienic
11:13Chousukeor whatever the fancy word was.
11:15Chousukeanaphoric! that's it.
11:16ozzileeI don't think that's quite it. I'm not sure if it's nonhygenic either, but whatever it is is necessary for anaphoric macros, but not necessarily anaphoric myself. I think :-)
11:17Chousukewell, the macro "overrides" a name in the environment
11:18Chousukewhich is difficult to do by accident thanks to syntax-quote resolving names by default and let refusing to bind to fully qualified names.
11:18ozzileeYeah, variable capture. There might be a fancier word than that.
11:19ozzileeI think nonhygenic is probably it.
11:21Chousukehttp://coding.derkeiler.com/Archive/Lisp/comp.lang.lisp/2005-05/msg00548.html this is informative
11:22Chousukeozzilee: be sure to remember to document that "params" is bound to something within your macro.
11:23ozzileeChousuke: Indeec.
11:24ozzilee*indeed.
11:28ezyangIn the api docs, what does args* mean?
11:29ezyangAlso, what does the ampersand mean?
11:31ozzileeampersand means "collect at the rest of the args in a seq and call them this"
11:32ezyangOk, so it's sort of like Haskell's x:xs
11:32ozzilee(fn [x & ys]) will take any number of args, with everything after the first one collected in ys.
11:32ozzileeezyang: Yeah.
11:32ezyangWhat about the asterisk
11:33ozzileeI think it means optional arguments, but it's not clojure syntax. Just a shorthand for the docs.
11:33ezyangSavvy.
11:35ezyangIf I have something like ([] (expr)), what does that do?
11:35Chousukewhere is it? :)
11:35ezyangI don't understand how the vector can be applied
11:35ezyangIt's a defn named run-tests
11:35Chousukeit's an overload
11:35Chousukeyou can have multiple arities with defn
11:36Chouserah! the other place were the thing at the head of a list isn't called
11:36ezyangWhy does clojure like calling its parameters "arities"? :-)
11:37Chousukeezyang: because I didn't mean parameters
11:37Chousuke[x y z] <- x, y an z are parameters, the arity is 3
11:37Chousukemultiple parameters, one arity :)
11:37ezyangkk :-)
11:39Chousuke(defn foo ([x] x) ([x y] (+ x (inc y)))) <- multiple arities
11:39ChousukeChouser: where's the other place? :/
11:39ezyangOk, so what's confusig me, then, is that the first overload is [& namespaces]; doesn't the ampersand make namespaces optional?
11:39Chousukeyes.
11:40Chousukeit could be empty
11:40ezyangBut then, I have another overload that is []
11:40Chousukeyeah, that's for the case when it IS empty.
11:40ezyangAnd it seems to me that the second one would never be seen
11:40Chousukewell, it's picked when you actually have a namespace :)
11:40ezyangHuh. Then wouldn't ([namespace] (expr)) work?
11:41Chousukethat would only allow one parameter.
11:41ezyangOh... then I don't know what & means
11:41ezyangOh man, I thought it was [namespaces &], but it's actually [& namespaces]
11:41ezyangOk, makes perfect sense now
11:42Chousuke(let [[a b & xs] [1 2 3 4 5 6 7]] [a b xs])
11:42Chousuke,(let [[a b & xs] [1 2 3 4 5 6 7]] [a b xs])
11:42clojurebot[1 2 (3 4 5 6 7)]
11:42ChousukeI always forget that
11:42Chousukenote that the & foo parameter is a *lazy* sequence
11:42ezyangPerfect.
11:43ezyangI have another question, now: what's the difference between bindings and let?
11:43ezyangs/bindings/binding/
11:43ezyangLike, I understand that their method of operation is different, but I wonder if that results in a functional difference
11:43ezyang(pun not intended)
11:44Chousukelet binds a name/var in the lexical context to a value. binding binds it in a thread-local dynamic context.
11:45ezyangOh, and lexical context isn't necessarily equivalent to thread-local?
11:46ozzileeFor example, you could re-bind println to do something else, and every call to println, even in code in another function, would use that new definition.
11:46Chousukeso if you have a global var x bound to 5, use it in a function foo, the (let [x 1] (foo)) will return whatever foo returns when x is 5, but (binding [x 1] (foo)) will return whatever foo returns when x is 1
11:47Chousukeyeah
11:47Chousukehmm
11:47ozzileelet only binds things you can see, binding binds things everywhere.
11:47ezyangneat
11:47Chousukebinding has some gotchas with lazy evaluation though
11:48ezyangI can imgaine
11:48ezyang*imagine
11:48ezyangMonkeying around with global state, naughty naughty
11:48Chousuke,(let [x 1] (binding [x 5] (map #(+ x %) [1 2 3 4 5])))
11:48clojurebotjava.lang.Exception: Unable to resolve var: x in this context
11:48Chousukehm
11:48ChousukeI guess it doesn't work with let-bound stuff
11:49aravindI'd like some general advise about clojure web frameworks. I know of compojure and webjure. Are there any other? I really, really don't like writing html or anything to do with html.. so I was wondering if there was anything similar to weblocks in clojure?
11:49ezyangThat's... odd.
11:49ozzileeChousuke: No, it has to be a top-level var, afaik.
11:49ezyang,(binding [x 5] (map #(+ x %) [1 2 3 4]))
11:49clojurebotjava.lang.Exception: Unable to resolve var: x in this context
11:49ezyangOk.
11:49Chousukeezyang: and it's thread-local monkeying, so it's fine.
11:50Chousuke,(declare x)
11:50clojurebotDENIED
11:50ezyangChousuke: heh
11:50Chousukedamn
11:50ezyangCute. :-)
11:50Chousukethere are ways to circumvent it though.
11:50ozzileearavind: I use compojure, I don't know of anything beside those two. There isn't anything as abstract as, say, Seaside. I haven't used weblocks.
11:50Chousuke,(intern *ns* 'x 1)
11:50clojurebotDENIED
11:51aravindozzilee: weblocks has a bunch of cool features, but I'd willing to settle for anything that gets html away from me!
11:51danlarkinlet is lexical scope
11:52ozzileearavind: Yeah, there's no web ui library as far as I know. Compojure has an html macro: (html [:html [:head [:title "Title"]] [:body [:h1 "Hi"]]])
11:52ozzileeBut it's still html, just a different syntax.
11:52Chousuke~def intern
11:52ozzileedanlarkin: But is binding dynamic scope, or something else entirely?
11:53danlarkinozzilee: yup, dynamic
11:53aravindozzilee: yeah, I was afraid I'd end up having to write html :(
11:53Chousuke,(clojure.lang.Var/intern (the-ns *ns*) 'x 1)
11:53clojurebotDENIED
11:54ChousukeI wonder if hiredman made it use a whitelist instead of a blacklist
11:54danlarkinaravind: there's my (very) immature web platform, madison... http://github.com/danlarkin/madison/tree/master
11:54ozzileearavind: You could always look into one of the high-level javascript frameworks, not sure if you really gain a lot by going that way though. Still not pure clojure code.
11:56aravinddanlarkin: do you have any example pages that show how I'd write code to say display a struct?
11:56Chousuke,(binding [+ -] (map + [1 2 3 4 5]))
11:56clojurebot(-1 -2 -3 -4 -5)
11:56ozzileeSproutCore, Dojo, that's Cocoa-esque one that I forget the name of. Probably all more complex than you want.
11:57aravindozzilee: so java should have some web frameworks to abstract away the html part, but I don't know enough about compojure to know if I can hammer those on top of it.
11:57Chousuke,(let [a (binding [+ -] (map + [1 2 3 4 5]))] a)
11:58clojurebot(-1 -2 -3 -4 -5)
11:58Chousukehmm. now I can't figure out the situation where that return just (1 2 3 4 5) :/
11:58Chousuke+s
11:59aravindozzilee: I am really only beginning to think of the web frameworks to display my data, so I am still in the research phase :)
11:59danlarkinaravind: it's really light on documentation/examples ATM. It's pretty simple though... you won't really get to avoid HTML though... unless you want to return text/plain
11:59Chousuke,(let [a (future (binding [+ -] (map + [1 2 3 4 5])))] @a)
11:59clojurebot(-1 -2 -3 -4 -5)
12:01aravinddanlarkin: ah okay, my goal is to find out a way to have some java library or framework to display my data and take care of providing edit fields, submit button etc.. I really really liked weblocks for that, but its in cl.. so that killed it for me.
12:01ozzileearavind: You should be able to get compojure to work with a java framework... or skip compojure and just wrap the java framework by itself.
12:02aravindozzilee: wait.. are you saying I could use something like say spring, and make it play nice with clojure?
12:03ozzileearavind: I don't see why not. Clojure's java-interop is pretty good.
12:04aravindhmm.. that's something I hadn't considered before..
12:06ozzileearavind: I've never been happy with html-generators for very long. I always want to twist them in some way they weren't meant to be twisted :-) The html for forms and such should be pretty simple, unless you get into fancy javascript things.
12:08aravindozzilee: I am very happy to use the stock stuff and leave the css, layouts, colours, etc.. for people with more skill than I have.
12:09aravindwould you know if webjure is any more pliable than compojure for this sort of html-generator integration?
12:10ozzileearavind: No, I haven't used webjure. Compojure should be fine, it can just serve up whatever html string/stream gets generated.
12:11ozzileeActually, now that I think of it, compojure has some helpers that might do most of what you need.
12:11ozzileeThings like (unordered-list ["foo" "bar" "baz"]).
12:12aravindoh nice
12:12Chouserhave you guys looked at enlive?
12:12ozzileeChouser: Deeply :-)
12:12Chouserok, good.
12:13ChouserI haven't yet, but it sounds yummy.
12:13Chouseras does lunch, come to think of it. bbl...
12:13ozzileeChouser: I'm still stumbling my way through the syntax a bit, but the idea seems sound.
12:14ozzileearavind: It's probably not quite what you're looking for. It's for starting with hand-written html and transforming it in code.
12:14ozzileeThe opposite of what you want, actually :-)
12:14aravindheh, thanks :)
12:15ozzileearavind: Here you go, compojure's form helpers: http://github.com/weavejester/compojure/blob/551b30350ca741c8b53042fdc5de1c5231459251/src/compojure/html/form_helpers.clj
12:16aravindozzilee: sweet.. I see the magic words "Functions for generating HTML forms" :)
12:16ozzileearavind: Enlive would be nice if you had designers creating a template and you needed to stick some html into the middle of it. It won't help in generating the html for you, though. At least, afaik.
12:17ozzileearavind: Good deal, and good luck. I haven't played with that yet.
12:17aravindozzilee: very cool, thanks for the pointers.
12:19ozzileearavind: No problem, any time. I'm not on here nearly as much as I should be, but you can get me at ozzi@ozzilee.com if you want, I do a fair bit of web-related clojure stuff. So do a lot of other people in here, though :-)
12:19aravindthank you!
12:29cemerickisn't the real draw of enlive that you can use html emitted by e.g. dreamweaver, and just populate the data you need? It doesn't have to be 'hand written' by any stretch AFAIK.
12:44ozzileecemerick: Yes, that too.
12:44ozzileeBut it still won't help you generate a form from a map.
12:44ozzileeFor example, afaik.
12:46cemerickhuh, I thought you could inject arbitrary html if you so desired
12:46ozzileeI should have said pre-written instead of hand written.
12:46ozzileecemerick: Right, but it doesn't create the html. It could inject "<ul><li>foo</li></ul>", but it wouldn't generate that from ["foo"].
12:47aravindcemerick: yup, it looks like thats what it does, lets you use pre-existing html with your code. I wanted something to generate all the html for me.
12:47ozzileeUnless he's added in some html generation capabilities that I don't know about, of course.
13:18cemerickam I misreading things, or is there no sorted-set-by? The necessary constructor in PersistentTreeSet is package-private.
13:23Chousercemerick: http://code.google.com/p/clojure/issues/detail?id=76
13:28stuartsierraAnyone feel excited about a new string library?
13:28Chousukelooks neat.
13:28stuartsierraChousuke: thanks
13:30Chousukeit's a shame that the string-specific partition etc. can't be made transparent, though :/
13:30stuartsierraYeah, but unless core goes heavy into multimethods, which would kill performance, that can't happen.
13:31Chouserwhat string library are we talking about?
13:31stuartsierrac.c.str-utils2
13:32replacaI'm excited that the autodoc picked it up right (which it didn't do for fnmap)
13:32clojurebotfor is not used enough
13:33replacastuartsierra: can you put arglist metadata on the multimethods when you get a chance? Clojure doesn't do that automatically.
13:33stuartsierrareplaca: sure
13:34stuartsierrareplaca: autodoc only got about 1/4 of the definitions.
13:35replacastuartsierra: really? thanks for pointing it out. There's something weird going on there. Time to debug! (But I can't do it right now.)
13:35stuartsierrano worries
13:35replacaEveryone, please let me know if you see the autodoc not working right! I promise I'll fix it :-)
13:36Chouserthe value of the replace multimethod over String.replace() is performance?
13:38hiredmanuh, really?
13:39Chouserdunno, that's why I asked.
13:40pragdaveGreetings. I was wondering if you folks would care to criticize my first foray into Clojure. I implemented Havil's analysis of The Impossible Problem (a math puzzle)
13:42lisppaste8pragdave pasted "First attempt at a solution to the "Impossible Problem"" at http://paste.lisp.org/display/81369
13:50stuartsierraChouser: no, flexibility. the replace multimethod accepts a function for the replacement
13:53ozzileepragdave: Looks pretty darn good to me. The code, anyway. I'll have to trust you on the math :-)
13:54pragdaveozzilee: thanks. I don't like the code that removes pairs with duplicae products and sums. I just know there has to be a better way
13:54ozzileepragdave: You're talking about pairs-with-unique-result ?
13:54pragdaveyes
13:55ezyangWhat does #^String at the beginning of an arguments list for a defn mean?
13:56ozzileeHmm. The recursion could be an issue, as clojure doesn't optimize tail recursion. Let me take a crack at it.
13:56stuartsierraezyang: type hint for the Clojure compiler, to prevent reflective calls
13:56ezyangSavvy.
14:02ozzileepragdave: How about (values (zipmap (map function pairs) pairs))? Create a map with the results as the keys and the pairs as the values, which will necessarily only include unique keys (results), then take the values (pairs).
14:06lisppaste8Chousuke annotated #81369 "simplified and using recur" at http://paste.lisp.org/display/81369#1
14:06ChousukeI hope that works
14:07mrsoloM-x slime-edit-definition explodes on me..anybody else seen this?
14:09lisppaste8hiredman annotated #81369 "as long as everyone else is doing it" at http://paste.lisp.org/display/81369#2
14:10hiredmanbasically the same as Chousuke's
14:10hiredmaneven the double ifs and the let
14:11cemerickChouser: do you keep a stack of patches to clojure, etc. in git only locally, or do you also push those patches to some remote git repo as well?
14:13Chousercemerick: I'm not currently maintaining a git branch. the patches that I've produced that aren't in the main svn are either attached to issues or (for clojurescript) checked (as a patch!) into contrib.
14:15alrex021(defn get-lower [s] (apply str [filter #(Character/isLowerCase %) s])) ... This function is suppose to return a string of all lower case characters in a given string. I get back "clojure.core$filter__4465@d5e6dauser$get_lower__1792$fn__1794@4a25abABCdef". What's missing, if anything? (Learning clojure :-))
14:15cemerickah -- then perhaps what I'm trying to do isn't reasonable. I'd like to git-clone the clojure svn, push some changesets on top of the particular rev we want to track for a while, and then push the whole thing to our gitosis. Unfortunately, the svn info doesn't seem to get carried along when I push.
14:16pragdaveozzilee: I think that returns the first pair for each distict (function a b), rather than pairs with unique values for (function a b)
14:17Chouseralrex021: use parens instead of square brackets around get-lower
14:17Chousersorry, around filter
14:18lisppaste8hiredman annotated #81369 "using reduce" at http://paste.lisp.org/display/81369#3
14:18alrex021Chouser: thank you
14:19Chouseralrex021: scheme background? square brackets in Clojure have very specific meaning that is different from parens.
14:20pragdavehiredman: Ithink your solution does the same thing--returns onr pair per unique result, rather than pairs that have a unique result
14:21hiredmanpragdave: eh?
14:21ozzileepragdave: Yup, we both got it wrong :-)
14:21pragdave(pairs-with-unique-result * [[1 2] [2 1] [3 4] [3 3] [2 6]])
14:21pragdaveshould return ([3 3])
14:22pragdavebecause no other pair has a unique result
14:22alrex021Chouser: "scheme background?" No, its actually an example that I saw but the example was in an low quality image.. so couldn't make out if it was square brackets or parens.
14:22Chouseralrex021: ah. I believe scheme (or some schemes, anyway?) allow parens and square brackets to be used interchangably.
14:23alrex021Chouser: ouch thats confusing (if interchangably)
14:24alrex021Chouser: is parents though suppose to represent a list or a form of grouping blocks of code, or both?
14:24ezyangDoes clojure do "The Right Thing" with decimal literals?
14:24Chousukealrex021: parens always represent a list
14:25alrex021Chousuke: ok, I see. thx
14:26Chouseralrex021: a list can represent a function call, a block of code, or something along those lines ...when evaluated.
14:26Chousukealrex021: in clojure, () means lists, [] represents a vector, {} a map, and #{} a set. Clojure code is made of these things :)
14:26Chousukealrex021: the lists, vectors, maps and sets I mean, not the characters.
14:26lisppaste8hiredman annotated #81369 "corrected reduce" at http://paste.lisp.org/display/81369#4
14:27alrex021Chousuke: yup, it took me a few days to get my head around that concept that in Clojure...data sets rule :)
14:28ChousukeI wonder what clojure would look like with an xml-based syntax :/
14:28hiredmanChousuke: ssshh
14:28ezyangxslt?
14:28alrex021Chousuke: I read the Programming Clojure book... and will read it again as things are certainly making more sense now. Coming from an OOP background for many years with no exposer to FP, its mind blowing :)
14:29Chousuke<list><atom val="+" /><atom val="1"/> <atom val="2"/></list>
14:29Chousukenot nice.
14:29hiredmanerm
14:29Chouseralrex021: welcome! it keeps being fun. :-)
14:29hiredmanit'd be like <double val="">
14:29Chousukeoh, right.
14:30Chousuke<list><symbol val="+" /><number val="1"/> <number val="2"/></list> <- corrected
14:31Chousukestill, all you need is a reader for the xml-based syntax and you'd be able to write clojure in it ;/
14:32rabidsnailHere's a puzzler. If I have a clojure hashmap whose values are SoftReferences, and one of the values gets garbage collected, does contains? on its key return true or nil?
14:33Chousertrue
14:34pragdavehiredman: that's funny. My first solution used a hash, and I rejected it because I thought I was being too Ruby-like
14:36Chousukepurist lispers might disagree, but with clojure it's idiomatic to make full use of the available data structures ;)
14:37ezyangI come from scheme, and I like the fact that clojure has good data structures
14:37ezyangNo more cons'ing down the list :-)
14:41hiredmanbah
14:41alrex021Enclojure or Emacs with Slime? I am trying to decide between the two, any bias opinions? :)
14:42hiredmanChouser: is there an easy way to check if an arbitrary symbol is bound to a var?
14:42Chouser,(resolve 'map)
14:42clojurebot#'clojure.core/map
14:42Chousereasier than that?
14:42Chousuke,(resolve 'asdfjasj)
14:42clojurebotnil
14:43hiredmanoh
14:43hiredmanthat's pretty easy
14:43Chouseryeah, I use it all the time. probably more than I should.
14:52hiredmanreplaca: it would be nice if the :vars bit in the contrib json also contained namespace information
14:52hiredmanlike what namespace the var's symbol is in
14:53hiredman(doc xml1->)
14:53clojurebot"[[loc & preds]]; Returns the first item from loc based on the query predicates given. See xml->"
14:58replacahiredman: ok, i'll take a look
14:58replacahiredman: shouldn't be a problem
15:03ezyangClojure doesn't have pattern matching :-(
15:04Chouserezyang: but it has macros, so you can add it yourself. :-)
15:04Chouserezyang: what's your use case?
15:05hiredmanezyang: http://www.thelastcitadel.com/blag/clojure_multi-method
15:05hiredmanI guess I should update that
15:06ezyangChouser: It's just something I'm used to from Haskell
15:06ezyangI'm not actually interested in hacking it on
15:07ezyang,(when 0 1)
15:07clojurebot1
15:07ezyangWait, what?
15:07hiredmanezyang: anything not nil is true
15:07ezyangOh
15:07ezyang,(nil 0 1)
15:07clojurebotjava.lang.IllegalArgumentException: Can't call nil
15:07hiredman(when nil 1)
15:07ezyangum.
15:08hiredman,(when nil 1)
15:08clojurebotnil
15:08ezyangSavvy
15:08hiredmannil is not a function, so you cannot call it as a function
15:08ezyangThat was a typo
15:28tashafahow do you take all but the last element in a seq?
15:29gnuvince,(butlast [1,2,3,4,5])
15:29clojurebot(1 2 3 4)
15:29tashafa(doc butlast)
15:29clojurebot"([coll]); Return a seq of all but the last item in coll, in linear time"
15:30hiredman~def butlast
15:30tashafathanks gnuvince... i knew i had come accross it before
15:30Chouseror drop-last
15:30hiredman~def drop-last
15:31tashafa(doc drop-last)
15:31clojurebot"([s] [n s]); Return a lazy sequence of all but the last n (default 1) items in coll"
15:39Chousukedrop-last is pretty clever.
15:51kefka,(defmacro q [x] `(if (nil? ~x) ~x (~x 4)))
15:51clojurebotDENIED
15:51kefkaThis raises an error ("can't call nil") but it shouldn't, right?
15:52kefkaWhen x = nil, it'll expand into (if (nil? nil) nil (nil 4)), which should be harmless.
15:52kefkabecause the (nil 4) will never execute.
15:52hiredmandamn
15:52Chouserhmph
15:52hiredmanthats what I get for playing around in the clojurebot repl
15:53gnuvince(doc assert)
15:53clojurebot"([x]); Evaluates expr and throws an exception if it does not evaluate to logical true."
15:53Chouserbut (let [y nil] (q y)) is fine
15:54Chouserit's only when x is known to be nil at compile-time that it's a problem
15:54Chouser(defmacro q [x] (when x `(if (nil? ~x) ~x (~x 4))))
16:57lisppaste8pragdave annotated #81369 "untitled" at http://paste.lisp.org/display/81369#5
16:59hiredmanah
16:59hiredmanof course
17:05Chousukethe q macro evaluates x too many times anyway :)
17:06Chouserso true
17:08lisppaste8hoeck annotated #81369 "using contrib" at http://paste.lisp.org/display/81369#6
17:21kefkaI've noticed something interesting about STM Refs: if someone is reading it in a dosync block, and the ref changes, the reader may or may not receive the update.
17:22kefkaMy test has been to: 1. (def *r* (ref 0))
17:22kefka2. (with-new-thread (dotimes [i 100] (Thread/sleep 1000) (println @*r*)))
17:23hiredmankefka: a transaction is a snapshot in time
17:23kefkaOk.
17:23kefkaSo there's no guarantee that a reader in a transaction will recieve updates.
17:23hiredmanwhat is the rest of your test?
17:23kefkaOn 2, the dotimes was in a dosync.
17:23kefka3. Repeatedly (dosync (alter *r* inc))
17:23hiredmankefka: the whole point is it should not
17:24kefkaOk. I know that if ensure, alter, et al are used, the variable is only modifiable by that transaction.
17:25Chouserif the value of *r* appears to change within a single transaction, that would be an error.
17:25Chousera bug, I should say
17:25hiredmanwrapping that dotimes in a dosync makes the whole thing happen within one transaction
17:25hiredmanso it will only ever seen one value for r
17:26kefkaOk. Let me try that again.
17:26kefkaMake sure I'm not doing something wrong.
17:27hiredmankefka: http://blip.tv/file/812787/ <-- have you seen this?
17:28hiredmanit's not that you are doing something wrong, you don't understand what a transaction is, so you cannot reason correctly about their behaviour
17:28hiredmancome to think of it, I may watch that video again
17:30kefkaYeah. I need to watch the vid again.
17:30kefkaThe value not changing makes sense to me. I was confused by the inconsistent behavior.
17:31hiredman?
17:32kefkaThe value being printed by (2) changes.
17:32kefkaSometimes, but not always.
17:32hiredmankefka: because transactions get retried
17:32hiredmanthat it is why side effects in a transaction are a bad idea
17:33hiredmanlike printing or starting a new thread
17:33kefkaAh. This makes sense.
17:34Chouseryou could print a marker inside the dosync but before the dotimes loop, to see when it gets restarted.
17:37Chousukehmm
17:40kefkaI think I figured out my problem. Thanks. I was abusing the STM because I thought readers in a dosync block had no effect on anything until ensure was called.
17:40kefka,(doc ensure)
17:40clojurebot"([ref]); Must be called in a transaction. Protects the ref from modification by other transactions. Returns the in-transaction-value of ref. Allows for more concurrency than (ref-set ref @ref)"
17:40hiredmanthey don't have an effect
17:41Chouserbut there is a consequence for being in a dosync
17:41kefkaSo ensure in transaction T1 means that some other transaction T2 can't alter the ref and force T1 to restart?
17:41clojurebotalter is always correct
17:43kgrad5How does Clojure's performance compare to Scala and Java? (sorry if this has been asked 9 million times before).
17:43hiredmankgrad5: if you do it right, on your performence sensitive inner loops you get the same jvm byte code as you do from java
17:44technomancykgrad5: sometimes getting Java speed requires adding some additional type hints and other kinds of tweaks to your code, but AFAIK you can always get pretty close.
17:44Chouser* after HotSpot has had its way
17:45hiredman?
17:45kgrad5Interesting, thanks
17:47Chousukekgrad5: Rich is also working on some new stuff on trunk that might make it even easier to write performant clojure code :)
17:47hiredmanrhickey is always cooking something
17:47hiredmanI am still waiting for scopes
17:47Chousukekgrad5: most of clojure improvements are still architectural though.
17:48Chousukekgrad5: the compiler itself doesn't bother with much optimisation :)
17:48kgrad5Cool, thanks Chousuke, I assume this is mostly due to how new Clojure is?
17:49Chousukekgrad5: yeah, and the architectural stuff is where the real performance gains are, anyway.
17:49kgrad5I doubt I will be doing anything that requires supreme performance, but it's nice to know you can still optimize and get almost Java performance, looking forward to diving into my copy of Programming Clojure when it arrives.
17:49Chousukeno need to optimise existing solutions when you can provide new stuff that is *naturally* faster
17:50Chousukekgrad5: in the worst case, you always have Java as a "low level langauge" if you just can't get enough performance out of clojure.
17:51Chousukelanguage*
17:51Chousukebut the goal is to make that a rare occurrence.
17:51kgrad5Chousuke: yeah exactly :D, is it really easy to use java libraries with Clojure and vice versa? (Clojure classes within java)
17:52Chousukekgrad5: java from clojure is really easy. Clojure from java I've never tried, but it shouldn't be too difficult either.
17:52hiredmanclojure doesn't have classes, there are only java classes
17:52kgrad5sorry i should have said clojure code
17:52hiredmanI have done a very little of that
17:52ChouserClojure from java isn't too bad.
17:52hiredmanmostly the other way around, java from clojure
17:53hiredman,(import 'java.util.ArrayList)
17:53clojurebotjava.util.ArrayList
17:53hiredman,(ArrayList. '(1 2 3 4))
17:53clojurebot#<ArrayList [1, 2, 3, 4]>
17:53hiredman,(import 'java.util.Collections)
17:53technomancyClojure from Java seems very awkward to me, but I haven't done much Java to Java; it's probably about par for the course. =)
17:53clojurebotjava.util.Collections
17:54ChouserI've got a lib that is 100% clojure code, but when compiled AOT provides a few Java classes such that users code (written in Java) can't tell it's not .java inside.
17:54Chousuketechnomancy: I suppose it could be made easier with some utility classes
17:54hiredman,(let [a (ArrayList. (range 10)] (Collections/shuffle a) (vec a))
17:54clojurebotUnmatched delimiter: ]
17:54hiredman,(let [a (ArrayList. (range 10))] (Collections/shuffle a) (vec a))
17:54clojurebot[4 5 0 7 8 6 1 2 9 3]
17:55Chousuke:)
17:55hiredmanbut that is all mutable and icky
17:55kgrad5I could see that being very useful for integrating clojure with some existing java programs Chouser
17:56ozzileeIs there a function where (x "test") -> "test" and (x :test) -> "test" as well?
17:56hiredman,(doc as-str)
17:56Chouserkgrad5: yep, that's what I'm doing. Setting up the build environment, figuring out gen-class, etc. is still a bit tricky and somewhat weakly documented, but it's doable and runs plenty fast.
17:56clojurebot"[[x]]; Returns the name or string representation of x"
17:57ozzileehiredman: Ah, there it is. Thanks.
17:57hiredmanozzilee: that is in contrib somewhere
17:57hiredman(not sure where)
17:57technomancythere's no way to alias namespaces, is there?
17:57ozzileehiredman: So it is. I'll find it.
17:57Chousertechnomancy: sure
17:57Chousuke(doc alias=
17:57technomancyI see people refer to contrib libraries as c.c.repl-utils etc, but that's just a shorthand convention, not recognized by clojure?
17:57clojurebotEOF while reading
17:57Chousuke(doc alias)
17:57clojurebot"([alias namespace-sym]); Add an alias in the current namespace to another namespace. Arguments are two symbols: the alias to be used, and the symbolic name of the target namespace. Use :as in the ns macro in preference to calling this directly."
17:57technomancyoh, nice
17:58hiredmanyeah
17:58technomancyChousuke: but that only applies on a per-namespace level
17:58hiredmanuse :as
17:58durka42_,as-str
17:58clojurebotjava.lang.Exception: Unable to resolve symbol: as-str in this context
17:59hiredmandurka42: uses magic json replaca generates to lookup contrib stuff
17:59Chousuketechnomancy: right. there could actually be a real c.c.repl-utils namespace :P
17:59durka42i see
17:59technomancygotcha
18:00technomancywell I don't use repl-utils anymore since I discovered the slime inspector works on classes, but I was still curious
18:00kgrad5Does Clojure do tail-call optimization?
18:00hiredmannope
18:00technomancykgrad5: not implicitly
18:00Chousukekgrad5: the JVM doesn't support it, so no.
18:01dnolenkgrad5: no, it has loop/recur and trampolines instead
18:01hiredmanand lazy-seqs
18:02kgrad5Interesting, are there any benefits to using tail recursion then?
18:02hiredmanlooks cleaner?
18:02Chousukekgrad5: sure, but you just do it explicitly with recur
18:02Chousukeuntil the JVM gets TCO at least. :)
18:03kgrad5I'll start the letter campaign to oracle ;)
18:03Chousukeisn't it going to be in JDK7? or was it just escape analysis that's going there.
18:03hiredman,(loop [i 0] (if (> i 5) (println "done") (recur (inc i))))
18:03clojurebotdone
18:03Chousukealso works with functions.
18:03hiredmanChousuke: I think escape analysis was in the last java6 update
18:04Chousukehiredman: but not enabled by default.
18:07kgrad5Chousuke, I don't think it's planned for jdk7
18:07kgrad5atleast, I couldn't find it while googling
18:18Chousukeinvokedynamic is going into JDK7
18:18ChousukeI wonder if that implies TCO
18:18hiredmannope
18:25dudehmm, having trouble getting 'La Clojure' REPL to work in IntelliJ
18:34aravindI am trying to get the basic get compojure to work as a war example to run in my jetty setup, but so far I haven't had much luck. I keep getting the "java.lang.NoClassDefFoundError: clojure/lang/IFn" error whenever I hit the app. Other apps deployed in the same jetty instance work. Also, I have -Djetty.class.path pointing to clojure.jar.
18:35technomancyaravind: generally we are a pretty peaceful folk in here. I don't know if we can help you with your wars.
18:36hiredmanhar har har
18:36aravindhehe
18:37hiredmanaravind: where did you get your clojure.jar?
18:37aravindhiredman: built it
18:37hiredmanaravind: ant clean, then rebuild it
18:38aravindI did.
18:38hiredmanOh
18:38aravindrebuilt contribs, and compojure as well.
18:44dudelooks like La Clojure is having trouble finding clojure: Exception in thread "main" java.lang.NoClassDefFoundError: clojure/lang/Repl
18:44dudeI thought clojure was bundled with the plugin?
18:59mrsolopsft.. can't get :require to work...
19:00hiredmanhow are you trying to use it?
19:00mrsoloin ns
19:00mrsoloclj is in classpath
19:00hiredman...
19:00mrsolobut repl keeps complaining
19:00replacatechnomancy: I was sorry we didn't get to hang out some more last night :-(
19:00technomancyreplaca: yeah, too much good stuff going on to take in at once!
19:01mrsolohmm nopaste is gone? duh...
19:01technomancymrsolo: lisppaste is better anyway.
19:02replacatechnomancy: I know. I felt like a host at a party who never has time to talk with the guests!
19:02dreishgist has clojure color-coding.
19:02technomancyreplaca: thanks a bunch for getting hosting for that. seemed like just about the perfect size.
19:02replacatechnomancy: any bigger and it would have exploded. Very fun though!
19:03mrsolook http://paste.lisp.org/display/81384 is the code...pretty simple
19:03mrsolorepl complains it can't find zimbra.qa.util/unique
19:04mrsoloutil.clj is in zimbra/qa/util so... should have found it eh?
19:05hiredmanmrsolo: you want something like (:require [zimbra.qa.util :as util])
19:05hiredmanthen you call stuff as (util/whatever ...)
19:06hiredmanthere is also :use
19:06mrsolonice shortand
19:06hiredmanwhich works more like what you are trying to do with :require
19:06hiredmanbut :require is better
19:06mrsoloya still doesn't work.. look like slime repl can't find it.. of course
19:07mrsoloif i manually load util.clj into repl it works...
19:07technomancyreplaca: didn't match the face to the nick until you said something about the meeting in here and I did a whois. =)
19:07mrsoloi though :require is suppsoed to search through classpath?
19:07technomancyI'll be sure to bring a name tag next time.
19:07replacatechnomancy: cool. I had matched all names for you cause I had to do the attendee list
19:08replacanow I gotta see if I can pull a video together
19:09mrsolohttp://paste.lisp.org/display/81385 <-class path
19:10technomancymrsolo: also nice: (System/getProperty "java.class.path")
19:11mrsolovery nice
19:19mrsoloah found the user error :-)
19:23dudeguess I'll go back to clo-jet for a bit; 'la clojure' REPL refusing to work
19:41dnolenanyone know a good image manipulation library for Java?
19:42gnuvince_JImageManipulationLibrary
19:42gnuvince_(kidding, I don't know)
19:42ataggartlol
19:43ataggartHow do you guys pull down and include the clojure contrib stuff when working on a project?
19:45technomancyataggart: I use Maven for all dependencies.
19:45technomancythough that might be overkill if your only dep is contrib
19:45hiredmanI don't use a contrib much
19:46ataggartI'm just starting to prototype something out in IDEA, and thought there might be a better way than just browsing to google code and downloading the file(s)
19:46hiredmanoh
19:47hiredmanyou do an svn checkout
19:47hiredmanbuild a jar
19:47ataggartah ok. didnt occur to me that it was really just one but buildable project
19:47ataggart*one big
20:04tayssirHi! I just installed Clojure via emacs elpa. Does anyone know why (use 'clojure.contrib.pprint) throws ClassNotFoundException for clojure.contrib.pprint.PrettyWriter?
20:06technomancytayssir: ah! it looks like pprint requires contrib to be AOT-compiled
20:06technomancycurrently M-x clojure-install doesn't do that
20:06tayssirAh, thanks! I'll figure out how to do that...
20:07technomancytayssir: I will fix that; in the mean time you can just run "ant -Dclojure.jar=<...path to clojure.jar..>" to do it manually
20:07technomancywhen I wrote it there were only one or two contrib libs that required AOT
20:09tayssirtechnomancy: Hmm, I ran ant that way, when I googled for a fix... Am I supposed to do something special afterwards?
20:10technomancytayssir: ant needs the -Dclojure.jar= argument; did you use that?
20:10tayssirYep... but in case I totally missed the point, let me try again... ;)
20:10technomancytayssir: you could try M-x slime-restart-inferior-lisp, but that shouldn't be necessary.
20:12technomancytayssir: oh, of course... only contrib's src/ is on the classpath
20:12technomancywill need to add its classes/ directory
20:13tayssirAahhh... thanks, I'll add classes/ to the classpath.
20:13technomancytayssir: or the contrib jar; either will do
20:19tayssirtechnomancy: Awesome, can't live without cl-format. ;)
20:20technomancytayssir: is that the one that uses ~A as a placeholder?
20:21tayssirtechnomancy: Yep.
20:22technomancyno accounting for taste I guess. =)
20:27tayssirIt's ugly, but I like its various tricks, and I'm not too familiar with what Java has. So, to get a comma-delimited string "1, 2, 3" you can do (cl-format true "~{~A~^, ~}~%" [1 2 3]).
20:27tayssirThis doesn't seem supported yet, but you should be able to get roman numerals like:
20:27tayssir(cl-format true "~@r" 1234) ==> "MCCXXXIV"
20:27tayssirand "old-style" roman numerals (where fours and nines are IIII and VIII):
20:27tayssir(cl-format true "~:@r" 1234) ==> "MCCXXXIIII"
20:28technomancy,(use 'clojure.contrib.str-utils)
20:28clojurebotnil
20:29technomancy,(str-join ", " [1 2 3])
20:29clojurebot"1, 2, 3"
20:29technomancybit more readable
20:32tayssirHrmm, good point. I'm curious how I'll look back on cl-format after getting used to the idiomatic Java/Clojurey ways...
20:32quidnuncstr-join join can't do something like 1, 2 and 3.
20:33quidnuncformat can.
20:38Chouserit may be a question of whether it's worth learning another language or not. You get succinctness in exchange for a whole new vocabular, syntax and grammar.
20:39Chouser,(#(apply str (interpose ", " (concat (drop-last %) [(str "and " (last %))]))) [1 2 3])
20:39clojurebot"1, 2, and 3"
20:42mrsolo java -cp testme.jar zimbra.qa.hello.main <- this doesn;t work but
20:42mrsolo java -cp testme.jar clojure.main -i "@zimbra/qa/hello.clj" -e "(zimbra.qa.hello/main) <- this does... compiled wrong?
20:45quidnuncChouser: Point taken. (And of course the example was only to illustrate that some things are "easier" to do with format. Two str-joins would have worked also).
20:49tayssirFor anything more complex than I'm used to, I just look up cl-format at: http://gigamonkeys.com/book/a-few-format-recipes.html ;)
20:49tayssir,(use 'clojure.contrib.pprint)
20:49clojurebotnil
20:49tayssir,(cl-format nil "This place houses ~r ~:*(~d) famil~:@p" 1)
20:49clojurebot"This place houses one (1) family"
20:49tayssir,(cl-format nil "This place houses ~r ~:*(~d) famil~:@p" 2)
20:49clojurebot"This place houses two (2) families"
20:49cp2thats neat
20:50dmiles_afki need something that will consify all the fields of an instance.. and store the type.. so later on i can restore teh object
20:51dmiles_afklistify i guess
20:51ataggart,(doc bean)
20:51clojurebot"([x]); Takes a Java object and returns a read-only implementation of the map abstraction based upon its JavaBean properties."
20:51dmiles_afki guess i can write two functions .. ToObject and FromObject
20:51dmiles_afkoh cool
21:01dmiles_afk,(["i am a string"]);
21:01clojurebotjava.lang.IllegalArgumentException: Wrong number of args passed to: LazilyPersistentVector
21:02dmiles_afkcan you show me a little example in here?
21:03ataggartof?
21:03dmiles_afkbeanifying an object (i icked string becaseu it wasnt primitive)
21:03ataggartyou didn't use the bean function
21:03dmiles_afkoh oops i need the fn name ';P
21:03ataggart(bean "hello")
21:04ataggart,(bean "hello")
21:04clojurebot{:empty false, :class java.lang.String, :bytes #<byte[] [B@101d3e4>}
21:04dmiles_afkright on.. thanks
21:04ataggartthe ([x]) notation means the function only has one arity
21:04ataggart(doc +)
21:04clojurebot"([] [x] [x y] [x y & more]); Returns the sum of nums. (+) returns 0."
21:05ataggart~google arity
21:05clojurebotFirst, out of 99900 results is:
21:05clojurebotArity - Wikipedia, the free encyclopedia
21:05clojurebothttp://en.wikipedia.org/wiki/Arity
21:06dmiles_afki see. i guess i am going to need something a little more agressive .. alsmost a serizatino format.. then convert to lists
21:06dmiles_afkalmost a serialization
21:07ataggartwhat problem are you trying to solve?
21:07dmiles_afkbut (bean ...) is still very nice
21:08dmiles_afkwell i al writting a video game library that executes the scenes in secondlife.. intiallally you can capture a current simlatuator state.. i am wanting to print the simulator state into a format that i can instance offline
21:09ataggartanyone using intellij/La Clojure around that can tell me howto get clojure-contrib.jar to be picked up by the repl?
21:09dmiles_afkinitially i capture the scene state.. and going to write out things in macros later like (make-prim... [the data format])
21:10dmiles_afkthe prim object has about 200 properties
21:11dmiles_afki run clojure in .NET thru IKVM .. most of the code impl is in C#
21:11dmiles_afkbut amazingly it all works
21:12ataggarthave you looked at the CLR port?
21:13dmiles_afki am tepted to.. since the primitive typs are in java.lang.* namespace
21:13dmiles_afktempted to
21:14dmiles_afkuseing the IKVM version lnds to some confusions down the road.. so i might switch over.. but want sure how much attention the code was going to get
21:14dmiles_afkfor the Clojure .NET
21:15dmiles_afki been using DotLisp for a while and that was pretty neat
21:15dmiles_afki think it was clojure's prototyp
21:23dmiles_afki almost could go back and forth to object<->XML using a typical java file.. and make cljore call the To/From Object
21:24dmiles_afki almost could go back and forth to object<->XML using a typical java lib
21:24dmiles_afkand still let clojure do the control logic i gaues ans at least do a (make-prim "<xml...>")
21:36ataggarthow do we force AOT in contrib so that I stop getting "java.lang.ClassNotFoundException: clojure.contrib.pprint.PrettyWriter (pprint.clj:0)"
21:38durka42ant -Dclojure.jar=/path/to/clojure.jar
21:39ataggartk thx
22:01ataggartso is anyone else not able to build contrib?
22:01ataggart[java] Caused by: java.lang.Exception: Unable to resolve symbol: get-method in this context
22:02durka42is this the latest checkout?
22:02durka42mine built
22:02ataggartyup, just pulled from trunk
22:02durka42hmm...
22:02durka42try just doing an ant clean to clear it out?
22:03durka42get-method is in core though...
22:03durka42do you have the latest core?
22:03ataggartI'm pointing to 1.0.0
22:04ataggartyou mean clojrue core, right?
22:04durka42yes
22:04ataggarttop of the stack trace:
22:04ataggart [java] Compiling clojure.contrib.accumulators to /Users/ataggart/IdeaProjects/contrib/classes
22:04ataggart [java] java.lang.Exception: Unable to resolve symbol: get-method in this context (accumulators.clj:60)
22:06durka42and what was the command?
22:06ataggartant -Dclojure.jar="../proto/lib/clojure.jar"
22:07ataggartbuilds the jars tho which I find odd
22:07durka42and that path is correct?
22:07durka42yes this should AOT compile everything and stuff it all in clojure-contrib.jar
22:07ataggartyup
22:07ataggartpath is correct otherwise we wouldnt see the clojure stuff in the stack
22:07ataggarte.g. Compile
22:17ataggartok, so it turns out the "clojure.jar" that comes bundled with the IDEA plugin is not quite right
22:17ataggartI pulled down the 1.0.0 jar from google code and everything works fine
22:28dudeataggart: thanks, that did it
22:28ataggart?
22:29dudeit's odd, they were the same size; I didn't check the CRC though
22:29dudeusing the clojure-1.0.0.jar for IDEA
22:29ataggartah
22:29ataggartyeah, and I haven't figured out how to swap the jar out
22:30ataggartI'm new to IDEA
22:30ataggartcan't figure out where the plugin is hiding
22:30dudeI think I was complicating things in my case: I had clo-jet installed and a clojure facet already in my projct when I switched to 'la clojure'
22:31dudehmm, on OS X it's in ~/Library/Application Support/IntelliJIDEA80/clojure-plugin/lib
22:32ataggartah thanks
22:35ataggartok this is wierd
22:35ataggartI just compiled contrib using the jar in the plugin, and it worked fine
22:35ataggartbut using the jar that was dropped in my lib dir when creating a project didnt