#clojure logs

2010-04-15

00:37MrEvilI was wondering if their is a construct somewhere in clojure similar async {} in F#. An easy way to spawn a bunch of asynchronus concurrent tasks whoes results get returned in a collection.
00:42hiredman,(doc pvalues)
00:42clojurebot"([& exprs]); Returns a lazy sequence of the values of the exprs, which are evaluated in parallel"
00:42MrEvilooh thankyou
00:57Scriptoris anyone going to the clojure meetup in nyc tomorrow?
00:57vIkSiThmm, so I got lein-swank installed; i can load the file in and sent it to the REPL - but for some reason, the file only compiles - don't see any output.
00:57vIkSiTIs there something after Cc Ck I should be using in emacs?
00:57technomancyvIkSiT: it might be in the *inferior-lisp* buffer
00:57technomancygenerally you shouldn't get output at compile-time though
00:57technomancyI mean, unless you're just experimenting
00:58vIkSiTtechnomancy, ah. so yes, in this case, I was basically following one of your posts and getting an uberjar built, and invoking java -jar uberjar.jar
00:58vIkSiTnow I'm trying to get the program to run through swank.
00:59vIkSiTso I guess, previously, I would just Mx slime, open up a new clj file, and use Cc Ck to send it to the REPL
00:59vIkSiTI was wondering how I'd see the output of this -main function the same way?
01:01technomancyjust run (-main) from that ns if I'm understanding you correctly
01:02vIkSiToh I See. all I had to do was go to the REPL, change (ns test1), and then everytime I run Cc Ck - I can see the output!
01:06technomancynot sure I follow, but if it's working that's great! =)
01:13lancepantztechnomancy: is there a way i can set jvm options for lein tasks?
01:14vIkSiTbtw, anyone here use aquamacs?
01:15vIkSiTtechnomancy, :) [the default ns was user; the program I was trying to run was in ns test1. as a result, I had to shift the ns before I could call (-main)]
01:19vIkSiThey Fossi
01:20Fossihi vIkSiT
01:20Fossihacking some clojure?
01:21vIkSiTFossi, indeed :) are you by any change trying CS with clojure?!
01:21vIkSiTchance*
01:22Fossinope
01:22Fossishould be working through the java bindings though
01:22Fossibut i guess it's real ugly
01:22vIkSiTyes, I guess its going to be hard to wrap around though
01:23Fossii guess it'd be better to embed clojure
01:23vIkSiThmm clojure as a scripting language.
01:48MrEvilExpressions like the following always give me the error regaurding recur not in the tail position due to the presence of the (def) in the else clause of the first if. I was wondering if there is something that I should be doing but am not.
01:48MrEvil(defn __findIntegerTriaglesWithIntRatio [p a bseq output]
01:48MrEvil (if (empty? bseq)
01:48MrEvil output
01:48MrEvil ((def a (findArea p a (first bseq)))
01:48MrEvil (if (integerRatio? a p)
01:48MrEvil (recur p a (rest bseq) (conj output a))
01:48MrEvil (recur p a (rest bseq) output)))))
01:49arbschtMrEvil: use paste.lisp.org or gist.github.com or something :)
01:50MrEvilhttp://gist.github.com/366723
01:50MrEvilthanks for taking a look
01:50MrEvilit's the presence of line 4 that always gives me trouble
01:50arbschtMrEvil: use def at the top level for var declarations, not inside functions
01:51MrEvilbut what if the call is only neccessary in an else clause of the if statement do i just have to trust that the JVM will optimize it away?
01:51arbschtMrEvil: your function would be better written in a high-level functional style. probably no need to use recur
01:52MrEvili was optimizing my solution for euler #283, getting rid of some of the multiple passes
01:53MrEvilmy first solution only used map and filter but i was iterating through the collection multiple times
01:56MrEvilam i misunderstanding the purpose of def?
01:58arbschtI think so. def is for global vars. I guess you want 'let', for local bindings
01:58MrEvilok that's just what i was going to ask
01:58MrEvilthanks
01:59MrEvilthat clears things up
02:30LauJensenMorning team
02:32polypusyou didn't sleep long Lau
02:32LauJensenhmm, I think I got at least 6 good hours :)
02:32polypustime flies when you're clojuring i guess
02:33LauJensenTrue
02:34polypusanyways time for me to hit the sack :)
02:34LauJensenNighty night
03:29LauJensenHeads up: I've pushed a non AOT compiled version of ClojureQL to Clojars, should work with all versions now 1.0+
04:27AWizzArdLauJensen: is the non-aot version the only one, or do you want to offer that one plus a 1.2aot’ed one?
04:28LauJensenAWizzArd: Clojuresque 1.0.0 defaulted to AOT compilation, which was why I was pushing AOTed jars, it was a mistake. So switching to Clojuresque 1.3.0 fixed that bug :)
04:28AWizzArdk
06:07vegaiCOJ defines this: (def AND #(and %1 %2))
06:08vegaiwhat's the point? Aren't 'AND' and 'and' equivalent?
06:08vegaiit's used like so: (def rank (zipmap [- + * / AND =] (iterate inc 1)))
06:09vegaiahh, I should put these in the repl before I ask :)
06:09vegaiuser=> (def rank2 (zipmap [- + * / and =] (iterate inc 1)))
06:09vegaijava.lang.Exception: Can't take value of a macro: #'clojure.core/and (NO_SOURCE_FILE:10)
06:09vegaiso 'and' is a macro
06:10vegaiby the way, doc is a great idea. Whoever figured that it should be in there deserves a reward
06:12Chousukeruntime access to documentation is an old idea :)
06:13vegaiChousuke: yes, but mindboggingly, new languages/platforms are still being created without it
06:13vegaihmm
06:13vegaithe doc for iterate says that f must be free of side-effects
06:13vegaibut there are no checks on this
06:14vegaiI can do (defn a [] (println "1")) (iterate a 1)
06:14Chousukeit's not possible to check for side-effects
06:14vegaiwhat's the consequence of having side-effects in a fun that's called from iterate?
06:14Chousukewell it'll just work in a very weird way
06:15Chousukesince iterate creates a sequence
06:16Chousuke,(take 5 (iterate (fn [x] (print "f: " x) (inc x)) 1)))
06:16clojurebot(1 2 3 4 5)
06:16vegaiyeah...
06:16Chousukehmm, where did the print output go? :(
06:16vegaiI come from a bit of haskell background, so I take "must be free of side-effects" rather seriously
06:17Chousukewell, haskell has a type system that can help you differentiate between side-effecting functions and "really pure" functions
06:17Chousukebut Clojure doesn't, so you're just expected to do the right thing.
06:18vegaifunctions can have metadata, right?
06:18Chousukeas of 1.2, yes.
06:18Chousuke(which is still unreleased)
06:18vegaicouldn't there be a :pure for instance?
06:18SynrGin programming clojure in examples/taslklist.clj i don't understand where 'parser' comes from
06:19Chousuketechnically yes, but I don't think that's feasible :/
06:19vegaicould it be so that a missing :pure from a function definition infects all the functions that call that function?
06:19AWizzArdvegai: yes, I suggested something similar also in the past.
06:19Chousukevegai: dynamic binding could break that easily
06:19AWizzArdIn principle Clojure can do more type checking in the future, optionally.
06:20ChousukeAWizzArd: if someone writes the type system, yes. :P
06:20vegaiyeah... just a random thought.
06:20AWizzArdRight, a good bit of work will be required, but it can be an optional type system.
06:21Chousukebut I think the general sentiment is that any static type checking must remain completely optional and degrade gracefully when combined with "fully dynamic" code.
06:21AWizzArdCould be even on top of FindBugs.
06:21AWizzArdChousuke: yes, 100% optional.
06:22ChousukeIt's definitely not a simple problem to solve, but still an interesting one
06:24AWizzArdI may remember to look at this posting: http://groups.google.com/group/clojure/browse_frm/thread/7a48f48e4b197a15/9538dbdb1549f1c6
06:24AWizzArdChousuke: yes, difficult, but could be very useful
06:24Chousukesure
06:24AWizzArdGood morning rhickey. Thanks for updating Master to include defrecord :-)
06:25rhickeyAWizzArd: you're welcome, some rough edges still to work out today I'm sure
06:28AWizzArdWhat I found so far is that a (.readObject ois) on a (defrecord Foo [a b c] java.io.Serializable) throws java.lang.ClassNotFoundException
06:32AWizzArdCode was basically: (do (defrecord Foo [a b c] java.io.Serializable) (def fos (java.io.FileOutputStream. "/file.ser")) (def oos (java.io.ObjectOutputStream. fos)) (.writeObject oos (Foo. 1 2 3)) (.close oos) (def fis (java.io.FileInputStream. "c:/file.ser")) (def ois (java.io.ObjectInputStream. fis)) (.readObject ois))
06:35rhickeyAWizzArd: if you are trying to do dynamic serialization, that won't work as I said yesterday, only with AOT
06:36rhickeythat won't work, as I said yesterday
06:36AWizzArdOk, I will retry it later again with an AOTed version.
06:41vegairecur confuses the hell out of me
06:42AWizzArdvegai: just think of normal tail recursion
06:42AWizzArdwhere you would place the name of the function that you recursively want to call, just put recur in.
06:42vegaithe example here, http://clojure.org/special_forms#recur
06:43AWizzArdyes, imagine the example as you would write it now, without using recur
06:43vegaidoes the recur go back to the loop there?
06:43AWizzArdit would look identical, only replace "recur" with "factorial"
06:43AWizzArdIf you understand that function then, then you understand recur :)-
06:44vegaioh, that's it?
06:44AWizzArdrecur returns to the innermost loop or function
06:44vegaithere's an example in COJ that uses in the same function both recur and the function's name
06:44vegailike so
06:44AWizzArd(loop1 (loop2 (loop3 ... (recur -> goes to loop3))))
06:44vegai(defn infix* [[a b & [c d e & more]]]
06:44vegai (cond
06:45vegai (vector? a) (recur (list* (infix* a) b c d e more))
06:45vegai...
06:45vegaisee that? there's both a call to recur and infix*
06:46vegaigranted, it does say below the example that I shouldn't perhaps try to understand this yet :)
06:47Chousukerecur is not really different from ordinary recursion; it's just limited to tail recursion so it can be optimised
06:48Chousukea function can call itself as many times as it needs, and in that example one recursive call is tail-recursive so it can be done with recur, and the other is not so there is a call to the function
06:48vegaiah, it's for the tco?
06:48vegaiI was a bit confused about the documentation of recur
06:48Chousukeyeah
06:49Chousukerecur exists because the JVM doesn't guarantee TCO
06:49vegaiit says "There is no tail-call optimization" but I misinterpreted the context of that
06:49vegaiI thought it was saying that recur doesn't have a tco
06:49Chousukethough recur has other benefits too; it actually checks if the call is in tail position
06:49vegaiyes, that's nice
06:51ChousukeI think there is no reason to do away with recur even if the JVM someday will guarantee TCO :)
06:52ChousukeI would also be in favour of a recur-at special form if it were possible to implement one to efficiently support mutual recursion.
07:02SynrGlet's try again, since conversation has settled down (and without typos :) in Programming Clojure, i understand all of this example *except* where 'parse' comes from (on line 16): http://github.com/stuarthalloway/programming-clojure/blob/master/examples/tasklist.clj
07:02SynrGanyone?
07:02vegaiyeah, it's not a bad idea generally. Has the potential of making recursive code somewhat clearer too
07:04ChousukeSynrG: it is a method of the SAXParser class
07:04ChousukeSynrG: note the .. form
07:04SynrGoh, that's included in '..'! doh. i thought i got all of those
07:05ChousukeThis is the main reason I prefer (-> foo .bar)... it makes java methods explicit so you won't mistakenly see them as clojure functions
07:06SynrGso the file object is coerced to a BufferedReader, passed to an InputSource constructor, which returns an object which is passed to SAXParserFactory.newInstance.newSAXParser.parse
07:06SynrGthis java interop stuff is a bit dense
07:07ChousukeSAXParserFactory.newInstace().newSAXParser().parse(new InputSource(...))
07:07SynrGit took multiple reads through this example to get it all
07:07Chousuke(the clojure code actually has fewer parentheses)
07:07SynrGand it doesn't help that i am only casually familiar with Java :P
07:08SynrGanyway, thanks. pleased to finally get every line of code
07:09SynrGthe book glosses over with "this is boilerplate for ..."
07:11ChousukeSynrG: so to reiterate, the code creates a new factory instance by using the newInstance method of Class (not of SAXParserFactory), then calls the newSAXParser() method of that instance which returns the actual parser, and then the parse method of that is called with the InputSource and handler as its arguments.
07:12Chousukeat least, I think that's the case :P
07:12SynrGahh. key to understanding this is that ...
07:12SynrG(.. System getProperties (get "os.name"))
07:12SynrGand
07:12SynrG(.. System (getProperties) (get "os.name"))
07:13SynrGare equivalent
07:13Chousukeright.
07:13Chousukethough you should prefer (-> System .getProperties (.get "os.name"))
07:13Chousuke(because I think it's clearer)
07:14SynrGjava.lang.IllegalArgumentException: No matching field found: getProperties for class java.lang.Class (NO_SOURCE_FILE:0)
07:14Chousukeoops
07:15LauJensenI think you should go with
07:15LauJensen,(System/getProperty "os.name")
07:15clojurebotjava.security.AccessControlException: access denied (java.util.PropertyPermission os.name read)
07:15LauJensenMuch much clearer :)
07:15ChousukeI guess it has to be (-> (System/getProperties) (.get ...))in this case :/
07:16SynrGLauJensen: well. i was just using (doc ..) to try to understand ..
07:16Chousukewhich is even better since it's explict about getProperties being a static method
07:16SynrGthis is an exercise in code reading, not in learning the most concise way to express it :)
07:16SynrGbut i will keep this in mind
07:16SynrGChousuke: and back to what you said above. "... newInstance method of Class (not of SAXParserFactory) ..." how can i tell?
07:17ChousukeSynrG: I think in this case I might be wrong actually
07:17Chousuke.. seems to have different semantics for static/instance method resolution than rest of clojure. confusing
07:17SynrGhmm
07:18Chousuke(.foo String) is calling the .foo method of the Class object that represents String
07:18Chousukebut (.. String foo) seems to be resolved as a call to a static method of String; ie. String/foo
07:19ChousukeWhich just reinforces my point. Avoid .. :P
07:20LauJensen.. precedes -> by almost a year I think
07:20SynrGLauJensen: and thus, not used in the text?
07:21LauJensenThey are 2 different things entirely, .. is just a helper for ., where -> has much broader application
07:21LauJensenSo I think you can comfortable take Chousuke's advice
07:22Chousuke.. might be more convenient in some cases but I think -> makes things more explicit and is thus better
07:22Chousuke-> is just a way to transform (-> foo bar whatever) to (whatever (bar foo))
07:23Chousukeit's only incidentally that it contains most of ..'s functionality.
07:24SynrGthe doc lacks examples. but i think i follow
07:24Chousuke(-> "foobar" (subs 3) .toUpperCase)); can't do this with ..
07:25SynrGChousuke: minus your extra final paren :)
07:25LauJensenSynrG: -> and ->> made the most sense to me, when I just looked at the arguments as lists that got an extra argument. for -> its the second arg to the list, for ->> is the last
07:29SynrG,(-> "foobar" (subs 3) (str "quux"))
07:29clojurebot"barquux"
07:30SynrG,(str (subs "foobar" 3) "quux")
07:30clojurebot"barquux"
07:32SynrG,(->> "foobar" (str "baz") (str "quux"))
07:32clojurebot"quuxbazfoobar"
07:34SynrGok. makes sense
07:54AWizzArdrhickey: so far there is no automatic static Foo/create method right? And also no create-Foo?
07:55rhickeyAWizzArd: right
07:57AWizzArdAre they still planned or will it be (Foo. ...)?
08:09AWizzArd~seen ordnungswidrig
08:09clojurebotordnungswidrig was last seen quiting IRC, 28261 minutes ago
08:24AWizzArdrhickey: all my use cases were so far (Foo. arg1 ... argn). Didn’t need a create-Foo. Basically it won’t matter if it is Foo. or Foo/create. What are your plans for Foo/create and create-Foo?
08:36rhickeyAWizzArd: using Foo. spreads the hostiness all over, also can have no associated logic (arg processing etc)
08:45AWizzArdok, so minimum we want is a Foo/create I guess
08:47AWizzArdalthough create-Foo would indeed be nicer :)
08:48AWizzArd^^
08:48cemerickAWizzArd: what's wrong with (Foo ...)?
08:50liwphostiness is a great term!
08:50rhickeycemerick: Foo is the name of a class, will be auto-imported
08:50sattvikWould Foo/create possibly conflict with interfaces that declare a create function?
08:51rhickeysattvik: not in Java-land, where instance and static methods are distinct
08:53AWizzArdcemerick: rhickey explained this has to go away, I think it had to do with name clashes.
08:53AWizzArdcemerick: today it is: (defrecord Foo [a b]) ... (Foo. 10 20) ==> #:Foo{:a 10, :b 20}
08:54cemerickYeah, I can see the conflict. I quite liked being able to use Foo as a ctor fn.
08:54AWizzArdcemerick: maybe we will soon get create-Foo as a replacement :)
08:54AWizzArdplus defrecords produce stable class names
08:55AWizzArdcemerick: but serialization still works only for AOTed records.
08:55rhickeyAWizzArd: how could it otherwise, seriously?
08:55cemerickAWizzArd: no other option
08:56rhickeycemerick: I am interested in options for the factory fns, I brought it up yesterday
08:56cemerickhrm, sorry I missed that
08:57cemerickrhickey: you know my distaste for magically-created defs, i.e. create-Foo
08:57rhickeyno significant input then, so feel free. I'm thinking about enabling static methods in general, thus supporting Foo/create
08:57cemerickrhickey: this discussion was yesterday morning?
08:57rhickeycemerick: yes
08:57AWizzArdcemerick: do you see technical problems there?
08:57cemerickAWizzArd: with create-Foo, or similar?
08:58AWizzArdyes, with these autodefed functions
08:58cemerickno, no technical issues -- I just don't like automagically-created vars. Reminds me of CLOS pain.
08:59AWizzArdI think it is comfortable to have them, while it indeed will not be the most beautiful thing. But it still offers several advantages, and as defrecords will be important it is okay to make an exception here.
08:59cemerick...which was fundamentally a failing of mine at the time, but the automatically-created fns didn't help at all.
08:59AWizzArdcemerick: clos does not autodef such functions. Those are CLs defstructs
08:59cemerickeh, whatever it was
08:59AWizzArdand it defines really lots of them
09:00AWizzArdbut create-Foo would be pretty much the only fn getting defined
09:00AWizzArdnot a getter on each field
09:01AWizzArdCLs defstruct really is going a bit too far with this magic. But just having a constructor sounds okay. Also this could be an option {:contructor-fn-name 'make-foo} *shrugs*
09:01cemerickIt's a pretty hostile thing, really. The first thing someone who's using defrecord will want to do is create a record, and they've got to go find the docs that explain create-Foo or Foo/create.
09:01AWizzArddefaulting to create-Foo
09:02AWizzArdcemerick: they will have to read about records anyway.
09:02cemerickvs. assuming that it works just like defn
09:02sattvikrhickey: Do you know if Foo/create would be a problem with other runtimes, namely CLR?
09:02rhickeycemerick: they would presume a same-named factory fn? I don't think so
09:02AWizzArdplus there can still be a fn (create-record Foo arg1 ... argn)
09:02AWizzArdThis would be the less efficient general factory.
09:03AWizzArd(map #(create-record Foo %*) (bar)) vs (map create-Foo (bar))
09:03LauJensen(clojure in top10 on HN again =))
09:04liwpAWizzArd: I was just about to suggest an optional :contructor-fn-name :)
09:04@chouseronce upon a time we came up with consistent syntax for (map Foo/create aseq) that supported arg hinting and everything.
09:04AWizzArdmornin chouser
09:05AWizzArdliwp: yes, to overwrite the default
09:05cemerickrhickey: Eh, maybe not, but (Foo ...) was a very natural-feeling thing
09:05rhickeychouser: yes, still hosty
09:05@chouserg'morning.
09:05rhickeycemerick: and (Foo. ...) ?
09:05AWizzArdI did not find (Foo ...) natural.
09:06AWizzArdThe uppercase F indicated a jvm class
09:06AWizzArdbut where is the "."?
09:06cemerickrhickey: I'm fine with that. Foo. is the standard ctor usage, so it's a good fit.
09:06@chouseryeah. One concrete way to describe the difference between create-Foo and Foo/create is the ability to find the identifiers in the latter based on the name of the datatype
09:06AWizzArdCompared with (File. ...) (SomeClass. ...) etc it was strange.
09:07rhickeychouser: that's a good point
09:07AWizzArdcemerick: but rhickey mentioned above that "using Foo. spreads the hostiness all over, also can have no associated logic (arg processing etc)".
09:07@chousermaybe this is just a vimism, but I have a keystroke that takes me from an identifier to the next use of that identifier, and I find it very helpful for quickly finding my way through unfamilier code to the part I care about.
09:08@chouserbut a strike against create-Foo without a solid alternative doesn't do us much good. We don't want to generatea namespace, right
09:08rhickeyOne thing is that deftype/defrecord *have* changed in creating named types, vs dynamically tagged types. Any kind of wrapper diminishes the power of that somewhat
09:09cemerickAWizzArd: yeah, I saw that. I presume rhickey meant "hostiness" in a derogatory way, but insofar as being hosty is around the second thing one learns how to do in clojure, carrying Foo. over to something that has the same semantics is fine by me.
09:09rhickeyand any generated 'create' might need to be overridden by a type-specific static factory
09:11AWizzArdrhickey: btw, also very nice to see that you are still actively working on Cells too *thumbs up*
09:12rhickeyAWizzArd: just using that cells code to test the changes
09:12AWizzArdyes, but this is still an important update, because when I use the changes, then my old cells.clj file wouldn't work anymore.
09:12rhickeysattvik: checking CLI spec...
09:14cemerickhrm, I'm actually liking Foo. more than the bare Foo ctor fns I've been using. Our generic create form is already there: (new MyRecord ...)
09:18rhickeycemerick: except new is not a proper function, nor is Foo.
09:19rhickeysattvik: I think the CLI is fine with it
09:20cemerickrhickey: well, I was careful in 1/2 spots to say form instead of fn :-)
09:20AWizzArdAfter a few days of usage create-Foo will look familiar and idiomatic.
09:20cemerickcompared to Foo/create, create-Foo is just bad. Sorry, AWizzArd
09:21AWizzArdOnly from an aesthetic pov. Technically it is fine.
09:21cemerickrhickey: perhaps then a new-esque fn could be made that would be applicable to records and classes.
09:22AWizzArdFor basically all my deftypes I made a (defn make-foo ...) anyway.
09:22rhickeycemerick: not one whose perf didn't stink
09:22jlbAnybody have experience deploying AOT'd compojure/ring servlets? Everything works fine for me if I run in jetty, but I get weird NPE's deploying to a servlet container
09:22cemerickjlb: paste the stacks somewhere
09:23AWizzArdOften the constructors have to do some clever jobs anyway, and don't want to just fill the fields with some bare values.
09:23cemerickrhickey: isn't the same problem in each case? There's a host ctor that needs to be invoked.
09:23cemerickisn't it*
09:23AWizzArdMaybe we just need an option {:contructor-name make-foo} ?
09:23rhickeycemerick: not way to do that w/o reflection, or if a multimethod, a lookup
09:24jlbcemerick: will do, one sec
09:24sattvikrhickey: That's good. It doesn't guarantee that Foo/create will not cause any problems when porting clojure to other platforms, but at least the two primary targets would be fine with it.
09:24rhickeysattvik: no need to worry about it yet, same args against creating names apply in class scope as in namespaces, really
09:25cemerickrhickey: but a reflection-free create fn can be made for records, e.g. (create Foo ...)?
09:25rhickeycemerick: still lookup
09:25AWizzArdThis will still have to look up the class
09:26AWizzArdWould be nice to have this generic factory too tho
09:26cemerickoh, ok. In that case, I fail to see the downside of Foo., given that it reuses all the existing host semantics (appropriately, it seems)
09:26jlbcemerick: http://pastebin.com/1jh62sUv
09:27AWizzArdNow that I think about my use cases a Foo. or Foo/create would really be enough (for me). I define a make-foo anyway for nearly all cases, which sets internal fields and such.
09:27jlbIt's largely unhelpful
09:27rhickeycemerick: that's where I ended up, and thus that's all there is for now
09:27AWizzArda create-Foo which does nothing different from Foo. or Foo/create would in that case pollute the namespace
09:27cemerickrhickey: ah, I thought you were actively preferring Foo/create (or, something in addition to the ctor)
09:29cemerickjlb: I would double-check the container's security policy
09:29rhickeycemerick: I am anticipating the need for factory fns, but ones that go beyond a direct mapping to the ctor. My philosophy is, ctors should just set fields, use factory fns if doing arg munging etc, so what's really needed are static methods in deftype. Also good for helpers. Given that, then perhaps defrecrod would auto-define Foo/create factory
09:29jlbIf I strip everything out and just return strings from the file that extends HttpServlet, that much works
09:30rhickeycemerick: for now I'm not going to auto-generate anything and instead work on statics and protocol cleanup to go along with deftype changes
09:30cemerickjlb: when you strip everything out, are you removing require and use dependencies?
09:31cemerickrhickey: presumably, one might want multiple factory fns then?
09:31AWizzArdrhickey: but what would create-Foo then do if it is auto defined? I mean, what can it do that Foo. can’t?
09:31rhickeyone problem mwith no standard factory is that print/read won't be able to use a factory, only a ctor
09:31rhickeycemerick: yes
09:31AWizzArdI would think the user has to implement create-Foo himself
09:31jlbcemerick: yep. I'm going to try fooling with class paths and things in the war lib directory and so on next... however, right now I think everything is in there.
09:32rhickeyI'd like records to be readable
09:32jlbBut if that useless error is code for "can't find some dependency" then that's where I'll look first
09:33cemerickjlb: I've hit something like this before. I'm guessing one of that namespace's dependencies is throwing an exception in the process of loading, which are unfortunately sometimes swallowed.
09:34jlbcemerick: ok, thanks
09:34sexpbotRaynes: You have 1 new messages. Type $getmessages to see them.
09:34cemerickrhickey: isn't print/read only using ctors OK? I mean, the fields will have already been munged (if necessary), so why would a factory fn ever be relevant at that point?
09:34rhickeycemerick: manually-written literals
09:35cemerickyikes
09:35cemerickif one can define multiple factory fns, then that seems untenable
09:35RaynesI think that mail plugin might be the most useful thing I've ever written.
09:35rhickeycemerick: not if they have a known name and can only be overloaded on arity
09:35ChousukeRaynes: you should make it send a private message or a notice though
09:36RaynesYeah, because it's just so annoying! ;)
09:39rhickey,(binding [*print-dup* true] (prn (array-map :a 1 :b 2)))
09:39clojurebot#=(clojure.lang.PersistentArrayMap/create {:a 1, :b 2})
09:40rhickeynot a ctor ^^
09:41AWizzArdI think print-dup should really output #=(user-defined-record-factory arg1 arg2 ...) to be generally usable.
09:44AWizzArdFor example, I have (defrecord [foo bar #^FileOutputStream fos ...])
09:44AWizzArdThis gets set according to bar, and is not so easily printable.
09:46RaynesChousuke: It notices now. Just for you. <3
09:46AWizzArdOr I want to store a ThreadPoolExecutor, etc.
09:47rhickeyAWizzArd: you'll only ever be able to print/read records containing fields that support print/read
09:48AWizzArdWhen I can provide my own print-dup method then I can have it generate #=(my-make-foo "filename" n-threads)
09:48AWizzArdBefore I read I’ll have to make sure my-make-foo is loaded, and then it can make a fos on filename and setup a TPE.
09:50AWizzArdthat’s application specific long-term serialization then
09:50Chousukeisn't it possible to do that already by provide a print-method for the type of the record?
09:51Chousukeproviding*
09:51AWizzArdA default for printable and immutable objects would still be nice though, and portable between all Clojures then.
09:51AWizzArdChousuke: yes
09:51AWizzArdAlthough.. one problem would be to access the fields of the record.
09:52AWizzArdno, nevermind
09:54rhickeythere will only be the functionality of extend-class, not tag-based extend-type, but I'd like to call it extend-type
09:55AWizzArdextend-record?
09:56rhickeyAWizzArd: no, works for deftypes too
09:56rhickeyand ordinary classes and interfaces
10:02cemerickspeaking of java / servlet container security policy, I've blown a bunch of hours on this already; any help would be greatly appreciated. :-) http://stackoverflow.com/questions/2645298/how-to-sanely-configure-security-policy-in-tomcat-6
10:02sexpbotHow to sanely configure security policy in Tomcat 6 - Stack Overflow
10:12cemerickRaynes: I think you'll end up ignoring all links eventually :-)
10:12AWizzArdns of defn-memo anyone?
10:12Raynescemerick: Not all of them. :>
10:13AWizzArdnm :)
10:17dnolenah
10:17dnolenso defrecord is more "primitive" than deftype?
10:17cemerickdnolen: vice versa
10:18AWizzArddeftype is very lowlevel now
10:18dnolencemerick: ok, looking at the code this seems more like a refactoring right? deftype used to have both deftype/defrecord functionality, now deftype is barebones.
10:19cemerickright
10:19cemerick"closer to the metal" rather than "barebones", but sure.
10:21stuartsierraso what's up with defrecord?
10:21stuartsierraI saw the commit
10:22cemerickit's alive! :-)
10:22@chouserit exists. love it, and applyh search/replace to your chapter...
10:22stuartsierrayeah...
10:23stuartsierraSo defrecord is like deftype + IPersistentMap
10:23@chouseryep
10:23stuartsierraDoes deftype include any default interfaces at all?
10:23cemerickminus the mutables that deftype had, and still has
10:23@chouserah
10:27wthiddenDoes anyone know where the latest writeup on defrecord is located?
10:27fogusOn #clojure
10:27jlbcemerick: re: your tomcat problem, what happens if you create the file that it is complaining about?
10:28jlbcemerick: BTW I got my AOT'd servlet working... turns out I was providing *too many* jars in the war lib
10:28cemerickjlb: too many jars?
10:29cemerickjlb: I tried that, but it then fails searching for a classfile to load, again on path that doesn't exist. It seems like a general issue.
10:30jlbcemerick: right, the container seemed not to like the fact that I was providing implementations of classes it already had. Or something. wiping out WEB-INF/lib did the trick (with my bare bones code devoid of other dependencies)
10:31cemerickjlb: which container?
10:31jlbcemerick: jboss
10:32cemerickjlb: I'd doubt the conclusion of too many jars being the problem. People put some pretty friggin' massive wars and ears into jboss. :-)
10:32cemerickthe classloader hierarchy, now that might be something worth looking at
10:33cemericknever worked with jboss myself, but most containers have different modes for arranging their classloaders, which can help to avoid issues like using different versions of classes the container depends upon itself.
10:34dnolenhmm
10:34jlbcemerick: it's definitely weird, but removing lib did the trick. I had all the apache commons stuff in there, etc. I don't mean too many in the count sense, but in the conflicting implementations sense
10:34dnolenso with defrecord I have to use the (my-record. & args) ?
10:34dnolenno more support for (my-record & args)
10:34dnolen?
10:35cemerickjlb: commons-logging? It does some wonky stuff with classloaders. Try removing just that one....
10:35cemerickdnolen: that's the current state, yeah
10:35cemericklikely to persist, if I've interpreted the tea leaves right
10:35stuartsierraso instead of defining a constructor function, it imports the class name?
10:36cemerickyeah
10:36stuartsierraok. Are datatypes still identified by namespaced keywords?
10:36cemerickAFAIK, yes
10:37dnolencemerick: any particular reason?
10:38cemerickdnolen: http://clojure-log.n01se.net/date/2010-04-14.html#08:58
10:38sexpbot#clojure log - Apr 14 2010
10:39dnolenah, good reason
10:40cemerickI actually think it's a very positive change at this point.
10:40dnolenso we're waiting for (my-record/create-or-some-other-name & args)
10:41cemerickrhickey has plans for factory functions, yeah
10:45stuartsierraLast contrib build on build.clojure.org failed. http://build.clojure.org/job/clojure-contrib/lastBuild/console
10:45sexpbotclojure-contrib #64 Console [Hudson]
10:46stuartsierraI can't reproduce this locally; any ideas?
10:46dnolendefrecord question? how do I use the constructor in a different namespace since it's not a function anymore?
10:46stuartsierradnolen: import the class?
10:48dnolenstuartsierra: ok, that works.
10:48cemerickstuartsierra: try making the maven invocation 'clean install' -- this would likely resolve one of the issues in my clojure-dev node
10:48cemerickand potentially fix the build error
10:49stuartsierraI thought Hudson always started with a clean checkout anyway.
10:49jlbBTW, rhickey (or anyone), is there a ballpark "done" or at least stable date for 1.2? I'm hoping to ship some production stuff on Clojure and deftype/defrecord/defsomething would be very nice to have (it would suck to retrofit that)
10:50cemerickstuartsierra: nope
10:50stuartsierrajlb: rhickey doesn't do dates
10:50cemerickjlb: I really doubt deftype/defrecord are going to go away.
10:51cemerickwe already have a very early version of deftype in production :-)
10:51stuartsierrajlb: if you have to ship now, pick a single snapshot and stick with it.
10:53@chouserno, I think datatypes and records both have unmunged class names now, so no more need of ::Foo
10:53jlbstuartsierra: production is a few months off... so I just need to know what the endpoint will look like, ballpark. :) I'm using deftype now, for example
10:54stuartsierrawe don't know yet
10:54stuartsierrait's experimental :)
10:55stuartsierrasome of the necessary changes aren't apparent until after people have had a chance to play with it
10:55stuartsierraSo we get to be the guinea pigs. :)
10:55cemerickjlb: you'll likely want defrecord (or its equivalent) from here on out, unless you're using the low-level mutable stuff in deftype
10:56jlbcemerick: ok, good to know... BTW I noticed that it implements IPersistentMap, does that mean I can instantiate it from a map by chance?
10:56cemerickstuartsierra: clean builds FTW :-)
10:57stuartsierracemerick: Yes, thanks for the tip. http://build.clojure.org/job/clojure-contrib/lastBuild/ is successful now
10:57sexpbotclojure-contrib #65 [Hudson]
10:57stuartsierrawho's this sexpbot, by the way?
10:58LauJensenstuartsierra: Thats Raynes' experiment
10:58cemericknow let's wait for all those using 1.2.0-SNAPSHOT to suddenly start missing duck-streams et al.
10:58@chouserjlb: you'd still use 'into' to copy from an existing map into a record
10:58dnolenjlb: that just so that you do map like things with a defrecord instance, (:x record-instance) and (assoc record-instance :x 'foo). main difference being you have the speed of java fields.
10:58jlbstuartsierra: understood... it's just helpful when selling to others to be able to say something other than "no clue when it will be solidified" :)
10:58Raynesstuartsierra: Woot! Finally fixed, eh? :>
10:59@chouserjlb: anything else would be a lie. :-)
10:59stuartsierraRaynes: it was fine until this morning
10:59cemerickI'm betting on 12/31/2010 for 1.2.
10:59stuartsierracemerick: really?!
11:00jlbchouser: hehe.
11:00cemerickstuartsierra: a yearly release cycle seems entirely reasonable. Besides, there's a ton of scope left.
11:00jlbchouser: lies would be going too far... some clueful exaggerations would be ok :)
11:00cemerickAnd it's not like defrecord et al. have been beaten up properly.
11:01stuartsierraRaynes: contrib build has been stable for weeks.
11:01stuartsierracemerick: yeah
11:01Raynesstuartsierra: Are we talking about snapshots?
11:02stuartsierrayes
11:02LauJensenYearly released cycle?
11:02cemericka long-ish lead like that is helpful insofar as it gets people using SNAPSHOTs, draws more people into the "test pool" ;-)
11:02Raynesstuartsierra: http://build.clojure.org/snapshots/org/clojure/clojure-contrib/ There hasn't been a new build here since January.
11:02sexpbotIndex of /snapshots/org/clojure/clojure-contrib/
11:02dnolenanybody messed with Clojure on a core i7 laptop, so does Java see those machines as having 4 cpus ? :D
11:02cemerickRaynes: see 1.2.0-SNAPSHOT directory
11:03RaynesOh. Well, that's weird.
11:03cemerickstuartsierra: any idea about why prior snapshots aren't being retained for contrib?
11:03stuartsierrano
11:03stuartsierracemerick: I don't know that much about Hudson, but i'd guess that's how it's configured
11:03LauJensendnolen: (.. Runtime getRuntime availableProcessors)
11:04dnolenLauJensen: yes I know, I wondering if anybody's tried that.
11:04cemerickevery core should get reported as a processor
11:05dnolenbut core i5 & i7 has hyperthreading, so OS supposedly reports two more cores.
11:06rsynnottit would, yeah
11:06rsynnottif you have a four-core hyperthreading processor the OS will see that as eight logical processors
11:07pjstadigi have a quad core i7
11:07rsynnott(or, in the case of a Sun T2, eight threads per core, so _64_ logical processors, which makes for unreadable top readouts)
11:08pjstadigsystem monitor shows 8 procs
11:08AWizzArdstuartsierra: I find your last edit of http://www.assembla.com/wiki/show/clojure/Getting_Started_with_Emacs very unfortunate. Why do you suggest that one should not learn Emacs and Clojure at the same time? I think this suggestion should go away again, or get added for all other IDEs/Editors as well.
11:08sexpbotGetting Started with Emacs | Clojure | Assembla
11:08pjstadiguser> (.. Runtime getRuntime availableProcessors)
11:08pjstadig8
11:08dnolenpjstadig: nice :D an excellent Clojure machine.
11:08rsynnottcertainly, people usually learn common lisp and emacs at the same time if they don't know emacs already
11:08stuartsierraI'm trying to avoid the "Lisp is hard because you have to learn Emacs" problem.
11:08rsynnotton the basis that there is no satisfactory way to use common lisp without emacs, usually :)
11:09rsynnottstuartsierra: but you may, if you want to
11:09stuartsierraWell, obviously, I can't stop anyone.
11:09AWizzArdstuartsierra: the same is true for all editors. It makes not much sense to pick on Emacs.
11:09stuartsierraWhy not? everyone else does? ;)
11:09stuartsierraBut I'll change it.
11:10LauJensenstuartsierra: I think thats in bad taste
11:10AWizzArdthx
11:10stuartsierraI LOVE Emacs, I will never leave it. But I spent years on it before I ever tried to use SLIME/SWANK.
11:10stuartsierraAnd it was STILL hard to get SLIME/SWANK/Clojure working together.
11:10rsynnottHow else are they meant to learn clojure, anyway? From command line?
11:10LauJensenstuartsierra: I learned emacs simultaneously with learning SBCL
11:11AWizzArdcemerick: ^^
11:11rsynnottI suppose there's clojure integration for the big scary java IDEs...
11:11LauJensenAnd besides, getting SLIME up and running, with the multitude of wiki guides, blogposts and even videos you'd have to be an impressive character to fail at it these days, wouldnt you ? :)
11:11rsynnottLauJensen: ditto, more or less; I'd used emacs before but not seriously. Also, it was cmucl
11:11pjstadigelpa makes getting emacs setup much easier nowadays IMO
11:11stuartsierraI think everyone should start with the environment they are most familiar with. If that's a text editor and a command line, use that. If it's a big Java IDE, use that.
11:12AWizzArdpjstadig: but how do I setup elpa?
11:12LauJensenstuartsierra: I think you're making way too much of this
11:12pjstadigi just use technomancy's starter kit
11:12LauJensenIt takes so little effort to get into Emacs, so I hardly think it deserves a warning sign
11:12AWizzArdSo the starter kit setups elpa, which then allows to setup swank-clojure?
11:12LauJensenAnd secondly, the benefits are so massive that we should be helping people pass those hurdles, not point at them and scream danger
11:12AWizzArdI ask because I still use the version from October 2009, which was easy to install.
11:12pjstadigyeah
11:13cemerickLauJensen: please keep your emacs advocacy away from my language. :-)
11:13AWizzArdEveryone with a cheat sheet can learn the basic Emacs commands within 1-2 days.
11:13pjstadigi had to wrangle with things before, but setting up emacs recently with the starter kit was easy...for me
11:13LauJensencemerick: haven't you got some XML that needs untangling ? :)
11:13AWizzArdAs if I know all the key combos for Netbeans, Ideo or VimClojure. I would have to learn them all anyway.
11:13AWizzArdstuartsierra: thanks.
11:14LauJensenOk, I'll back down. But I think the editor discussion is silly. Go with the one which strikes your fancy. Dont fear learning. Thats it
11:14cemerickstuartsierra: eh, don't do that, the sentiment was correct IMO.
11:14arbschtuh oh, now you're in trouble :)
11:14LauJensenThis is hardly worth getting upset over stuartsierra :)
11:14cemerickLauJensen: That's fine. "Helping people get past [emacs'] hurdles" isn't.
11:14stuartsierraI know, I'm just being goofy. ;)
11:15AWizzArdcemerick: same hurdles with netbeans
11:15cemerickAWizzArd: not for the 90+% of devs that use eclipse/netbeans/intellij
11:15jweissi think if the question is "does emacs scare people away from clojure" the answer is clearly "yes", wouldn't we all agree? But they don't have to use emacs
11:16AWizzArdcemerick: unfair comparison, cause they already *know* how to use those
11:16cemerickAWizzArd: and as a clojure advocate, that's all I care about.
11:16jweissalthough i did learn emacs even though i tried to avoid it, because it's by far the best environemnt to use for clojure (IMO)
11:16AWizzArdcemerick: but then there should still be a warning to not learn Clojure and Netbeans at the same time, as for any editor/ide.
11:17rhickey1.2 will be soon
11:17cemerickAWizzArd: well, the warning's gone now. Besides, tackling the emacs-starter-kit is enough of a warning to those that don't care about emacs. ;-)
11:17AWizzArd^^
11:18stuartsierrarhickey: yay!
11:19AWizzArdbtw, whill 1.2 include deftype/defrecord?
11:19rhickeyAWizzArd: it already does
11:19AWizzArdgood good
11:19AWizzArdCells are for 1.3?
11:20jweisswhere can i find docs on these new features?
11:20AWizzArdjweiss: http://www.assembla.com/wiki/show/clojure/Datatypes and http://www.assembla.com/wiki/show/clojure/Protocols
11:20sexpbotDatatypes | Clojure | Assembla
11:21rhickeyyikes, TIOBE lumping Clojure with Lisp/Scheme, of course that makes it leap to #23 (over Scala, Erlang)
11:22cemerickrhickey: yeah, that's hilariously sad, eh?
11:23rhickeyand Go is #15 and in the hall of fame, oh please
11:23stuartsierrayeah
11:23cemerickI presume the page is only there for SEO purposes.
11:23liebkeseems like they might as well lump C/C++/Java together too then
11:24AWizzArdTiobe uses a google search
11:24AWizzArdcompare: "go programming language" 48 million hits
11:24AWizzArd"clojure programming language" 70k hits
11:27rhickeyhrm, I get "go programming" 60k, "go language" 156k, clojure 356k
11:28AWizzArdrhickey: ok, might be because I use the german version of google.
11:28stuartsierrarhickey: after latest patch, I get "Warning: profocol #'ns/FooProtocol is overwriting function foo"
11:29rhickeystuartsierra: when you do what?
11:29AWizzArdWhen i put it into quotes, "go programming language" i get 291k hits vs "clojure programming language" 177k hits.
11:29stuartsierrarhickey: load my code
11:29rhickeystuartsierra: which code
11:29stuartsierraoh, maybe it's getting loaded twice
11:29stuartsierramine
11:30stuartsierracontaining (defprotocol FooProcotol...)
11:30stuartsierrahang on, checking to see if it's loading twice because of testing
11:31rhickeystuartsierra: I can reload the cells code over and over without warning
11:31stuartsierraok, I get it on first load
11:31rhickeyany declares?
11:31stuartsierrano
11:32carkhthe protocol naming convention is PascalCase ?
11:33rhickeycarkh: yes
11:33carkhsame for types and records ?
11:33rhickeycarkh: yes
11:33carkhthanks !
11:33AWizzArdhttp://java.sun.com/docs/codeconv/html/CodeConventions.doc8.html
11:33rhickeyall will become Java class names
11:34stuartsierrarhickey: http://gist.github.com/367231
11:34carkhok got it ... just looking weird with all lisp looking names around =P
11:34stuartsierracode here: http://github.com/stuartsierra/lazytest/blob/master/src/main/clojure/com/stuartsierra/lazytest.clj
11:37stuartsierrabut (use 'com.stuartsierra.lazytest :reload) prints no warnings
11:39stuartsierrasame thing in SLIME
11:39AWizzArdslime prints no warnings?
11:39stuartsierrano, same warnings in SLIME
11:39stuartsierraonly get warnings first time I load the file; subsequent reloads print no warnings
11:41rhickeystuartsierra: I get no warnings at all, not from loading the code from buffer, nor from file, nor via use
11:41stuartsierrahmmmm
11:41drewrrhickey: http://gist.github.com/367250 am I missing something?
11:42rhickeydrewr: no facgtory fns now, use (Foo.)
11:43rhickeydocstrings have changed on deftype and defrecord, please read fro latest details, I don't have a changes list yet
11:43drewrah, ok; I saw that in the docstring but didn't translate that to constructor call
11:43stuartsierrarhickey: ok, no warnings at plain REPL
11:43stuartsierrasomething about my dev env
11:44rhickeydrewr: the docstring doesn't say use the ctor, as I'm still thinking about factories, but it doesn't say you get a factory anymore
11:44drewrI think I was confused by "A factory function of current.ns/Name will be defined..."
11:44rhickeydrewr: that's a bug, will fix thanks
11:46rhickeyI took it out of deftype doc, but not defrecrod
11:47drewrah
11:48rhickeyfixed
11:49stuartsierrarhickey: It was AOT-compilation that triggered the warning
11:50stuartsierraWhen the ns containing defprotocol is AOT-compiled, it produces the warning when loaded
11:51AWizzArdrhickey: maybe for 1.2 you just leave it as Foo., and if this won't need changes in the future, then in 1.3 Foo/create and create-foo or whatever can be added?
11:51AWizzArdIn the next months this would generate some code and show how people use it.
11:54rhickeystuartsierra: thanks, will look into that
11:55stuartsierrathanks
11:55stuartsierraneed a break from all this intense conversation :)
12:01RaynesHuh
12:01RaynesLeiningen is downloading 1.2.0-SNAPSHOT from Clojars for some reason.
12:01Raynesclojure-contrib, that is.
12:16fogusI get back from lunch and see that Twitter has declared rhickey is almost done with v1.2.
12:18rhickeyah, that twitter
12:19LauJensenWhats a 'recrod' ?
12:19fogusrhickey: Well, if Twitter says it then it must be true
12:20fogusLauJensen: It's when you have to crod again
12:20LauJensenfogus: oh, so I need the crod then..
12:23rhickeyhrm, I fix stuartsierra's problem and he's left
12:30MecIs there a way to get the repl to only print one '...' after *print-length* is reached, instead of one '...' for every single item left
12:50slyphonso, kind of a "working with clojure" question, when working in the repl do you load everything in the project explicitly? if so, how?c
12:52carkhslyphon: laod your top-level namespace, and this on loads what it needs ...recursively so that everything gets loaded
12:53slyphontop-level namespace as in the 'user.clj' file or the top-level for my project (i.e. 'fqdn.project')?
12:53carkhi personally don't use the user namespace for that
12:54carkhi'm currently working on a project which has like 80 files (didn't cound them really)
12:55carkhit's all loaded from dev_init when working on it with my editor
12:55carkhor from my genclass with the main method
12:55slyphonyou do a (require 'blah.dev_init)
12:55carkhi just load that file then compile =P
12:55slyphon:)
12:55slyphonok
12:56@chouserI often do (require 'foo.bar :reload) or :reload-all
12:56carkhso really yes, that's like a require
12:56carkhi can't really reload-all, i have much state all over the place that needs to be kept alive
12:57carkhlike network connections to some hardware and such
12:57slyphoni mean, i know how i structure and manage stuff in say, ruby, but it's these kinds of "best practices" that take time to suss out
12:57slyphonyeah, indeed
12:58cemerickrhickey: so, uh, sometime next week for a 1.2 release, mmmkay? ;-)
12:58carkhcemerick: i'd say tomorrow !
12:59carkhor better, tonight !
12:59slyphonhave there been improvements made to the ns macro?
12:59slyphoni saw that ns+ project which looked really cool
12:59carkhi think the ns maco fits the bill as it is
12:59slyphonehhh
12:59@chousercarkh: I tend to use defonce for state that shouldn't be blown away.
12:59slyphonthere's a *lot* of repetition
13:00slyphoni mean spread out between files
13:00slyphoni'd like some kind of "common set of things" across my whole project
13:00carkhchouser: right, but this quite large project was started a while back, when i didn't know about defonce
13:00@chouserah, ok
13:01cemerickchouser: have you poked at that restricted compilation scope any further?
13:02carkhbesides reaload-all doesn't provide a clean state, when i need to reload-all, i just kill my clojure process and reload the whole thing
13:23naeufogus: hey there
13:25LauJensenAah, feeling right at home here in #Clojure, enjoying a nice cup of tea.... (coffee maker is broken)
13:25slyphonLauJensen: put your feet up, make yourself comfortable
13:25fogusnaeu: Hello there
13:25kylesmithI'm getting a weired error that happens when I set *warn-on-reflection* to true and load a file. "swank.util.io.proxy$java.io.StringWriter$0 cannot be cast to java.io.PrintWriter" Any ideas?
13:26slyphonkylesmith: there was some discussion of that
13:26naeufogus: I've been reading joyofclojure. It is remarkably well written
13:26slyphoni had a problem with that and the contrib.sql lib
13:26LauJensenkylesmith: its a known issue with swank, Zach Tellman posted a patch for it somewhere, check the group
13:26fogusnaeu: Thank you very much, but I blame @chouser
13:26naeufogus: The only thing I struggled with was the 2d drawing example
13:26fogusnaeu: Oh wait, you said "well written" ;-)
13:27LauJensenhehe
13:27lancepantzis it out?
13:27slyphonkylesmith: i htink i wound up changing my dev-dependencies to use [swank-clojure "1.2.0-SNAPSHOT"]
13:27slyphonlein-swank as well
13:27scottjlancepantz: just first 5 chapters
13:27naeufogus: I didn't realise that you had to outstretch the canvas before you grabbed the graphical context in order to draw a rectangle
13:28lancepantzah, yeah- i have a link to those somewhere
13:28fogusnaeu: I think we should fix that
13:28naeufogus: I also didn't realise that when you change the size of the canvas, it clears it
13:28LauJensenfogus: Also I dont know if Sam posted it correctly, but are you showing people stuff like (let [f (JFrame.) _ (.setSize f 300 300)] ??
13:28LauJensens/posted/pasted
13:28naeufogus: you just need to add one line specifying an initial size
13:28naeuLauJensen: no, that was me condensing it down for IRC consumption
13:28LauJensenphew
13:29fogusLauJensen: Sam? Pasted?
13:29LauJensenfogus: naeu is Sam Aaron
13:29naeufogus: I discussed it in here a few days ago
13:29LauJensenAnd he pasted some vile looking code in here a few days ago
13:29fogusnaeu: I was almost certain we did, but it might have gotten lost in the copy/paste
13:29LauJensenHad your name on it
13:30fogusLauJensen: I might have missed that
13:30naeuLauJensen: cheeky bugger
13:30LauJensenhehe
13:31naeufogus: anyway, you and @chouser are doing a wonderful job. It's a joy to read
13:32naeuthe joy of the joy of clojure!
13:32fogusnaeu: Thank you. And thanks for pointing out the dimension issue
13:33naeufogus: you're welcome. The only other things I noticed were the occasional grammar error here and there. I guess you have an editor to deal with those
13:33naeufogus: or are you looking for that kind of feedback too?
13:34fogusnaeu: Yes. We have an editor, but every little bit helps. We have a forum for that at http://www.manning-sandbox.com/forum.jspa?forumID=624
13:34sexpbotManning Forums: Joy of Clojure
13:35naeufogus: oh ok. I'll start making a note of things I find then :-)
13:35fogusThank you
13:35naeuit's the least I can do
13:36naeubtw, will you be covering 1.2 stuff. Or is it too late for that?
13:39fogusnaeu: It's all 1.2
13:40naeufogus: oh cool, so will the Java.next chapter cover deftype, defprotocol & friends?
13:41fogusnaeu: No. That chapter only covers interop. types/proto/reify will be in chapter 8
13:41naeufogus: oh cool :-)
13:42kylesmithWell, I just git pull'ed clojure, clojure-contrib, slime, clojure-mode, and swank-clojure, and I'm still getting the same error.
13:44scottjkylesmith: LauJensen said there was a patch, but not necessarily merged in. he said check group.
13:45LauJensenI dont think its merged. What I do though, is I keep a terminal open, so if I need to check for reflections I just eval the file from there, look at the line numbers, and go back to my code buffer
13:52kylesmithYeah, I looked, but couldn't find anything. Does anyone have a link?
13:57LauJensenI'll look
13:59LauJensenkylesmith: http://groups.google.com/group/swank-clojure/browse_thread/thread/36cc0c9d325a9c76/be3bcb3501cec1e9?show_docid=be3bcb3501cec1e9
13:59LauJensenThat was my source
14:00kylesmithOh, I didn't realize swank-clojure had its own group. thanks.
14:18@chouserwhat's the state of the art in clojure.test integration with junit?
14:19@chouserI've got a little macro that generates a junit test suite out of a namespace full on functions named like -testFoo
14:20@chouserbut it's clumsy to get clojure.test failures to show up as junit failures.
14:23@chouserclojure.test/are always returns true?
14:23@chouseroh, true if the last test succeeds, regardless of earlier tests' results? Is that intentional?
14:31tomoj,(require 'clojure.test)
14:31clojurebotnil
14:31tomoj,(clojure.test/are [x] (inc x) -2 -3)
14:31clojurebotDENIED
14:31tomojdarn
14:32tomojlooks like it just returns whatever the last template expression returns
14:33@chouserpoking around in clojure-test, it looks like you're expected to rebind clojure.test/report and do something appropriate there.
14:42NorritHey, I am trying to "use" contrib.http.agen/http-agen, but it doesnt quite work .. any suggestions?
14:43NorritOnly require seems to work
14:43Norrit(ns test (:require clojure.contrib.http.agent))
14:47vegaiNorrit: that's a typo in your comment, not in your code, right?
14:48Norritthe typo is in the comment
14:49vegaihow do you use it?
14:49NorritI tried (ns test2 (:use clojure.contrib.http.agent)) but that doesnt work
14:50NorritThe error message is: bytes already refers to: #'clojure.core/bytes in namespace: test2
14:50Norritseems like there is a nameing conflict
14:51hiredman,(doc refer-clojure)
14:51clojurebot"([& filters]); Same as (refer 'clojure.core <filters>)"
14:55@chouserNorrit: I'd recommend avoiding naked 'use' like that. Either list the specific Vars you want, or give the whole namespace a convenient alias.
14:55@chouser(use '[clojure.contrib.http.agent :only [foo bar]])
14:56@chouser(use '[clojure.contrib.http.agent :as http :only []]) ... (http/foo ...)
14:57Norritthanks (use '[clojure.contrib.http.agent :only [http-agent]]) works great
14:58slyphonis "locking" re-entrant?
15:00slyphonby the same thread?
15:01timcharperI posted this to twitter, but a few of you may be interested in this: http://gist.github.com/367421
15:01timcharper(Maybe something else already exists like it?)
15:01maxhodakdivision is giving me exact fractions
15:02maxhodakhow do i get decimal results back?
15:02slyphonrhickey: sorry to bother you, is the "locking" macro reentrant by the same thread?
15:02maxhodaki.e., (/ (reduce + a) (count a)) -> 2/25 or 3/5 or such
15:02slyphonrhickey: in ruby the Monitor class is reentrant, but the Mutex class isn't, so i wanted to make sure i'm DTRT
15:03maxhodak,(/ (reduce + [1 2 3 4 5]) (count [1 2 3 4 5]))
15:03clojurebot3
15:03maxhodaker
15:04maxhodak,(/ (reduce + [0 0 0 1 1 1 0 1 1 0]) (count [0 0 0 1 1 1 0 1 1 0]))
15:04clojurebot1/2
15:04maxhodakwtf
15:04slyphonthat's a lisp-ism, iirc
15:05@chouserslyphon: locking blocks access to it's body to any but one thread at a time. Perhaps I don't understand your question.
15:05maxhodakoh wait
15:05maxhodak,(Float. (/ (reduce + [0 0 0 1 1 1 0 1 1 0]) (count [0 0 0 1 1 1 0 1 1 0])))
15:05clojurebotjava.lang.IllegalArgumentException: No matching ctor found for class java.lang.Float
15:05maxhodak:(
15:06@chouser,(double 2/3)
15:06clojurebot0.6666666666666667
15:06maxhodakchouser: thanks
15:06slyphonchouser: can thread X grab lock Y multiple times without blocking?
15:06@chouserah! I think not.
15:07slyphonballs!
15:07slyphonok
15:07@chousershould be easy to test. hang on.
15:07slyphonyeah, i was about to
15:07slyphoni need a reentrant lock
15:08@chouserI thought I had done this before and got instant deadlock, but now it's acting differently than I remember
15:08slyphonhmm
15:09@chouser,(let [x (Object.)] (locking x (prn 1) (locking x (prn 2))))
15:09clojurebot1 2
15:09@chouserno deadlock
15:09slyphonah
15:09slyphonoh, well, excellent
15:11@chouser"Gain exclusive ownership of a raw monitor. The same thread may enter a monitor more then once. The thread must exit the monitor the same number of times as it is entered."
15:11slyphonah
15:11slyphonis that under the "locking" docs?
15:11@chouserthat's from some random jvm docs on the web. combined with results of experimentation, I think you're safe.
15:11slyphoni went looking to find the java impl of monitor-enter but couldn't make heads-or-tails of what i found
15:11slyphonchouser: cool
15:11slyphonchouser: ty
15:12@chouserslyphon: yeah, it decends rapidly from the 'locking' macro to raw JVM bytecodes.
15:13slyphonrhickey: sorry to bother you, chouser fielded that one admirably
15:14slyphoner, "to not"
15:22riddochcHi, folks... looks like current -contrib doesn't build with current master of clojure.
15:23riddochcOr, actually, has errors...
15:23riddochcERROR in (complex-division) (run-test108689328942713466.clj:44)
15:23riddochcexpected: (= (/ (imaginary 5) (imaginary 5)) 1) actual: java.lang.IllegalArgumentException: No method in multimethod '/' for dispatch value: :clojure.contrib.complex-numbers/pure-imaginary
15:24rhickeyriddochc: did you mvn clean?
15:25rhickeyall clear here
15:25riddochcrhickey: I'll try that, though it was a fresh git checkout...
15:26jfields if I have a symbol that references a function, how can I call that function?
15:26rhickeyjfields: a symbol or a var?
15:26riddochcrhickey: By the way, thanks for clojure. It's pretty much what I've always wanted: a modern, useful lisp.
15:27jfields(defn x [] 0) (doseq [y ['x]] (println y) (println ... how do I get 0 for the 2nd println?
15:29riddochcCurious. I'm setting it up on a different system (laptop crash) and I wonder if there's an issue that it's using openjdk instead of sun's.
15:32jfieldsthere must be a better way to do this
15:32jfields(doseq [y ['x]] (println y) (println (eval (list y))))
15:34riddochcOh well, I'll just use sun's java. I guess my distro just defaulted to openjdk.
15:37rhickeyjfields: ,((resolve 'inc) 41)
15:37rhickey,((resolve 'inc) 41)
15:37clojurebot42
15:38rhickeyriddochc: you're welcome
15:39jfieldsthanks Rich
15:44technomancyriddochc: I have yet to notice a difference between openjdk and sun that affects clojure
15:44technomancybut there's a first time for everything I guess
15:44wthiddenHow do I call a static inner class java method from clojure?
15:44riddochctechnomancy: Could just be my setup. We'll find out in a moment.
15:45wthiddenI have class Scheduler that has a static inner class error with method eror that takes 2 strings.
15:45technomancyyeah, works here with openjdk
15:45@chouser(the.package.name.Scheduler$Error/error "thing1" "thing2")
15:46wthiddeni thought I'd do (Scheduler$error/error "path" "exception") but seem not to be able to get the method.
15:46@chouserwthidden: you can check that (show Scheduler$error) has the methods you expect
15:47@chouserwthidden: note that if you're trying to do without the full package name, you need to have imported Scheduler$error, not just Scheduler
15:47wthiddenchouser: ah that might help.
15:47wthiddenchouser:ooh did not do that yet...
15:48wthiddenhmm from what context does show work?
15:49wthiddenis that from the introspect package?
15:50@chouserclojure.contrib.repl-utils/show
15:51riddochcOkay, all the exceptions I'm getting from clojure-contrib tests are coming from "Testing clojure.contrib.test-complex-numbers"
15:52@chouserhm, you know the number of people saying they don't use contrib or don't know how to get it has been down lately.
15:52@chouserI wonder if that's because of build.clojure.org, or something else.
15:55riddochcLooks like all the exceptions are of the variety: java.lang.IllegalArgumentException: No method in multimethod 'sqrt' for dispatch value: :clojure.contrib.complex-numbers/complex... sometimes, substitute '+', '-', '/', 'exp', or '*' for 'sqrt'...
15:56riddochcThe errors are limited to the complex-numbers tests, it looks like.
15:56riddochcRan 359 tests containing 1248 assertions.
15:56riddochc4 failures, 253 errors.
15:57riddochcOdd.
16:04hiredmandoes anyone have an example of a macro that emits a type hinted method call?
16:29riddochcOy. The maven "getting started guide" is *awful*. Quote: ...in a nutshell Maven is an attempt to apply patterns to a project's build infrastructure in order to promote comprehension and productivity by providing a clear path in the use of best practices.
16:29greghwith synergy.
16:30riddochcMakes me want to just stop reading, right there. "Oops, wrong document. I'm not An Enterprise."
16:32lancepantzsaw a book title today: Eliminating Waste in Software Projects, with the subtitle "The enterprise 2.0 concept applied to lean software development."
16:32lancepantzyay, enterprise 2.0
16:35riddochcI think the appropriate phrase involves a valley accent: "Like, totally gag me with a spoon, or some junk."
16:35riddochcAnyway. Gotta run. Have fun clojuring, folks.
16:36arohnerhiredman: the gvec code does a lot of it
16:36arohnerI think
16:37hiredman:(
16:39hiredmannot a whole lot, actually
16:40hiredmaninfact, at a quick glance it only does it once
16:40hiredmanhttp://gist.github.com/367619 I don't see why I get that reflection warning
16:47remleduffAre you supposed to be able to take the value of a method as a field like that?
16:48Chousukehiredman: I think tags are supposed to be symbols, not actual class objects
16:48hiredmanayeee
16:50hiredmanChousuke: excellent
16:53remleduffOut of curiosity, what was the magic?
16:54remleduff(let [x (gensym)] `(fn [~x] (. ~(with-meta x {:tag (resolve 'String)}) toString))) doesn't seem to make any difference to me
16:55Chousukejust :tag 'String
16:56remleduffAha
16:56Chousukereflection can be avoided if the symbol's metadata contains a value for the :tag key that is either a symbol or a string naming the class
16:59LauJensenhiredman: Aren't you looking for something like the aget! and aset! macros in my FD blog post?
17:00hiredmannope
17:03remleduffDoes the reader actually "read" the result of macros? I was trying to get #^String to work in that example, but it doesn't seem to every take effect. If not, how do {} literals work? Are they not really reader macros?
17:03remleduffs/every/ever
17:03remleduffActually, there's no macro there, is there
17:05hiredmanremleduff: the reader's job is to transform text into datastructures, macros already are operating on datastructures, why would the reader still be involved?
17:05remleduff,(eval `(fn [#^String x#] (. x# toString)))
17:05clojurebotDENIED
17:08remleduffI don't know, it's just too easy for me to think of reader macros as "magic things that do stuff", I need to be sure to keep what they do clear in my head I guess.
17:08@chouserremleduff: #^Foo works inside syntax-quote in *some* places, but by no means in all.
17:09Chousukeremleduff: don't confuse reader macros with normal macros :)
17:11@chouser,(binding [*print-meta* true] (prn `(#^Foo x)))
17:11clojurebot(#^sandbox/Foo sandbox/x)
17:11@chouser,(binding [*print-meta* true] (prn `(#^Foo x#)))
17:11clojurebot(#^sandbox/Foo x__10025__auto__)
17:11@chouserso those work, but this does not:
17:11@chouser,(binding [*print-meta* true] (prn `(#^Foo ~'x)))
17:12clojurebot(x)
17:14remleduffBecause x is being captured from the environment there, and you can't "change" its metadata only create a new value with with-meta?
17:14remleduff,(binding [*print-meta* true] (prn `((with-meta ~'x {:tag 'Foo})))
17:14clojurebotEOF while reading
17:15remleduff,(binding [*print-meta* true] (prn `((with-meta ~'x {:tag 'Foo}))))
17:15clojurebot((clojure.core/with-meta x {:tag (quote sandbox/Foo)}))
17:15Chousuke,(binding [*print-meta* true] (prn `(~'#^Foo x)))
17:15clojurebot(#^Foo x)
17:15remleduffThat's way too many sigils ;)
17:15Chousukehehe
17:16Chousukefortunately you almost never need that
17:16Chousukeonly if you absolutely must emit an unqualified constant symbol with a type hint :P
17:16remleduffWill that actually ever be "read" though, to allow the #^Foo to work on x?
17:17Chousukewith a *constant* type hint, even
17:17Chousukeyes. When the macro is defined
17:19Chousukeit gets read into a data structure something like the following: (binding [*print-meta* true] (prn (list (quote x))) where the symbol x has metadata
17:20@chouser,(binding [*print-meta* true] (prn `(~(with-meta `x {:tag `Foo}))))
17:20clojurebot(#^sandbox/Foo sandbox/x)
17:21@chouserbasically there are certain expansions in syntax-quote that ignore the metadata you put on the pre-expansion thing (using #^), and in those cases you may have to using something else.
17:21@chouserthe closest equivalent is what I just pasted, using with-meta inside an unquote (~)
17:22Chousuke#^Foo is amusing with quote since you must remember that 'bar expads to (quote bar)
17:22Chousukeso #^Foo 'bar puts metadata on the list
17:22Chousukeand you have to use the slightly unintuitive form '#^Foo bar :)
17:23remleduffOK, I'll chew on that for a while
17:25fyuryuhmm, I get 4 test failures in contrib. is it just me?
17:29slyphonrhickey: it'd be nice if there was some way in the ns macro, in the :require clause to have single names mean ':as', i find my code has a lot of (foo :as foo) (bar :as bar)
17:29slyphoninside the context of some outer namespace
17:35tomojI've wondered before about wrapping ns
17:36tomojseems like a difficult thing to do
17:36tomoj(use '[my.ns :only my-ns]) (my-ns ...) I guess
17:36tomojexcept without the mistake
17:37tomojprobably a terrible idea
17:37tomojI just feel bad having all this Macro Power but not being able to bend ns to my will
17:37slyphontomoj: ns is *narsty*
17:38slyphontomoj: http://onclojure.com/2010/02/17/managing-namespaces/
17:38sexpbotManaging namespaces &laquo; On Clojure
17:38tomojoh, someone's already done it! hah
17:38slyphononly works w/ 1.2
17:39tomojI suppose you might also someone have your ns+ cause the namespaces it loads to automatically have ns+ available
17:39tomojbut that sounds even more evil
17:39slyphon:)
17:39tomojbecause then the file won't compile on its own
17:39slyphonyeah, with something like that, it's probably better to actually know what the fuck is going on
17:39tomojI just don't like the '
17:40tomoj(use nstools.ns) would be cool, but (use 'nstools.ns) is unacceptable
17:41tomojnot sure I like :like
17:41slyphoni like the idea, though
17:41slyphonsort of "templatized namespaces"
17:42slyphonin ruby, i'd have either a base class or a module i'd import into things for this purpose
17:42tomojwell, I meant I'm not sure if I like the idea
17:42tomojit means you have to run around looking for what's actually in the namespace
17:42slyphonehhh
17:42tomoj(right?)
17:42slyphonwell, you'd probably have one or two central places with the "base" namespaces defined
17:42slyphoni think it'd make things easier
17:43tomojhmm, that's interesting
17:43slyphonlike, i have an exception class that should basically be imported everywhere
17:43tomojI don't think I have enough duplication in my ns decls to benefit much, though, but maybe I just haven't noticed it
19:28merchantlyhi - i'm extremely new to clojure/lisp, so sorry if this is a really lame question. How do you update a value in a set? For example if I have a set (def my-data {"Michael" 25, "Michelle" 26}), how do I update Michael's value to 28?
19:29technomancymerchantly: (assoc my-data "Michael" 28)
19:29programblemerchantly: assoc
19:29programbleaw
19:29programblewas beat to it
19:30merchantlythanks
19:33technomancymerchantly: "How do you update a value in a set?" it's actually in a map fwiw
19:34programbleyer'
19:34merchantlyok thanks, that's helpful
19:34merchantlyis set something else?
19:35carkh#{:a :set :of :5 :values}
19:35carkhalso you're not quite updating the map, you're creating a new map as these are immutable
19:41merchantlywhen I use assoc to create the new map, how come when I call my-data it hasn't changed?
19:42carkhbecause it's immutable
19:42programblebecause your not changing it
19:42carkhcalling assoc returns a new map
19:42carkhbut does not modify the binding of my-data
19:42merchantlyso i have to rebind it?
19:43carkhusually you would use an atom or a ref for that purpose
19:43carkhfor instance : (def my-data (atom {"Michael" 25, "Michelle" 26}))
19:44carkhthen to change michael's age : (swap! my-data assoc "Michael" 26)
19:45carkhthere is a talk somewhere about identity and state
19:45carkhyou might want to check it out
19:46merchantlyok thanks - i'll look it up
19:49carkhhttp://www.infoq.com/presentations/Value-Identity-State-Rich-Hickey
19:49carkhtho infoq is down right now
19:49carkhso i couldn't check if it's the actual talk i'm refering to =/
19:50merchantlyjust read through this: http://clojure.org/state, I "think" I get it
19:51carkhyep good introduction, tho it's always good to hear ritch's talks
19:52carkhhum last thing : don't forget you're now working with an atom, so you can't just use it as a simpe map
19:53carkhto access michael's age you need to do this : (get @my-data "Michael")
19:53carkh@my-data is shorthand for (deref my-data)
20:04merchantlyok so I want to add 1 to Michael's age and then change my-data to reflect that, here's what I came up with: (swap! my-data assoc "Michael" (+ (get @my-data "Michael") 1))
20:04merchantlyis that the right way to do it?
20:04programbleor use inc
20:05programble,(+ 5 1)
20:05clojurebot6
20:05programble,(inc 5)
20:05clojurebot6
20:09merchantlycool - ok I just tried to change that into a function, but I'm missing something: (defn year-older [name] (swap! my-data assoc name (inc (get @my-data name))))
20:09merchantlynm
20:09merchantlyit works
20:09merchantlyawesome
20:10technomancyif you make it a map of names to atoms then you could just swap with inc
20:11technomancy,(let [name "Michael", my-data {name (atom 22)}] (swap! (my-data name) inc) my-data)
20:11clojurebot{"Michael" #<Atom@a3686b: 23>}
20:12technomancydepends on where you want to emphasize the fact of mutability
20:13carkhi would recommend putting the muttable thing as high as possible, make your functions work with and return immutable objects, and have the atom stuff as top-level calls
20:14carkhso to use inc directly : (swap! my-data update-in ["Michael"] inc)
20:14technomancytotally depends on the situation imo
20:14technomancybut bonus points for using update-in
20:15carkhtechnomancy: agreed it depends, but the common case is that you don't need to sprinkle atoms all over the place
20:15carkhor refs
20:16carkhthat would be going back to imperative programming
20:16technomancyneed more context to tell
20:17merchantlyalright im trying to understand each example
20:18technomancythe lack of indentation certainly doesn't help
20:20merchantlyok so in the update-in example, we're taking the value of "Michael", then incrementing it, then updating the value, and then swapping the data in the atom?
20:20carkherrr i'm viewing it the other way around, but yes
20:21merchantlycould you explain how you view it? I'm trying to wrap my head around how to think about it
20:22carkhswap! will make you worl with the value inside the atom, we want to update that value, at the 'Michael' position, there is an age which needs to be incremented
20:22carkhworl->work
20:23carkhexactly what you said, in reverse order =)
20:40merchantlythanks for all the help carkh
20:40carkh=)
20:54RaynesWhere did shuffle go?
20:54RaynesI've noticed it's not in c.c.string.
20:55RaynesOr was it in seq?
20:55RaynesAh, I think it was.
20:56weissjclojurebot: paste
20:56clojurebotlisppaste8, url
20:57weissjlisppaste8: url
20:57weissjhm
20:57weissjsomebody help me out :)
20:58Raynesgist.github.com
21:00weissjRaynes: cool thx
21:00weissjcan someone point me to an example project.clj that has swank-clojure as a dev-dependency? i run lein swank and it complains
21:01weissj#<CompilerException java.lang.ClassFormatError: clojure.contrib.pprint.PrettyWriter (erroneous identifier) (pprint.clj:6)>
21:01weissjMake sure swank-clojure is added as a dev-dependency in your project.clj.
21:01weissji have a feeling it's not really complaining about swank
21:01weissjit's seems to be complaining about pprint
21:15RaynesHrm.
22:20AntonyBlakeyAnyone have a recommendation for unit-testing html generators i.e. parsing and asserting things about html documents?
22:28rlubkeAntonyBlakey: HtmlUnit?
22:28AntonyBlakeyI don't want to simulate the browser
22:28AntonyBlakeybecause I'm dealing with incomplete fragments
22:30AntonyBlakeyBut for full pages and system testing, yes I'd use HtmlUnit.
22:31sattvikAntonyBlakey: I've heard that enlive can be used for scraping HTML. I have not done it, so I do not know how well it would work for testing.
22:31AntonyBlakeyThanks, I'll check enlive as well.
23:11cachouhello~ anyone play robocode here?
23:12cachouI met a problem. "java.lang.ExceptionInInitializerError".
23:13cachouAll code in the internet seems not work. I'am using clojure-1.1.0, Is it a version problem?
23:41LoshaHello
23:42dsnydersHi
23:45LoshaDo people need to be registered to use this channel. Someone was asking on #ubuntu...
23:46hiredmanfreenode instituted a spam fighting measure a while back, but no ops to turn it off
23:46johnmn3test
23:47johnmn3ok, it works.. thanks Losha and dsnyders
23:47johnmn3I had to register
23:47Loshathanks hiredman...
23:47cp2might explain why its been so quiet lately =P
23:48johnmn3I haven't been on here in a while but I was reading my news feeds and I've been noticing the term 'defrecord' ... what's that all about?
23:48johnmn3similar to deftype?
23:50Raynesjohnmn3: http://github.com/richhickey/clojure/blob/master/src/clj/clojure/core_deftype.clj#L189 The doc strings of defrecord and deftype should be enlightening.
23:55johnmn3I did try to read the doc string before. I have a hard time understanding those sometimes.
23:56johnmn3the docs for deftype and defrecord seem similar, though I noticed the bit on IPersistentMap in deftype.