#clojure log - Aug 18 2011

The Joy of Clojure
Main Clojure site
Google Group
IRC
List of all logged dates

0:24 callen: okay okay

0:24 what happened to leiningen?

0:24 lein swank disappeared, lein repl claims to start a socket server, but slime connect against that port doesn't work.

0:25 amalloy: $google lein swank plugin install

0:25 lazybot: [technomancy/swank-clojure - GitHub] https://github.com/technomancy/swank-clojure

0:28 callen: clojure-jack-in isn't coming up in my completions for the latest version of clojure-mode either.

0:29 clojure-jac [No match]

0:29 and it matches the raw version of the latest clojure-mode.

0:33 scottj: callen: maybe you're using the wrong elpa repo

0:34 callen: No I manually added it.

0:34 scottj: did you byte compile it and that version not the source is being loaded?

0:34 callen: think I have it now.

0:35 I'll have an answer momentarily. It's stuck on "Starting swank server..." for clojure-jack-in atm.

0:35 I wrapped it in my safe-load function.

0:36 got it.

0:37 scottj: I avoid using package managers for my emacs.

0:37 scottj: my .emacs.d is eldritch and custom-assembled from long before marmalade existed. :)

0:37 duncanm: amalloy: i feel like a newbie asking this, do you know about this slime-clj is void issue?

0:37 callen: scottj: thanks for the pointers though.

0:37 amalloy: duncanm: i don't know anything about it

0:43 duncanm: hmm

0:44 is slime-ritz the preferred way to run clojure in slime now?

0:51 scottj: duncanm: almost everyone is still using slime-clojure

0:51 ritz = slime-clj, if you want to do debugging it has the best interface imo

0:52 duncanm: scottj: yeah, i'm back to using swank-clojure

0:52 scottj: it 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

0:54 if 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

1:10 grant_: 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

1:11 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)

1:11 but that means i can't tweak any more because the variable seems to be holding onto the old function

1:12 is there any way to propagate my tweaks to all functions? or what is the right way to solve this problem?

1:14 amalloy: grant_: is the actual function my-fn still global?

1:15 grant_: yes

1:15 amalloy: if so, you can pass in #'my-fn instead of my-fn

1:15 grant_: that is an interesting bit of syntax

1:15 what is it?

1:15 amalloy: &(quote #'inc)

1:15 lazybot: ⇒ (var inc)

1:15 amalloy: &#'inc

1:15 lazybot: ⇒ #'clojure.core/inc

1:15 amalloy: &inc

1:15 lazybot: ⇒ #<core$inc clojure.core$inc@14e1328>

1:16 grant_: interesting...

1:16 amalloy: &@#'inc

1:16 lazybot: ⇒ #<core$inc clojure.core$inc@14e1328>

1:16 grant_: ok now you're just trying to scare me :)

1:17 amalloy: heh

1:17 nah. just pointing out that derefing a var gives you its value

1:17 grant_: i see

1:18 that's awesome, that fix 'just worked'

1:18 jblomo: in clojurescript, i'm seeing undefined *ns* and ns-aliases. are these in the "eventually will implement" or "will not implement" list?

1:19 grant_: thanks a lot

1:19 amalloy: grant_: if i wanted to scare you with a raft of punctuation i could do worse :)

1:19 grant_: :)

1:26 scottj: tbatchelli: you missed pacman :)

1:27 tbatchelli: did I? I just got the tweet

1:27 unfortunately, it crashes Safari

1:28 scottj: ahh I guess not, the release was ~7 hours ago but I guess no one tweeted about it

1:28 tbatchelli: I guess so

1:28 scottj: I think it only works in chrome and firefox 6

1:28 tbatchelli: works on chrome, that I know

1:28 vey cool

1:29 the 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

1:29 scottj: I didn't realize you can zoom in and it sitll works fine

1:30 srid: $google clojure pacman

1:30 scottj: I think it's funny that he added doom and vim keybindings

1:30 lazybot: [Monads in Clojure] http://intensivesystems.net/tutorials/monads_101.html

1:30 tbatchelli: so far facts are backing me up

1:30 scottj: tbatchelli: one thing that is cool about this is he doesn't need appengine or heroku bc the entire app can run off github

1:31 srid: http://mjg123.github.com/pacman/pacman.html

1:31 tbatchelli: scottj: indeed. That's some feature. I guess that's a good thing about javascript

1:33 scottj: I 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

1:36 srid: On 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.

1:36 whoa!

1:36 I understand zen now. ;-)

1:38 ctx - http://people.csail.mit.edu/gregs/ll1-discuss-archive-html/msg03277.html

1:39 scottj: tbatchelli: 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

1:40 tbatchelli: scottj, yeah, I see that as an issue too

1:41 scottj: tbatchelli: 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 :)

1:41 tbatchelli: scottj: I guess a good solution would be to stop using Wordpress and use something that I can customize more

1:41 scottj: easier to read in that it looks less cluttered

1:42 how many subscribers does disclojure have?

1:42 tbatchelli: feedburner =

1:42 >

1:42 > ~750

1:42 hsbot: Pattern syntax in expression context: ~750

1:42 scottj: I'm surprised there's not something like this that supports lots of languages, I think it's super useful

1:42 have you thought about expanding to other languages?

1:43 tbatchelli: yes, but before that I need to work on my project of expanding days to 48h

1:43 scottj: I think the way to do it would be one editor per language

1:43 tbatchelli: agreed, I thought about that

1:44 scottj: are you using any special tools or just copying pasting the relevant tweets?

1:44 tbatchelli: I hace some clojure code that does the hefty work

1:44 but I still read a ton of tweets, around 100 a day at least

1:45 (which, interestingly enough, is a number that has been stable over the last 20 months or so)

1:45 so growth in twitter is based on retweets, not original tweet

1:45 tweets

1:45 scottj: a 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)

1:46 tbatchelli: simpler, but works ok. I'd like to do what you suggested with ClojureScript, but again, that's pending the 48hr day project ;)

1:47 a lot of people read the intertweets via planet clojure, so my readership count is probably very off

1:48 scottj: tbatchelli: do you have any ideas how to monetize an expanded to more languages version?

1:48 tbatchelli: not looking for monetization for now, but maybe expanding, yes

1:48 I see this as a community service

1:50 scottj: I think it a js/ruby/python version would be super popular with a few witty editors

1:50 tbatchelli: it probably would

1:50 thanks for the enthusiasm :)

1:50 scottj: big fan :)

1:51 tbatchelli: I have the idea in my mind, but too busy working on pallet now :)

1:51 I should get back to it… it needs a ui and better algorithms to summarize the tweet stream

1:52 I'd recon that there are orders or magnitude more tweets with "ruby" in them than ones mentioning "clojure"

1:52 scottj: do you sort by retweets?

1:52 # of

1:53 tbatchelli: not really, but I group tweets about the same thing together

1:53 and usually quote the earliest tweet of the bunch

1:53 although twitter's timestamps are quite all over the place

1:55 sometimes the most interesting stuff is only tweeted once, while boring stuff is retweeted tens of times

1:55 popularity != interest

1:55 scottj: do you read everything with clojure or #clojure?

1:56 tbatchelli: I do

1:57 for example, today was a slow day. 152 tweets in 24hrs. Of those, only 85 are original tweets

1:57 so I read about 85

2:08 amalloy: yeah, sadly development mostly tapered off before we implemented a viable way of publicizing all solutions

2:09 patches welcome, as they say

2:09 tbatchelli: in general, #clojure is not very noisy. If anything, plenty of people talking about having received a clojure book like Joy, Practical, or Programming

2:10 amalloy: the joy of practical programming

3:13 gausos: hi

3:13 FYI: 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/

3:14 maybe the code used in the comparison wasn't very idiomatic

3:16 scottj: I doubt the code is doing the task in the same way

3:17 if you look at the shootout clojure averages maybe 3x java/scala, and that's without 1.3

3:17 jli: scala is about equal to java? interesting

3:18 dbushenko: 1.3 slower then 1.2??

3:20 gausos: scottj: it's weird that list recursion/reduction be faster in java than in clojure! Much faster"

3:21 maybe some clojure guru could review the code used in the comparison?

3:21 raek: "Updated clojure element recursion code as per suggestion by David Nolen. Now time down from 135.36 to 29.170 microseconds"

3:21 gausos: that blog is referenced in DZone, too: http://java.dzone.com/articles/contrasting-performance?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+javalobby%2Ffrontpage+%28Javalobby+%2F+Java+Zone%29

