#clojure logs

2009-05-30

00:02cp2"Garbage First, or G1, is a low pause, server style collector. G1's primary advantages over the Concurrent Mark-Sweep (CMS) collector include incremental compaction, better predictability and ease of use.
00:02cp2Although G1 is available for use in this release, note that production use of G1 is only permitted where a Java support contract has been purchased. G1 is supported thru Sun's Java Platform Standard Edition for Business program.
00:02cp2ahhh oracle...
00:11hiredmancp2: I hearing that they said that just because it is alpha and they are covering their backside
00:53hiredmanclojurebot: science?
00:53clojurebotmake a note of http://scienceblogs.com/goodmath/2006/11/the_c_is_efficient_language_fa.php it is yet another article about picking c or c++ for performance being naive
00:54hiredmanclojurebot: science is <reply>"science is whatever we want it to be" -- Dr. Spaceman
00:54clojurebotAlles klar
00:59durka42oh dear
00:59durka42writing about code is a really good way to find bugs, isn't it
00:59durka42finding*
01:00durka42if i fix this bug correctly nothing will change, because there are multiple coincidences hiding it
01:22durka42i'm being asked whether clojure is more similar to CL or scheme
01:22durka42what do y'all think
01:33duck1123durka42: I'm not either, but if I had to guess, I'd say scheme
01:34durka42that was my answer
01:34durka42because, i said, of functional tendencies and lack of cruft
01:35duck1123so does anyone know if clojurescript is fit to write my jquery code yet
01:35duck1123cause I'm much rather be writing clojure right now than js
01:35durka42wouldn't that require porting jquery to clojurescript?
01:35durka42or is there an FFI
01:35rich_holygoatdurka42: conversely, it has a usably large standard library, multimethods are similar to CL generics, and the specifics of the syntax (e.g., defn) remind me more of CL.
01:36durka42good points
01:36durka42i don't know what scheme does for generics
01:37duck1123I assumed that clojurescript was able to interface with pure javascript functions
06:02dejjHow do I turn a StructMap into a dissociatable map?
06:21leafwdejj: add all its values to a new non-struct map.
06:26hoeck /quit bye
06:46dejj@leafw: is there some brief way to do that?
07:05cgranddejj: (conj {} your-struct)
07:07dejjah, thank you
13:01gnuvince_durka42: Url?
13:02durka42one second
13:04durka42i guess i should upload the pictures as well...
13:05durka42that's better
13:05durka42http://durka.github.com/2009/05/28/subleq-assembler.html
13:07rsynnottgithub does blogs now?
13:07rsynnottalso, have you an RSS feed?
13:07rsynnottno use having a blog without an RSS feed
13:07durka42rsynnott: working on that :)
13:07durka42i was going to just use the template engine the github provides to generate one
13:08durka42rsynnott: http://github.com/blog/272-github-pages
13:20durka42oh, excellent
13:20durka42the guy who invented github pages has an auto-generating atom.xml that i can steal
13:27durka42rsynnott: does the RSS feed work now?
14:43achinDoes anyone have any editor/IDE recommendations other than Emacs/SLIME?
15:00hoeckachin: netbeans with enclojure plugin
15:00achinIs that what you use?
15:00hoeckachin: I'm an emacs/slime user, but i tried it once at my windows workstation at work
15:00achinI'm playing with the TextMate bundle now, but it's buggy.
15:00achinHmm.
15:01hoeckachin: and besides beeing not emacs, i really liked it
15:01clojurebotemacs is best configured for Clojure with instructions at http://technomancy.us/126
15:01achinhoeck: Thanks.
15:01hoeckespecially the easy integration of non-clojure libraries and java-code
15:01achinI'll give it a shot.
15:36unlinkWhat's a better way of doing (when-let [a (func)] (when-let [b (func2 a)] (when-let [c (func3 b)] ...))) ?
15:41hiredmanI think there is -?> in contrib
15:41hiredmansomewhere
15:41hiredman~def -?>
15:46unlink1hiredman: that is for dotting
15:47unlink1java stuff
15:47unlink1I basically want nilsafe-comp
15:52hiredmanuh
15:52durka42unlink1: .?. is for java. -?> is like ->
15:53hiredman(-?> (func) func2 func3)
15:57unlink1right
15:57unlink1that's sort of similar, but only threads the 2nd arg
15:57unlink1,((fn [[name]] (-?> (symbol name) resolve)) ["java.lang.String"])
15:57clojurebotjava.lang.Exception: Unable to resolve symbol: -?> in this context
15:57unlink1,(use 'clojure.contrib.core) ((fn [[name]] (-?> (symbol name) resolve)) ["java.lang.String"])
15:57clojurebotnil
15:58unlink1(resolve 'java.lang.String)
15:58unlink1er.
15:58unlink1,(resolve 'java.lang.String)
15:58clojurebotjava.lang.String
15:58hiredman,(-?> (symbol "java.lang.String") resolve)
15:58clojurebotjava.lang.String
15:59hiredman,(-?> (symbol "java.lang.Foo") resolve)
15:59clojurebotjava.lang.ClassNotFoundException: java.lang.Foo
15:59hiredman,(resolve 'java.lang.Foo)
16:00clojurebotjava.lang.ClassNotFoundException: java.lang.Foo
16:01durka42,(-?> (symbol "java.lang.String") resolve newInstance)
16:01clojurebotjava.lang.Exception: Unable to resolve symbol: newInstance in this context
16:01durka42,(-?> (symbol "java.lang.String") resolve .newInstance)
16:01clojurebot""
16:04durka42,(-> (symbol "java.lang.String") resolve .newInstance seq getClass)
16:04clojurebotjava.lang.Exception: Unable to resolve symbol: getClass in this context
16:04durka42,(-> (symbol "java.lang.String") resolve .newInstance seq .getClass)
16:04clojurebotjava.lang.NullPointerException
16:04durka42,(-?> (symbol "java.lang.String") resolve .newInstance seq .getClass)
16:04clojurebotnil
16:10achinHow do I make a new type of seq? i.e. implement ISeq?
16:15hiredmaneasiest is to just make a function that explicitly creates a seq from something
16:15hiredmanlike iterator-seq
16:16quidnuncHow do I implement a selector for text in enlive? I have tried using text-node and (text-pred text-node) as selectors but they don't seem to match anything.
16:57bradfordanyone know of a clojrue lib around hadoop?
16:57bradfordi'm trying to get setup with amazon elastic map reduce and do my mapper sand reducers in clojure
16:58bradfordi saw something from Bendiken but it seems to be donw now
17:43Chouser /nick Chouser_
17:44Chouserah, well...
17:44danlarkintoo many chousers!
17:56j-dotis there any reliable way to get a reference to a function from a string containing the name of the function? Something in the spirit of the following paste ...
17:57lisppaste8j-dot pasted "Getting a function from a string" at http://paste.lisp.org/display/81089
17:57hiredman,(resolve (symbol "+"))
17:57clojurebot#'clojure.core/+
17:57hiredman,((resolve (symbol "+")) 1 2)
17:57clojurebot3
17:57j-dotahh, thank you!
17:57j-dotI knew it was there somewhere
17:58hiredmanthat is actually the var, but vars dispatch function calls to their contents
17:58Chouserbe aware that resolves in a globall context. Using your macro inside a fn and giving it the name of a local won't work.
17:59j-dotthanks, Chouser ... I'm only interested in resolving a few fns from clojure.core for now
20:11bradford,(#({:a %}) 10)
20:11clojurebotjava.lang.IllegalArgumentException: Wrong number of args passed to: PersistentArrayMap
20:12bradfordhow do i do something liek that?
20:13bradford,((fn [b] {:a b}) 10)
20:13clojurebot{:a 10}
20:14bradfordhmmm - what is it about the # version of hte lambda that doesn't work for building the literal map in this case?
20:46Chouserthe #() includes the inner parens
20:46Chouser#({:a %}) is like (fn [x] ({:a %}))
20:50quidnuncAnyone know how the text-node selector is used in enlive?
20:55Roland_LWhi
20:56rhickeyhi
20:56Roland_LWWhat is the best web framework for clojure?
20:56slashus2,(#(map :a %) 10)
20:56clojurebotjava.lang.IllegalArgumentException: Don't know how to create ISeq from: Integer
20:57rhickey,(#(hash-map :a %) 10)
20:57clojurebot{:a 10}
20:58slashus2oops
20:58quidnuncRoland_LW: Is there something besides compojure?
20:58rhickeyRoland_LW: compojure seems to have the most activity: http://groups.google.com/group/compojure
20:58Roland_LWI don't know even compojure, I'm new to this
20:58slashus2I completely lost my mind there.
20:59rhickeyslashus2: no worries, map is heavily overloaded
20:59quidnuncBest is easy to evaluate when there is a single contender.
20:59Roland_LWIs compojure ready for production use? I'm planning to do a serious project and we are choosing between Ruby and Cojure
21:00Roland_LWClojure
21:07Roland_LWanyone? ;)
21:07Roland_LWAnyone ever faced the decision Ruby(on Rails) vs. Clojure?
21:08rhickeyRoland_LW: you might want to join the Compojure group and ask there - more likely to get Compojure users than are here right now
21:10Roland_LWrhickey: yeah, you have a good point there. :)
21:11quidnuncRoland_LW: I can't imagine that Compojure is more mature than Rails.
21:11Roland_LWquidnunc: sure, but more mature doesn't mean that Rails is better. Also, we are planning for the future here
21:11quidnuncor is near the maturity of Rails. Not that that is praise for ruby
21:12slashus2Does compojure have a website yet?
21:14Roland_LWslashus2 compojure.org is not up yet
21:37spooonI understand why seqs need the new rest method in order to be fully lazy, but why keep next around on the ISeq interface?
21:38spooonCan't next be implemented in terms of rest?
22:34arkadybeen trying some basic socket IO, is there a class like BufferedReader which doesn't block on readLine if no data is available?
22:36slashus2arkady: Have you looked at java.nio ? I think that stuff is for non-blocking IO. I don't know if that is what you are looking for.
22:38arkadyslashus2: seen that, looks like overkill
22:39arkadyslashus2: shouldn't bufferedreader return 'nil' if it doesn't have a proper line?
22:39Chouserwouldn't you have to poll it then? :-/
22:39ChouserClojure works nicely with threads -- you don't want a separate thread blocking on the socket?
22:40arkadyyeah, that will probably work
22:41arkadydoes clojure have a special thread construct, or do I have to use the Thread class manually?
22:44arkadydocumentation is really rather scant
22:46Chouserfor?
22:46Chousereverything? :-)
22:47slashus2arkady: It is easy to create a thread because clojure functions implement runnable.
22:47slashus2,(.start (Thread. (fn [] (println "hello"))))
22:47clojurebotnil
22:47arkadyah, right
22:48arkadythanks. just figured there was some "proc" syntax or something
22:51slashus2,(.get (future (println "hello")))
22:51clojurebotnil
22:58Chouserprinln returns nil, even in the future.
22:58Chouserprintln
22:59slashus21000 years in the future.