#clojure logs

2009-01-16

00:22durkais it possible to define a lazy seq that is reified 100 elements at a time
00:22durkai suppose i could just use flatten
00:32durkaso given that the namespaces a.b.c and a.b.d exist, and a.b.c/f and a.b.d/g are functions in them
00:32durkai sort of want to do this
00:33durka(use 'a.b)
00:33durka(c/f "blah") (d/g "quux")
00:33durkabut it doesn't work
00:34durkais there a way to do that kind of thing?
00:37Chouser(require '[a.b.c :as c] '[a.b.d :as d]
00:37Chouser)
00:37ChouserI think.
00:38Chouseror even: (require '(a.b [c :as c] [d :as d]))
00:38durkathanks
03:38slevenwhy is it much faster to write to Derby than to postgresql?
04:58timothypratleyIn Rich's ants.clj there is a global 'running', how does this get set to false? [is it ever?]
05:01hiredmanit would have to be a binding, a set!, or a def
05:01hiredmanI have not looked at ants.clj, but maybe running is a flag, and if you set it to false the simulation stops
05:02timothypratleyhttp://clojure.googlegroups.com/web/ants.clj
05:02timothypratleyyeah that's what I thought,
05:02timothypratleyexcept it never gets set to false
05:02hiredmanI imagine you would set it to nil in the repl
05:03timothypratleyah :)
12:34danlarkinthis is a goof, http://kiwi.cabal.fi/home/aki/misc/cons-ceremony.txt
12:41durkaheh
12:41durkabit of a verbose trace there
13:20Lau_of_DKGood evening all
13:23cgrandevening, Lau!
13:23durkagood afternoon
13:23Lau_of_DK;)
13:49clojurebotsvn rev 1216; lift loops from expression contexts
14:03kefkaI'm using Svn rev 1178. I do not have gen-and-save-class. Do I need a newer version of Clojure?
14:06danlarkinkefka: why not update anyway, you'll get lots of bug fixes :)
14:06hiredmanthe gen-and-save stuff is mostly gone
14:06danlarkinregarding your question, though, gen-and-save-class is old school
14:06hiredmana lot of changes in those areas
14:07kefkaOk, so gen-and-save-class is outdated? What do I do if I want to generate a .class file on the fly?
14:07hiredman,(doc compile)
14:07clojurebot------------------------- clojure.core/compile ([lib]) Compiles the namespace named by the symbol lib into a set of classfiles. The source for the lib must be in a proper classpath-relative directory. The output files will go into the directory specified by *compile-path*, and that directory too must be in the classpath.
14:07hiredmaner
14:08hiredmankefka: you should avoid generating .class files on the fly
14:10kefkahiredman: Ok. So what are current best practices for generating a standalone executable?
14:10hiredmanwhat are you doing that requires it?
14:10hiredmanclojurebot: stand alone?
14:10clojurebotExcuse me?
14:10kefkaI'm sending an executable to a remote machine that has the JVM but not a Clojure intrepreter.
14:10hiredmankefka: well, you will need the clojure.jar regardless
14:11clowsthat clojurebot doc just made me realize what i did wrong with gen-class :)
14:11hiredmanthe class clojure generates are just stubs that call to clojure
14:15clowsif I wanted to subclass a swing class and use that in clojure (and also call methods of that subclass form clojure). would using gen-class allow me do to that?
14:16Chousukegen-class or proxy perhaps
14:16hiredmanclows: I would look at proxy
14:17clowsI tried proxy first but i can't seem to be able to access the added methods
14:17hiredmanproxy does 90% of what people want from gen-class and does it with less fuss and muss
14:17hiredmanoh
14:17hiredmanyeah
14:17clowsmight be my fault ofc
14:17hiredmannah
14:17hiredmanproxy doesn't let you add methods
14:17hiredmanthat is right, for subclassing you still want gen-class
14:17clowsok
14:18hiredmanclojurebot: gen-class?
14:18clojurebotNo, hiredman, you want gen-interface + proxy
14:18clowsI'm thinking just doing that stuff in java might be the best way to go anyway ... it kinda gets messy in clojure
14:18ChousukeAFAIK if you only need to override superclass methods then proxy works. otherwise you need gen-class
14:19clowsthat'd explain i think
14:20hiredmanhttp://clojure.org/compilation <-
14:22hiredmanhttp://gist.github.com/34229 <-- nasty bean maker macros using gen-class
14:23hiredmanhmm
14:23clowsI struggled with gen-class because i didn't have the right classpath ... meh ... but it seems to work now. thats a start :)
14:26Chousukegen-class is a lot easier to use now than it used to be though :P
14:28clowsit seems easy enough. once you read about *compile-path* ...
14:31Chouser_one thing to keep in mind is that lots of stuff that in Java would require a subclass with new methods or data members can be done in Clojure with proxy and closures.
14:32Chouser_If you really truly need new methods, then you will have to compile something (gen-class or gen-interface)
14:33Lau_of_DKChouser_: Why isnt your nick verified?
14:33Lau_of_DKregistered
14:50pjb3I'd like to have a ref that contains a vector
14:50pjb3and have some way to call a function like take on it
14:50pjb3where it returns n items from the vector, but also removes them from the vector in the ref
14:51pjb3but obviously in a safe way, so if there are multiple threads pulling stuff from the ref, things don't get taken twice by different threads
14:51pjb3does that make sense? ideas?
14:51pjb3Is there a name for that kind of pattern?
14:52durkathat's a transaction isn't it
14:53pjb3well, it would probably invlove a transaction
14:53pjb3but in thinking about it initially it's tricky because you want to modify what's in the collection
14:54durka(doc pop)
14:54clojurebotFor a list or queue, returns a new list/queue without the first item, for a vector, returns a new vector without the last item. If the collection is empty, throws an exception. Note - not the same as rest/butlast.; arglists ([coll])
14:54hiredmanpjb3: you want a write lock
14:54hiredmanor whatever it is called you you block others from writing
14:54pjb3hiredman: yeah, but I thought the whole point of clojure was to avoid having to manage locks :)
14:55pjb3,(pop '(1 2 3))
14:55clojurebot(2 3)
14:55hiredmanpjb3: depends
14:55pjb3see, but I need the 1 as well
14:55hiredman(doc peek)
14:55clojurebotFor a list or queue, same as first, for a vector, same as, but much more efficient than, last. If the collection is empty, returns nil.; arglists ([coll])
14:55pjb3,(peek "xyz")
14:55clojurebotjava.lang.ClassCastException: java.lang.String cannot be cast to clojure.lang.IPersistentStack
14:55pjb3,(peek [1 2 3])
14:55clojurebot3
14:56hiredman,(peek (seq "xyz"))
14:56clojurebotjava.lang.ClassCastException: clojure.lang.StringSeq cannot be cast to clojure.lang.IPersistentStack
14:56hiredmanI see
14:56pjb3,(peek '(1 2 3))
14:56clojurebot1
14:56hiredmanactually
14:56hiredmanyeah, transactions, thats the ticket
14:56pjb3What I want is:
14:57pjb3(def stuff (ref '(1 2 3)))
14:57pjb3(take-and-remove 2) => (1 2)
14:57pjb3@stuff => (3)
14:57hiredmanso if you do the read and write in the same dosync block
14:58hiredman(same transaction)
14:58pjb3,(take 2 '(1 2 3 4 5))
14:58clojurebot(1 2)
14:59pjb3,(drop 2 '(1 2 3 4 5))
14:59clojurebot(3 4 5)
14:59pjb3ah, there it is, do that in a dosync
15:00hiredman(doc split-at)
15:00clojurebotReturns a vector of [(take n coll) (drop n coll)]; arglists ([n coll])
15:00pjb3,(split-at 2 '(1 2 3 4 5))
15:00clojurebot[(1 2) (3 4 5)]
15:01durkaheh, the source of split-at is its docstring
15:01Chousuke:)
15:01tomswCan anyone explain why I get a "method not found" error from java when I try this: (doto (javax.swing.JFrame.)
15:01tomsw (.setLayout (java.awt.GridLayout. 2 2 3 3)))?
15:02tomswIt's from http://en.wikibooks.org/wiki/Clojure_Programming/By_Example - I'm just trying to get the hang of things
15:02hiredmantomsw: $5 says you have an old version of clojure
15:02hiredmanwhat is the exact message?
15:03tomswhiredman: java.lang.IllegalArgumentException: No matching method found: .setLayout for class javax.swing.JFrame (NO_SOURCE_FILE:0)
15:04hiredmanyeah
15:05hiredmanyou are using the new doto syntax with an old version of clojure
15:05pjb3I don't get an error when I run that, just seems to not really do aything
15:05pjb3other than return the JFrame
15:05pjb3oh yeah, that's probably it
15:05durkawell it won't until you .show the JFrame
15:05pjb3(.show *1)
15:05pjb3and there it is :)
15:05hiredmanyou can tell because of the ".setLayout" the fact that it sees the "." in the method name
15:06tomswhiredman: you mean it should be trying to call "setLayout" without the leading dot
15:06hiredmanyes
15:06hiredmanclojurebot: svn?
15:06clojurebotsvn is http://clojure.googlecode.com/svn/trunk/
15:07Chousuketomsw: download the newer release from google code, or get the latest SVN
15:07tomswhiredman: thanks. I'll install it & pester you all with silly questions in a bit :)
15:07Chousukeclojurebot: download
15:07clojurebotdownload is http://code.google.com/p/clojure/downloads/list
15:14Chouser_pjb3: you have your transaction function worked out?
15:16pjb3Chouser_: Yeah, I haven't written it out yet, but it should just be (let [things (take n the-list)] (drop n the-list) things)
15:16pjb3how do I set the ref to the dropped version of the list?
15:17hiredman(doc alter)
15:17clojurebotMust be called in a transaction. Sets the in-transaction-value of ref to: (apply fun in-transaction-value-of-ref args) and returns the in-transaction-value of ref.; arglists ([ref fun & args])
15:18Chouser_(dosync (let [things (take n the-list)] (alter the-list drop n) things)) I think
15:19pjb3(def stuff (ref '(1 2 3 4 5 6 7 8 9)))
15:19pjb3(dosync (alter stuff drop 3))
15:19pjb3java.lang.ClassCastException: clojure.lang.PersistentList
15:19pjb3same for
15:19pjb3(dosync (alter @stuff drop 3))
15:19Chouser_ah, indeed. (alter stuff #(drop 3 %))
15:20durka(alter stuff (switch drop) 3)
15:20durka(defn switch [f] #(f %2 %1))
15:20Chouser_heh
15:20durkai find myself using that all the time
15:20Chouser_really? I just use #(foo arg %)
15:21pjb3What's the difference between alter and commute
15:21pjb3?
15:21pjb3(doc alter)
15:21clojurebotMust be called in a transaction. Sets the in-transaction-value of ref to: (apply fun in-transaction-value-of-ref args) and returns the in-transaction-value of ref.; arglists ([ref fun & args])
15:21pjb3(doc commute)
15:21clojurebotMust be called in a transaction. Sets the in-transaction-value of ref to: (apply fun in-transaction-value-of-ref args) and returns the in-transaction-value of ref. At the commit point of the transaction, sets the value of ref to be: (apply fun most-recently-committed-value-of-ref args) Thus fun should be commutative, or, failing that, you must accept last-one-in-wins behavior. commute allows for more c
15:22pjb3I guess commute is faster, so if your operation is communative, you would use that instead of alter?
15:22clowsjava.lang.NoSuchMethodError: clojure.lang.Util.equal ... has that method been renamed by any chance?
15:22Chouser_commute is to be used on commutative functions, alter for others
15:23pjb3I assume replacing the value of a ref with another value is not communative
15:23pjb3especailly in this case
15:23pjb3so alter is needed
15:23durka,(show clojure.lang.Util)
15:23clojurebotjava.lang.Exception: Unable to resolve symbol: show in this context
15:23durkaclows: there is a static equals method, is that it?
15:23Chouser_no, alter and commute are always for replacing the value of a ref with another. The difference is the function you pass to each of them.
15:24Chouser_I used 'alter' because it's safer. It takes thought to determine if 'commute' will be ok in a given situation.
15:24pjb3,(def x (ref 1))
15:24clojurebotDENIED
15:25clowsdukra: yeah i think so
15:25clowsI get this error message when trying to (load-file) my test file... java.lang.NoSuchMethodError: clojure.lang.Util.equal(Ljava/lang/Object;Ljava/lang/Object;)Z (internal.clj:26)
15:26Chouser_clows: you may need to do a clean and rebuild of clojure, those functions have changed recently.
15:26pjb3(def x (ref 1))
15:26pjb3(dosync (alter x inc))
15:26clowsI thought I did but ... yeah will do again :)
15:26pjb3(dosync (commute x inc))
15:26Chouser_cleans are supposed to happen automatically now, but someone on the group said that fixed a similar problem for them.
15:27pjb3so both of those work, but in that case, you want to use commute, because the operation is communative
15:27Chouser_pjb3: the difference will only show up under contention, when two threads are in the transaction at the same time.
15:27pjb3I'm not sure I understand how to tell if my function is communative
15:27Chouser_for your 'drop' case, i'm pretty sure you need 'alter'
15:27pjb3Chouser_: yeah, I agree
15:28pjb3Or would you?
15:28pjb3Because if I have 2 threads that need to get 10 items from the list
15:28pjb3to work on
15:28pjb3they don't care which ones
15:28durkaif you don't care which one gets in first...
15:28durkathen it should be commutative
15:28rhickeypjb3: you must use alter
15:29durkai stand corrected
15:29durkawhat did i miss
15:29pjb3The thread doesn't care which items it gets, so shouldn't that be communative?
15:29Chouser_with commute, you may see a different value for the ref than will actually be committed.
15:29rhickeypjb3: it does care that it doesn't get he same items as another
15:30pjb3(dosync (let [items (take 5 stuff)] (comute stuff #(drop 5 %))))
15:30clowsI think it's a clojure contrib issue (I might have to update that too) :)
15:30pjb3that's what we are talking about doing
15:30Chouser_In your case if you used commute, the list would always shrink by the right amount, but two threads may get overlapping values, and other may get skipped.
15:30pjb3rhickey: that is true
15:30rhickeypjb3: that's plainly read-modify-write, must be alter
15:31pjb3rhickey: Ok, I'll take your word for it, like you said yesterday, I obviously need to read Java Concurrency in Practice
15:31rhickeycommute is for things like a tasks-done counter, each transaction wants to increment it, but doesn't care about specific before/after values
15:31pjb3so when doing alter
15:31pjb3with the dosync above
15:31pjb3or commute I mean
15:31pjb3in the case above
15:32pjb3if the transaction detects there is a conflict, it won't run the take again?
15:32rhickeypjb3: with commute there is never a conflict
15:32rhickeyeach transaction takes the at-commit time value and modifies it
15:33rhickeyyou need alter, gotta run...
15:33pjb3rhickey: thanks, I believe you, just trying to understand it better
15:34Chouser_pjb3: I believe the commutes will get queued up and applied again later.
15:36pjb3Chouser_: so what happens with alter?
15:37Chouser_with alter, if there's a conflict the whole transaction will be retried.
15:37Chouser_I think. :-)
15:37pjb3and what does "the whole transaction" mean?
15:37Chouser_The outermost enclosing dosync
15:37pjb3because I assume that means everything in the body of the dosync, right?
15:38Chouser_yes
15:38pjb3so if the ref has the numbers 1 - 9 in it
15:38pjb3then thread a starts the dosync from above
15:38clows(updating clojure-contrib fixed that btw .... I love it when i trip over my own feet)
15:38pjb3first is does take 3 on the ref
15:38pjb3which returns 1 2 3
15:38pjb3then thread b does take 3 on the same ref, also returning 1 2 3
15:39pjb3then thread a does the drop in the alter , which leaves 4 - 9 in the ref
15:39pjb3then thread b tries to do the the drop, which would also leave 4 - 9, but that's a conflict
15:40pjb3so then thread b should restart that dosync, do take 3 which this time returns 4 5 6, because the ref has been altered by thread a to have just 4 - 9 left
15:40hiredmanin a comute there is no conflict
15:40pjb3then thread b does the drop, leaving 7 8 9 and everybody is happy
15:40hiredmanyou are describing alter's behaviour
15:40Chouser_pjb3: I think that's right.
15:41pjb3thread a got 1 2 3 and thread b got 4 5 6
15:41pjb3hiredman: so what happens differently if I replace alter with commute?
15:41hiredmanin a comute, the last one in wins
15:41pjb3so in the case of commute, if would just blindy do the drop, not checking for conflicts?
15:42hiredmanthere are no conflicts with commute
15:42pjb3gotcha
15:42hiredmanso why would it check?
15:42pjb3so a transaction never restarts when there is just commute in there
15:42pjb3I get it now
15:43pjb3so to round out my example from above, if I incorrectly did commute instead of alter, both threads would get 1 2 3
15:43pjb3which is wrong
15:43pjb3and 4 - 9 would be left in the ref
15:43Chouser_two threads doing the commute, each dropping 3 would still end up dropping 6 total.
15:44Chouser_no, 7-9 would be left in the ref
15:44Chouser_the commutes would all happen, just not necessarily in the same order as seen inside the transactions.
15:48pjb3Chouser_: ah, you are right, both threads would get 1 2 3, but would each drop, so only 7 8 9 would be left
15:48pjb3so 1 2 3 would get processed twice
15:48pjb3and 4 5 6 never would
15:48Chouser_I think that's right.
15:49pjb3that;s all assuming the threads actually interleave in that way I described above
15:49Chouser_right, it would be a race condition -- sometimes you'd get unwanted results.
15:49pjb3this would definitely be one of those nasty concurrency bugs you might not catch until the app is in production
15:49Chouser_which is why I use 'alter' until I'm quite sure that 'commute' is ok.
15:49Chouser_:-)
15:50rhickeypjb3: alter is always correct, so no need to get into commute until you are trying to solve a performance issue
15:50pjb3rhickey: good point
15:50pjb3or unless it is a simple counter and you are just using inc
15:51rhickeypjb3: there are lots of valid uses of commute, like making an entry in a map
15:51pjb3sure
15:51Chouser_I wonder if premature optimization is frequently caused by insufficiently interesting problems.
15:51rhickeyyou don't care if someone has added something else in the meantime
15:51rhickeyChouser_: :)
15:51pjb3rhickey: you might care if someone has already set a value for that key, right?
15:52rhickeypjb3: yes
15:52rhickeymore useful for a cache-like thing
15:52Chouser_the function you pass to commute will be run twice?
15:53rhickeyor generated keys
15:53pjb3rhickey: you missed it while you were gone, but now I actually understand why I need to use alter :)
15:53rhickeyChouser_: yes, twice
15:53rhickeypjb3: great!
15:54Chouser_so merge-with might sometimes be a useful option in a commute.
15:59rhickeyChouser_: yes, good example
16:12rfgpfeifferJava interop seems to choke on inner classes
16:12rfgpfeifferhttp://gist.github.com/48138
16:16rfgpfeifferI don't use inner classes myself, i found this in a paper and wanted to try it out on the REPL
16:16Chouser_rfgpfeiffer: the problem is not the inner class but the anonymous package
16:17Chouser_I moved R into a package P, and then (.makeAnI (new P.R)) works fine, no import needed.
16:18rfgpfeifferChouser_: thanks, I will try it
16:26edwHi. My net connection sucks (or will suck once I leave the coffee shop) and I was wondering if there's a nice downloadable set of docs (PDF, HTML tarball, or something similar).
16:27Chousukewell, you can always use find-doc and doc in a clojure REPL. Other than that, there's the (non-free) clojure book beta
16:28Chouser_there's a PDF of the website, but it may be too out-of-date now to bother with.
16:29hiredmanyou could just print the website to pdf
16:29Chousukethough special forms don't have very useful doc strings. All the info of them is on the website
16:29Chouser_the html pages have print stylesheets, so yeah, you might try what hiredman said.
16:29edwThanks. I haven't read enough of the docs to know that procedures have documentation.
16:30Chousuke(doc find-doc)
16:30clojurebotPrints documentation for any var whose documentation or name contains a match for re-string-or-pattern; arglists ([re-string-or-pattern])
16:37edwThanks. I'm making about 40 PDFs right now.
16:38danlarkinyou can always just download a copy of the website if you want
16:41pjb3danlarkin: how do you download a copy of the website?
16:42danlarkinwget can follow links
16:44hiredmanlooks like however I did it already got pushed out of my shell history
16:44pjb3danlarkin: Is it really as easy as wget --magic http://clojure.org?
16:44pjb3or do you have to do a bunch of hacking to get a reasonable local copy?
16:46danlarkinyeah, wget -m http://clojure.org
16:46hiredmanI think http://www.easysw.com/htmldoc/ is what I used
16:46hiredmanmade a pdf of the website
16:47pjb3danlarkin: that didn't work, some error about a certificate
16:48hiredmanactually I guess I used the .org version
16:48pjb3wget --no-check-certificate -m http://clojure.org
16:48pjb3that gets past the cert error, but then you only get index.html
16:51danlarkin*shrug*
16:51danlarkin-m stands for --mirror
16:51danlarkinwhich "Turn on options suitable for mirroring. This option turns on recursion and time-stamping, sets infinite recursion depth and keeps FTP directory listings."
16:51pjb3danlarkin: hmmm..well, it don't work :)
17:01danlarkinok, here's an incantation that works for me
17:01danlarkin wget --no-check-certificate --mirror -k -w 2 -p clojure.org --convert-links clojure.org
17:02danlarkin-p flag probably not necessary
17:09pjb3danlarkin: all the links start with /
17:10pjb3Would have to either run it through a web server locally or figure out a way chomp those off
17:11danlarkindonno, I'm no wget master
17:11danlarkinmaybe there's an option for chomping those
17:26danlarkinif I'm merging two hash-maps together and I want to remove an element from the first, the appropriate way to do that would be associate it with nil in the second, right?
17:26danlarkin,(:foo (merge {:foo 'bar} {:foo nil}))
17:26clojurebotnil
17:26danlarkin,(:foo {:not-foo 'bar})
17:26clojurebotnil
17:27Chouser_a nil value is not the same as a non-existent entry
17:28Chouser_I don't think there's any way to use merge or merge-with and end up with fewer entries than when you started.
17:28danlarkinyeahh
17:28Chouser_do you have a list of keys you want to remove?
17:28hiredman(doc dissoc)
17:28clojurebotdissoc[iate]. Returns a new map of the same (hashed/sorted) type, that does not contain a mapping for key(s).; arglists ([map] [map key] [map key & ks])
17:29danlarkinWell I want a function to return a hash-map and I'll merge that with another
17:29danlarkinbut if the function wants to /remove/ an element...
17:29hiredmandissoc
17:30Chouser_can it return a 2-item vector? [#{set of keys to dissoc} {map to merge}) ?
17:30danlarkinHmm
17:30hiredman,(dissoc {:a 1 :b 2} :a)
17:30clojurebot{:b 2}
17:30danlarkinChouser_: yes I suppose it could, although that's uglier :-/
17:30hiredman,(apply dissoc {:a 1 :b 2} #{:a :b})
17:30clojurebot{}
17:31hiredmandanlarkin: why can't the function just dissoc the element it wants to remove?
17:32Chouser_danlarkin: if you're sure you never want to have a nil value in your final map, I bet we could write something nice to use nil as a sentinel to mean dissoc
17:32danlarkinhiredman: because if I have the function return a hash-map and merge that with another that's no different than just not returning the element from the function
17:33danlarkinChouser_: mmm. yeah it will be allowed nils now that I think about it. I guess I could use :BALLS or something :)
17:34danlarkinperhaps I'll just have this function return the entire map and not merge it, even though that's amazing either
17:34Chouser_yeah, you could pass in the other map and have the function do the merging.
17:35danlarkinyeah
17:37clowswhen i have an anonymous function within an anonymous function *ponder* what does % refer to in that case?
17:38danlarkincan't nest #() forms
17:38clowsok
18:07danlarkinso who's excited for a sweet night of clojure programming?!
18:08rhickeyI am!
18:08danlarkinwoo hooo
18:13grosourshi there
18:14rhickeyhi
18:26stuhoodcould coercion and type hinting be combined somehow?
18:26stuhoodthe coercion example on the wiki is really simple, but it is already an example of coercion being ugly
18:27stuhoodfrom
18:27stuhood(defn foo [n] (loop [i 1] (if (< i n) (recur (inc i)) i)))
18:27stuhoodto
18:27stuhood(defn foo2 [n] (let [n (int n)] (loop [i (int 0)] (if (< i n) (recur (inc i)) i))))
18:29stuhoodwould be nicer to use:
18:29stuhood(defn foo [#^int n] (loop [#^int i 1] (if (< i n) (recur (inc i)) i)))
18:29dreishI think having to give extra information to the compiler so it can make your code go faster is always going to be inherently "ugly". That's somewhere way down the list of reasons premature optimization is forbidden.
18:29hiredmanstuhood: how is that nicer?
18:30stuhoodit doesn't contain another level of nesting
18:30stuhoodfor the let
18:30sp00oonhey all. was wondering if it was worth my time & money to buy the Stuart Halloway beta book
18:31dreishsp00oon: If you're just starting out, I'd say absolutely.
18:40sp00oondreish: Yes. Am just getting my toes wet ;) Thx.
18:42stuhoodalso, it isn't really worth making a ticket about, but 'foo2' at http://clojure.org/java_interop#toc36 won't compile because it contains an extra paren
19:45LARefugeeAnyone see Charles Nutter's recent talk about the JRuby implementation at InfoQ?
19:58danlarkinLARefugee: I haven't, link me?
20:00LARefugeedanlarkin: http://www.infoq.com/presentations/nutter-jruby-jvm-lang-summit;jsessionid=4F95BB3A93601B4AE6F69BE064CEBEDD
20:00danlarkinthanks
20:01LARefugeeIt was gnarly. Ruby is very difficult to make fast.
20:01LARefugeeOn the jvm at least
20:04dreishYet just when you thought no one could invent a slower language, along comes Groovy.
20:06bitbcktLARefugee: it isn't particularly quick on C, either. REE is somewhat better, though.
20:08bitbcktCharlie likes to puff about JRuby being comparable in speed to Ruby 1.9 and quicker than Ruby 1.8.6
20:08bitbcktbut that really isn't saying much
20:22LARefugeeI haven't looked at REE too closely. Besides better memory performance what's the biggest win?
20:25LARefugeeRuby's been around since 1993! No decen implementation yet. 1.9 was supposed to be a proof-of-concept on the way to 2.0.
20:27LARefugeeI was thinking JRuby might be it but after Nutter's talk I'm not so sure people should trust it.
20:40danlarkinthis talk makes me think JRuby is just like
20:40danlarkinnot worth it
20:40danlarkinwith the amount of work arounds they have to do
20:42LARefugeedanlarkin: I've read Nutter say that the jvm is a good platform for dynamic languages. Sure didn't seem like it, at least not for ruby.
20:44danlarkinsrsly
20:55dreishI think it helps if your language features correspond reasonably closely with what the computer can actually do in a reasonable amount of time.
22:26LARefugeeclojurebot: logs?
22:26clojurebotlogs is http://clojure-log.n01se.net/
22:57Chouserclojurebot, mind your grammar. "logs are"
22:57danlarkinpatches welcome
22:57Chouserheh
22:57danlarkincouldn't resist, haha
23:00danlarkin:-o someone actually using clojure-json, sweeeet http://github.com/sethtrain/clojure-github/blob/e27d790078307ecf40840d1c0f9817e03f8e6ea3/src/org/buntin/github/email.clj
23:04danlarkinI might change the namespace
23:04danlarkinhaving my name in there bothers me
23:05durkai mean, you did write it
23:06danlarkinyeah but
23:06danlarkinit's lame
23:07Chouserdanlarkin: have your CA in? You could lobby to have it in contrib.
23:08danlarkintrue
23:20durkagoodnight all
23:20durkathis marks the end of winter break, so we'll see how much time school permits for clojure hacking
23:22danlarkinyou make your own destiny!
23:44danlarkinjoshua choi's fnparse is really cool
23:57danlarkinnow if I could just remember BNF from university