3:22 raek: but in plain java 6 they are 1.435 ms 2.816 ms

3:22 28.753 vs 2.816 !

3:24 scottj: gausos: you could post the clojure code to ml asking for improvements

3:26 gausos: should be https://github.com/dnene/josephus/blob/master/element-recursion/josephus.clj and https://github.com/dnene/josephus/blob/master/list-reduction/josephus.clj

3:27 scottj: ml = mailing list

3:27 lau jensen did some scala vs clojure speed tests a year or two ago

3:45 jli: hm, I must be doing something wrong

4:00 he uses (= 0 ...) instead of zero? and didn't use recur in his main function, but these changes don't appear to make a difference

4:08 clgv: When 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?

4:11 Chousuke: clgv: until you take one item from it, there's are only two objects.

4:12 clgv: the seq generated by range and the seq generated by filter

4:12 clgv: Chousuke: ok. I was inprecise. when I now do a (doall fs) how many LazySeq objects related to fs are there?

4:13 Chousuke: most likely 5 at the end since the unused range nodes get gc'd

4:14 You'd have to read the code to get the real object count though

4:15 clgv: ok. so the following iterations over fs only see the 5 objects that represent the filtered values?

4:15 Chousuke: yeah, lazy seqs are cached

4:15 raek: range will create 10 conses (which will all be gc:ed) and filter will create 5 conses

4:16 clgv: I started reading the code for filter lazy-seq and clojure.lang.LazySeq but was not pretty sure yet

4:16 Chousuke: so once an item is generated it'll cache it

4:16 raek: the caching lies in the (lazy-seq ...) wrapper

4:17 amalloy: i 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

4:17 raek: when you call seq on it it will evaluate the body and remember it for later seq calls

4:18 clgv: humm ok. another related question: do the the generated LazySeq-Objects except the first only exist as long as they are not evaluated?

4:19 ordnungswidrig1: clgv: do you ask if the are "realized" in-place?

4:20 clgv: ordnungswidrig1: kinda, yes. I do get the impression when reading LazySeq.seq() implementation

4:21 mduerksen: join #clojure.de

4:21 ups

4:21 ordnungswidrig1: mduerksen: *g*

4:21 mduerksen: sorry ^^

4:23 clgv: the 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?

4:24 ordnungswidrig1: clgv: I don't think so. the sequence will be realized once.

4:28 Chousuke: you can test that pretty easily

4:28 clgv: how?

4:28 clojurebot: with style and grace

4:30 Chousuke: You can try filtering a very long seq and then try to do something with it several times

4:30 if you filter it so that it leaves just a few elements, the first run should be noticeably longer than the rest

4:32 clgv: uuh but that has to be pretty long to notice the difference just because of wandering through unused objects

4:32 Chousuke: well it's not hard to create a seq of a hundred million objects :)

4:33 then filter it with #(> 5 %) :P

4:36 clgv: ok I think I have a comparison

4:37 ah well not really. range also calculates something...

4:37 crazyFox: does anybody know why negative ints are represented with 64 bits?

4:38 ,(format "%X" (Integer/MIN_VALUE))

4:38 clojurebot: "FFFFFFFF80000000"

4:39 amalloy: $javadoc java.util.text.Formatter

4:39 mutter

4:42 http://download.oracle.com/javase/1.5.0/docs/api/java/util/Formatter.html

4:42 If 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.

4:43 and, crazyFox, it sounds like you're suggesting that FFFFFFFF80000000 is -1, which it isn't

4:44 wait, what i just said is retarded. that last part, anyway. my quote from the javadocs is still dead on

4:44 anyway, i'm going to bed. you know what to read if you want to learn more

4:44 timvisher: hey all

4:45 anyone know if it's 'official policy' to use the contrib tools if they're available rather than another implementation?

4:45 i.e. data.json vs. cheshire?

4:46 obviously, 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?

4:47 crazyFox: amalloy: kk, thx

4:47 clgv: Chousuke: ok no overhead their. I tested with a combination of doall and dorun

4:47 like this: (time (def r (doall (range 10000000)))) (time (dorun r)) (time (def f (doall (filter #(zero? (mod % 100000)))))) (time (dorun f))

4:51 is there any abbreviation in clojure to access private fields via reflection? I just want to complete my lazy-seq understanding by some scalpel investigation ;)

4:52 ah clojure.contrib.reflect sounds promising

4:55 thorwil: timvisher: 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

5:02 timvisher: thorwil: 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

5:03 something 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.

5:04 this 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

5:04 thorwil: timvisher: i'd say it's quite simply: if an existing solution exists, use it. if it's almost there, but not quite, consider contributing

5:04 timvisher: it's just less clear to me regarding contrib what the purpose of it is

5:05 that's where i'm leaning

5:05 just figured i'd ask about it. :)

5:05 clgv: ok 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

5:08 ah one error in that statement, the one LazySeq object is the only one provided I evaluated the whole sequence

5:20 tsdh: Hi

5:28 jeremyheiler: hey

7:23 clgv: how 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

7:27 kencausey: clgv: alias perhaps?

7:28 clgv: kencausey: no, alias is only for namespaces

7:28 kencausey: right, sorry

7:29 clgv: second try: refer

7:29 clgv: I cant rename with refer ;)

7:30 kencausey: :rename keyword arg?

7:31 clgv: oh right

7:31 thx

7:31 kencausey: yay, par 2.5

7:35 clgv: what's that?

7:35 kencausey: sorry, I managed to answer the question in a bit more than 2 tries.

7:35 clgv: lol ok ;)

7:36 kencausey: About the only time I can manage is when not enough people are around who can answer much faster than I ;)

7:37 lnostdal_: 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

7:38 checking this using a finalization function would have been great .. hum

8:11 clgv: lnostdal_: can you provide an explanation of what you do with code examples?

8:11 hiredman: lnostdal_: it is not, the fn is just added to a map with the key as a key

8:22 lnostdal_: oh, hiredman

9:00 cemerick: Hrm, someone just said I was from a particular "paradigm cult".

9:00 I wonder if that's a good or bad thing :-P

9:01 ejackson: you probably score points either way

9:03 it would be a cool domain name :)

9:03 not taken

9:04 sleepynate: anyone know of a library that renames/implements the HOFs from haskell in clojure?

9:05 chouser: sleepynate: what are you missing?

9:05 foldleft?

9:05 sleepynate: chouser: oh i'm not _missing_ anything... i just find myself going back and looking up "oh foldl, that's reduce"

9:06 just the names being different, i lose a little time trying to discern which one i'm looking for in clojureland

9:06 chouser: Ah. Well, just like #define BEGIN { in C, I think you'll have to do that yourself or not at all. :-)

9:07 kencausey: best not and expect repeated use to burn it into memory

9:07 noidi: how can I restart a swank session started with `clojure-jack-in`?

9:08 sleepynate: haha 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 ;)

9:08 technomancy: noidi: kill *swank* and M-x clojure-jack-in

9:08 cemerick: ejackson: a good domain name indeed :-)

9:08 Too bad I don't have anything to put on a site named as such.

9:08 noidi: technomancy, thanks!

9:08 sleepynate: chouser: btw your book has ended up being a good recommendation to folks. cheers.

9:09 chouser: sleepynate: cool, thanks!

9:09 sleepynate: yea, folks seem to dig it.

9:10 and this is to java/scala folk, as opposed to lispers.

9:10 dunno if that feedback helps at all

9:11 chouser: interesting. It's certainly nice to know.

9:12 sleepynate: rock 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

9:12 chouser: heh. I totally understand.

9:12 kencausey: technomancy: 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?

9:19 technomancy: kencausey: it's supposed to

9:19 in fact it does for me

9:20 but there have been reports of that not working in some versions of emacs, so right now that's my advice

9:20 kencausey: ah, noidi: did you try to just run clojure-jack-in

9:22 technomancy: next version will have that fixed

9:25 kencausey: excelletn

9:25 s/tn/nt/

9:25 lazybot: <kencausey> excellent

9:25 technomancy: unfortunately it is behind Leiningen, slamhound, and swank-clojure on the queue

9:26 kencausey: technomancy: you are just too prolific

9:28 st3fan: what is slamhound?

9:28 technomancy: clojurebot: slamhound?

9:28 clojurebot: Excuse me?

9:28 technomancy: dang

9:28 clojurebot: slamhound is for reconstructing your ns forms from scratch: https://github.com/technomancy/slamhound

9:29 clojurebot: c'est bon!

