#clojure logs

2011-08-18

00:24callenokay okay
00:24callenwhat happened to leiningen?
00:24callenlein swank disappeared, lein repl claims to start a socket server, but slime connect against that port doesn't work.
00:25amalloy$google lein swank plugin install
00:25lazybot[technomancy/swank-clojure - GitHub] https://github.com/technomancy/swank-clojure
00:28callenclojure-jack-in isn't coming up in my completions for the latest version of clojure-mode either.
00:29callenclojure-jac [No match]
00:29callenand it matches the raw version of the latest clojure-mode.
00:33scottjcallen: maybe you're using the wrong elpa repo
00:34callenNo I manually added it.
00:34scottjdid you byte compile it and that version not the source is being loaded?
00:34callenthink I have it now.
00:35callenI'll have an answer momentarily. It's stuck on "Starting swank server..." for clojure-jack-in atm.
00:35callenI wrapped it in my safe-load function.
00:36callengot it.
00:37callenscottj: I avoid using package managers for my emacs.
00:37callenscottj: my .emacs.d is eldritch and custom-assembled from long before marmalade existed. :)
00:37duncanmamalloy: i feel like a newbie asking this, do you know about this slime-clj is void issue?
00:37callenscottj: thanks for the pointers though.
00:37amalloyduncanm: i don't know anything about it
00:43duncanmhmm
00:44duncanmis slime-ritz the preferred way to run clojure in slime now?
00:51scottjduncanm: almost everyone is still using slime-clojure
00:51scottjritz = slime-clj, if you want to do debugging it has the best interface imo
00:52duncanmscottj: yeah, i'm back to using swank-clojure
00:52scottjit has cool features too like if you eval multiple lines in the repl and there's an exception it will tell you what line it came from, wherease swank-clojure says some no source thing
00:54scottjif you use it with openjdk it's pretty pimp you can step through you code, the code for clojure, and the code for the jvm
01:10grant_so in my code i have (loop [stuff] (my-fn) (recur bla bla)). and its great because i can tweak my-fn and send it to the repl and it gets updated every loop pass
01:11grant_but eventually i wanted to do some abstraction so instead of my-fn its a variable that i'm passing in that gets set once to my-fn (at the start of the program)
01:11grant_but that means i can't tweak any more because the variable seems to be holding onto the old function
01:12grant_is there any way to propagate my tweaks to all functions? or what is the right way to solve this problem?
01:14amalloygrant_: is the actual function my-fn still global?
01:15grant_yes
01:15amalloyif so, you can pass in #'my-fn instead of my-fn
01:15grant_that is an interesting bit of syntax
01:15grant_what is it?
01:15amalloy&(quote #'inc)
01:15lazybot⇒ (var inc)
01:15amalloy&#'inc
01:15lazybot⇒ #'clojure.core/inc
01:15amalloy&inc
01:15lazybot⇒ #<core$inc clojure.core$inc@14e1328>
01:16grant_interesting...
01:16amalloy&@#'inc
01:16lazybot⇒ #<core$inc clojure.core$inc@14e1328>
01:16grant_ok now you're just trying to scare me :)
01:17amalloyheh
01:17amalloynah. just pointing out that derefing a var gives you its value
01:17grant_i see
01:18grant_that's awesome, that fix 'just worked'
01:18jblomoin clojurescript, i'm seeing undefined *ns* and ns-aliases. are these in the "eventually will implement" or "will not implement" list?
01:19grant_thanks a lot
01:19amalloygrant_: if i wanted to scare you with a raft of punctuation i could do worse :)
01:19grant_:)
01:26scottjtbatchelli: you missed pacman :)
01:27tbatchellidid I? I just got the tweet
01:27tbatchelliunfortunately, it crashes Safari
01:28scottjahh I guess not, the release was ~7 hours ago but I guess no one tweeted about it
01:28tbatchelliI guess so
01:28scottjI think it only works in chrome and firefox 6
01:28tbatchelliworks on chrome, that I know
01:28tbatchellivey cool
01:29tbatchellithe other day I made the bold statement that in a few years, not many, there will be more ClojureScript out there than JVM Clojure, and I wasn't drunk
01:29scottjI didn't realize you can zoom in and it sitll works fine
01:30srid$google clojure pacman
01:30scottjI think it's funny that he added doom and vim keybindings
01:30lazybot[Monads in Clojure] http://intensivesystems.net/tutorials/monads_101.html
01:30tbatchelliso far facts are backing me up
01:30scottjtbatchelli: one thing that is cool about this is he doesn't need appengine or heroku bc the entire app can run off github
01:31scottjsrid: http://mjg123.github.com/pacman/pacman.html
01:31tbatchelliscottj: indeed. That's some feature. I guess that's a good thing about javascript
01:33scottjI just changed clojure-mode to make it not load slime for cljs files, so I can use inferior-mode with the browser cljs branch and C-x C-e both cljs and clj forms and the clj ones go to slime and cljs to the browser via inferior-lisp
01:36sridOn his next walk with Qc Na, Anton attempted to impress his master by saying “Master, I have diligently studied the matter, and now understand that objects are truly a poor man’s closures.” Qc Na responded by hitting Anton with his stick, saying “When will you learn? Closures are a poor man’s object.” At that moment, Anton became enlightened.
01:36sridwhoa!
01:36sridI understand zen now. ;-)
01:38sridctx - http://people.csail.mit.edu/gregs/ll1-discuss-archive-html/msg03277.html
01:39scottjtbatchelli: re recent change, I liked how the here showed clearly what url was tweeted and what urls you were adding for reference, not sure how to incorporate that with current system when there are multiple links in the tweet message
01:40tbatchelliscottj, yeah, I see that as an issue too
01:41scottjtbatchelli: I also think it's easier to read the old way, which is definitely my preference, but I understand catering to the blind clojure hackers :)
01:41tbatchelliscottj: I guess a good solution would be to stop using Wordpress and use something that I can customize more
01:41scottjeasier to read in that it looks less cluttered
01:42scottjhow many subscribers does disclojure have?
01:42tbatchellifeedburner =
01:42tbatchelli>
01:42tbatchelli> ~750
01:42hsbot Pattern syntax in expression context: ~750
01:42scottjI'm surprised there's not something like this that supports lots of languages, I think it's super useful
01:42scottjhave you thought about expanding to other languages?
01:43tbatchelliyes, but before that I need to work on my project of expanding days to 48h
01:43scottjI think the way to do it would be one editor per language
01:43tbatchelliagreed, I thought about that
01:44scottjare you using any special tools or just copying pasting the relevant tweets?
01:44tbatchelliI hace some clojure code that does the hefty work
01:44tbatchellibut I still read a ton of tweets, around 100 a day at least
01:45tbatchelli(which, interestingly enough, is a number that has been stable over the last 20 months or so)
01:45tbatchelliso growth in twitter is based on retweets, not original tweet
01:45tbatchellitweets
01:45scottja special client where you can just mark the important tweets and type a comment and the tool builds the post would be cool (maybe that's what you have)
01:46tbatchellisimpler, but works ok. I'd like to do what you suggested with ClojureScript, but again, that's pending the 48hr day project ;)
01:47tbatchellia lot of people read the intertweets via planet clojure, so my readership count is probably very off
01:48scottjtbatchelli: do you have any ideas how to monetize an expanded to more languages version?
01:48tbatchellinot looking for monetization for now, but maybe expanding, yes
01:48tbatchelliI see this as a community service
01:50scottjI think it a js/ruby/python version would be super popular with a few witty editors
01:50tbatchelliit probably would
01:50tbatchellithanks for the enthusiasm :)
01:50scottjbig fan :)
01:51tbatchelliI have the idea in my mind, but too busy working on pallet now :)
01:51tbatchelliI should get back to it… it needs a ui and better algorithms to summarize the tweet stream
01:52tbatchelliI'd recon that there are orders or magnitude more tweets with "ruby" in them than ones mentioning "clojure"
01:52scottjdo you sort by retweets?
01:52scottj# of
01:53tbatchellinot really, but I group tweets about the same thing together
01:53tbatchelliand usually quote the earliest tweet of the bunch
01:53tbatchellialthough twitter's timestamps are quite all over the place
01:55tbatchellisometimes the most interesting stuff is only tweeted once, while boring stuff is retweeted tens of times
01:55tbatchellipopularity != interest
01:55scottjdo you read everything with clojure or #clojure?
01:56tbatchelliI do
01:57tbatchellifor example, today was a slow day. 152 tweets in 24hrs. Of those, only 85 are original tweets
01:57tbatchelliso I read about 85
02:08amalloyyeah, sadly development mostly tapered off before we implemented a viable way of publicizing all solutions
02:09amalloypatches welcome, as they say
02:09tbatchelliin general, #clojure is not very noisy. If anything, plenty of people talking about having received a clojure book like Joy, Practical, or Programming
02:10amalloythe joy of practical programming
03:13gausoshi
03:13gausosFYI: a recent performance comparison on languages gave a bad result for Clojure: http://blog.dhananjaynene.com/2011/08/cperformance-comparison-languages-styles-and-vms-java-scala-python-erlang-clojure-ruby-groovy-javascript/
03:14gausosmaybe the code used in the comparison wasn't very idiomatic
03:16scottjI doubt the code is doing the task in the same way
03:17scottjif you look at the shootout clojure averages maybe 3x java/scala, and that's without 1.3
03:17jliscala is about equal to java? interesting
03:18dbushenko1.3 slower then 1.2??
03:20gausosscottj: it's weird that list recursion/reduction be faster in java than in clojure! Much faster"
03:21gausosmaybe some clojure guru could review the code used in the comparison?
03:21raek"Updated clojure element recursion code as per suggestion by David Nolen. Now time down from 135.36 to 29.170 microseconds"
03:21gausosthat blog is referenced in DZone, too: http://java.dzone.com/articles/contrasting-performance?utm_source=feedburner&amp;utm_medium=feed&amp;utm_campaign=Feed%3A+javalobby%2Ffrontpage+%28Javalobby+%2F+Java+Zone%29
03:22gausosraek: but in plain java 6 they are 1.435 ms 2.816 ms
03:22gausos 28.753 vs 2.816 !
03:24scottjgausos: you could post the clojure code to ml asking for improvements
03:26gausosshould be https://github.com/dnene/josephus/blob/master/element-recursion/josephus.clj and https://github.com/dnene/josephus/blob/master/list-reduction/josephus.clj
03:27scottjml = mailing list
03:27scottjlau jensen did some scala vs clojure speed tests a year or two ago
03:45jlihm, I must be doing something wrong
04:00jlihe uses (= 0 ...) instead of zero? and didn't use recur in his main function, but these changes don't appear to make a difference
04:08clgvWhen I create a lazy sequence via filter how does the jvm object structure look beneath? Assume the call is (def fs (filter even? (range 10))), Does fs consist of 10 clojure.lang.LazySeq objects or only of 5 LazySeq objects?
04:11Chousukeclgv: until you take one item from it, there's are only two objects.
04:12Chousukeclgv: the seq generated by range and the seq generated by filter
04:12clgvChousuke: ok. I was inprecise. when I now do a (doall fs) how many LazySeq objects related to fs are there?
04:13Chousukemost likely 5 at the end since the unused range nodes get gc'd
04:14ChousukeYou'd have to read the code to get the real object count though
04:15clgvok. so the following iterations over fs only see the 5 objects that represent the filtered values?
04:15Chousukeyeah, lazy seqs are cached
04:15raekrange will create 10 conses (which will all be gc:ed) and filter will create 5 conses
04:16clgvI started reading the code for filter lazy-seq and clojure.lang.LazySeq but was not pretty sure yet
04:16Chousukeso once an item is generated it'll cache it
04:16raekthe caching lies in the (lazy-seq ...) wrapper
04:17amalloyi know this is sorta just clouding the picture, but if you're testing this you should probably use (take n (iterate inc 0)) instead of (range n), since range generates chunked lazy-seqs that aren't really quite as lazy
04:17raekwhen you call seq on it it will evaluate the body and remember it for later seq calls
04:18clgvhumm ok. another related question: do the the generated LazySeq-Objects except the first only exist as long as they are not evaluated?
04:19ordnungswidrig1clgv: do you ask if the are "realized" in-place?
04:20clgvordnungswidrig1: kinda, yes. I do get the impression when reading LazySeq.seq() implementation
04:21mduerksenjoin #clojure.de
04:21mduerksenups
04:21ordnungswidrig1mduerksen: *g*
04:21mduerksensorry ^^
04:23clgvthe distilled question is: When I once evaluated all of a LazySequence, that is create with something like filter, do the following iterations have overhead because of the left out elements?
04:24ordnungswidrig1clgv: I don't think so. the sequence will be realized once.
04:28Chousukeyou can test that pretty easily
04:28clgvhow?
04:28clojurebotwith style and grace
04:30ChousukeYou can try filtering a very long seq and then try to do something with it several times
04:30Chousukeif you filter it so that it leaves just a few elements, the first run should be noticeably longer than the rest
04:32clgvuuh but that has to be pretty long to notice the difference just because of wandering through unused objects
04:32Chousukewell it's not hard to create a seq of a hundred million objects :)
04:33Chousukethen filter it with #(> 5 %) :P
04:36clgvok I think I have a comparison
04:37clgvah well not really. range also calculates something...
04:37crazyFoxdoes anybody know why negative ints are represented with 64 bits?
04:38crazyFox,(format "%X" (Integer/MIN_VALUE))
04:38clojurebot"FFFFFFFF80000000"
04:39amalloy$javadoc java.util.text.Formatter
04:39amalloymutter
04:42amalloyhttp://download.oracle.com/javase/1.5.0/docs/api/java/util/Formatter.html
04:42amalloyIf x is negative then the result will be an unsigned value generated by adding 2^n to the value where n is the number of bits in the type as returned by the static SIZE field in the Byte,Short, Integer, or Long classes as appropriate.
04:43amalloyand, crazyFox, it sounds like you're suggesting that FFFFFFFF80000000 is -1, which it isn't
04:44amalloywait, what i just said is retarded. that last part, anyway. my quote from the javadocs is still dead on
04:44amalloyanyway, i'm going to bed. you know what to read if you want to learn more
04:44timvisherhey all
04:45timvisheranyone know if it's 'official policy' to use the contrib tools if they're available rather than another implementation?
04:45timvisheri.e. data.json vs. cheshire?
04:46timvisherobviously, there's nothing stopping anyone from using whatever implementation of something they want, but are the contrib libraries 'promised development' in any way or are they not really any better off than any other project out there?
04:47crazyFoxamalloy: kk, thx
04:47clgvChousuke: ok no overhead their. I tested with a combination of doall and dorun
04:47clgvlike this: (time (def r (doall (range 10000000)))) (time (dorun r)) (time (def f (doall (filter #(zero? (mod % 100000)))))) (time (dorun f))
04:51clgvis there any abbreviation in clojure to access private fields via reflection? I just want to complete my lazy-seq understanding by some scalpel investigation ;)
04:52clgvah clojure.contrib.reflect sounds promising
04:55thorwiltimvisher: parts of clojure 1.2's contrib are split up for clojure 1.3, afaik. that is, parts that have been found useful and that have a maintainer
05:02timvisherthorwil: i think i understand that much. what i'm wondering specifically is whether or not there's a community leaning towards using those in favor of others if possible
05:03timvishersomething along the lines of trying to use standard Exception types in Java if at all possible and only inventing new ones if none of the standard ones can possibly fit.
05:04timvisherthis is obviously the case for clojure.core. Nothing's stopping anyone from inventing their own implemantions of IPersistentMap and throwing away the work that already exists, but the obvious choice is to use what's there and contribute back to it if you can
05:04thorwiltimvisher: i'd say it's quite simply: if an existing solution exists, use it. if it's almost there, but not quite, consider contributing
05:04timvisherit's just less clear to me regarding contrib what the purpose of it is
05:05timvisherthat's where i'm leaning
05:05timvisherjust figured i'd ask about it. :)
05:05clgvok after a seq() on the LazySeq there is only a reference to an ISeq left which is a ChunkedCons in my filter case. that means there is only one LazySeq object left for this lazy sequence
05:08clgvah one error in that statement, the one LazySeq object is the only one provided I evaluated the whole sequence
05:20tsdhHi
05:28jeremyheilerhey
07:23clgvhow do I add a symbol to a namespace that shall refer to a variable in another namespace manuall? I know the opposite task is done via ns-unmap
07:27kencauseyclgv: alias perhaps?
07:28clgv kencausey: no, alias is only for namespaces
07:28kencauseyright, sorry
07:29kencauseyclgv: second try: refer
07:29clgvI cant rename with refer ;)
07:30kencausey:rename keyword arg?
07:31clgvoh right
07:31clgvthx
07:31kencauseyyay, par 2.5
07:35clgvwhat's that?
07:35kencauseysorry, I managed to answer the question in a bit more than 2 tries.
07:35clgvlol ok ;)
07:36kencauseyAbout the only time I can manage is when not enough people are around who can answer much faster than I ;)
07:37lnostdal_maybe a dumb question, but the closure associated with a ref using add-watch is (free to be) GCed when the ref is GCed, right? .. e.g. the 'key' is for cases where the user wants to disconnect the two early
07:38lnostdal_checking this using a finalization function would have been great .. hum
08:11clgvlnostdal_: can you provide an explanation of what you do with code examples?
08:11hiredmanlnostdal_: it is not, the fn is just added to a map with the key as a key
08:22lnostdal_oh, hiredman
09:00cemerickHrm, someone just said I was from a particular "paradigm cult".
09:00cemerickI wonder if that's a good or bad thing :-P
09:01ejacksonyou probably score points either way
09:03ejacksonit would be a cool domain name :)
09:03ejacksonnot taken
09:04sleepynateanyone know of a library that renames/implements the HOFs from haskell in clojure?
09:05chousersleepynate: what are you missing?
09:05chouserfoldleft?
09:05sleepynatechouser: oh i'm not _missing_ anything... i just find myself going back and looking up "oh foldl, that's reduce"
09:06sleepynatejust the names being different, i lose a little time trying to discern which one i'm looking for in clojureland
09:06chouserAh. Well, just like #define BEGIN { in C, I think you'll have to do that yourself or not at all. :-)
09:07kencauseybest not and expect repeated use to burn it into memory
09:07noidihow can I restart a swank session started with `clojure-jack-in`?
09:08sleepynatehaha yea, i'm half hoping there's not one just so i'll write it, and by the time i'm done have memorized all of them ;)
09:08technomancynoidi: kill *swank* and M-x clojure-jack-in
09:08cemerickejackson: a good domain name indeed :-)
09:08cemerickToo bad I don't have anything to put on a site named as such.
09:08noiditechnomancy, thanks!
09:08sleepynatechouser: btw your book has ended up being a good recommendation to folks. cheers.
09:09chousersleepynate: cool, thanks!
09:09sleepynateyea, folks seem to dig it.
09:10sleepynateand this is to java/scala folk, as opposed to lispers.
09:10sleepynatedunno if that feedback helps at all
09:11chouserinteresting. It's certainly nice to know.
09:12sleepynaterock on. i'll sheepishly admit i flipped through it, said "ok this looks like a good resource" and has sat on my shelf until my next long plane ride :P
09:12chouserheh. I totally understand.
09:12kencauseytechnomancy: would it be a mistake (difficult?) for clojure-jack-in to check for the existence of *swank* and ask to kill it if it exists?
09:19technomancykencausey: it's supposed to
09:19technomancyin fact it does for me
09:20technomancybut there have been reports of that not working in some versions of emacs, so right now that's my advice
09:20kencauseyah, noidi: did you try to just run clojure-jack-in
09:22technomancynext version will have that fixed
09:25kencauseyexcelletn
09:25kencauseys/tn/nt/
09:25lazybot<kencausey> excellent
09:25technomancyunfortunately it is behind Leiningen, slamhound, and swank-clojure on the queue
09:26kencauseytechnomancy: you are just too prolific
09:28st3fanwhat is slamhound?
09:28technomancyclojurebot: slamhound?
09:28clojurebotExcuse me?
09:28technomancydang
09:28technomancyclojurebot: slamhound is for reconstructing your ns forms from scratch: https://github.com/technomancy/slamhound
09:29clojurebotc'est bon!
09:29sleepynateshould i define a helper function inside a lambda? or is the convention to recur?
09:31kencauseyI should think both have their uses and cases
09:31sleepynateok
09:32sleepynateloop / recur has kind of wants to be loop/for for me, but it is foreign and scary to me ;)
09:32kencauseyor perhaps but a better way, you might want to show an example of where you are not clear which is the better choice
09:32kencauseys/but/put/
09:32lazybot<kencausey> or perhaps put a better way, you might want to show an example of where you are not clear which is the better choice
09:32kencauseyyou don't have to use the loop bit ;)
09:33sleepynateorly?
09:33sleepynatefor example, if i'm writing a lambda version of "last"
09:35manutter,(letfn [(countdown [n] (if (zero? n) nil (do (println (str n "...")) (recur (dec n)))))] (countdown 3))
09:35clojurebot3...
09:35clojurebot2...
09:35clojurebot1...
09:35kencauseyrecur will recur on function points, not just loop
09:37sleepynate(fn [x & xs] (if ((= (len xs) 0) x) (recur xs))) ?
09:37sleepynatesomething along those lines?
09:38joly,((fn [x & xs] (if ((= (len xs) 0) x) (recur xs))) 1 2 3 4 5)
09:38clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: len in this context, compiling:(NO_SOURCE_PATH:0)>
09:39bpruse count
09:39joly,((fn [x & xs] (if ((= (count xs) 0) x) (recur xs))) 1 2 3 4 5)
09:39clojurebot#<CompilerException java.lang.IllegalArgumentException: Mismatched argument count to recur, expected: 2 args, got: 1, compiling:(NO_SOURCE_PATH:0)>
09:39sleepynateoh hrm
09:39kencausey,((fn [x & xs] (if ((= (count xs) 0) x) (recur xs))) [1 2 3 4 5])
09:39clojurebot#<CompilerException java.lang.IllegalArgumentException: Mismatched argument count to recur, expected: 2 args, got: 1, compiling:(NO_SOURCE_PATH:0)>
09:40manutteror better yet, use (if (seq xs)...
09:40bprtrue
09:40sleepynateahh good point there too
09:40jolyHmm, I don't think recur will work right here if we're using & xs ?
09:40technomancyrecur and destructuring interact in bizarre and inexplicable ways
09:41bprjoly: that destructuring works in (loop ...), at least in clojure 1.2.1
09:41bprwhat verion is clojurebot?
09:41technomancyI think you need to think of it as recurring to the point right after the destructuring occurs, not really back to the top of the function
09:41sleepynateso i should define a helper in the anon? or is there a better way to do it?
09:42bprbtw, I'm simply refering to the [x & xs] destructuring, not all the rest of the code
09:42manutter,((fn [x & xs] (if (seq xs) (apply recur xs) x)) 1 2 3 4 5)
09:42clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: recur in this context, compiling:(NO_SOURCE_PATH:0)>
09:43bprcan you apply special forms?
09:43manutter,(doc recur)
09:43clojurebotGabh mo leithscéal?
09:43jolyI doubt it
09:44manutterbpr: I'd say no, based on the experiment above.
09:44bpryeah, lol
09:44sleepynatei love that i've broken #clojure in rewriting "last" :D
09:44kencauseytry clojure is down?
09:44sleepynatekencausey: was yesterday
09:44kencauseyShould that be pointed out to Raynes?
09:45jolysomeone did, but he may not have seen it
09:45kencauseyI was more questioning my memory really.
09:45hiredmanmanutter: you cannot apply recur
09:45manutterhiredman: so I see :)
09:46technomancyhow did the NYC meetup go?
09:46hiredman,((fn [& xs] (when (seq xs) (recur [(rest xs)]))) (range 10))
09:46clojurebotExecution Timed Out
09:46hiredmanhuh
09:47sleepynateyea that just keeps stackin'
09:47hiredmanvar args and recur are funky
09:47sleepynateyou're end up with a bunch of [10]
09:47hiredmanahh
09:47hiredmanhold on
09:48Chousukeyeah, the destructuring is not redone
09:48Chousukeso you need to pass in a seq
09:48chouserit's not really destructuring at that level
09:48Chousukejust (recur (rest xs))
09:48hiredmanright
09:50chouser& is used for both varargs and destructuring, and destructuring is supported on each arg including the varag, so it's very easy to think of them as all the same
09:50lazybotjava.lang.Exception: Unable to resolve symbol: is in this context
09:50chouserlazybot: um, yeah.
09:51manutterlol, lazybot is just saying "It all depends on what your definition of 'is' is..."
09:52wastrellazy bot :[
09:55bpr,(loop [[x & xs] (range 10)] (when (seq xs) (println x) (recur xs)))
09:55clojurebot0
09:55clojurebot1
09:55clojurebot2
09:55clojurebot3
09:55clojurebot4
09:55clojurebot5
09:55clojurebot6
09:55clojurebot7
09:55clojurebot8
09:55opqdonutoh my
09:55bproop, sry about the spam
09:56Chousukesince when does clojurebot print newlines? :/
09:56bpri was trying to demostrate that that destructuing works in a loop form. Why wouldn't it work when the recur target is a function?
09:56manutterhehe, that's why I only counted down from 3
09:57Chousukebpr: different issue
09:57bproh?
09:57Chousukebpr: the loop form starts with a seq, a vararg function can be called as (foo 1 2 3 4 5 ...)
09:58clgvChousuke: clojurebot always printed newlines. that enables the fun of mail bombs ;)
09:58Chousukeclgv: huh, IIRC it used not to do that
09:58clgvChousuke: it did already at least half a year ago
09:58sleepynate,(fn [x & xs] (if (empty? xs) x (recur (first xs) (rest xs)))) '(1 2 3))
09:58clojurebot#<sandbox$eval4157$fn__4158 sandbox$eval4157$fn__4158@fc801f>
09:59sleepynate:o
09:59sleepynate,((fn [x & xs] (if (empty? xs) x (recur (first xs) (rest xs)))) '(1 2 3))
09:59clojurebot(1 2 3)
09:59sleepynatehrm
09:59ChousukeWell, the last time I touched Clojurebot's code must've been like two years ago
09:59clgvyou can use lazybot (sexpbot formerly) with clojurebot to spam with the mail feature ;)
09:59TimMc,(println "&(println (\"I use arrows!\")")
09:59clojurebot&(println ("I use arrows!")
09:59lazybotjava.lang.ClassCastException: java.lang.String cannot be cast to clojure.lang.IFn
09:59TimMcoops
09:59clgvalmost ;)
10:00TimMcWell, close enough for demonstration purposes.
10:00sleepynateany way to see the call stack within a recur ?
10:00TimMcDoes either bot have a bot flag set?
10:00TimMcI don't see one...
10:01TimMcsleepynate: I think the point is that there isn't one.
10:01clgv,(doseq [x (range 3)] (println (format "&(println \"got %s\")" x))
10:01clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: EOF while reading>
10:01TimMcAt least not for the thing you are recur'ing.
10:01sleepynateTimMc: well, or the deconstruction
10:01clgv,(doseq [x (range 3)] (println (format "&(println \"got %s\")" x)))
10:01clojurebot&(println "got 0")
10:01lazybot⇒ got 0 nil
10:01clojurebot&(println "got 1")
10:01lazybot⇒ got 1 nil
10:01clojurebot&(println "got 2")
10:01lazybot⇒ got 2 nil
10:01sleepynateTimMc: for example, in CLISP we can TRACE
10:01jolyoh dear
10:01clgv;)
10:01TimMcsleepynate: I wouldn't know about that, Paul.
10:02TimMc:-)
10:02bpri guess you can get the desired behavior with: ((fn [& [x & xs]] (println x) (when-not (empty? xs) (recur xs))) 1 2 3)
10:02bprI'm not gunna eval it though lol
10:02bprbut that's fugly
10:02technomancyslime can do tracing, but I don't think it catches recurs
10:02TimMcsleepynate: You could build up a stack of past arguments and pass that around.
10:03sleepynate,((fn [x & xs] (if (empty? xs) x (recur (first xs) (rest xs)))) 1 2 3 4) ; also works
10:03clojurebot4
10:03sleepynatebut also wasteful :P
10:03bpryeah, because you're basically doing the destructuring in the recur form
10:06clgvhow about: ##((fn [& [x & xs]] (if (empty? xs) x (recur xs))) 1 2 3 4)
10:06lazybot⇒ 4
10:06sleepynate,( (fn [x] (if (empty? (rest x)) (first x) (recur (rest x)))) [5 4 3 2 1] )
10:06clojurebot1
10:06clgvbut I am still not entirely sure why that works ^^
10:06sleepynatethat gross beast worked
10:06sleepynatebut there MUST BE A BETTER WAY
10:07clgvsleepynate: how about last?
10:08TimMcI believe that was the point.
10:08sleepynate,( (fn derp [x] (if (next s) (recur (next s)) (first s)) [5 4 3 2 1])
10:08clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: EOF while reading>
10:08TimMcmissed a paren, I suppose
10:08sleepynatethe point was not to write last, it was toexcercise loop/recur versus a helper inside a lambda
10:09sleepynate,( (fn derp [x] (if (next s) (recur (next s)) (first s))) [5 4 3 2 1])
10:09clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: s in this context, compiling:(NO_SOURCE_PATH:0)>
10:10sleepynate,( (fn derp [s] (if (next s) (recur (next s)) (first s))) [5 4 3 2 1])
10:10clojurebot1
10:10sleepynateso that's basically stolen straight from core
10:10sleepynatelooks like "ignore the rest of the seq and don't deconstruct " is the rule at hand there :p
10:11bprit looks cleaner to me anyhow
10:11TimMc,((fn derp [s] (if-let [n (next s)] (recur n) (first s))) [5 4 3 2 1])
10:11clojurebot1
10:11TimMcyay if-let
10:11sleepynateoooh fancy
10:12sleepynatenow rewrite using nnext
10:12TimMc,(doc nnext)
10:12clojurebot"([x]); Same as (next (next x))"
10:12TimMchrmph
10:13sleepynatewhat doesn't kill you makes you more annoyed at me
10:13sleepynatei mean... smarter
10:14TimMc,(doc cdaddr) :-P
10:14clojurebotGabh mo leithscéal?
10:15bprlol, am I wrong for liking the conciseness of function names like cdaddr?
10:16technomancywe do have ffirst
10:23sleepynatefor the few of you who may care... here's the pattern i was questioning emulating in haskell at them beginning of our chat: (\a -> let f (x:xs) = if null xs then x else f xs in f a) [1, 2, 3, 4, 5]
10:24sleepynatebut the (fn ... (recur (next _)) seems more fitting to clj :)
10:36dnolenslides from yesterday on pattern matching and predicate dispatch http://www.scribd.com/doc/62571669/Patterns
10:45technomancyhe left before I could compliment his typography
10:47technomancyoh man... matching dates is extremely badass
10:56sleepynatewhoa
10:56sleepynate+1 pattern matching
10:57sleepynatebetween that and multiple argument set definitions... untz untz untz untz
11:04rpgtechnomancy: Sorry to ask stupid question --- I'm a little lost in the web pages --- where is it we get the version of SLIME that's synced to swank-clojure?
11:07technomancyrpg: it's inside the swank-clojure jar
11:07technomancyswank/payload/slime.el
11:08rpgtechnomancy: ah. I'm trying to figure out how to make an alternative emacs config for running clojure versus running CL...
11:08rpg(probably a task of interest to a vanishingly small sub-population ;->)
11:08technomancyah yes, a problem that awaits an eager hacker who actually cares about CL
11:09rpgtechnomancy: I've actually had this problem before (using SLIME versus Franz's ELI) and emacs seems surprisingly resistant to a solution.
11:10rpgSo does your approach jam the slime in from the clojure side? If so, I can probably simply make an emacs config that simply makes its own copy of SLIME "invisible."
11:10technomancythat's the idea
11:10rpgtechnomancy: this is the arrangement described in your "simplification" post, right?
11:10technomancyM-x clojure-jack-in will contaminate that emacs instance with the clojure-compatible slime, but until you run that you can have it set up for the cl-compatible version
11:10technomancyyeah
11:14rpgtechnomancy: and by "contaminate that emacs instance" you mean that (1) it overwrites the loaded SLIME and (2) it does NOT mess with your file structure (uses its own SLIME copy), right?
11:15technomancyyeah, it's all in memory
11:17rpglast question (sorry!): does this require that we put swank-clojure-1.3.1.jar in the dev-dependencies?
11:19technomancyno, it can be a user-level plugin
11:24rpgsigh.... Didn't complete (got *swank* buffer; no *slime-repl clojure* buffer)... Suspect some "features" of my base-level emacs config conflict.....
11:36dnolentechnomancy: oh yeah, Inconsolata for source and Latin Modern Roman, <3
11:37dnolenfor text
11:38ejacksondnolen: was anybody waving about a camcorder ?
11:38bpror maybe just a microphone?
11:39ejacksonslaves with clay tablets even ?
11:39dnolenejackson: bpr: 2 people recorded
11:39ejacksonsweet, any promises from them ?
11:39dnolenTom Hickey asked for link to slides so probably pretty soon.
11:40bprsweet
11:40ejacksonthanks again, this is going to be really useful
11:40bpr^
11:53gtrak`how is clojure.contrib's fmap different from map?
11:56clgv,(range 0.1 1.0 0.1)
11:56clojurebot(0.1 0.2 0.30000000000000004 0.4 0.5 ...)
11:56clgv&(range 0.1 1.0 0.1)
11:56lazybot⇒ (0.1 0.2 0.30000000000000004 0.4 0.5 0.6 0.7 0.7999999999999999 0.8999999999999999 0.9999999999999999)
11:57gtrak`clgv, http://download.oracle.com/docs/cd/E19957-01/806-3568/ncg_goldberg.html
11:57jolyanyone have some quick code for downloading the contents of a URL?
11:58gtrak`take a look at clj-http
11:58clgvgtrak`: lol yeah I know. but maybe one should handle floating point numbers better in range
11:58fliebeljoly: java.net.URL should do, if it's just for playing around.
11:58raekjoly: you can open a input-stream or a reader on a URL object (see clojure.java.io)
11:58jolycool, thanks
11:59gtrak`clgv, nah... what would 'better' mean?
11:59clgvnow I do it via: ##(->> (range 10) rest (map #(/ % 10.0)))
11:59lazybot⇒ (0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9)
11:59meredyddgtrak`, Do you know if there's any chance clj-http will be acquiring POST support in the near-ish future?
12:00gtrak`pretty sure it has it already, no?
12:00gtrak`yea, do client/post
12:01PupenoI'm getting this error: java.lang.Exception: A global connection by that name already exists (:default-connection) (config.clj:1), config.clj:1 just defines the namespace. Any ideas why I'm not getting a full stack trace? any way to get it?
12:01gtrak`clgv, I think making some changes to what floating point does would butcher something somewhere, the IEEE standard is pretty well defined
12:02clgvgtrak`: lol I didnt suggest to change the IEEE standard :P
12:03joly,(range 1/10 1 1/10)
12:03clojurebot(1/10 1/5 3/10 2/5 1/2 ...)
12:03gtrak`I'm just saying, you have to know what you're doing when you deal with floating point... no way around it
12:03clgv(map double (range 1/10 1 1/10))
12:03clgv##(map double (range 1/10 1 1/10))
12:03lazybot⇒ (0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9)
12:03clgvgtrak`: yeah but you dont have to get that error in range ;)
12:04gtrak`it's not an error
12:04gtrak`nature of the beast
12:04clgvif range cant support it's implied semantics for floats it should either handle it special or forbid you use floats with it ,)
12:05clgv,(doc range)
12:05clojurebot"([] [end] [start end] [start end step]); Returns a lazy seq of nums from start (inclusive) to end (exclusive), by step, where start defaults to 0, step to 1, and end to infinity."
12:06gtrak`clgv, it does support its implied semantics... it has no way to account for what you think it should do in the case of rounding error
12:06gtrak`&(= .1 (/ 1 10))
12:06lazybotjava.lang.Exception: Unable to resolve symbol: .1 in this context
12:08sleepynategtrak`: fmap actually uses map under the hood to map a function across a collection into a collection of that type again
12:09sleepynate,(fmap println {:a 5 :b 6})
12:09clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: fmap in this context, compiling:(NO_SOURCE_PATH:0)>
12:09sleepynatederp
12:10gtrak`cljv, ##(= 0.1 (/ (+ 0.1 0.1 0.1) 3))
12:10lazybot⇒ false
12:10Scriptorhttp://goo.gl/RgxPs <- source for fmap for those interested
12:11gtrak`sleepynate, is the key difference 'collection of that type' ? looks like map creates a lazy seq
12:12Scriptorgtrak`: seems so
12:13Scriptorsince fmap uses into, and into uses conj, which uses the same type as the 'to coll'
12:13Scriptorin the case with fmap, the to-coll is the same type as the original collection
12:14gtrak`ah, interesting, so use fmap when you don't care about laziness or the source collection type
12:14sleepynategtrak`: ok check this
12:14sleepynate&(map println {:a 5 :b 6})
12:14lazybot⇒ ([:a 5][:b 6]nil nil)
12:14sleepynateprints but has weird nil nil return
12:15sleepynate(fmap println {:a 5 :b 6}) yields {:a nil, :b nil}
12:15sleepynatewhile printing "5" and "6" along the way
12:15sleepynatethe return types are matched with the keys in a collection of the same type
12:15gtrak`huh, how do the original entries make it into the first return seq?
12:15gtrak`if print returns nil
12:16gtrak`oh, it prints those, then the return seq has (nil nil)
12:16sleepynateright
12:16sleepynatebut for something like (map, there's no difference inc [1 2 3])
12:16sleepynateerm
12:17sleepynatehi termcap
12:17gtrak`##(map (fn [[k v]] [k (println v)))
12:17sleepynatefor something like (map inc [1 2 3]) ; there is no difference
12:17gtrak`##(map (fn [[k v]] [k (println v)) {:a 5 :b 6})
12:17gtrak`&(map (fn [[k v]] [k (println v)) {:a 5 :b 6})
12:17lazybotjava.lang.IllegalArgumentException: Wrong number of args (1) passed to: core$map
12:19sleepynategtrak`: you missed a ]
12:19sleepynate&(map (fn [[k v]] [k (println v)]) {:a 5 :b 6})
12:19lazybot⇒ (56[:a nil] [:b nil])
12:19rpgtechnomancy: OK, got it! One last, stupid question: OK, I have my swank prompt now, but how do I load my project? I know how to do this from leiningen, but not from inside slime.... It seems like the repl I get isn't the one I would have gotten from "lein repl"
12:19gtrak`&(into {} (map (fn [[k v]] [k (println v)]) {:a 5 :b 6}))
12:19lazybot⇒ 5 6 {:a nil, :b nil}
12:21gtrak`ah, sleepynate, i think the [:a 5][:b 6] made it in to the middle of the first return due to map's laziness
12:22sleepynateprobably
12:22manutter,(map inc {:a 1 :b 3})
12:22clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.ClassCastException: clojure.lang.MapEntry cannot be cast to java.lang.Number>
12:23sleepynateso basically, the functor is lifting the function as an object
12:23sleepynateif that makes sense
12:23sleepynatein fact... just read http://en.wikipedia.org/wiki/Function_object
12:23sleepynate:D
12:24technomancyrpg: you mean C-c C-k?
12:25rpgtechnomancy: ah. Does C-c C-k work in a project.clj to load the whole system?
12:25rpgHm.... error: java.lang.Exception: Unable to resolve symbol: defproject in this context (project.clj:1)
12:25rpgIf I have a bunch of files, I don't want to have to load them all by hand, do I?
12:26rpgI figured there was something I could load into my development environment that would do to the defproject form what leiningen does to it....
12:26technomancyleiningen doesn't do anything special for that
12:26technomancythere's no difference between repl and swank in that regard
12:27rpgtechnomancy: when I did the clojure-jack-in I got a repl that doesn't seem to know about the code in my project... When I do lein repl I get a repl with my stuff loaded (and in the right namespace).
12:28technomancyrepl and swank should both honor the :repl-init namespace
12:28rpgtechnomancy: Ah. I have only a :main, which repl seems to honor...
12:29rpgAlso when I change to my namespace (using in-ns), it seems that my code has not been loaded, although with "lein repl" it has....
12:29technomancyhm... I didn't know it did that; that's odd
12:29technomancyI think that's a hold-over from before :repl-init existed
12:29rpgOK, will try with repl-init, thanks!
12:29technomancyanyway, just use C-c C-k on your main namespace or set repl-init
12:31rpghm. I still got "user>"
12:34rpgBut then (require '<ns>) works fine....
12:35rpgBTW, the "IN-PACKAGE" command works, but when I did the "C-c~" command (sync directory and package), the connection crashed....
12:35rpgPossibly just disabling this command would be a good thing....
12:37rpgtechnomancy: Thanks a million --- I now have a shiny development environment that's familiar and powerful! Trying to work in "lein repl" was much less easy!
12:47ndimiduki have a question about protocols
12:47ndimiduki'd like to extend some of the definitions in clojure.java.io/IOFactory
12:48ndimiduki'd like to wrap existing functionality so i thought it would be a pretty straight forward example of functional composition
12:49ndimidukusing find-protocol-method to grab the existing definition and invoke it when my additional conditions are not bet
12:49ndimiduk*met
12:50ndimidukbut this isn't working because it looks like find-protocol-method doesn't give me the actual implementation for the object type in question
12:50ndimiduknotably, (= (find-protocol-method io/IOFactory :make-input-stream String) (find-protocol-method io/IOFactory :make-input-stream Object)) => true
12:50ndimidukwhat am i missing?
12:58Bronsa,(deftype X [x y] clojure.lang.Sequable (seq [this] '(x y)))
12:58clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.lang.ClassNotFoundException: clojure.lang.Sequable>
12:58Bronsawhy is this not working?
13:00hiredmanBronsa: clojure.lang.Sequable doesn't exist
13:00Bronsa,(instance? clojure.lang.Seqable '())
13:00clojurebottrue
13:00Bronsathen why this works?
13:01hiredmanhuh
13:01hiredmanah
13:02hiredmancheck your spelling
13:02Bronsaoh.
13:02Bronsai'm sorry, thanks
13:02Bronsathe funny thing is, i've typed that 2 times
13:07dnolenpattern matching talk video is up, http://vimeo.com/27860102, I need a haircut.
13:19antares_what's the best way to do "splicing" (à la Ruby and so on)? I cannot make apply work with merge-with
13:19dnolenantares_: ?
13:19antares_dnolen: for example, (merge-with concat [{ :a [1] } { :b [2] } { :a [3, 4] }])
13:20antares_doesn't work the way I want it to because merge-with is variadic
13:20dnolen,(apply merge-with concat [{ :a [1] } { :b [2] } { :a [3, 4] }])
13:20clojurebot{:b [2], :a (1 3 4)}
13:21dnolenantares_: ^ is that not what you want?
13:21antares_hm
13:21antares_that's exactly what I want and I tried apply a few times
13:21antares_I must have done something wrong :)
13:21antares_let me try in SLIME
13:21antares_it works
13:21antares_dnolen: thank you :)
13:23technomancymaaaaan I wish pattern matching had been around when this code was written three months ago =)
13:25dnolentechnomancy: haha
13:26jorgebI am having trouble with leiningen. 'lein run' works, but 'lein compile' throws a ClassCastException on me. The stack trace doesn't show anything related to my code.
13:27jorgebbut maybe I am just not understanding the issue.
13:28technomancyjorgeb: gist the trace?
13:29jorgebhttps://gist.github.com/071c764888b724364eae
13:29technomancyand project.clj?
13:30jorgebadded
13:31technomancy:main needs to be a symbol
13:32jorgebaha
13:32jorgebperfect, thank you technomancy
13:33technomancysure
14:02nickmbaileyis there a way to make 'lein run' not shut down my agent threadpools when my main function returns but the app keeps running
14:09amalloydnolen: your hair is too exciting to cut
14:30iceydnolen: I put your talk on HN here http://news.ycombinator.com/item?id=2900387 , but there aren't any curse words in the title and you're not talking about bitcoin, node.js or a bad AirBnB experience, so I don't know if it will go anywhere :|
14:30dnolenamalloy: ha!
14:30dnolenicey: thx
14:33amalloyicey: maybe link to the slides too? i watched the first half of the video or so this morning on my phone, and it's annoying to not see the slides
14:34manutteramalloy: http://www.scribd.com/doc/62571669/Patterns
14:35amalloymanutter: i meant in the HN discussion; i can follow twitter links myself :P
14:35manutterdoh
14:35manutter:)
14:39iceyamalloy: thanks, I added them in a comment
14:39chouserdnolen: ISpecializePattern provides a method that gets called at macroexpand time?
14:42dnolenchouser: yeah, pretty much everything is macroexpand time here.
14:44chouserheh. "or" patterns use infix notation
14:45dnolenchouser: heh yeah, not tied to that. part of the reason is that the first thing in a list is currently always the pattern.
14:45dnolen(p :or ...) (p | p | p) (p :when ...) (p :as ...)
14:49chouserI'm not critisizing -- don't know enough yet for my opinion to be of any value. Just struck me as amusing :-)
14:49amalloychouser: dnolen is a secret anti-lisp rebel, trying to switch us all to infix
14:50chouserfigured
14:52amalloyoh, dnolen, i had a question that it doesn't look like got totally resolved in the video. you were saying you can "never match a literal under a wildcard"; is there an implied "first" at the end of that?
14:55amalloybecause in the matrix [[_ true] [false _]], you do need to match against false, just not right away
14:56aaelonyhey all, I have a vector that contains maps. I want to compute 2 new values to each vector element based on one field in the corresponding map and add those 2 new keys to the map. The folowing works for 1 of the things I am computing & adding via assoc-in, but is there a way to add two new keys with computed values in one shot without the doseq?? (doseq [m vec-of-maps] (println (assoc-in m [:timestamp_nz_gmt] (timestamp-to-date (:timestamp m)))) th
14:59dnolenchouser: was mostly try make sure that match could do all the cool things you can do in OCaml/Haskell, (p | p | p) bit was lifted from there. Open to feedback.
15:00antares_is there a predicate like string? but for numerical values?
15:00amalloy&(doc number?)
15:00lazybot⇒ "([x]); Returns true if x is a Number"
15:00antares_interesting, cheet sheet does not mention it :) thanks!
15:02amalloy$findarg map % [3 "3" nil] [true false false]
15:02lazybot[clojure.core/number? clojure.core/integer? clojure.core/rational?]
15:02amalloyantares_: ^
15:02dnolenamalloy: yeah was not quite accurate that statement. you are correct. I chalk it up to nervousness.
15:03dnolenwas trying to explain we don't look underneath that point to calculate the column's score since - a wildcard makes patterns beneath it "less interesting".
15:03amalloyright
15:04amalloydnolen: so is match using core.logic, or are they separate?
15:05dnolenamalloy: not yet. It will when we tackle predicate dispatch.
15:17lobotomywhat's a good way to do a basic debug timing thing in clojure, like this in java: long start = System.nanoTime(); compute_stuff(); System.err.println("elapsed nanos " + (System.nanoTime() - start));
15:18dnolen,(time (+ 1 1))
15:18clojurebot"Elapsed time: 0.084 msecs"
15:18clojurebot2
15:18dnolenlobotomy: ^
15:19lobotomyhmm, of course... how do i turn that off though?
15:19lobotomyi mean, putting all the stuff inside (time ...). hmm, just define it to nop or something?
15:19lobotomyi mean, when i want to not print the debug timing stuff :)
15:20dnolenlobotomy: just remove it :)
15:20dnolenlobotomy: if you're doing serious profiling, use a profiler.
15:21lobotomywell, i'd right now prefer something i can get working in approx. 20 seconds, so i guess i'll just go with (time (do_stuff ...))
15:21lobotomycheers
15:27lobotomyumh, i can't use time with macros though?
15:27lobotomysuch as (time (cond (...))
15:28dnolenlobotomy: time is a macro.
15:28dnolenyou can use it anywhere pretty much.
15:30lobotomyhmm ok, seems to work with that stuff too yeah
15:32ordnungswidrighi all
15:44lobotomyheh, the naive solution with a (print (str "z is now " z)) in the beginning and then a (time ...) around the whole thing produces pretty funnily messy output
15:44lobotomyin a recursive function that is
15:45lobotomyapparently the print and the time aren't executed immediately, or something? is there an easy way to force them to be done here and now?
15:45lobotomyor should i do this in some other way?
16:11bsod1I'm trying to install clojure-contrib as described here: http://riddell.us/ClojureOnUbuntu.html but I'm getting this error http://paste.pocoo.org/show/460454/ . can anyone help me?
16:13amalloysigh. start by deleting everything on riddell.us
16:13amalloyclojurebot: blog?
16:13clojurebotmake 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
16:13amalloyoh well
16:13amalloyi was hoping he'd point out that blogs on installing clojure are always, without exception, either terrible or out of date
16:14amalloyclojurebot: lein?
16:14clojurebotlein is http://github.com/technomancy/leiningen
16:15amalloybsod1: start there. download lein, run lein self-install, and then let it manage dependencies like contrib for you
16:16bsod1amalloy: I already have lein installed but I'm trying to setup emacs(I was using vimclojure), is there a way to use SLIME with lein swank?
16:17amalloythat's like asking if you can use peanut butter with jelly - they're made for each other
16:18amalloywhy did you say you can't install contrib, if you (a) have lein installed and are therefore not "installing" any dependencies, (b) actually want to set up emacs, not contrib?
16:21babilenbsod1: leiningen, clojure and clojure-contrib are all packaged for Ubuntu and backportable to older Ubuntu versions fwiw -- https://launchpad.net/ubuntu/+source/leiningen
16:24bsod1ok, now I cloned and installed emacs starter kit, started a project with lein and installed swank plugin(lein plugin install swank-clojure 1.3.2), how can I start SLIME REPL for this clojure project?
16:32insideoutbsod1: lein repl
16:38babilenbsod1: btw, why the switch from VimClojure?
16:39bsod1babilen: I just want to try but still couldn't set up emacs starter kit + slime + clojure. I think I'll continue with vimclojure
16:41babilenbsod1: You might want to install paredit for vim (part of slimv) -- M-x clojure-jack-in or M-x slime-connect (start swank with "~/.lein/bin/swank-clojure" for this) for emacs
16:43scottjdnolen: very good presentation.
16:44dnolenscottj: thx!
16:46babilendnolen: Indeed, just watched it - very interesting, enticing and I am curious what I'll use it for. Keep up the good work! (and make match even better)
16:57polypus74~ping
16:57clojurebotPONG!
16:59polypus74so i'm trying my first clojure web app, messing around with ring sessions but when i try to use the cookie store, i'm getting an error that it doesn't implement SessionStore protocol's read-session method. i get the same error with a custom store, but the in memory store works fine. any hints?
17:10lobotomyhmm, how do i make run-tests in clojure.test print the detailed results?
17:10lobotomyit did that but then i added another test and it stopped doing that, or something
17:10coopernursepolypus74: I don't know much about that, but do you have a gist/pastebin with your custom store we could see? presumably it needs to provide that function (read-session). you could also check the source of the memory store to compare
17:12lobotomyseriously, wtf. should be asleep already and now the thing stopped telling me what is going wrong in the tests... >.<
17:17lobotomyah ok, restarting the "lein swank" process helped... now (run-tests) actually prints the things again
17:24polypus7`coopernurse: weird, i restarted the server process and no longer get the error. thanks anyway
17:24polypus7`probably some wrap-reload funniness or something
17:28coopernursepolypus74: ah, great. it seems that restarting the REPL fixes many woes
17:28coopernurseover time I hope to understand the internals a little better so I can diagnose root cause.. but restarting seems to get you productive again
18:09sleepynatewhat's the syntax to have a to automatically reload a module in the repl?
18:11sleepynatealso to english good >_<
18:11coopernursesleepynate: you could try: (use :reload-all 'my-namespace)
18:13sleepynateahh many thanks
18:14coopernursehappy to help
18:18sleepynatenow if i get clojurecheck working i will be a super-happy camper
18:19sleepynateor is "fact" more popular
18:29lobotomyhow do i make a jar with leiningen that also contains the tests?
18:36dnolenlooking forward to someone putting together a good match tutorial and/or blog post on how they used it *hint* *hint*
18:37technomancyinc
18:37sleepynatednolen: soon as i find a good use for it, but the problems i solve with clojure aren't that complex ;)
18:42scottjdnolen: are the guard's wrapped in try's?
18:42dnolensleepynate: it's seems more complex then it is. I think there's a lot of simple use cases once you get into the habit of seeing where it can be applied.
18:42dnolenscottj: no, why do you think they should be?
18:42sleepynateoh yea... i am a perfectly happy haskeller, but all my funcitonal work is in my spare time :)
18:43scottjdnolen: in your preso the even? example would throw exception if you had strings and ints in same column no?
18:43sleepynateso when i saw your slides this morning i was all "yay!", but i don't know what on earth i'd do with it at the moment
18:44dnolenscottj: true, but I'm not going to address that until predicate dispatch, there we can use implication to infer the other tests.
18:44dnolensleepynate: why can't you use pattern matching the same way you would in Haskell?
18:45dnolenscottj: if you're going to be mixing types w/ match I'm assuming you know what you're doing, or you're going to put in the extra guards.
18:45scottjdnolen: so a guard doesn't only restrict the pattern it's in, but that column of all the other patterns too
18:46scottjs/all/some
18:46sleepynatednolen: 'cause i'm using clojure now :D
18:46lazybot<scottj> dnolen: so a guard doesn't only restrict the pattern it's in, but that column of some the other patterns too
18:46sleepynatednolen: but point taken ;)
18:46dnolenscottj: guards are grouped at the moment very simply by guard sets.
18:46dnolenall even? guards in the same column grouped together for example
18:46dnolenif possible of course.
18:47dnolenscottj: so no, a guard doesn't necessarily protect a whole column.
18:47dnolenbut the compiler may see that two rows have a column that share the same test and decide they can be tested together.
18:50dnolenso who's going to add RegEx patterns? ;)
18:50dsantiagoSounds hard.
18:51dnolendsantiago: matching would be pretty easy, but people will want to pull apart matches, that's the tricky bit I think.
18:51dsantiagoHm, yeah. That'd be awesome.
18:52dsantiagoUnfortunately, I could barely understand the explanation of ISpecializeMatrix in your talk.
18:52dnolendsantiago: ISpecializeMatrix is pretty tricky, I'll probably write a detailed explanation at some point.
18:53dsantiagoAlso, I wasn't sure if _ is special, or giving any unbound symbol will result in a successful match.
18:54dnolen([_ _ _] :regex #"...") ?
18:54dnolendsantiago: unbound symbols are very much "named wildcards"
18:54dsantiagoCool.
18:55dsantiagoI don't understand the question, though.
18:56scottjdnolen: oh, by put in the extra guards you mean when you use even? if you could also have a string you use number? first?
18:58dnolenscottj: you can have multiple fns in a guard, :when [number? even?]
18:59scottjyeah, I see now that solves the problem I was thinking of
18:59dnolenhmm I'm not a Regex person but it seems like a pattern that uses re-matches would be kind of sick.
19:00dsantiagoYeah, I could see doing route matching with something like ["post" #"\d+"] or something like that.
19:01dsantiagoI know it probably wouldn' tmake a performance difference, but I'd love that to be optimized instead of trying each route linearly to find a match.
19:01amalloydnolen: i don't think that's true. you're passing around string ids of things, like "comment-10" or "post-123", and you want to match comments
19:08dnolenamalloy: ?
19:16amalloyregexes would be useful in matching if: ...
19:20dnolen(match [x] [([_ "comment" id] :regex #"(\w+)-(\d+)")] ... [([_ "post" id] :regex #"(\w+)-(\d+)")] ...)
19:20dnolenmore things to think about
19:23TimMctechnomancy: Does lein currently just ban any *jure, or does it check a dictionary for s/j/s/?
19:24joegalloit actually sends him a text via soap, and he responds back with yay or nay
19:26pjstadig`soap via carrier pidgeon transport
19:26technomancyhttp://p.hagelb.org/via-soap.png
19:26technomancyTimMc: srsly though; it's all jures except clojure and compojure
19:26pjstadig`and seajure
19:26technomancyno, I created seajure by hand
19:26pjstadig`wait... you can create projects by hand?
19:27sleepynate:o
19:27technomancypjstadig`: well actually via M-x butterfly if you want to get technical
19:27TimMcI couldn't crack the encryption, I had to use lein.
19:27pjstadig`there's a way to defeat your protections???
19:27lazybotpjstadig`: Yes, 100% for sure.
19:27pjstadig`we're doomed
19:33TimMc(coming to you live from the Boston Clojure Meetup)
19:34amalloylazybot: high five, dude. way to participate
19:36BufferUnderpantsI'm having trouble connecting to SLIME in Emacs.
19:36TimMcI should have created a fake Meeup account for Lazybot and RSVP'd.
19:37amalloyTimMc: he wouldn't have shown up. too lazy
19:38BufferUnderpantsWhen I try to connect (either via slime-connect or clojure-jack-in) it says: error in process filter: require: Symbol's value as variable is void: slime-clj
19:39technomancyBufferUnderpants: slime-clj is not what you want
19:39technomancyrm -rf ~/.emacs.d/elpa/slime-clj
19:40amalloytechnomancy: if you have enough credibility that a stranger on the internet will rm -rf something just because you say so, i want to be more like you
19:40technomancyhaha awesome
19:40technomancyit's a trick I learned from pascal j bourginton
19:40amalloysee, and now he's gone. probably slime-clj is symlinked to /
19:41TimMcI think it would have to be hardlinked.
19:42TimMc(Hardlinked directories are *awesome*.)
19:42amalloyi didn't think you could hardlink directories
19:42TimMcI think it is very, very discouraged.
19:42technomancyhttp://groups.google.com/group/comp.lang.lisp/msg/4c95766a8bdda347 for the reference
19:42TimMcamalloy: Hmm, maybe not.
19:42amalloyapparently only root can do it
19:42amalloyand even so most systems will tell him to bugger off
19:43TimMcah, --directory
19:45amalloytechnomancy: i see that he's deleting everything, but i don't quite get the joke
19:45technomancyI guess you need context
19:45technomancysomeone asked an innocuous newbie question and he hid a CL port of rm -rf / in the answer
19:46amalloyright
19:47amalloyit's probably funnier if i have the often-attributed-to-common-lisp attitude that new users are idiots
19:47technomancyalso I guess it wasn't really a joke?
19:48amalloyi guess that's true
19:51pdkif you want to get a taste of typical CL attitude
19:51pdkjust read the taglines for let over lambda
19:53technomancythat guy hangs out in the #emacs channel; huge troll
19:54technomancyhe was going on and on about how mutable strings aren't really a problem and I pushed him an it; apparently it's totally fine in CL because you can just audit every single library you use to make sure they don't modify the strings you pass in
19:56technomancyFISSION MAILED
19:56amalloysurely duping the string yourself before you pass it on is easier
19:57technomancyamalloy: you're usually in #emacs, why don't you ask him about it? =)
19:57amalloyoh my god. i did a google search for that to see if it was an mgs reference, or if there was some older thing it refers to. in addition to the reasonable references, i found "An information center for the Fission Mailed livejournal roleplaying game."
19:58amalloyi guess i don't really have much to say about it except that the {mgs players} and {livejournal roleplayers} probably don't have a lot of overlap
19:59TimMcI wouldn't be so sure.
19:59TimMcLJ is a pretty popular social network in the Boston area, and there's a big gamer/RP overlap here.
20:00amalloyreally? i thought LJ basically died out ages ago
20:00TimMcUsually LARP or tabletop though, not online.
20:00TimMcSo did I, until I moved here.
20:08TimMcamalloy: Common in the geek/fandom/kink/poly/MIT/LARP/square dance circles. :-)
20:22kwertiiIs anyone working on, or are there any plans for, adding a persistence layer directly to the STM? Something like AllegroCache or ElephantDB...
20:23technomancykwertii: alyssa qwan did something along those lines
20:23technomancykwan maybe?
20:24kwertiitechnomancy: I found that project, actually, but it seems to be long abandoned...
20:24amalloyif it wasn't called the HTM i don't approve
20:24technomancykwertii: yeah, core was frosty to the idea
20:25kwertiitechnomancy: to the implementation or to the idea in general? it seems like a much better long term strategy than building ad hoc database bridges for each app...
20:26kwertiiI'd ideally run something like ErosOS that didn't have any distinction between short and long term storage at all
20:27technomancykwertii: I don't know the details of the objections, just that they brushed her off.
20:27kwertiiso what are people generally doing for data persistence nowadays?
20:27amalloymongo seems popular
20:28kwertiiset watches on every ref that needs to be persistent, which shunt backend database updates to an agent...?
20:29technomancyit's much harder than it sounds to be truly transactional
20:30kwertiiyeah, I'll bet
20:30kwertiian easy (ideally, transparent) persistence solution would be a true killer feature for Clojure.
20:33KirinDavePersistence meaning, to disk?
20:33KirinDaveMake something like Wasp
20:33KirinDavehttps://github.com/codahale/wasp
20:34kwertiiKirinDave: not necessarily, though I imagine that'd be the most common way of doing it. I mean you create data structures that magically still exist after your program is shut down and restarted
20:34KirinDaveOr just wrap over wasp.
20:34KirinDavekwertii: I wrote a framework in scala for this. People hated it.
20:34kwertiiKirinDave: really, why?
20:34KirinDavekwertii: https://github.com/KirinDave/Clipping
20:34KirinDavekwertii: Because doing it correctly makes for complex code.
20:35KirinDavekwertii: And my default implementations were not very robust, so everyone assumed it was stupid.
20:35kwertiiKirinDave: something like this: http://www.franz.com/products/allegrocache/
20:35KirinDaveLook at what I did with clipping
20:35KirinDaveTo write a fast, safe proxy over a variable you gotta do something like: https://github.com/KirinDave/Clipping/blob/master/src/main/scala/com/banksimple/clipping/ManagementStrategies/AsynchronousManagementStrategy.scala
20:36KirinDaveEven in clojure, that's not going to be easy.
20:36KirinDaveBut this library could be used over anything. It's pretty neat that way, I think.
20:36KirinDaveI actually wrote a redis binding for it.
20:37kwertiiKirinDave: looking now, interesting
20:38kwertiiI'm not at all familiar with how the STM works internally, but I'm guessing it has some kind of transaction log. at a base level, ensuring that that gets copied to disk (or a Redis backend, etc) would provide enough information to reconstruct the state of memory at any point, wouldn't it? (if not necessarily efficiently..)
20:39KirinDavekwertii: I am pretty sure it does not keep a ten log.
20:39KirinDavekwertii: It's structure-sharing mvcc.
20:39KirinDavejeez freakin lion's autocorrect. txn
21:07amalloylion really has autocorrect for actual keyboard input? that sounds like madness
21:11dnolenmacros don't have access to line numbers right?
21:13cemerickdnolen: try (-> &form meta :line)
21:14dnolencemerick: YES
21:14ambrosebscemerick: cheers :)
21:14cemerick\o
21:15cemerick:-D
21:15cemerickdnolen: the talk went well
21:15cemerick?
21:16dnolencemerick: it did, decent turn out and some good questions.
21:16cemericknice, looking forward to the vid
21:16dnolencemerick: vid is already up and slides as well.
21:16cemerickyou guys doing some logic macrology hacking, I take it? :-)
21:17ambrosebsprinting out some warnings for pattern matching
21:17ambrosebssimple stuff :)
21:18cemerickwhoa, accurate error messages? Unheard of! ;-)
21:18cemerickI actually remember being *really* frustrated with the error messages the last time I did any prolog.
21:19dnolencemerick: yeah ambrosebs is adding pretty comprehensive errors to match.
21:20ambrosebs(syntax checking for now)
21:22zmarilIs there a way of rewriting a function once it is written?
21:22zmarilLike if I did (defn example [] "a")
21:22amalloywrite it again
21:23zmarilHmmm. I need a better way to phrase this.
21:23zmarilWhat's the inverse of eval?
21:23zmarilList?
21:23ibdknoxany ideas why the clojurescript compiler will work consistently from the repl and inconsistently once it is run using lein run?
21:24amalloyzmaril: don't write code that modifies code at runtime
21:24ibdknoxor perhaps a better question: are there obvious differences between running code in those two contexts that I can start to dig into?
21:25amalloyfeel free to rewrite functions yourself at runtime, or programmatically at compile time, but if you try to change code automatically at runtime then (a) you're doing something difficult and dangerous for no reason, and (b) it won't work well
21:25zmarilHmm
21:25zmarilThen I need to find a new way to do differentiation.
21:26zmarilI would like to do something like (diff #(+ 1 %)) and get back #(1)
21:26kencauseyzmaril: A thread of possible interest, starting with 2nd post: http://groups.google.com/group/clojure/browse_thread/thread/55178d64138f664b#
21:27amalloyzmaril: finding the derivative of an arbitrary function is basically impossible
21:27amalloy(you can approximate it numerically, of course)
21:27kencauseyzmaril: actually starting with daly's 4th post in that thread
21:28zmarilkencausey: I know! I am trying to get a study group going for this at Texas A&M. If you scroll down I am like the 12th post actually on that thread
21:28kencauseyzmaril: oops ;)
21:28amalloybut if you instead pass around the *list* '(+ 1 x), then you can differentiate that without a problem
21:28zmarilamalloy: Numerical is pretty easy.
21:28zmarilI was just thinking like basic calc 1 stuff
21:29zmarilOkay. Lists it is then.
21:29kencauseyrepresenting them as functions does not seem the best in this case
21:29zmarilCan you turn a list into a function later on though?
21:29amalloyeval
21:29scottjat least one of the famous lisp books covers this near the beginning I think
21:29amalloyscottj: sicp
21:30zmarilI skimmed through that once. I am probably just remembering the problem without remembering why.
21:30kencauseyyep, at least the first level of this very task is discussed IRIC
21:30amalloyif you skim through sicp you are either an inhuman supergenius, or not actually reading it
21:31zmarilMore the latter than the former.
21:31zmarilI just heard it was neat and looked at it and balked.
21:31dnolen,(.write (clojure.lang.RT/errPrintWriter) "foo")
21:31clojurebotfoo
21:31clojurebotnil
21:31dnolenis there a better way to do that ^
21:32amalloydnolen: rebind *err*?
21:32amalloyer, the other way round. write to *err*
21:33dnolen,(binding [*out* *err*] (println "foo"))
21:33clojurebotfoo
21:33dnolen?
21:33clojurebotnil
21:38scottj,(.print *err* "foo\n")
21:38clojurebot#<IllegalArgumentException java.lang.IllegalArgumentException: No matching method found: print for class java.io.StringWriter>
21:38ibdknoxit's append I think
21:38ibdknox,(.append *err* "woo")
21:38clojurebotwoo
21:38clojurebot#<StringWriter woo>
21:38scottj,*err*
21:38clojurebot#<StringWriter >
21:39scottjthat's why, on my system it's #<PrintWriter java.io.PrintWriter@1f4b3950>
21:40ibdknox,(.write *err* "hey")
21:40clojurebothey
21:40clojurebotnil
21:40ibdknox.write should work on all of them
21:42amalloydnolen: that works too, yeah
21:45scottjibdknox: do the dom utils in pinot actually work?
21:46ibdknoxlol
21:46ibdknoxyes?
21:48scottjso (h/append-to (h/dom-find "#wrapper") (h/html [:h1 "hi"])) should work?
21:48ibdknoxI've left it alone for the past couple of days trying to figure out why the cljs compiler isn't working consistently from a jar, but what's there works
21:48dnolenhmm similar to line, how can we get the file that we're in?
21:48ibdknoxscottj: as long as #wrapper exists by the time you call that, yep
21:49cemerickdnolen: I think you're SOL on that one.
21:49cemerick(meta &form) only has :line, at least in -beta1
21:50cemerickObviously would also include other user-supplied metadata, but that's it for reader-sourced info.
21:51dnolencemerick: I guess you can just assume the ns …
21:54cemerickYeah, I guess so.
22:26sridthe joy of clojure has an elevator FSA example demonstrating `trampoline` -> https://github.com/joyofclojure/book-source/blob/master/src/joy/elevator.clj
22:27pcavsBoston Clojure Meetup was interesting... Is it traditional to start a smug lisp weenie argument at the beginning of every one?
22:28cemerickprobably depends on how many smug lisp weenies are in the room
22:29sridumm, ok. i understand why trampoline is required now.
22:32cemerickpcavs: how many attended total?
22:32pcavscemerick: ohh around 25 I'd say
22:32cemericknot bad
22:32pcavsyeah
22:33technomancypcavs: ... man I don't know what that was all about
22:33cemerickNo video, transcripts?
22:34pcavstechnomancy: haha, yeah...
22:35drewrcemerick: not worth it
22:35pcavsyeah
22:35cemerickwhew, that bad, huh?
22:35pcavsAlthough the project it was trying to shed light on looks interesting
22:35drewrpcavs: right. was hoping for a tutorial/demonstration. instead...
22:37pcavsdrewr: If you hang out in #scheme and ask stupid questions about syntax rules, there are users who will take pity on you, as they did me.
22:43sridso far, I've read till chapter 7 of the-joy-of-clojure, but I'm impatient to work on a real-world Clojure project, so I'll start one immediately, and slowly resume reading the later chapters (macros, multi methods, java.next, mutation, STM). or is that too hasty?
22:43scottjnope
22:44drewrsrid: not at all; there are useful programs to be written with none of those features
22:44amalloysrid: you have plenty to get started with
22:44sridgreat, i'm thinking of writing a web app actually.
22:44drewrin fact you probably don't really understand them anyway until you need them
22:44sridtrue.
22:44amalloyheh
22:45amalloysrid: you're likely to want a little bit of mutation for a webapp, but it's (a) not strictly necessary, and (b) not that hard to learn once you decide you need it
22:47sridwill keep that in mind.
22:48ibdknoxdnolen: have you started in on the cljs watch stuff? I was thinking of making a lein plugin
22:48dnolenibdknox: hadn't had a chance to look into that yet.
22:48scottjmake noir-cljs work without noir?
22:49ibdknoxscottj: basically, yes
22:50ibdknoxdnolen: the suggestion to listen on a port seemed odd to me, thoughts?
22:50dnolenibdknox: can't say I've thought too much about it.
22:50scottjI thought it was weird too
22:51ibdknoxI would've expected that it just took over the thread like every other watcher would
22:51scottjif you want to stop it, ^c
22:51ibdknoxyeah
22:51ibdknoxdnolen: mind if I throw something together?
22:53dnolenibdknox: not at all.
22:53ibdknoxscottj: did that pinot stuff work for you? Sorry, I had to scoot for a bit
22:54scottjibdknox: nope, I got distracted trying to get pinot to load in the browser repl branch
22:54scottjunfortunately no ns or require
22:54scottjor ns works, but require in ns doesn't work I don't think
22:55ibdknoxheh
22:55ibdknoxI talked with Brenton about that a bit
22:55ibdknoxhe didn't think it was necessary
22:55ibdknoxbrepl has require
22:55ibdknoxfwiw
22:55scottjI wonderd how much you guys had communicated
22:56scottjwhy didn't he think it was necessary?
22:56ibdknoxthere was some and then just went off and did it themselves without talking to me anymore
22:56scottjyou can go to each file and load it
22:56scottjit seemed like they started it after brepl was finished
22:56ibdknoxthey did
22:56ibdknoxby a couple weeks lol
22:57ibdknoxI dunno I was somewhat confused by it
22:57scottjI have what would be a sweet setup, .cljs files go to inferior-lisp and .clj to slime, so I can c-x c-e a form and it goes to the right place, but that's pretty useless if you can't load other libraries
22:57TheBusbyHmm, any idea why enhanced primitive support isn't working here? http://pastie.org/2394699 I more or less copy/pasted the examples for assembla and it doesn't appear to be working...
22:58ibdknoxscottj: yeah, I didn't think a repl sans require was very useful
22:59ibdknoxsince you have to know up front what you want and have direct access to its source
22:59ibdknoxit was a little odd to implement an entire long polling server from scratch too
22:59ibdknoxbut they wanted it to have no external dependencies
22:59ibdknoxwhich is fair I guess
22:59cemerickTheBusby: assembla is old
23:00cemerickhttp://dev.clojure.org/display/doc/Enhanced+Primitive+Support
23:00scottjdoes brenton work for relevance now? I saw his twitter location said durham
23:00cemerickTheBusby: Also, it may very well be working -- drop the hints and see what the relative perf is.
23:01cemerick^:static has no meaning anymore
23:01ibdknoxscottj: I don't think so, but I'm not certain. When I was talking to him before he said he wasn't part of clojure/core
23:01TheBusbycemerick: The first run, in the pastien, was minus type hints
23:02cemerickOK, its formatting is pretty garbled on my end, didn't look too hard at it.
23:03TheBusbycemerick: trying the double example from the dev.clojure.org page is 1000ms slower than the original unhinted example
23:04scottjibdknox: so is there a dom ready function in closure like jquery I should be putting the h/append-to stuff in?
23:04cemerickTheBusby: I don't believe it ;-)
23:04cemerickworksforme, anyway
23:05TheBusbycemerick: hmm, further info http://pastie.org/2394730
23:05TheBusbycemerick: could JVM settings be throwing it off?
23:06cemerickTheBusby: your platform, java rev?
23:06TheBusbyjava 1.6.0_26 or ubuntu server
23:07cemericksun/oracle JVM, or icedtea/openjdk guff?
23:07TheBusbysun
23:07cemerickDoesn't seem like that'd be a problem.
23:08carllercheI just made my first clojure project public. https://github.com/strobecorp/picard/
23:08carllercheIt's an async HTTP framework built on netty... thanks for all who helped me learn clojure :)
23:08carllerche(It's still very raw, but I might as well make it open)
23:08ibdknoxscottj: just put it at the bottom of your body for now
23:09ibdknoxscottj: apparently it was an explicit design decision in google closure not to have a document loaded event
23:09scottjibdknox: ahh that worked, thanks!
23:09ibdknoxscottj: I'll probably come up with something
23:09TheBusbycemerick: thanks. Are you using a newer JVM or anything?
23:09ibdknoxscottj: but for now that's the best solution
23:10cemerickTheBusby: nope, 1.6.0_26 on OS X.
23:10scottjibdknox: cool, so pinot works after all :)
23:10cemerickTheBusby: I often deploy stuff to ubuntu server w/ sun JDK though, so I would mostly discount that (unless you're doing something funny with jvm opts).
23:11TheBusbycemerick: I just disabled all jvm-opts, everything got slightly slower but no hinting improvement :(
23:11cemerick"disabled"?
23:11carllercheredinger: hey
23:11TheBusbycemerick: this is via lein-swank BTW, not sure if that makes any difference. "disabled" = commented out in project.clj
23:12cemerickTheBusby: As a sanity-check, just do `java -jar clojure.jar`, and copy/paste the different impls in.
23:13TheBusbycemerick: k, checking no
23:15TheBusbycemerick: no change, even while running as java -jar
23:15cemerickbizarre
23:15cemerickTheBusby: paste full output of java -version
23:16TheBusbycemerick: http://pastie.org/2394781
23:17TheBusbycemerick: java version information in comments at the bottom
23:19cemerickwonky
23:19cemerickI don't have a theory for you at the moment
23:20TheBusbycemerick: I'll try a couple other machines and see if I have the same problem
23:21scottjTheBusby: I reproduced your problem
23:23TheBusbyscottj: Great to hear I'm not the only one. I spent forever tracing this back, and then decided to speak up here when I couldn't get the example on the website to work.
23:26TheBusbyI just tried with clojure-1.3.0-alpha7 and I experience the same issue.
23:28scottjfor reference http://pastie.org/2394808
23:30ibdknoxTheBusby: we're up to 1.3.0-beta1 now
23:31TheBusbyibdknox: I just wanted to make sure the issues occured in both beta1 and alpha7
23:31ibdknoxah
23:33cemerickscottj, TheBusby: Not sure what to say; the stuff works, has for a while. There has to be a (maybe not isolated?) config issue or something… https://gist.github.com/c54c261b8675e85fe600
23:33TheBusbycemerick: I just replicated this on an ubuntu server and my macbook, both are using sun 1.6.0_26 though
23:42scottjTheBusby: your several examples all call fib
23:45TheBusbyscottj: Here is the exact code I'm testing with now, and it includes the reference example you provided: http://pastie.org/2394869
23:45scottjthe reference I posted was wrong, notice how they're all calling the same function fib :)
23:46TheBusbydoh, you're right
23:46scottjthe one you want is fib3
23:46TheBusbygotten too used to recur
23:47scottjI really like that aspect of recur
23:47TheBusbyWell that solves the issue. Sorry for wasting time :(
23:49cemerickGuess I should go to bed.