9:29 sleepynate: should i define a helper function inside a lambda? or is the convention to recur?

9:31 kencausey: I should think both have their uses and cases

9:31 sleepynate: ok

9:32 loop / recur has kind of wants to be loop/for for me, but it is foreign and scary to me ;)

9:32 kencausey: or perhaps but a better way, you might want to show an example of where you are not clear which is the better choice

9:32 s/but/put/

9:32 lazybot: <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

9:32 kencausey: you don't have to use the loop bit ;)

9:33 sleepynate: orly?

9:33 for example, if i'm writing a lambda version of "last"

9:34 * kencausey checks to make sure he isn't confused

9:35 manutter: ,(letfn [(countdown [n] (if (zero? n) nil (do (println (str n "...")) (recur (dec n)))))] (countdown 3))

9:35 clojurebot: 3...

9:35 2...

9:35 1...

9:35 kencausey: recur will recur on function points, not just loop

9:36 * kencausey was a little surprised not to find recur in the API docs

9:37 sleepynate: (fn [x & xs] (if ((= (len xs) 0) x) (recur xs))) ?

9:37 something along those lines?

9:38 joly: ,((fn [x & xs] (if ((= (len xs) 0) x) (recur xs))) 1 2 3 4 5)

9:38 clojurebot: #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: len in this context, compiling:(NO_SOURCE_PATH:0)>

9:39 bpr: use count

9:39 joly: ,((fn [x & xs] (if ((= (count xs) 0) x) (recur xs))) 1 2 3 4 5)

9:39 clojurebot: #<CompilerException java.lang.IllegalArgumentException: Mismatched argument count to recur, expected: 2 args, got: 1, compiling:(NO_SOURCE_PATH:0)>

9:39 sleepynate: oh hrm

9:39 kencausey: ,((fn [x & xs] (if ((= (count xs) 0) x) (recur xs))) [1 2 3 4 5])

9:39 clojurebot: #<CompilerException java.lang.IllegalArgumentException: Mismatched argument count to recur, expected: 2 args, got: 1, compiling:(NO_SOURCE_PATH:0)>

9:40 manutter: or better yet, use (if (seq xs)...

9:40 bpr: true

9:40 sleepynate: ahh good point there too

9:40 joly: Hmm, I don't think recur will work right here if we're using & xs ?

9:40 technomancy: recur and destructuring interact in bizarre and inexplicable ways

9:41 bpr: joly: that destructuring works in (loop ...), at least in clojure 1.2.1

9:41 what verion is clojurebot?

9:41 technomancy: I 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

9:41 sleepynate: so i should define a helper in the anon? or is there a better way to do it?

9:42 bpr: btw, I'm simply refering to the [x & xs] destructuring, not all the rest of the code

9:42 manutter: ,((fn [x & xs] (if (seq xs) (apply recur xs) x)) 1 2 3 4 5)

9:42 clojurebot: #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: recur in this context, compiling:(NO_SOURCE_PATH:0)>

9:43 bpr: can you apply special forms?

9:43 manutter: ,(doc recur)

9:43 clojurebot: Gabh mo leithscéal?

9:43 joly: I doubt it

9:44 manutter: bpr: I'd say no, based on the experiment above.

9:44 bpr: yeah, lol

9:44 sleepynate: i love that i've broken #clojure in rewriting "last" :D

9:44 kencausey: try clojure is down?

9:44 sleepynate: kencausey: was yesterday

9:44 kencausey: Should that be pointed out to Raynes?

9:45 joly: someone did, but he may not have seen it

9:45 kencausey: I was more questioning my memory really.

9:45 hiredman: manutter: you cannot apply recur

9:45 manutter: hiredman: so I see :)

9:46 technomancy: how did the NYC meetup go?

9:46 hiredman: ,((fn [& xs] (when (seq xs) (recur [(rest xs)]))) (range 10))

9:46 clojurebot: Execution Timed Out

9:46 hiredman: huh

9:47 sleepynate: yea that just keeps stackin'

9:47 hiredman: var args and recur are funky

9:47 sleepynate: you're end up with a bunch of [10]

9:47 hiredman: ahh

9:47 hold on

9:48 Chousuke: yeah, the destructuring is not redone

9:48 so you need to pass in a seq

9:48 chouser: it's not really destructuring at that level

9:48 Chousuke: just (recur (rest xs))

9:48 hiredman: right

9:50 chouser: & 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

9:50 lazybot: java.lang.Exception: Unable to resolve symbol: is in this context

9:50 chouser: lazybot: um, yeah.

9:51 manutter: lol, lazybot is just saying "It all depends on what your definition of 'is' is..."

9:52 wastrel: lazy bot :[

9:55 bpr: ,(loop [[x & xs] (range 10)] (when (seq xs) (println x) (recur xs)))

9:55 clojurebot: 0

9:55 1

9:55 2

9:55 3

9:55 4

9:55 5

9:55 6

9:55 7

9:55 8

9:55 opqdonut: oh my

9:55 bpr: oop, sry about the spam

9:56 Chousuke: since when does clojurebot print newlines? :/

9:56 bpr: i was trying to demostrate that that destructuing works in a loop form. Why wouldn't it work when the recur target is a function?

9:56 manutter: hehe, that's why I only counted down from 3

9:57 Chousuke: bpr: different issue

9:57 bpr: oh?

9:57 Chousuke: bpr: the loop form starts with a seq, a vararg function can be called as (foo 1 2 3 4 5 ...)

9:58 clgv: Chousuke: clojurebot always printed newlines. that enables the fun of mail bombs ;)

9:58 Chousuke: clgv: huh, IIRC it used not to do that

9:58 clgv: Chousuke: it did already at least half a year ago

9:58 sleepynate: ,(fn [x & xs] (if (empty? xs) x (recur (first xs) (rest xs)))) '(1 2 3))

9:58 clojurebot: #<sandbox$eval4157$fn__4158 sandbox$eval4157$fn__4158@fc801f>

9:59 sleepynate: :o

9:59 ,((fn [x & xs] (if (empty? xs) x (recur (first xs) (rest xs)))) '(1 2 3))

9:59 clojurebot: (1 2 3)

9:59 sleepynate: hrm

9:59 Chousuke: Well, the last time I touched Clojurebot's code must've been like two years ago

9:59 clgv: you can use lazybot (sexpbot formerly) with clojurebot to spam with the mail feature ;)

9:59 TimMc: ,(println "&(println (\"I use arrows!\")")

9:59 clojurebot: &(println ("I use arrows!")

9:59 lazybot: java.lang.ClassCastException: java.lang.String cannot be cast to clojure.lang.IFn

9:59 TimMc: oops

9:59 clgv: almost ;)

10:00 TimMc: Well, close enough for demonstration purposes.

10:00 sleepynate: any way to see the call stack within a recur ?

10:00 TimMc: Does either bot have a bot flag set?

10:00 I don't see one...

10:01 sleepynate: I think the point is that there isn't one.

10:01 clgv: ,(doseq [x (range 3)] (println (format "&(println \"got %s\")" x))

10:01 clojurebot: #<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: EOF while reading>

10:01 TimMc: At least not for the thing you are recur'ing.

10:01 sleepynate: TimMc: well, or the deconstruction

10:01 clgv: ,(doseq [x (range 3)] (println (format "&(println \"got %s\")" x)))

10:01 clojurebot: &(println "got 0")

10:01 lazybot: ⇒ got 0 nil

10:01 clojurebot: &(println "got 1")

10:01 lazybot: ⇒ got 1 nil

10:01 clojurebot: &(println "got 2")

10:01 lazybot: ⇒ got 2 nil

10:01 sleepynate: TimMc: for example, in CLISP we can TRACE

10:01 joly: oh dear

10:01 clgv: ;)

10:01 TimMc: sleepynate: I wouldn't know about that, Paul.

10:02 :-)

10:02 bpr: i guess you can get the desired behavior with: ((fn [& [x & xs]] (println x) (when-not (empty? xs) (recur xs))) 1 2 3)

10:02 I'm not gunna eval it though lol

10:02 * sleepynate ಠ_ಠ

10:02 bpr: but that's fugly

10:02 technomancy: slime can do tracing, but I don't think it catches recurs

10:02 TimMc: sleepynate: You could build up a stack of past arguments and pass that around.

10:03 sleepynate: ,((fn [x & xs] (if (empty? xs) x (recur (first xs) (rest xs)))) 1 2 3 4) ; also works

10:03 clojurebot: 4

10:03 sleepynate: but also wasteful :P

10:03 bpr: yeah, because you're basically doing the destructuring in the recur form

10:06 clgv: how about: ##((fn [& [x & xs]] (if (empty? xs) x (recur xs))) 1 2 3 4)

10:06 lazybot: ⇒ 4

10:06 sleepynate: ,( (fn [x] (if (empty? (rest x)) (first x) (recur (rest x)))) [5 4 3 2 1] )

10:06 clojurebot: 1

10:06 clgv: but I am still not entirely sure why that works ^^

10:06 sleepynate: that gross beast worked

10:06 but there MUST BE A BETTER WAY

10:07 clgv: sleepynate: how about last?

10:08 TimMc: I believe that was the point.

10:08 sleepynate: ,( (fn derp [x] (if (next s) (recur (next s)) (first s)) [5 4 3 2 1])

10:08 clojurebot: #<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: EOF while reading>

10:08 TimMc: missed a paren, I suppose

10:08 sleepynate: the point was not to write last, it was toexcercise loop/recur versus a helper inside a lambda

10:09 ,( (fn derp [x] (if (next s) (recur (next s)) (first s))) [5 4 3 2 1])

10:09 clojurebot: #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: s in this context, compiling:(NO_SOURCE_PATH:0)>

10:10 sleepynate: ,( (fn derp [s] (if (next s) (recur (next s)) (first s))) [5 4 3 2 1])

10:10 clojurebot: 1

10:10 sleepynate: so that's basically stolen straight from core

10:10 looks like "ignore the rest of the seq and don't deconstruct " is the rule at hand there :p

10:11 bpr: it looks cleaner to me anyhow

10:11 TimMc: ,((fn derp [s] (if-let [n (next s)] (recur n) (first s))) [5 4 3 2 1])

10:11 clojurebot: 1

10:11 TimMc: yay if-let

10:11 sleepynate: oooh fancy

10:12 now rewrite using nnext

10:12 TimMc: ,(doc nnext)

10:12 clojurebot: "([x]); Same as (next (next x))"

10:12 TimMc: hrmph

10:13 sleepynate: what doesn't kill you makes you more annoyed at me

10:13 i mean... smarter

10:14 TimMc: ,(doc cdaddr) :-P

10:14 clojurebot: Gabh mo leithscéal?

10:15 bpr: lol, am I wrong for liking the conciseness of function names like cdaddr?

10:16 technomancy: we do have ffirst

10:23 sleepynate: for 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:24 but the (fn ... (recur (next _)) seems more fitting to clj :)

10:36 dnolen: slides from yesterday on pattern matching and predicate dispatch http://www.scribd.com/doc/62571669/Patterns

10:45 technomancy: he left before I could compliment his typography

10:47 oh man... matching dates is extremely badass

10:56 sleepynate: whoa

10:56 +1 pattern matching

10:57 between that and multiple argument set definitions... untz untz untz untz

11:04 rpg: technomancy: 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:07 technomancy: rpg: it's inside the swank-clojure jar

11:07 swank/payload/slime.el

11:08 rpg: technomancy: ah. I'm trying to figure out how to make an alternative emacs config for running clojure versus running CL...

11:08 (probably a task of interest to a vanishingly small sub-population ;->)

11:08 technomancy: ah yes, a problem that awaits an eager hacker who actually cares about CL

11:09 rpg: technomancy: I've actually had this problem before (using SLIME versus Franz's ELI) and emacs seems surprisingly resistant to a solution.

11:10 So 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:10 technomancy: that's the idea

11:10 rpg: technomancy: this is the arrangement described in your "simplification" post, right?

11:10 technomancy: M-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:10 yeah

11:14 rpg: technomancy: 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:15 technomancy: yeah, it's all in memory

11:17 rpg: last question (sorry!): does this require that we put swank-clojure-1.3.1.jar in the dev-dependencies?

11:19 technomancy: no, it can be a user-level plugin

11:24 rpg: sigh.... Didn't complete (got *swank* buffer; no *slime-repl clojure* buffer)... Suspect some "features" of my base-level emacs config conflict.....

11:36 dnolen: technomancy: oh yeah, Inconsolata for source and Latin Modern Roman, <3

11:37 for text

11:38 ejackson: dnolen: was anybody waving about a camcorder ?

11:38 bpr: or maybe just a microphone?

11:39 ejackson: slaves with clay tablets even ?

11:39 dnolen: ejackson: bpr: 2 people recorded

11:39 ejackson: sweet, any promises from them ?

11:39 dnolen: Tom Hickey asked for link to slides so probably pretty soon.

11:40 bpr: sweet

11:40 ejackson: thanks again, this is going to be really useful

11:40 bpr: ^

11:53 gtrak`: how is clojure.contrib's fmap different from map?

11:56 clgv: ,(range 0.1 1.0 0.1)

11:56 clojurebot: (0.1 0.2 0.30000000000000004 0.4 0.5 ...)

11:56 clgv: &(range 0.1 1.0 0.1)

11:56 lazybot: ⇒ (0.1 0.2 0.30000000000000004 0.4 0.5 0.6 0.7 0.7999999999999999 0.8999999999999999 0.9999999999999999)

11:57 gtrak`: clgv, http://download.oracle.com/docs/cd/E19957-01/806-3568/ncg_goldberg.html

11:57 joly: anyone have some quick code for downloading the contents of a URL?

11:58 gtrak`: take a look at clj-http

11:58 clgv: gtrak`: lol yeah I know. but maybe one should handle floating point numbers better in range

11:58 fliebel: joly: java.net.URL should do, if it's just for playing around.

11:58 raek: joly: you can open a input-stream or a reader on a URL object (see clojure.java.io)

11:58 joly: cool, thanks

11:59 gtrak`: clgv, nah... what would 'better' mean?

11:59 clgv: now I do it via: ##(->> (range 10) rest (map #(/ % 10.0)))

11:59 lazybot: ⇒ (0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9)

11:59 meredydd: gtrak`, Do you know if there's any chance clj-http will be acquiring POST support in the near-ish future?

12:00 gtrak`: pretty sure it has it already, no?

12:00 yea, do client/post

12:01 Pupeno: I'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:01 gtrak`: clgv, I think making some changes to what floating point does would butcher something somewhere, the IEEE standard is pretty well defined

12:02 clgv: gtrak`: lol I didnt suggest to change the IEEE standard :P

12:03 joly: ,(range 1/10 1 1/10)

12:03 clojurebot: (1/10 1/5 3/10 2/5 1/2 ...)

12:03 gtrak`: I'm just saying, you have to know what you're doing when you deal with floating point... no way around it

12:03 clgv: (map double (range 1/10 1 1/10))

12:03 ##(map double (range 1/10 1 1/10))

12:03 lazybot: ⇒ (0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9)

12:03 clgv: gtrak`: yeah but you dont have to get that error in range ;)

12:04 gtrak`: it's not an error

12:04 nature of the beast

12:04 clgv: if range cant support it's implied semantics for floats it should either handle it special or forbid you use floats with it ,)

12:05 ,(doc range)

12:05 clojurebot: "([] [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:06 gtrak`: 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:06 &(= .1 (/ 1 10))

12:06 lazybot: java.lang.Exception: Unable to resolve symbol: .1 in this context

12:08 sleepynate: gtrak`: fmap actually uses map under the hood to map a function across a collection into a collection of that type again

12:09 ,(fmap println {:a 5 :b 6})

12:09 clojurebot: #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: fmap in this context, compiling:(NO_SOURCE_PATH:0)>

12:09 sleepynate: derp

12:10 gtrak`: cljv, ##(= 0.1 (/ (+ 0.1 0.1 0.1) 3))

12:10 lazybot: ⇒ false

12:10 Scriptor: http://goo.gl/RgxPs <- source for fmap for those interested

12:11 gtrak`: sleepynate, is the key difference 'collection of that type' ? looks like map creates a lazy seq

12:12 Scriptor: gtrak`: seems so

12:13 since fmap uses into, and into uses conj, which uses the same type as the 'to coll'

12:13 in the case with fmap, the to-coll is the same type as the original collection

12:14 gtrak`: ah, interesting, so use fmap when you don't care about laziness or the source collection type

12:14 sleepynate: gtrak`: ok check this

12:14 &(map println {:a 5 :b 6})

12:14 lazybot: ⇒ ([:a 5][:b 6]nil nil)

12:14 sleepynate: prints but has weird nil nil return

12:15 (fmap println {:a 5 :b 6}) yields {:a nil, :b nil}

12:15 while printing "5" and "6" along the way

12:15 the return types are matched with the keys in a collection of the same type

12:15 gtrak`: huh, how do the original entries make it into the first return seq?

12:15 if print returns nil

12:16 oh, it prints those, then the return seq has (nil nil)

12:16 sleepynate: right

12:16 but for something like (map, there's no difference inc [1 2 3])

12:16 erm

12:17 hi termcap

12:17 gtrak`: ##(map (fn [[k v]] [k (println v)))

12:17 sleepynate: for something like (map inc [1 2 3]) ; there is no difference

12:17 gtrak`: ##(map (fn [[k v]] [k (println v)) {:a 5 :b 6})

12:17 &(map (fn [[k v]] [k (println v)) {:a 5 :b 6})

12:17 lazybot: java.lang.IllegalArgumentException: Wrong number of args (1) passed to: core$map

12:19 sleepynate: gtrak`: you missed a ]

12:19 &(map (fn [[k v]] [k (println v)]) {:a 5 :b 6})

12:19 lazybot: ⇒ (56[:a nil] [:b nil])

12:19 rpg: technomancy: 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:19 gtrak`: &(into {} (map (fn [[k v]] [k (println v)]) {:a 5 :b 6}))

12:19 lazybot: ⇒ 5 6 {:a nil, :b nil}

12:21 gtrak`: 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:22 sleepynate: probably

12:22 manutter: ,(map inc {:a 1 :b 3})

12:22 clojurebot: #<ExecutionException java.util.concurrent.ExecutionException: java.lang.ClassCastException: clojure.lang.MapEntry cannot be cast to java.lang.Number>

12:23 sleepynate: so basically, the functor is lifting the function as an object

12:23 if that makes sense

12:23 in fact... just read http://en.wikipedia.org/wiki/Function_object

12:23 :D

12:24 technomancy: rpg: you mean C-c C-k?

12:25 rpg: technomancy: ah. Does C-c C-k work in a project.clj to load the whole system?

12:25 Hm.... error: java.lang.Exception: Unable to resolve symbol: defproject in this context (project.clj:1)

12:25 If I have a bunch of files, I don't want to have to load them all by hand, do I?

12:26 I figured there was something I could load into my development environment that would do to the defproject form what leiningen does to it....

12:26 technomancy: leiningen doesn't do anything special for that

12:26 there's no difference between repl and swank in that regard

12:27 rpg: technomancy: 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:28 technomancy: repl and swank should both honor the :repl-init namespace

12:28 rpg: technomancy: Ah. I have only a :main, which repl seems to honor...

12:29 Also 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:29 technomancy: hm... I didn't know it did that; that's odd

12:29 I think that's a hold-over from before :repl-init existed

12:29 rpg: OK, will try with repl-init, thanks!

12:29 technomancy: anyway, just use C-c C-k on your main namespace or set repl-init

12:31 rpg: hm. I still got "user>"

12:34 But then (require '<ns>) works fine....

12:35 BTW, the "IN-PACKAGE" command works, but when I did the "C-c~" command (sync directory and package), the connection crashed....

12:35 Possibly just disabling this command would be a good thing....

12:37 technomancy: 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:47 ndimiduk: i have a question about protocols

12:47 i'd like to extend some of the definitions in clojure.java.io/IOFactory

12:48 i'd like to wrap existing functionality so i thought it would be a pretty straight forward example of functional composition

12:49 using find-protocol-method to grab the existing definition and invoke it when my additional conditions are not bet

12:49 *met

12:50 but 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:50 notably, (= (find-protocol-method io/IOFactory :make-input-stream String) (find-protocol-method io/IOFactory :make-input-stream Object)) => true

12:50 what am i missing?

12:58 Bronsa: ,(deftype X [x y] clojure.lang.Sequable (seq [this] '(x y)))

12:58 clojurebot: #<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.lang.ClassNotFoundException: clojure.lang.Sequable>

12:58 Bronsa: why is this not working?

13:00 hiredman: Bronsa: clojure.lang.Sequable doesn't exist

13:00 Bronsa: ,(instance? clojure.lang.Seqable '())

13:00 clojurebot: true

13:00 Bronsa: then why this works?

13:01 hiredman: huh

13:01 ah

13:02 check your spelling

13:02 Bronsa: oh.

13:02 i'm sorry, thanks

13:02 the funny thing is, i've typed that 2 times

13:07 dnolen: pattern matching talk video is up, http://vimeo.com/27860102, I need a haircut.

13:19 antares_: what's the best way to do "splicing" (à la Ruby and so on)? I cannot make apply work with merge-with

13:19 dnolen: antares_: ?

13:19 antares_: dnolen: for example, (merge-with concat [{ :a [1] } { :b [2] } { :a [3, 4] }])

13:20 doesn't work the way I want it to because merge-with is variadic

13:20 dnolen: ,(apply merge-with concat [{ :a [1] } { :b [2] } { :a [3, 4] }])

13:20 clojurebot: {:b [2], :a (1 3 4)}

13:21 dnolen: antares_: ^ is that not what you want?

13:21 antares_: hm

13:21 that's exactly what I want and I tried apply a few times

13:21 I must have done something wrong :)

13:21 let me try in SLIME

13:21 it works

13:21 dnolen: thank you :)

13:23 technomancy: maaaaan I wish pattern matching had been around when this code was written three months ago =)

13:25 dnolen: technomancy: haha

13:26 jorgeb: I 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:27 but maybe I am just not understanding the issue.

13:28 technomancy: jorgeb: gist the trace?

13:29 jorgeb: https://gist.github.com/071c764888b724364eae

13:29 technomancy: and project.clj?

13:30 jorgeb: added

13:31 technomancy: :main needs to be a symbol

13:32 jorgeb: aha

13:32 perfect, thank you technomancy

13:33 technomancy: sure

14:02 nickmbailey: is there a way to make 'lein run' not shut down my agent threadpools when my main function returns but the app keeps running

14:09 amalloy: dnolen: your hair is too exciting to cut

14:30 icey: dnolen: 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:30 dnolen: amalloy: ha!

14:30 icey: thx

14:33 amalloy: icey: 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:34 manutter: amalloy: http://www.scribd.com/doc/62571669/Patterns

14:35 amalloy: manutter: i meant in the HN discussion; i can follow twitter links myself :P

14:35 manutter: doh

14:35 :)

14:39 icey: amalloy: thanks, I added them in a comment

14:39 chouser: dnolen: ISpecializePattern provides a method that gets called at macroexpand time?

14:42 dnolen: chouser: yeah, pretty much everything is macroexpand time here.

14:43 * chouser nods

14:44 chouser: heh. "or" patterns use infix notation

14:45 dnolen: chouser: heh yeah, not tied to that. part of the reason is that the first thing in a list is currently always the pattern.

14:45 (p :or ...) (p | p | p) (p :when ...) (p :as ...)

14:49 chouser: I'm not critisizing -- don't know enough yet for my opinion to be of any value. Just struck me as amusing :-)

14:49 amalloy: chouser: dnolen is a secret anti-lisp rebel, trying to switch us all to infix

14:50 chouser: figured

14:52 amalloy: oh, 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:55 because in the matrix [[_ true] [false _]], you do need to match against false, just not right away

14:56 aaelony: hey 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:59 dnolen: chouser: 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:00 antares_: is there a predicate like string? but for numerical values?

15:00 amalloy: &(doc number?)

15:00 lazybot: ⇒ "([x]); Returns true if x is a Number"

15:00 antares_: interesting, cheet sheet does not mention it :) thanks!

15:02 amalloy: $findarg map % [3 "3" nil] [true false false]

15:02 lazybot: [clojure.core/number? clojure.core/integer? clojure.core/rational?]

15:02 amalloy: antares_: ^

15:02 dnolen: amalloy: yeah was not quite accurate that statement. you are correct. I chalk it up to nervousness.

15:03 was 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:03 amalloy: right

15:04 dnolen: so is match using core.logic, or are they separate?

15:05 dnolen: amalloy: not yet. It will when we tackle predicate dispatch.

15:17 lobotomy: what'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:18 dnolen: ,(time (+ 1 1))

15:18 clojurebot: "Elapsed time: 0.084 msecs"

15:18 2

15:18 dnolen: lobotomy: ^

15:19 lobotomy: hmm, of course... how do i turn that off though?

15:19 i mean, putting all the stuff inside (time ...). hmm, just define it to nop or something?

15:19 i mean, when i want to not print the debug timing stuff :)

15:20 dnolen: lobotomy: just remove it :)

15:20 lobotomy: if you're doing serious profiling, use a profiler.

15:21 lobotomy: well, 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:21 cheers

15:27 umh, i can't use time with macros though?

15:27 such as (time (cond (...))

15:28 dnolen: lobotomy: time is a macro.

15:28 you can use it anywhere pretty much.

15:30 lobotomy: hmm ok, seems to work with that stuff too yeah

15:32 ordnungswidrig: hi all

15:44 lobotomy: heh, 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:44 in a recursive function that is

15:45 apparently 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:45 or should i do this in some other way?

16:11 bsod1: I'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:13 amalloy: sigh. start by deleting everything on riddell.us

16:13 clojurebot: blog?

16:13 clojurebot: make 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:13 amalloy: oh well

16:13 i was hoping he'd point out that blogs on installing clojure are always, without exception, either terrible or out of date

16:14 clojurebot: lein?

16:14 clojurebot: lein is http://github.com/technomancy/leiningen

16:15 amalloy: bsod1: start there. download lein, run lein self-install, and then let it manage dependencies like contrib for you

16:16 bsod1: amalloy: 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:17 amalloy: that's like asking if you can use peanut butter with jelly - they're made for each other

16:18 why 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:21 babilen: bsod1: leiningen, clojure and clojure-contrib are all packaged for Ubuntu and backportable to older Ubuntu versions fwiw -- https://launchpad.net/ubuntu/+source/leiningen

16:24 bsod1: ok, 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:32 insideout: bsod1: lein repl

16:38 babilen: bsod1: btw, why the switch from VimClojure?

16:39 bsod1: babilen: I just want to try but still couldn't set up emacs starter kit + slime + clojure. I think I'll continue with vimclojure

16:41 babilen: bsod1: 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:43 scottj: dnolen: very good presentation.

16:44 dnolen: scottj: thx!

16:46 babilen: dnolen: 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:57 polypus74: ~ping

16:57 clojurebot: PONG!

16:59 polypus74: so 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:10 lobotomy: hmm, how do i make run-tests in clojure.test print the detailed results?

17:10 it did that but then i added another test and it stopped doing that, or something

17:10 coopernurse: polypus74: 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:12 lobotomy: seriously, wtf. should be asleep already and now the thing stopped telling me what is going wrong in the tests... >.<

17:17 ah ok, restarting the "lein swank" process helped... now (run-tests) actually prints the things again

17:24 polypus7`: coopernurse: weird, i restarted the server process and no longer get the error. thanks anyway

17:24 probably some wrap-reload funniness or something

17:28 coopernurse: polypus74: ah, great. it seems that restarting the REPL fixes many woes

17:28 over 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:09 sleepynate: what's the syntax to have a to automatically reload a module in the repl?

18:11 also to english good >_<

18:11 coopernurse: sleepynate: you could try: (use :reload-all 'my-namespace)

18:13 sleepynate: ahh many thanks

18:14 coopernurse: happy to help

18:18 sleepynate: now if i get clojurecheck working i will be a super-happy camper

18:19 or is "fact" more popular

18:29 lobotomy: how do i make a jar with leiningen that also contains the tests?

18:36 dnolen: looking forward to someone putting together a good match tutorial and/or blog post on how they used it *hint* *hint*

18:37 technomancy: inc

18:37 sleepynate: dnolen: soon as i find a good use for it, but the problems i solve with clojure aren't that complex ;)

18:42 scottj: dnolen: are the guard's wrapped in try's?

18:42 dnolen: sleepynate: 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:42 scottj: no, why do you think they should be?

18:42 sleepynate: oh yea... i am a perfectly happy haskeller, but all my funcitonal work is in my spare time :)

18:43 scottj: dnolen: in your preso the even? example would throw exception if you had strings and ints in same column no?

18:43 sleepynate: so 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:44 dnolen: scottj: true, but I'm not going to address that until predicate dispatch, there we can use implication to infer the other tests.

18:44 sleepynate: why can't you use pattern matching the same way you would in Haskell?

18:45 scottj: 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:45 scottj: dnolen: so a guard doesn't only restrict the pattern it's in, but that column of all the other patterns too

18:46 s/all/some

18:46 sleepynate: dnolen: 'cause i'm using clojure now :D

18:46 lazybot: <scottj> dnolen: so a guard doesn't only restrict the pattern it's in, but that column of some the other patterns too

18:46 sleepynate: dnolen: but point taken ;)

18:46 dnolen: scottj: guards are grouped at the moment very simply by guard sets.

18:46 all even? guards in the same column grouped together for example

18:46 if possible of course.

18:47 scottj: so no, a guard doesn't necessarily protect a whole column.

18:47 but the compiler may see that two rows have a column that share the same test and decide they can be tested together.

18:50 so who's going to add RegEx patterns? ;)

18:50 dsantiago: Sounds hard.

18:51 dnolen: dsantiago: matching would be pretty easy, but people will want to pull apart matches, that's the tricky bit I think.

18:51 dsantiago: Hm, yeah. That'd be awesome.

18:52 Unfortunately, I could barely understand the explanation of ISpecializeMatrix in your talk.

18:52 dnolen: dsantiago: ISpecializeMatrix is pretty tricky, I'll probably write a detailed explanation at some point.

18:53 dsantiago: Also, I wasn't sure if _ is special, or giving any unbound symbol will result in a successful match.

18:54 dnolen: ([_ _ _] :regex #"...") ?

18:54 dsantiago: unbound symbols are very much "named wildcards"

18:54 dsantiago: Cool.

18:55 I don't understand the question, though.

18:56 scottj: dnolen: 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:58 dnolen: scottj: you can have multiple fns in a guard, :when [number? even?]

18:59 scottj: yeah, I see now that solves the problem I was thinking of

18:59 dnolen: hmm I'm not a Regex person but it seems like a pattern that uses re-matches would be kind of sick.

19:00 dsantiago: Yeah, I could see doing route matching with something like ["post" #"\d+"] or something like that.

19:01 I 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:01 amalloy: dnolen: 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:08 dnolen: amalloy: ?

19:16 amalloy: regexes would be useful in matching if: ...

19:20 dnolen: (match [x] [([_ "comment" id] :regex #"(\w+)-(\d+)")] ... [([_ "post" id] :regex #"(\w+)-(\d+)")] ...)

19:20 more things to think about

19:23 TimMc: technomancy: Does lein currently just ban any *jure, or does it check a dictionary for s/j/s/?

19:24 joegallo: it actually sends him a text via soap, and he responds back with yay or nay

19:26 pjstadig`: soap via carrier pidgeon transport

19:26 technomancy: http://p.hagelb.org/via-soap.png

19:26 TimMc: srsly though; it's all jures except clojure and compojure

19:26 pjstadig`: and seajure

19:26 technomancy: no, I created seajure by hand

19:26 pjstadig`: wait... you can create projects by hand?

19:27 sleepynate: :o

19:27 technomancy: pjstadig`: well actually via M-x butterfly if you want to get technical

19:27 TimMc: I couldn't crack the encryption, I had to use lein.

19:27 pjstadig`: there's a way to defeat your protections???

19:27 lazybot: pjstadig`: Yes, 100% for sure.

19:27 pjstadig`: we're doomed

19:33 TimMc: (coming to you live from the Boston Clojure Meetup)

19:34 amalloy: lazybot: high five, dude. way to participate

19:36 BufferUnderpants: I'm having trouble connecting to SLIME in Emacs.

19:36 TimMc: I should have created a fake Meeup account for Lazybot and RSVP'd.

19:37 amalloy: TimMc: he wouldn't have shown up. too lazy

19:38 BufferUnderpants: When 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:39 technomancy: BufferUnderpants: slime-clj is not what you want

19:39 rm -rf ~/.emacs.d/elpa/slime-clj

19:40 amalloy: technomancy: 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:40 technomancy: haha awesome

19:40 it's a trick I learned from pascal j bourginton

19:40 amalloy: see, and now he's gone. probably slime-clj is symlinked to /

19:41 TimMc: I think it would have to be hardlinked.

19:42 (Hardlinked directories are *awesome*.)

19:42 amalloy: i didn't think you could hardlink directories

19:42 TimMc: I think it is very, very discouraged.

19:42 technomancy: http://groups.google.com/group/comp.lang.lisp/msg/4c95766a8bdda347 for the reference

19:42 TimMc: amalloy: Hmm, maybe not.

19:42 amalloy: apparently only root can do it

19:42 and even so most systems will tell him to bugger off

19:43 TimMc: ah, --directory

19:45 amalloy: technomancy: i see that he's deleting everything, but i don't quite get the joke

19:45 technomancy: I guess you need context

19:45 someone asked an innocuous newbie question and he hid a CL port of rm -rf / in the answer

19:46 amalloy: right

19:47 it's probably funnier if i have the often-attributed-to-common-lisp attitude that new users are idiots

19:47 technomancy: also I guess it wasn't really a joke?

19:48 amalloy: i guess that's true

19:51 pdk: if you want to get a taste of typical CL attitude

19:51 just read the taglines for let over lambda

19:53 technomancy: that guy hangs out in the #emacs channel; huge troll

19:54 he 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:56 FISSION MAILED

19:56 amalloy: surely duping the string yourself before you pass it on is easier

19:57 technomancy: amalloy: you're usually in #emacs, why don't you ask him about it? =)

19:57 amalloy: oh 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:58 i 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:59 TimMc: I wouldn't be so sure.

19:59 LJ is a pretty popular social network in the Boston area, and there's a big gamer/RP overlap here.

20:00 amalloy: really? i thought LJ basically died out ages ago

20:00 TimMc: Usually LARP or tabletop though, not online.

20:00 So did I, until I moved here.

20:08 amalloy: Common in the geek/fandom/kink/poly/MIT/LARP/square dance circles. :-)

20:22 kwertii: Is anyone working on, or are there any plans for, adding a persistence layer directly to the STM? Something like AllegroCache or ElephantDB...

20:23 technomancy: kwertii: alyssa qwan did something along those lines

20:23 kwan maybe?

20:24 kwertii: technomancy: I found that project, actually, but it seems to be long abandoned...

20:24 amalloy: if it wasn't called the HTM i don't approve

20:24 technomancy: kwertii: yeah, core was frosty to the idea

20:25 kwertii: technomancy: 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:26 I'd ideally run something like ErosOS that didn't have any distinction between short and long term storage at all

20:27 technomancy: kwertii: I don't know the details of the objections, just that they brushed her off.

20:27 kwertii: so what are people generally doing for data persistence nowadays?

20:27 amalloy: mongo seems popular

20:28 kwertii: set watches on every ref that needs to be persistent, which shunt backend database updates to an agent...?

20:29 technomancy: it's much harder than it sounds to be truly transactional

20:30 kwertii: yeah, I'll bet

20:30 an easy (ideally, transparent) persistence solution would be a true killer feature for Clojure.

20:33 KirinDave: Persistence meaning, to disk?

20:33 Make something like Wasp

20:33 https://github.com/codahale/wasp

20:34 kwertii: KirinDave: 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:34 KirinDave: Or just wrap over wasp.

20:34 kwertii: I wrote a framework in scala for this. People hated it.

20:34 kwertii: KirinDave: really, why?

20:34 KirinDave: kwertii: https://github.com/KirinDave/Clipping

20:34 kwertii: Because doing it correctly makes for complex code.

20:35 kwertii: And my default implementations were not very robust, so everyone assumed it was stupid.

20:35 kwertii: KirinDave: something like this: http://www.franz.com/products/allegrocache/

20:35 KirinDave: Look at what I did with clipping

20:35 To 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:36 Even in clojure, that's not going to be easy.

20:36 But this library could be used over anything. It's pretty neat that way, I think.

20:36 I actually wrote a redis binding for it.

20:37 kwertii: KirinDave: looking now, interesting

20:38 I'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:39 KirinDave: kwertii: I am pretty sure it does not keep a ten log.

20:39 kwertii: It's structure-sharing mvcc.

20:39 jeez freakin lion's autocorrect. txn

21:07 amalloy: lion really has autocorrect for actual keyboard input? that sounds like madness

21:11 dnolen: macros don't have access to line numbers right?

21:13 cemerick: dnolen: try (-> &form meta :line)

21:14 dnolen: cemerick: YES

21:14 ambrosebs: cemerick: cheers :)

21:14 cemerick: \o

21:15 :-D

21:15 dnolen: the talk went well

21:15 ?

21:16 dnolen: cemerick: it did, decent turn out and some good questions.

21:16 cemerick: nice, looking forward to the vid

21:16 dnolen: cemerick: vid is already up and slides as well.

21:16 cemerick: you guys doing some logic macrology hacking, I take it? :-)

21:17 ambrosebs: printing out some warnings for pattern matching

21:17 simple stuff :)

21:18 cemerick: whoa, accurate error messages? Unheard of! ;-)

21:18 I actually remember being *really* frustrated with the error messages the last time I did any prolog.

21:19 dnolen: cemerick: yeah ambrosebs is adding pretty comprehensive errors to match.

21:20 ambrosebs: (syntax checking for now)

21:22 zmaril: Is there a way of rewriting a function once it is written?

21:22 Like if I did (defn example [] "a")

21:22 amalloy: write it again

21:23 zmaril: Hmmm. I need a better way to phrase this.

21:23 What's the inverse of eval?

21:23 List?

21:23 ibdknox: any ideas why the clojurescript compiler will work consistently from the repl and inconsistently once it is run using lein run?

21:24 amalloy: zmaril: don't write code that modifies code at runtime

21:24 ibdknox: or perhaps a better question: are there obvious differences between running code in those two contexts that I can start to dig into?

21:25 amalloy: feel 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:25 zmaril: Hmm

21:25 Then I need to find a new way to do differentiation.

21:26 I would like to do something like (diff #(+ 1 %)) and get back #(1)

21:26 kencausey: zmaril: A thread of possible interest, starting with 2nd post: http://groups.google.com/group/clojure/browse_thread/thread/55178d64138f664b#

21:27 amalloy: zmaril: finding the derivative of an arbitrary function is basically impossible

21:27 (you can approximate it numerically, of course)

21:27 kencausey: zmaril: actually starting with daly's 4th post in that thread

21:28 zmaril: kencausey: 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:28 kencausey: zmaril: oops ;)

21:28 amalloy: but if you instead pass around the *list* '(+ 1 x), then you can differentiate that without a problem

21:28 zmaril: amalloy: Numerical is pretty easy.

21:28 I was just thinking like basic calc 1 stuff

21:29 Okay. Lists it is then.

21:29 kencausey: representing them as functions does not seem the best in this case

21:29 zmaril: Can you turn a list into a function later on though?

21:29 amalloy: eval

21:29 scottj: at least one of the famous lisp books covers this near the beginning I think

21:29 amalloy: scottj: sicp

21:30 zmaril: I skimmed through that once. I am probably just remembering the problem without remembering why.

21:30 kencausey: yep, at least the first level of this very task is discussed IRIC

21:30 amalloy: if you skim through sicp you are either an inhuman supergenius, or not actually reading it

21:31 zmaril: More the latter than the former.

21:31 I just heard it was neat and looked at it and balked.

21:31 dnolen: ,(.write (clojure.lang.RT/errPrintWriter) "foo")

21:31 clojurebot: foo

21:31 nil

21:31 dnolen: is there a better way to do that ^

21:32 amalloy: dnolen: rebind *err*?

21:32 er, the other way round. write to *err*

21:33 dnolen: ,(binding [*out* *err*] (println "foo"))

21:33 clojurebot: foo

21:33 dnolen: ?

21:33 clojurebot: nil

21:38 scottj: ,(.print *err* "foo\n")

21:38 clojurebot: #<IllegalArgumentException java.lang.IllegalArgumentException: No matching method found: print for class java.io.StringWriter>

21:38 ibdknox: it's append I think

21:38 ,(.append *err* "woo")

21:38 clojurebot: woo

21:38 #<StringWriter woo>

21:38 scottj: ,*err*

21:38 clojurebot: #<StringWriter >

21:39 scottj: that's why, on my system it's #<PrintWriter java.io.PrintWriter@1f4b3950>

21:40 ibdknox: ,(.write *err* "hey")

21:40 clojurebot: hey

21:40 nil

21:40 ibdknox: .write should work on all of them

21:42 amalloy: dnolen: that works too, yeah

21:45 scottj: ibdknox: do the dom utils in pinot actually work?

21:46 ibdknox: lol

21:46 yes?

21:48 scottj: so (h/append-to (h/dom-find "#wrapper") (h/html [:h1 "hi"])) should work?

21:48 ibdknox: I'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:48 dnolen: hmm similar to line, how can we get the file that we're in?

21:48 ibdknox: scottj: as long as #wrapper exists by the time you call that, yep

21:49 cemerick: dnolen: I think you're SOL on that one.

21:49 (meta &form) only has :line, at least in -beta1

21:50 Obviously would also include other user-supplied metadata, but that's it for reader-sourced info.

21:51 dnolen: cemerick: I guess you can just assume the ns …

21:54 cemerick: Yeah, I guess so.

22:26 srid: the joy of clojure has an elevator FSA example demonstrating `trampoline` -> https://github.com/joyofclojure/book-source/blob/master/src/joy/elevator.clj

22:27 * srid thinks further before writing his question

22:27 pcavs: Boston Clojure Meetup was interesting... Is it traditional to start a smug lisp weenie argument at the beginning of every one?

22:28 cemerick: probably depends on how many smug lisp weenies are in the room

22:29 srid: umm, ok. i understand why trampoline is required now.

22:32 cemerick: pcavs: how many attended total?

22:32 pcavs: cemerick: ohh around 25 I'd say

22:32 cemerick: not bad

22:32 pcavs: yeah

22:33 technomancy: pcavs: ... man I don't know what that was all about

22:33 cemerick: No video, transcripts?

22:34 * cemerick gets a sick thrill from tales of smug lisp weenie

22:34 pcavs: technomancy: haha, yeah...

22:35 drewr: cemerick: not worth it

22:35 pcavs: yeah

22:35 cemerick: whew, that bad, huh?

22:35 pcavs: Although the project it was trying to shed light on looks interesting

22:35 drewr: pcavs: right. was hoping for a tutorial/demonstration. instead...

22:37 pcavs: drewr: 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:43 srid: so 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:43 scottj: nope

22:44 drewr: srid: not at all; there are useful programs to be written with none of those features

22:44 amalloy: srid: you have plenty to get started with

22:44 srid: great, i'm thinking of writing a web app actually.

22:44 drewr: in fact you probably don't really understand them anyway until you need them

22:44 srid: true.

22:44 amalloy: heh

22:45 srid: 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:47 srid: will keep that in mind.

22:48 ibdknox: dnolen: have you started in on the cljs watch stuff? I was thinking of making a lein plugin

22:48 dnolen: ibdknox: hadn't had a chance to look into that yet.

22:48 scottj: make noir-cljs work without noir?

22:49 ibdknox: scottj: basically, yes

22:50 dnolen: the suggestion to listen on a port seemed odd to me, thoughts?

22:50 dnolen: ibdknox: can't say I've thought too much about it.

22:50 scottj: I thought it was weird too

22:51 ibdknox: I would've expected that it just took over the thread like every other watcher would

22:51 scottj: if you want to stop it, ^c

22:51 ibdknox: yeah

22:51 dnolen: mind if I throw something together?

22:53 dnolen: ibdknox: not at all.

22:53 ibdknox: scottj: did that pinot stuff work for you? Sorry, I had to scoot for a bit

22:54 scottj: ibdknox: nope, I got distracted trying to get pinot to load in the browser repl branch

22:54 unfortunately no ns or require

22:54 or ns works, but require in ns doesn't work I don't think

22:55 ibdknox: heh

22:55 I talked with Brenton about that a bit

22:55 he didn't think it was necessary

22:55 brepl has require

22:55 fwiw

22:55 scottj: I wonderd how much you guys had communicated

22:56 why didn't he think it was necessary?

22:56 ibdknox: there was some and then just went off and did it themselves without talking to me anymore

22:56 scottj: you can go to each file and load it

22:56 it seemed like they started it after brepl was finished

22:56 ibdknox: they did

22:56 by a couple weeks lol

22:57 I dunno I was somewhat confused by it

22:57 scottj: I 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:57 TheBusby: Hmm, 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:58 ibdknox: scottj: yeah, I didn't think a repl sans require was very useful

22:59 since you have to know up front what you want and have direct access to its source

22:59 it was a little odd to implement an entire long polling server from scratch too

22:59 but they wanted it to have no external dependencies

22:59 which is fair I guess

22:59 cemerick: TheBusby: assembla is old

23:00 http://dev.clojure.org/display/doc/Enhanced+Primitive+Support

23:00 scottj: does brenton work for relevance now? I saw his twitter location said durham

23:00 cemerick: TheBusby: Also, it may very well be working -- drop the hints and see what the relative perf is.

23:01 ^:static has no meaning anymore

23:01 ibdknox: scottj: 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:01 TheBusby: cemerick: The first run, in the pastien, was minus type hints

23:02 cemerick: OK, its formatting is pretty garbled on my end, didn't look too hard at it.

23:03 TheBusby: cemerick: trying the double example from the dev.clojure.org page is 1000ms slower than the original unhinted example

23:04 scottj: ibdknox: so is there a dom ready function in closure like jquery I should be putting the h/append-to stuff in?

23:04 cemerick: TheBusby: I don't believe it ;-)

23:04 worksforme, anyway

23:05 TheBusby: cemerick: hmm, further info http://pastie.org/2394730

23:05 cemerick: could JVM settings be throwing it off?

23:06 cemerick: TheBusby: your platform, java rev?

23:06 TheBusby: java 1.6.0_26 or ubuntu server

23:07 cemerick: sun/oracle JVM, or icedtea/openjdk guff?

23:07 TheBusby: sun

23:07 * cemerick is foiled! :-P

23:07 cemerick: Doesn't seem like that'd be a problem.

23:08 carllerche: I just made my first clojure project public. https://github.com/strobecorp/picard/

23:08 It's an async HTTP framework built on netty... thanks for all who helped me learn clojure :)

23:08 (It's still very raw, but I might as well make it open)

23:08 ibdknox: scottj: just put it at the bottom of your body for now

23:09 scottj: apparently it was an explicit design decision in google closure not to have a document loaded event

23:09 scottj: ibdknox: ahh that worked, thanks!

23:09 ibdknox: scottj: I'll probably come up with something

23:09 TheBusby: cemerick: thanks. Are you using a newer JVM or anything?

23:09 ibdknox: scottj: but for now that's the best solution

23:10 cemerick: TheBusby: nope, 1.6.0_26 on OS X.

23:10 scottj: ibdknox: cool, so pinot works after all :)

23:10 cemerick: TheBusby: 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:11 TheBusby: cemerick: I just disabled all jvm-opts, everything got slightly slower but no hinting improvement :(

23:11 cemerick: "disabled"?

23:11 carllerche: redinger: hey

23:11 TheBusby: cemerick: this is via lein-swank BTW, not sure if that makes any difference. "disabled" = commented out in project.clj

23:12 cemerick: TheBusby: As a sanity-check, just do `java -jar clojure.jar`, and copy/paste the different impls in.

23:13 TheBusby: cemerick: k, checking no

23:15 cemerick: no change, even while running as java -jar

23:15 cemerick: bizarre

23:15 TheBusby: paste full output of java -version

23:16 TheBusby: cemerick: http://pastie.org/2394781

23:17 cemerick: java version information in comments at the bottom

23:19 cemerick: wonky

23:19 I don't have a theory for you at the moment

23:20 TheBusby: cemerick: I'll try a couple other machines and see if I have the same problem

23:21 scottj: TheBusby: I reproduced your problem

23:23 TheBusby: scottj: 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:26 I just tried with clojure-1.3.0-alpha7 and I experience the same issue.

23:28 scottj: for reference http://pastie.org/2394808

23:30 ibdknox: TheBusby: we're up to 1.3.0-beta1 now

23:31 TheBusby: ibdknox: I just wanted to make sure the issues occured in both beta1 and alpha7

23:31 ibdknox: ah

23:33 cemerick: scottj, 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:33 TheBusby: cemerick: I just replicated this on an ubuntu server and my macbook, both are using sun 1.6.0_26 though

23:42 scottj: TheBusby: your several examples all call fib

23:45 TheBusby: scottj: Here is the exact code I'm testing with now, and it includes the reference example you provided: http://pastie.org/2394869

23:45 scottj: the reference I posted was wrong, notice how they're all calling the same function fib :)

23:46 TheBusby: doh, you're right

23:46 scottj: the one you want is fib3

23:46 TheBusby: gotten too used to recur

23:47 scottj: I really like that aspect of recur

23:47 TheBusby: Well that solves the issue. Sorry for wasting time :(

23:49 * cemerick feels like a dope for not catching that :-(

23:49 cemerick: Guess I should go to bed.

Logging service provided by n01se.net