#clojure log - Sep 14 2012

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

2:02 akhudek: whoa aot + repl is not fun

2:02 at least with intellij

2:03 seems the repl always uses the compiled code no mater if you request it load from source

2:03 for protocols

2:33 Urthwhyte: Hey guys - would you recommend slimv or VimClojure more?

3:24 kral: namaste

3:24 I thought clojure was more attractive for emacs users

3:25 Seems like there's a lot of clojurist out there that use vim...

3:25 * kral is not trying to start a flame war, he's just surprised

3:30 antares_: kral: I'd say the majority does use emacs, but vimclojure is very good from what I hear

3:38 kral: antares_: I started with vim and moved to emacs long ago, but vim still intrigues me

3:39 so good to know vimclojure is good :)

3:42 hfaafb: https://gist.github.com/37a902a2ee88c2f73d49 my first clojure program >_>

3:43 ro_st: can i put atoms inside other atoms? in cljs, too?

4:01 antares_: ro_st: you can, not sure about cljs

4:02 hfaafb: #(keyword %) can be just keyword

4:02 hfaafb: also, looks like you can use reduce instead of explicit loop/recur, just an idea

4:03 hfaafb: that's why i posted it! thank you

4:03 amalloy: well, numerals is better written as a lazy-seq, not as a reduce

4:04 antares_: hfaafb: and do on line 29 seems unnecessary, you only have one expression in that branch (let)

4:16 mindbender1: No matter what new function one is trying to write there's always a bases to it, to which it should conform to at least one of it's CRUD protocol

4:18 Though people mostly always choose to keep that bases hidden

6:07 (doc bases)

6:07 clojurebot: "([c]); Returns the immediate superclass and direct interfaces of c, if any"

6:10 chauncey: hi! how do I determine what profiles I am in (:dev, :release) from clojure and clojurescript alike?

6:11 I used a distinct src-path with a profile-current.clj in it, but that doesn't work well with crossovers or cljs in general

6:11 and seems hacky :(

6:16 hyPiRion: It seems rather hacky to try and find it out in the first place. Could you do what you try to achieve without doing it?

6:17 chauncey: yes, disable logging etc.

6:18 all the stuff I use when developing

6:19 so, I could set a *loglevel* var somewhere, but...

6:19 there are some other things as well, and I don't want to forget and have it in my release version ^^

6:20 Might of course be that there is something fundamentally wrong with my workflow, in that case I am happy to hear alternatives :)

6:21 ro_st: in clojure, an env var would do

6:22 in cljs you'd have to write a .cljs file for the cljs compiler to pick up so that you can use its value conditionally in your cljs code

6:23 or find a way to leverage gclosure compiler's conditional compilation. not sure if cljs compiler exposes it.

6:25 chauncey: I tried to do it with the dedicated file approach, I have a profiles/dev/profiles/current.clj and the same for release in clojure, and tried to crossover the profiles.current namespace

6:25 unfortunately that seems to always take the one from the standard environment

6:25 i.e. de

6:25 v

6:26 Is it so unusual to have an application behave differently in development and release?

6:27 I could do it as a rpc, but that also doesn't feel right

6:30 ro_st: this is a dependency injection issue

6:32 hyPiRion: chauncey: https://github.com/technomancy/leiningen/blob/master/sample.project.clj#L63

6:32 Look at the :injections thing.

6:32 ro_st: yeah, that'll solve clj.

6:34 hyPiRion: "lein help profiles"

6:39 ro_st: grr why can't cljs find goog.crypt.Md5

6:39 it's in the jar

6:48 chauncey: um, okay... how about cljs?

6:49 ro_st: argh goog-jar you monstrosity

6:49 chauncey: :)

6:49 ro_st: chauncey: your cljs served via the web?

6:49 or are you up to rhino/node.js shenanigans

6:50 chauncey: no, noir + cljs app

6:50 ro_st: then inject the env value into the call that starts your app

6:50 my.app.ns.run(<here>)

6:50 and drive that value from clj using your env var

6:51 chauncey: hm, that sounds like a good idea

6:51 I'll try it, thanks

6:53 ro_st: hth :-)

7:30 zalentA-: sa

7:30 cs mac +1 olunur

9:06 mindbender1: Maths=Symbolic Nonsense

9:06 uvtc: How do I say, "if this regex matches, do $this with group 1 in the match"?

9:07 eni: can you use clojure apps in a java app easliy? if yes, can i see an example?

9:08 uvtc: That is to say, without repeating my call to re-find.

9:08 elzibub: uvtc: try re-seq

9:08 eni: link clojure.jar and use Var from Java

9:10 mindbender1: eni: and other data structures

9:10 eni: what do you mean by other data structures, are there some code examples online?

9:17 uvtc: elzibub: Ok. Thanks. I ended up doing "(let [search-result ...] (if search-result (let [part (search-result 1) ..."

9:26 chouser: uvtc: you might consider if-let

9:27 uvtc: chouser: Ah, that would reduce indenting a bit. Thanks.

9:28 Actually, I've got 2 regexes. If the first one matches, pull out group 1. If that fails, try another. Was thinking to try `cond`...

9:28 chouser: sure

9:29 people have written things that amount to let-cond, but none have caught on

9:31 grayzone: Hello everyone, I have a problem to import a protocol to another file CLJ: prompt returns ClassNotFound: can someone help me?

9:34 mindbender1: grayzone: it would make sense if you say what you did specifically

9:35 grayzone: ok : the command is : (import '[examples.midi MidiNote]) (from book 'Programming Clojure')

9:35 but the response is : ClassNotFoundException examples.midi.MidiNote java.net.URLClassLoader$1.run (URLClassLoader.java:202)

9:36 uvtc: cemerick: re. travis email (clojure-clutch), that was weird.

9:38 grayzone: in example.midi has a (defprotocol MidiNote ..... )

9:39 mindbender1: grayzone: you have to be consistent, is it example or examples and I don't think it's a java class so you shouldn't be using import

9:40 read the book gently

9:41 grayzone: I have the book with me which page

9:41 grayzone: member:mindbender1 : you reason but the import has written by author ....

9:41 cemerick: uvtc: what travis email?

9:42 uvtc: cemerick: I just got one after you made that trivial change regarding the backtick in the readme. It said the build failed.

9:42 grayzone: mindbender1 : i attempt with (:require ....

9:43 mindbender1: grayzone: what's page are you on

9:43 cemerick: uvtc: so it did, but I didn't get an email :-/

9:44 grayzone: mindbender1 : i am at page 162 ... (2 edition) in sample generator.clj

9:44 cemerick: Looks like travis doesn't have a couchdb server running in the test environments anymore…

9:45 uvtc: cemerick: thanks for looking into it!

9:46 cemerick: Seems it needs to be requested in the .travis.yml file now

9:48 wumpwomp: anyone have experience with lacij? the create-graph function seems to be missing from graph.core...

9:49 mindbender1: grayzone: I think I have the 1st edition.

9:50 Anyway try with (require '[]) or (use '[]) i.e if you started in the repl correctly

9:51 you could also use (load-file ..). Use (doc fn) to check up the doc of the above fn

9:51 cemerick: uvtc: fixed up, thanks for letting me know. Bizarre that I didn't get an email on the failure.

9:52 uvtc: cemerick: {insert emoticon for "high-five"} :)

9:52 o/

9:52 cemerick: \o

9:52 grayzone: mindbender1: thanks anyway for your interest : i attempt your suggestion (plse my bad english!)

9:52 cemerick: It's all love and plushy pink elephants here in #clojure. :-D

9:53 uvtc: It's so fluffy I'm gonna die!

9:55 clgv: grayzone: you probably do not have the examples directory on the classpath of your repl

9:56 grayzone: clgv: is possible .... i check ... thanks

10:06 mindbender1-clgv: thanks the sample go : i resolved with : 1) add classpath until examples 2) change import with (:use [examples.midi :as mx])) ... thanks again for suggestion's

10:07 abalone: clojure misspelled as cloujure in a recent article on scala

10:07 yay

10:31 TimMc: cluejure

10:31 kludger

10:57 mwcampbell: I'm brand new to Clojure, and not very experienced with any Lisp. Which book should I use to start learning Clojure?

10:58 ddima: I've not finished it myself yet, but I like The Joy of Clojure

10:58 scriptor: joy of clojure isn't aimed at beginners

10:58 uvtc: ~clojurebook

10:58 clojurebot: ClojureBooks is http://clojure.org/books

10:58 ddima: it depends on how he likes to learn ;)

10:58 casion: what languages do you know now?

10:58 scriptor: mwcampbell: I've heard good things about http://www.clojurebook.com/

10:58 clgv: is there something like that [a b & rest] for map destructuring {a :a, b :b, :rest r} ?

10:58 ddima: with much pain or only just a little

10:58 uvtc: Oooh. Didn't know about that page. :)

10:59 jondot`: i guess this get asked a lot - anyone care to point to a mature actor library for clojure where actors can be distributed across machines transparently to the programming model?

11:00 mwcampbell: casion: Been working mostly with Python. I basically know the Java language, though my knowledge of the surrounding ecosystem is quite out of date. The last time I did anything serious with a Lisp was with Emacs Lisp in the late 90's, and I've forgotten most of what I knew about that.

11:00 casion: mwcampbell: http://www.clojurebook.com then

11:00 clgv: jondot`: some had the idea to use akka ad where fit write convenience functions/macro for it

11:01 casion: mwcampbell: it's nearly a clojure book for python or ruby programmers

11:02 uvtc: mwcampbell: I wrote up a brief beginner's guide http://www.unexpected-vortices.com/clojure/brief-beginners-guide/ that might be helpful to you. Also what casion said.

11:02 casion: mwcampbell: also http://jafingerhut.github.com/cheatsheet-clj-1.3/cheatsheet-tiptip-no-cdocs-summary.html is probably the most useful clojure related link IMO

11:04 http://www.clojureatlas.com is also super cool (by one of the authors of the book suggested no less)

11:04 elzibub: clgv: Try [& {:keys [a b]}]

11:04 cemerick: casion: thanks :-)

11:05 clgv: elzibub: erm no. I want to select the keys and get the remaining keys ;)

11:05 elzibub: Coincidentally in 1st chapter of "Programming Clojure" I read at lunch - which is an excellent book and a far better tutorial than Joy

11:05 cemerick: and to all for your recommendations :-D

11:05 melipone: hello! I am trying to read a clojure map back in but I get this error: (def mymap (read-string (slurp "mymap.txt"))) RuntimeException Unreadable form clojure.lang.Util.runtimeException (Util.java:156) Any idea?

11:06 elzibub: clgv: This doesn't work then? [{:keys [a b]} & rest]

11:06 casion: elzibub: I personally far prefer 'programming clojure', but everyone I know who is into python/ruby seems to like 'clojure programming' better

11:06 they're both great books though, I think it just depends on where you're coming from

11:06 elzibub: casion: Whooops... I meant Clojure Programming! But then I haven't read Programming Clojure

11:07 casion: and joy of clojure is amazing once you've got the basics down, I just started reading it and I absolutely love it

11:07 clgv: elzibub: the example is {:a 1 :b 2 :c 3 :d 4} and I want to have (let [a 1, b 2, rest {:c 3 :d 4}] ... ) as the result from destructuring if there is a builtin way to do that ^^

11:07 elzibub: casion: I'm sure it's a great book once you're a year in

11:08 * nDuff considers the O'Reilley book and JoC his top two.

11:08 pepijndevos: what the hell does this function do? (Integer/bitCount (bitwise-and bitmap (- bit 1)))

11:09 jondot`: clgv: well i guess if i'm not using Akka, or Storm, is there any other library-like facility that I can build upon?

11:09 elzibub: clgv: To the REPL!

11:10 clgv: jondot`: there is an rpc lib called slacker but I am not sure if I wanted to use that to build anything

11:10 casion: pepijndevos: it should be explained in here http://lampwww.epfl.ch/papers/idealhashtrees.pdf

11:10 it's on page 4 I think, I don't remember exactly

11:10 jondot`: also looked at this one: https://github.com/antoniogarrote/jobim

11:11 casion: and I think http://blog.higher-order.net/2009/09/08/understanding-clojures-persistenthashmap-deftwice/ explains it as well

11:12 pepijndevos: casion: okay, will look at it

11:17 casion: pepijndevos: end of page 2 in the PDF where it explains finding sub-tries and how to calculate the arc (that's what the code you posted is doing)

11:17 elzibub: clgv: Can't see a way from CP book. Closest I can offer is to use {:keys a b :as all} then dissoc

11:18 pepijndevos: casion: oh, i read past it, I was on page 5 already

11:18 casion: pepijndevos: I would try to explain it myself, but I'm terrible with terminology and I just end up confusing people

11:18 melipone: ha! I found my error: I had an object stored in the map and not a string! euou euou!!

11:20 pepijndevos: casion: The paper does not explain the bit twiddling as far as I can see.

11:21 just that there is a bitmap of 32 bits

11:23 casion: pepijndevos: ok, let me see if I can explain this and not create chaos

11:23 pepijndevos: casion: so I have a hash, which I and with 0b1111 after shifting it by chunks of 5. This gives me an int between 0 and 31.

11:23 casion: pepijndevos: yes

11:23 pepijndevos: casion: then I but that number in the function I just posted

11:24 casion: and that gives you the index

11:25 pepijndevos: casion: how does that happen?

11:26 casion: so what you're doing is getting the bit pop, you and it with bit-1 to get a mask of only that sub-trie (or index)

11:27 it's because each index size isn't a fixed width

11:27 so you have to mask it against the bit count to have an accurate mask

11:27 pepijndevos: aaaah, what? I thought ever index had 32

11:28 casion: see, I'm shit with explaining things :|

11:28 pepijndevos: casion: no, it's starting to make sense. so you're mapping from 0-31 to the number of items you really have.

11:29 casion: pepijndevos: there you go

11:29 pepijndevos: casion: I still don't understand why the bitcount of the the thing adned minus one returns that.

11:30 so the bitcount of the the bitmap is the length of the actual array

11:30 mwcampbell: Has any of the Clojure implementations been used to develop a native iOS application?

11:31 scriptor: pepijndevos: have you read the blog posts about clojure's vector and hashmap implementations?

11:31 nDuff: mwcampbell: I think there's intent for ClojureC to eventually be suitable for that.

11:31 casion: yeah, there's http://blog.higher-order.net/2009/09/08/understanding-clojures-persistenthashmap-deftwice/ which explains it as well

11:31 I think I linked that

11:32 pepijndevos: casion: that is the old version I think, there is a part two

11:33 oh, i need to read this better

11:33 scriptor: pepijndevos: it does explain that line though

11:33 with the bitcount

11:34 pepijndevos: cool

11:34 mwcampbell: nDuff: Ah, I didn't know ClojureC existed.

11:36 casion: there's a clojure targeted at objc as well

11:36 pepijndevos: want!

11:37 casion: https://github.com/jspahrsummers/objective-clojure

11:37 and https://github.com/joshaber/clojurem

11:39 mwcampbell: I wonder if it would be better to invest effort in clojurescript-lua rather than C and ObjC targets. After al, LuaJIT provides a high-performance yet small-footprint VM and JIT, and I figure a good VM and JIT are a requirement for any performant Clojure implementation.

11:39 casion: mwcampbell: that's assuming effort on each 'port' is exclusive

11:40 different people with different interests working on different things

11:41 mwcampbell: casion: There's always the danger of spreading the effort of a small community too thin though, right?

11:41 Once I learn Clojure, I might start contributing to the Lua port

11:41 casion: mwcampbell: I don't see why, people are free to do as they wish

11:42 how would you manage to concentrate effort? email the clojureC guys and tell them to go work on clojurescript-lua instead?

11:42 I somehow have lost a cup of tea on my desk…maybe i should clean a bit today :|

11:42 mwcampbell: casion: Touche; I'd probably be better off just working on clojurescript-lua myself if I'm interested in it

11:43 casion: mwcampbell: also, I'm far more interested in clojureC myself ;)

11:43 mwcampbell: casion: Why? Just curious

11:43 nDuff: mwcampbell: A lot of the "ports" are using common work originally done for cljs

11:44 mwcampbell: ...so there's definitely common/combined effort.

11:44 casion: mwcampbell: I do embedded, and clojureC could be of use to me in that area

11:45 mwcampbell: casion: It depends on GLib though, right? That's a pretty hefty dependency, and an LGPL'd one at that

11:45 casion: mwcampbell: a boy can dream :)

11:46 mwcampbell: casion: Have you looked at LuaJIT? ~415k on x64, with impressive performance

11:46 casion: also glib works fine on arm, which I use often

11:46 mwcampbell: casion: and LuaJIT has ports to ARM and now MIPS

11:47 casion: mwcampbell: I did mess with lua, but I just never managed to find anything about it attractive

11:47 pepijndevos: casion: makes no sense… http://pastebin.com/4Hp40NNV

11:49 mwcampbell: casion: I'm not a big fan of Lua the language (though I've used it extensively in a project where it seemed like a good fit), but because LuaJIT is small, self-contained, liberally licensed, and quite fast, it seems to me that LuaJIT would be quite a good foundation for a Clojure implementation targeting embedded systems

11:50 casion: So I will be looking more closely at clojurescript-lua

11:51 casion: pepijndevos: that looks right to me

11:51 except the last few...

11:51 hmmm

11:52 pepijndevos: casion: so there are 4 elements, so the indext fro the first is 4, and then for both 1 and 2 it's 0

11:58 clgv: pepijndevos: you can have that easier by the way ##2r10101010

11:58 pepijndevos: casion: 4 is out of bounds, right? and I kind of expected 5+ to have different results

11:58 clgv: ,2r10101010

11:58 clojurebot: 170

11:58 pepijndevos: oh :)

11:58 casion: 5 is out of bounds I thought

11:59 pepijndevos: casion: I have 4 1 bits, so 4 elements, right, so that's 0,1,2,3

11:59 casion: oh, yes

12:01 pepijndevos: does not look right to me at all :(

12:01 maybe some casting promoting signed blah is interfering?

12:01 casion: now you have me confused too

12:06 ,(Integer/bitCount (bit-and 2r00000000000000010000000010000101) (- 7 1))

12:06 clojurebot: #<CompilerException java.lang.IllegalArgumentException: No matching method: bitCount, compiling:(NO_SOURCE_PATH:0)>

12:06 casion: pfft

12:06 it gives 1… it should return 2

12:06 :\

12:09 pepijndevos: where is this code, I want to look… I thought I understood this but it's making zero sense now

12:09 pepijndevos: casion: yes. it does. I assume the Java version works correctly? https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/PersistentHashMap.java#L575

12:11 casion: wait

12:11 duh :|

12:11 ok

12:11 pepijndevos: what?

12:11 clojurebot: what is bla

12:11 casion: here, let me do a few and pastebin it for you

12:11 pepijndevos: ok

12:12 casion: bitpos isn't an int, it's a position in the int 2r10 is 2, 2r1000000 is 7

12:12 pepijndevos: wait, really?

12:13 oh...

12:13 casion: http://pastebin.com/aAzeYFTb

12:13 see?

12:13 pepijndevos: stupid infix notation

12:14 casion: bit is the position of the bit from the right in binary, not an integer representation

12:14 nDuff: casion: ...in the future, would you mind using refheap or gist.github.com? pastebin.com is full of ads for anyone not running adblock.

12:14 casion: nDuff: sure, I wasn't aware

12:14 pepijndevos: I read bitpos as shifting mask right one, because it has keys and values interleaved

12:14 but it shifts one by mask :P

12:16 now the -1 also makes more sense

12:16 casion: ok, good luck :) lunch meeting

12:17 pepijndevos: casion: diner for me, thanks a lot

12:22 uvtc: Can I compose regexes of other regexes (regexen? regexi?) ?

12:23 re-pattern only takes one arg...

12:23 technomancy: uvtc: elisp has a symbolic regex representation that lets you compose things before they're compiled to actual regexes; kind of a cool idea

12:26 uvtc: technomancy: Any way to do it in Clojure? I've got the same regex repeated within a number of other regexen...

12:27 technomancy: it can probably be done with string mashing; haven't thought it through

12:27 xeqi: keeping strings around and using re-pattern?

12:27 uvtc: Oh, maybe (re-pattern (str s1 s2 ...)).

12:27 Right.

12:27 technomancy, xeqi: Thanks.

12:28 But then I'd have to add extra backslashes into those strings.

12:46 borkdude: "but Ruby and Python code bases will go to Go" http://gigaom.com/cloud/will-go-be-the-new-go-to-programming-language/

12:46 what's so special about it, anyone got experience with Go?

12:47 technomancy: I've looked at it briefly. the main thing about it is it's not C, and it has momentum.

12:47 emezeske: Go could possibly become an extremely efficient language, has pretty unobtrusive static typing, and has a lot of nice features that are higher-level than C

12:47 technomancy: FSVO "pretty unobtrusive"

12:47 it's still utter crap compared to hindley-milner

12:48 nDuff: I've got a friend whose company is starting to use it where they can; from what he describes, development velocity is similar to that of Python, but with better runtime performance and type checking.

12:48 emezeske: technomancy: True enough.

12:49 technomancy: but I'm this close to giving up on ocaml; I don't expect I'd ever be able to convince anyone to use it.

12:49 emezeske: technomancy: Less obtrusive than C I guess is the point

12:49 technomancy: ocaml and go both target places the JVM is crap at

12:49 emezeske: "better than getting kicked in the shins! check it out!"

12:50 mindbender1: Ocaml..that language is a beast

12:50 emezeske: technomancy: I don't like being kicked in the shins!

12:50 dnolen: borkdude: maybe Go users - I

12:50 technomancy: mostly it's the advocacy that bothers me; people come this close to implying that Go invented type inference.

12:50 dnolen: borkdude: er I mean maybe Python users. Less Ruby people I think. Go doesn't even have REPL

12:50 pandeiro: i started learning ocaml recently b/c i needed it installed for llpp and i wanted to like it, i really did

12:50 but i did not get very far

12:51 dnolen: Go & Dart - it's 2012 let's pretend McCarthy didn't exist

12:51 pandeiro: dnolen: u read my mind, i was wondering about a Go repl

12:51 i saw on HN recently someone created a kind of C repl using some debugging tool...

12:51 mindbender1: Novelty

12:51 emezeske: technomancy: Whoa, who does that? Silliness

12:52 technomancy: emezeske: well maybe it's unfair to extrapolate to Go users in general from hacker news

12:55 emezeske: technomancy: The way I view Go is as an absolutely practical language. E.g., the type inference is something just good enough, as well as some of the other features

12:56 technomancy: emezeske: yeah, as much as it bugs me I think the momentum it has outweighs the fact that ocaml is just plain better-designed.

12:56 * emezeske knows very little about ocaml, maybe he should read about it.

12:57 technomancy: if it means that fewer C programs get written, that's a net win

13:00 dnolen: http://shootout.alioth.debian.org/u64/benchmark.php?test=all&lang=java&lang2=go, go

13:01 's advantage over Java seems primarily in the area of memory usage

13:01 mindbender1: technomancy: have you gone through the handbook of automated reasoning and practical logic

13:01 dnolen: doesn't say much about memory behavior for non-trivial programs tho ...

13:01 borkdude: so how is that clojure 2 c compiler? could I advice anyone to program clojure for native code instead of Go?

13:02 wasn't there something with clojure -> scheme -> c -> native or smth?

13:02 haven't followed it closely

13:02 technomancy: mindbender1: haven't heard of it

13:02 mindbender1: It's based on Ocaml

13:03 Very advanced

13:04 For those moments when one is bored

13:04 Urthwhyte: Morning everyone - trying to get a SLIME like environment set up before a flight

13:04 Is VimClojure or Slimv better supported/recommended?

13:06 * nDuff tried VimClojure about a year ago and ended up deciding to relearn Emacs... which is a decision he's been happy with.

13:07 borkdude: I guess Go for native is the best option then

13:07 Urthwhyte: nDuff: I would do that if last time I tried emacs I didn't end up with lots of hand pain

13:07 borkdude: so Go is a very fast native language like C but has Pythonesque features in it, it sounds nice to me

13:07 Urthwhyte: and it would give my roommate too much satisfaction to see me switch ;)

13:07 emezeske: Urthwhyte: My understanding is that VimClojure is more clojure-specific; slimv is for CL but has special case support for clojure

13:08 * hoover_damm never understood why people get so locked into using editors and care so much about x vs y or z

13:08 emezeske: Urthwhyte: VimClojure is reasonably easy to set up if you use lein-tarsier

13:08 hoover_damm: I guess that's what I get for being a multi-editor user who just uses what works best

13:08 Urthwhyte: If you had years of muscle memory in an editor it makes it very hard to switch

13:08 scriptor: hoover_damm: in this case, it's good to know what's better supported and just in general considered better practice

13:08 hoover_damm: sure I get hand cramps with vim when I accidentally hit ^S

13:08 emezeske: hoover_damm: Lock-in can happen when you have muscle memory for >100 key bindings

13:08 hoover_damm: or other keys

13:09 dnolen: borkdude: there's a ClojureC project

13:09 borkdude: ok… I am mentally ready now to install nrepl.el

13:09 hoover_damm: emezeske, I started using ed over 20 years ago and then moved to vi

13:09 * technomancy gets grumpy whenever he has to use a WIMP browser even

13:09 hoover_damm: emezeske, I truly look at the whole editor groan and get confused

13:09 technomancy: feels like navigating with mittens on

13:10 hoover_damm: emezeske, I am able to use nano, vi, emacs, ed without grumping or caring

13:10 Hodapp: I keep getting pissed off at :ClojureRepl when I use lein-tarsier, because I'll be wanting to switch windows and I'll hit Ctrl-W W, but if I do that accidentally when the REPL is in insert mode, it just erases the prompt and the REPL is angry

13:10 hoover_damm: emezeske, obviously nano with clojure would be pure pain

13:10 technomancy: hoover_damm: maybe starting with ed has imbued with super editor powers =)

13:10 hoover_damm: (at least it feels pretty painful to me)

13:10 emezeske: hoover_damm: Well, either you have spent the time to develop muscle memory for each of those editors, or you don't use any of their advanced features

13:11 hoover_damm: Either way, you can't just tell people to stop groaning

13:11 hoover_damm: technomancy, I would like to think people are overcaring more and just need to relax and try it

13:11 dnolen: on the Clojure native front this looks really interesting http://www.ravenbrook.com/project/mps/

13:11 Urthwhyte: I just want a repl with working tab-complete and navigating back and forth between older and newer commands

13:11 dnolen: GC used in Harlequin Dylan and MLWorks I believe

13:11 emezeske: hoover_damm: Either they have to spend time developing muscle memory, or they have to drop the idea of having advanced features

13:11 Hodapp: Urthwhyte: and have you found one?

13:11 hoover_damm: because you learn you grow

13:11 dnolen: sounds like Open Dylan is using it as well

13:11 no7hing: on agents: anybody had problems with the error handler, as in the passed agent wasn't in error state?

13:11 mindbender1: With emacs..all your computer comes to party

13:11 Urthwhyte: Hodapp: Having some trouble getting slivm working due to what looks like classpath issues

13:11 hoover_damm: emezeske, everytime I hear advanced features and not the word emacs... I laugh

13:12 Hodapp: Anyone know a REPL that is as Urthwhyte describes?

13:12 technomancy: hoover_damm: it's not about editors so much as losing access to an embedded lisp in everything I do.

13:12 Urthwhyte: but having just escaped the gravitational vortex that is the Google codebase I do not want to deal with that for at least a couple of days

13:12 emezeske: hoover_damm: So you're some kind of editor elitist? I don't understand your position at all.

13:12 hoover_damm: technomancy, loosing access to embedded lisp is :(

13:12 Hodapp: technomancy: you use Emacs then?

13:13 Urthwhyte: I'd be comfortable enough with something that was irb/ipython for clj, doesn't even need to integrate with my editor

13:13 mindbender1: emezeske: has he taken a position?

13:13 Urthwhyte: I can do that comfortably enough with some inotify magic

13:13 technomancy: Hodapp: yes, and I pretend that Conkeror is implemented in a lisp as well even though it's not =(

13:13 cemerick: Hodapp: either Counterclockwise or Emacs are safe bets.

13:13 hoover_damm: emezeske, if i'm an editor elitest it's because I can use almost any editor with advanced features

13:13 technomancy: Hodapp: it still has M-: where you can quickly eval code snippets though

13:13 and dotfile support

13:13 hoover_damm: emezeske, and try and learn new editors and :) keep learning

13:13 Hodapp: I'm currently a vim user but I suppose I could attempt to learn Emacs...

13:14 Cheiron: when documenting defs, is is better to include ^{:doc "..."} or to use comments above the declaration?

13:14 hoover_damm: learning is the wholt point

13:14 mindbender1: that looks like me when I was looking for a house to rent

13:14 hoover_damm: rejecting part of what you accept is normal

13:14 and learning something new

13:14 cemerick: hoover_damm: use a docstring

13:14 technomancy: Cheiron: you can put in a proper docstring without ^:doc syntax

13:14 hoover_damm: whole*

13:14 technomancy: hoover_damm: but programs that don't have a repl are objectively worse

13:14 Hodapp: hoover_damm: Sometimes you want to debug your program, not debug your environment.

13:14 cemerick: hoover_damm: sorry, meant that for Cheiron :-)

13:14 emezeske: hoover_damm: Sometimes, you have to stop "learning and growing," and actually get shit done

13:15 mindbender1: right

13:15 Hodapp: Using Clojure is basically by definition not learning something different, say, ASM.

13:15 Cheiron: docstring without ^{:doc} ? how?

13:16 aniero: (defn foo "docstring" [& args] ... ) ?

13:17 Cheiron: i'm talking about def not defn

13:17 like (def url ".....")

13:20 no7hing: is it expected that the failed agent in the gist is *not* in failed state? https://gist.github.com/3723317

13:21 restart-agent blocks

13:21 mindbender1: By the way, our chosen programming language OCaml is derived from Edinburgh

13:21 ML, which was expressly designed for writing theorem proving programs

13:21 (Gordon, Milner and Wadsworth 1979) and whose name stands for Meta

13:21 Language

13:22 Urthwhyte: Anyone know where clojure.jar would be if I installed it from the ubuntu repos?

13:22 cark: in emacs+nrepl, how does one kill the java process ?

13:22 cleanly

13:23 technomancy: cark: there's an open ticket for that

13:23 jjido: Urthwhyte no, but did you check JAVA_HOME?

13:23 technomancy: for now kill the *nrepl-server* buffer

13:23 cark: technomancy: oh ok thanks

13:23 technomancy: Urthwhyte: in general... don't?

13:23 Urthwhyte: apt-get is for installing applications, it's not useful for installing libraries alone.

13:23 Hodapp: alright, technomancy, I'm installing Emacs here. If I look like Richard Stallman in a month, I'm blaming you.

13:24 technomancy: Hodapp: I disclaim all responsibility

13:24 Hodapp: technomancy: I already have a lawyer on retainer

13:24 technomancy: I can't actually remember the last time I suggested someone try Emacs in this channel.

13:24 pretty sure it's been over a year.

13:25 Hodapp: technomancy: what editor do you recommend?

13:25 technomancy: Hodapp: most of the time I have to tell people to not try to learn Emacs and Clojure at the same time

13:25 it's too much to take in at once

13:26 when you're learning Clojure, use what you already know. once you've got Clojure down then maybe consider switching things up.

13:27 borkdude: wasn't clojure written to get more people to use emacs? then was was the point, I forgot… ;)

13:27 Cheiron: while the question isn't targeting me, but I prefer Sublime Text 2 for Clojure dev

13:28 no7hing: bork: i thought that was erlang

13:29 aniero: i'm using vim :P

13:29 borkdude: yay, nrepl.el works

13:29 * nDuff uses vim for everything but Clojure and Java

13:30 nDuff: ...Emacs for Clojure, IDEA for Java.

13:30 aniero: lein-tarsier + vimclojure is pretty decent

13:31 Urthwhyte: I've heard bad things about the vimclojure repl though?

13:32 in terms of feature-completeness?

13:33 mefesto: Hello everyone :)

13:35 I'm experimenting around with riak + clojurewerkz/welle and was wondering if when performing a map-reduce if it's common that the js functions are raw strings? Is it common to store these in resource files and load them as strings then?

13:35 antares_: mefesto: absolutely

13:35 clojurewerkz.support.js lets you load them from classpath without hassle

13:35 sorry that it does not have any docs

13:35 mefesto: antares_: great thanks for the tip! :)

13:35 antares_: (I am the author of Welle, by the way)

13:36 mefesto: antares_: well so far im really liking it. the docs are pretty good. just the map-reduce side seems a bit light but otherwise great stuff!

13:37 antares_: https://github.com/clojurewerkz/support/blob/master/src/clojure/clojurewerkz/support/js.clj#L29 is the function you need

13:37 yes, the map/reduce part is worth writing a book on

13:37 also, I think that Riak's own docs can cover it much better, there is little client-specific about M/R

13:38 mefesto: yeah i was watching some of their vimeo vids

13:40 borkdude: nice blog: processing large files in clojure, exactly something I did recently, I should have used this approach for it: http://blog.malcolmsparks.com/?p=17

13:42 uvtc: borkdude: Your hunch about the Emacs + Clojure relationship is correct. It's now obvious where the name comes from. CLOJURE: Capture Lispers Overall Judiciously Usher Recruits to Emacs.

13:43 borkdude: yes

13:46 antares_: mefesto: I have to step away, let me know how it goes with Welle

13:46 mefesto: also, do complain about the docs, it is my favorite feature

13:46 mefesto: will do

13:46 borkdude: gtg

14:06 mefisto: emacs is the free software borg

14:06 if you start using it, you will be assimilated

14:06 pistolpete: I am using emacs==>erc right now. I am assimilated.

14:09 question: I'm looking to do some basic (static) web design. I'm coming from ruby/jekyll, and I've seen clojure tools like nakkaya/static and liquidz/misaki. I'm considering nakkaya/static because I like hiccup. Is there a better option?

14:09 technomancy: pistolpete: you don't need much for a static site generator

14:10 the seajure web site has one; it's pretty simple to build from scratch

14:10 antares_: pistolpete: haven't used any of those but why are you not happy with jekyll?

14:11 pistolpete: antares_: I'd like to put a bit of logic into some of the includes to prevent myself from repeating code.

14:12 technomancy: thanks, I'll take a look at the seajure web site. Maybe I'll just build one myself -- am I assuming correctly that all I need is hiccup and a few clojure functions?

14:12 I'm still quite new at Clojure

14:13 Apage43: heh, I gave up on my static site generator search because I couldn't find one that had good support for a markdown varient with footnotes and good clojure highlighting

14:13 *variant

14:14 pistolpete: antares_: and my secret reason is that I love using hiccup/writing html in sexpr form.

14:14 antares_: pistolpete: I see :) then use whichever uses hiccup

14:14 Apage43: my current solution is running first through multimarkdown, and then through a python script which pulls out the code chunks with beautifulsoup and pygmentizes them

14:14 technomancy: seajure uses enlive but swapping out that should be trivial

14:14 pistolpete: antares_: problem -- both use hiccup ;-)

14:15 ohh cool

14:17 technomancy: should I be looking at enlive in the long run anyway, or are they equivalent in power/concise-ness?

14:17 antares_: pistolpete: I think enlive is a bit different in scope but yes, more or less

14:17 technomancy: pistolpete: enlive transforms can be really hard to understand. I wouldn't recommend it unless you're going to have people working on templates who don't know Clojure.

14:18 * Apage43 just doesn't use it because I don't actually like looking at HTML =P

14:18 pistolpete: antares_ & technomancy: thanks!

14:18 technomancy: yeah, also it sucks not being able to use paredit on your templates =)

14:19 pistolpete: Apage43: same here

14:19 technomancy: also, hiccup: http://screencrave.com/wp-content/uploads/2010/03/How-To-Train-Your-Dragon-Hiccup-and-Astrid-25-3-10-kc.jpg

14:21 pistolpete: haha

14:22 mefesto: i created an nrepl server using nrepl-jack-in from emacs. is there a way to kill the server from emacs?

14:26 pistolpete: technomancy: sorry, what could the seajure static-site-generator be called? I'm not seeing it in the projects list there.

14:26 technomancy: it's just here: https://github.com/Seajure/seajure

14:26 pistolpete: d'oh, thanks!

14:27 technomancy: mefesto: right now you have to just kill *nrepl-server*; there's an open ticket for making that not suck

14:31 zmaril: If I'm writing a macro, how can I get the macro to find the name of the variable I've passed into the macro?

14:32 _ulises: evening all, I wrote (translated from a blog post) an implementation of Fizz-Buzz using Church Encodings and I'm interested in feedback in both the code and the narrative. Any takers? https://www.refheap.com/paste/5073/fullscreen

14:32 here are the tests for the code https://www.refheap.com/paste/5074/fullscreen

14:32 dnolen: zmaril: what do you mean by name of the "variable"? Do you mean the symbol?

14:32 zmaril: Yes

14:33 dnolen: zmaril: the string representation of the symbol? name

14:33 zmaril: I would like to get the name of the symbol and use that

14:35 cch1: ,(+ 1 2 3)

14:35 clojurebot: 6

14:36 cch1: OK, weird problem with macros + closures....

14:36 ,(defmacro m [x] (let [f (fn [] (println x))] `(~f)))

14:36 clojurebot: #<Exception java.lang.Exception: SANBOX DENIED>

14:36 cch1: (defmacro m [x] (let [f (fn [] (println x))] `(~f)))

14:37 That macro can't be run. It's just a simple closure over the arg passed to the macro, run from the expanded code.

14:37 Can anybody explain why it fails?

14:38 dnolen: cch1: that's not really how macros are supposed to work.

14:39 perhaps you want (defmacro m [x] (let [f `(fn [] (println ~x))] `(~f)))

14:39 cch1: dnolen: yep -that's what I ended up with.

14:40 DaoWen: clojuredocs lists a -?>> operator in clojure.contrib.core, but now that contrib doesn't really exist anymore I can't figure out where this ended up. It doesn't seem to be in clojure.core, otherwise I'd be available by default. Did it just get dropped?

14:41 zmaril: dnolen: Great! It works now

14:41 (defmacro shame-println [v] `(println ~(name v) ~v)) (def testing {:a 1}) (shame-println testing)

14:41 S11001001: DaoWen: core.incubator

14:41 zmaril: ;; testing {:a 1}

14:41 dnolen: zmaril: cool

14:41 clojurebot: Excuse me?

14:41 S11001001: DaoWen: where did clojure contrib go lists that as the new location of c.c.core

14:41 ~contrib

14:41 clojurebot: Monolithic clojure.contrib has been split up in favor of smaller, actually-maintained libs. Transition notes here: http://dev.clojure.org/display/design/Where+Did+Clojure.Contrib+Go

14:41 zmaril: Thanks!

14:42 S11001001: ~flatten

14:42 clojurebot: flatten is rarely the right answer. Suppose you need to use a list as your "base type", for example. Usually you only want to flatten a single level, and in that case you're better off with concat. Or, better still, use mapcat to produce a sequence that's shaped right to begin with.

14:42 DaoWen: S11001001: thanks!

14:43 mmitchell: ~reductions

14:43 clojurebot: excusez-moi

14:44 S11001001: mmitchell: no reductions is cool so no clojurebot complaints about it

14:44 clojurebot only complains, no praise

14:45 mmitchell: hilarious

14:45 mefisto: like an alcoholic father :(

14:50 abaranosky: hey guys, using clj-http, I was trying to test that my server returns the appropriate response w/ a 400 status when it receives bad paramters -- but clj-http will throw an exception in this case. What do you all use to test this type of things?

14:51 mefesto: abaranosky: i think there is an option you can pass that will disable that behavior

14:51 :throw-exceptions false

14:52 drewr: mefesto is correct

14:52 mefesto: abaranosky: (client/get url {:throw-exceptions false})

14:52 abaranosky: thanks @mefesto, appreciated

14:54 brainproxy: can I get cond-let for clojure 1.4? hunting around in the libs section of clojure.org...

15:05 antares_: brainproxy: clojure.org is a waste of time. For new contrib, see http://dev.clojure.org/display/design/Where+Did+Clojure.Contrib+Go but I don't think cond-let was extracted.

15:07 Sgeo_: Are there Clojure libraries for exact real numbers?

15:08 gfredericks: Sgeo_: curious what you mean exactly by that

15:08 algebraics?

15:09 brainproxy: antares_: okay, well, I just copied the macro's source from clojuredocs.org ... i don't see anything in the macro that should be a problem for clojure 1.4

15:10 Sgeo_: Suppose a and pi are exact reals, in the sense that I mean, and I add them to get c. c is "exact" in that there's sufficient information to, for example, request any finite number of decimal digits and display them

15:10 And those digits will be correct (modulo rounding or truncation at the end)

15:10 Example representation: A lazy list of decimal digits

15:10 gfredericks: fascinating

15:11 Sgeo_: Said lazy list would conceptually be infinite, thus representing any real (although, since most reals are not computable, most reals are not actually representable, I guess)

15:12 antares_: brainproxy: yes, it very likely will work, just no library to conveniently get it

15:13 scriptor: Sgeo_: so as a very simple example, you could represent the digits of pi as an infinite list of pi's digits?

15:14 Sgeo_: scriptor, yes

15:14 http://www.haskell.org/haskellwiki/Exact_real_arithmetic

15:15 scriptor: hmm, the first thing I thought of was trying to use infinite series

15:18 Sgeo_: Well, a list of digits is a series

15:18 Although specifying "series" rather than "digits" is probably easier, come to think of it

15:19 I think though that various existing Haskell libraries are more likely to have clues to efficient implementations

15:32 mefesto: antares_: map and reduce functions take an arg parameter. how do i specify that value with welle?

15:39 antares_: mefesto: https://github.com/michaelklishin/welle/blob/master/test/clojurewerkz/welle/test/mr_test.clj#L98

16:10 gfredericks: Sgeo_: I'm trying to prove to myself that what you're describing is impossible

16:10 e.g., what is the first digit of (+ (repeat 3) (repeat 6))?

16:11 (assume those represent 0.333... and 0.666...)

16:12 Sgeo_: Mathematically, the result would be 0.999... which is equal to one. It might be impossible to have the computer display 1 instead of 0.999..., but that doesn't mean 0.999... is a wrong result

16:12 gfredericks: well

16:12 assume (repeat 3 3) and (repeat 3 6) represent 0.333 and 0.666

16:13 you ask for the first digit and it should give 9

16:13 but it has to run to the end of the list to make sure it's not e.g. 0.334 + 0.666, in which case it's 1.0 instead of 0.9

16:13 but if the list is infinite, it can't return

16:13 Sgeo_: Ah.

16:14 Maybe that representation isn't good, then

16:14 gfredericks: I think binary has the same issue

16:14 Kowboy: hello!

16:14 gfredericks: Sgeo_: I know there are reasonable ways to do math with algebraics, but it's a lot more complicated than rationals

16:16 mattmoss: ,(+ 1/3 2/3)

16:16 clojurebot: 1N

16:16 hyPiRion: ,(apply + (map float [1/10 9/10]))

16:16 clojurebot: 0.9999999776482582

16:16 hyPiRion: ,(apply + (map double [1/10 9/10]))

16:16 clojurebot: 1.0

16:16 mattmoss: woo!

16:16 hiredman: gfredericks: what I think you are missing, is whenever you want a concrete value from an operation like +, you need to specify the precision you want

16:17 gfredericks: hiredman: so if I ask for a precision of 50 digits, I still can't be sure that the first digit is accurate

16:18 hiredman: so the value of (+ (repeat 3) (repeat 6)) is effectively a function that calculates it with a given precision

16:18 mefesto: antares_: ah thanks again

16:18 gfredericks: but I suppose I can be sure that the result is nonetheless quite close

16:18 Sgeo: Eep, computer went weird

16:18 gfredericks: hiredman: so as long as we don't insist on the correctness of particular digits, which Sgeo wanted

16:18 Sgeo: What happened after <Sgeo_> Maybe that representation isn't good, then

16:18 mattmoss: The perils of doing math with merely potential numbers.

16:19 Or the reverse. One of those.

16:23 Sgeo: Another representation, that at least works well for addition and subtraction, is a lazy sequence of vectors, the first item in the vector being a minimum, and the second being a maximum

16:23 The two values get closer later in the seq

16:24 (Although such a representation also means it's possible to construct nonsense numbers)

16:31 holo: hi

16:40 dnolen: holo: hello

16:52 uvtc: I wrote a little Clojure program to colorize and htmlize the #clojure irc logs that Raynes publishes. I'm hoping someone here might be able to have a look at and critique it. The code is at https://gist.github.com/3724690 . Sample output is at http://unexpected-vortices.com/temp/2012-09-14.txt.html .

16:52 technomancy: uvtc: lack of wrap there always bugged me

16:52 Raynes: uvtc: Not bad at all.

16:52 uvtc: I like it. :D

16:52 technomancy: uvtc: feature request: use the same nick coloring algorithm as erc-hl-nicks =D

16:53 Raynes: uvtc: Feature request: add anchors to messages so I can link to specific ones.

16:53 uvtc: You can do that.

16:54 Raynes: Oh

16:54 timestamps

16:54 Gotcha

16:54 technomancy: it's a pretty good algorithm

16:54 Raynes: Cool. Wanna have my babies?

16:54 technomancy: it normalizes for trailing ` and _ chars

16:54 uvtc: I just removed the underlines since I thought it made it look cluttered.

16:54 Raynes: hehehe

16:55 technomancy: my current algorithm is: find all users, then: (zipmap users (cycle colors)))

16:55 amalloy: uvtc: pretty nice. some of the colors are uncomfortably bright/pale on the white background for me

16:55 aperiodic: uvtc: right-align the nicks, and maybe leave the text uncolored?

16:55 technomancy: yeah, agreed that the actual text should be monochrome

16:55 leathekd did the erc module; it's pretty great

16:55 uvtc: Really? Hm. Interesting. Thought the colors made it easier to scan through and see who wrote what.

16:56 Any feedback on the code itself?

16:56 technomancy: there are already lines for that

16:56 TimMc: uvtc: Timestamps should underline on hover.

16:56 technomancy: ...though I could go for something that did similarity analysis on nicks and ensured that nicks that looked similar would have colors that weren't too close

16:56 uvtc: TimMc: Ah. Right. Thanks.

16:56 technomancy: also ponies

16:56 preferably several

16:56 uvtc: Ponies. Hm. Tricky. Unicorns ok?

16:57 technomancy: only if they're pegasus-unicorn hybrids.

16:57 uvtc: amalloy: Yes, it's difficult to come up with a large list of colors that look sufficiently different from eachother.

16:57 technomancy: I will have to talk to our breeding unit and see what they can do.

16:57 TimMc: Gravatars.

16:58 nsxt: any way to dynamically generate a namespaced keyword besides prepending a colon?

16:58 uvtc: TimMc: Hm! Gravatars. Interesting.

16:58 TimMc: Or 5 colored rectangles next to each nick. More visual data.

16:58 * aperiodic thought TimMC was joking

16:58 TimMc: nsxt: ##(keyword "foo/bar")

16:58 lazybot: ⇒ :foo/bar

16:59 amalloy: uvtc: passing around user-colors all over feels like a bit of a hassle. what about defining a function that takes a username and returns a randomly-selected color, and memoizing it?

16:59 technomancy: ,(-> keyword var meta :arglists)

16:59 TimMc: md5 of username

16:59 clojurebot: ([name] [ns name])

16:59 technomancy: nsxt: ^

16:59 TimMc: oooh

17:00 uvtc: amalloy: At first it was a global, then I thought better of it, but had to thread that user-colors map through a handful of functions.

17:00 aperiodic: it would be cool if evaluation requests to the bots were in a monospaced font

17:00 technomancy: amalloy: it would shift every day then

17:00 aperiodic: aw yezz

17:00 uvtc: aperiodic: Oooh. That would be cool.

17:01 amalloy: will look into memoizing.

17:01 Thanks for the feedback, all.

17:01 clojurebot: We live to serve.

17:01 technomancy: don't make it random

17:01 nsxt: technomancy: i don't follow :(

17:01 technomancy: it needs to be consistent across regenerations

17:01 amalloy: technomancy: wat. it will shift exactly as often as his current random-zipmap

17:01 using md5 or something is nice if you want to be consistent, although i don't think anyone looks at these logs often enough to care about that

17:02 technomancy: =(

17:02 amalloy: i already have different colors at home and at work due to 64/32-bit differences or something like that

17:02 technomancy: well I'm not the one writing it. get it into a proper repo and I'll make a pull req if I get annoyed with the random colors =)

17:04 aperiodic: i get irritated even when someone's nick gets truncated/underscored and they start showing up as a different color

17:04 technomancy: aperiodic: yeah leathekd fixed my client so it normalizes across that. <3

17:04 uvtc: Variety is the spice of life... :)

17:05 aperiodic: technomancy: ooh! man, i should really use a client that doesn't require knowing perl to hack on

17:05 technomancy: it's only 40 lines or so, I should port it

17:05 aperiodic: i would love you forever

17:06 technomancy: port it to clojure I mean

17:06 not touching perl

17:06 not even for you =)

17:06 aperiodic: drat!

17:06 technomancy: https://github.com/leathekd/erc-hl-nicks/blob/master/erc-hl-nicks.el#L125

17:06 scriptor: so…who's writing the clojure->perl compiler?

17:07 technomancy: it's only 4 functions

17:07 uvtc: Another way to do it is to just have set colors for folks who ask.

17:07 technomancy: heh; assign it by pull requests

17:08 Issue #23: clojurebot should totally be pink

17:08 uvtc: Will work on that tonight.

17:08 hiredman: that is the obvious color

17:08 uvtc: How about lazybot?

17:08 lazybot: favorite color?

17:09 clojurebot: what's lazybot's favorite color?

17:09 clojurebot: Gabh mo leithsc?al?

17:09 technomancy: clojurebot: mind your encodings

17:09 clojurebot: Titim gan ?ir? ort.

17:09 technomancy: you're hopeless

17:10 amalloy: &(Integer/toHexString (rand-int (apply * (repeat 24 2))))

17:10 lazybot: ⇒ "6b55a4"

17:10 amalloy: not bad, i guess

17:10 TimMc: ,(str "#" (.substring (Long/toString 36rlazybot 16) 0 6))

17:10 clojurebot: "#acc502"

17:10 technomancy: nice

17:11 TimMc: I'm sure that could be condensed witha format string.

17:11 amalloy: it's just 4 characters with cl-pprint, probably

17:16 TimMc: ,(format "#%06x" (mod 36rlazybot 16rFFFFFF))

17:16 clojurebot: #<ExecutionException java.util.concurrent.ExecutionException: java.lang.NoClassDefFoundError: Could not initialize class clojure.lang.RT>

17:16 TimMc: okay...

17:16 &(format "#%06x" (mod 36rlazybot 16rFFFFFF))

17:16 lazybot: ⇒ "#503579"

17:16 TimMc: Apparently format doesn't have a truncation option for ints.

17:18 Mandar: hey there

17:19 hyPiRion: Humm

17:20 amalloy: TimMc: you don't want to use mod there

17:21 do you? maybe you do. i didn't think the math through

17:21 right, i'm dumb. mod is fine

17:23 Mandar: how can i search the docs for what the ` symbol does?

17:24 i've tried running (find-doc "`")

17:24 nDuff: Mandar: it's called syntax-quote

17:24 Mandar: ...if that helps you search.

17:24 TimMc: Mandar: clojure.org/reader

17:24 Mandar: (find-doc "syntax-quote") doesn't return anything either

17:24 TimMc: That page covers the reader syntax.

17:24 Mandar: thanks TimMc

17:26 amalloy: it's also not a symbol

17:27 Mandar: how is it called amalloy?

17:27 amalloy: i dunno. i guess it's a reader macro? thinking of it as a prefix character is probably best

17:28 Mandar: (type `) doesn't run either

17:31 scriptor: Mandar: clojure syntax quotes something before it's evaluated, there's no way to refer to ` on its own

17:33 Mandar: http://pastie.org/4722271

17:33 nDuff: Mandar: ...yes, meant that for purposes of searching the web. The reader isn't self-documenting.

17:33 Mandar: why is the second form better than the first one?

17:33 nDuff: ...uhh.

17:33 Huh?

17:33 Why would it be better?

17:33 Mandar: i don't know, that's what the koan's comment says

17:34 nDuff: Which koan?

17:34 ...I mean, syntax-quote makes much more sense when you're mixing dereferences with literal content

17:34 which is usually the case when writing macros

17:34 Mandar: macros.clj

17:34 nDuff: but that particular example really doesn't do a good job of demonstrating what it's good for.

17:35 Mandar: maytbe i didn't fill the blank rights

17:35 right*

17:35 the test runs but it might not be the best answer

17:38 i don't get it

17:38 ~(second form) is needed to actually apply the operation operator

17:38 clojurebot: Alles klar

17:39 Mandar: but why ~(first form)

17:39 scriptor: Mandar: it's better because using syntax-quote is more idiomatic

17:39 you can use list and so on, but that gets verbose fast

17:39 at least, that's what I think they mean

17:39 Mandar: sure but i just don't understand the code

17:40 (first form) returns a number

17:40 what does "unquote a number" mean?

17:41 nDuff: Mandar: ...so, by default, you would get the literal list ('first 'form)

17:41 scriptor: Mandar: so, say you entered `(second form)

17:41 nDuff: Mandar: ...you wouldn't be running the function at all.

17:41 aperiodic: Mandar: you're not unquoting the number, you're unquoting the (first form) form

17:41 scriptor: that would have the macro return (second form) and place it where you called the macro

17:42 if you did `(~(second form)) it would evaluate the part that's unquoted (second form) in this case

17:42 which would return +

17:42 so then the macro return (+)

17:46 Mandar: i still don't get what ~(first form) does

17:46 what's the type of the returned value?

17:46 is it a raw list?

17:46 scriptor: Mandar: so we're agreed form is (9 + 1) right?

17:46 Mandar: yes

17:47 scriptor: so ~(first form) tells clojure that we are no longer syntax quoting,

17:47 but instead, we want to actually evaluate that code

17:47 so (first form) returns the first element of form

17:47 Mandar: but doesn't (first form) evaluate it already?

17:47 scriptor: no

17:48 because of the syntax quote

17:48 Mandar: oh

17:48 nDuff: Think about a regular, non-syntax quote

17:48 '(first form) doesn't get evaluated

17:48 Mandar: yes

17:48 nDuff: and in fact, _nothing_ in that quote does

17:48 syntax quotes do that, but give you an escape hatch

17:48 Mandar: but i thought the syntax quote would be applied at the end

17:48 like a regular function

17:48 scriptor: Mandar: nope, the syntax quote is applied before pretty much anything

17:48 nDuff: No -- that's why we pointed you to the reader documentation

17:48 the reader does its work before anything else

17:49 Mandar: sorry, i was trying my best

17:49 scriptor: Mandar: learn about regular quote first

17:49 and the difference between quote: ' and syntax-quote `

17:50 Mandar: i think i now understand what it does, it says "do not evalue this, unless ~ tells you to"

17:51 nDuff: There's more than just ~

17:51 there's also ~@, for instance

17:51 scriptor: Mandar: you're on the right track, but syntax quote also namespace qualifies every symbol

17:51 nDuff: really do read the reader documentation

17:51 scriptor: actually, I suggest a book or something more introductiony to teach you about macros

17:52 Mandar: nDuff, the documentation is quite hard to understand at my level

17:52 Raynes: The reader documentation is as useful to a person new to Lisp as telling them to read the reader documentation is.

17:52 nDuff: Mandar: Fair 'nuff -- the clojure.org docs are indeed not nearly as good as the better dead-tree books published.

17:53 scriptor: are there any good stand-alone clojure macro tutorials?

17:53 Mandar: i'm not criticizing anything, i know i need to learn about this stuff and i'm grateful for the help

17:54 i'll get a book after i'm done with the koans

17:54 but i need to build a toy project first

17:55 scriptor: Mandar: just stay clear from macros for now…unless you feel particularly adventurous ;)

17:55 Mandar: i was just curious :)

18:00 technomancy: it would be nice if clojure.org were actually a resource you could rely upon to get started with clojure

18:01 scriptor: well, a couple of links in does get you http://dev.clojure.org/display/doc/Getting+Started

18:04 aperiodic: oh sure, at the bottom of a page linked to halfway down the sidebar that starts by telling you to download the clojure jar and launch it with `java` :/

18:06 scriptor: it's just practice for when you have to grapple with the classpath, emacs, and clojure all at the same time

18:07 * muhoo suspects some latent "new users are a PITA, filter out the ones who can't figure out a classpath" going on at clojure.org

18:07 aperiodic: that's the impression it gives me

18:08 Mandar: thanks guys, i finally understood the difference between ` and '

18:09 technomancy: muhoo: unless they're paying for training, in which case clojure.com covers them just fine =)

18:17 * muhoo light bulb goes on

18:18 muhoo: of course, it makes perfect sense now. i'd never looked at that site before. now i get it.

18:31 Mandar: what book would you advise to a beginner?

18:31 (and i don't especially mean "closure for dummies")

18:35 no7hing: somebody should tell them that http://clojure.com/roadshow gives a 404

18:43 jk12: netbeans or eclipse for windows clojure dev? have no prior experience in either

18:44 casion: seems counterclockwise is more up to date

18:47 jk12: casion: thanks

18:48 no7hing: should the agent in http://clojuredocs.org/clojure_core/clojure.core/set-error-handler! be the failed one?

18:48 should/is

18:49 ah, confused, i meant the agent the actual handler get's passed

18:49 kind of late here

19:00 muhoo: Mandar: clojurebook.com

19:00 Mandar: muhoo, thanks :)

19:16 percious: hello out there, total clojure gumby here, coming from the python world, old-school lisp programmer

19:17 Khaoz: o/

19:18 percious: is there a good free clojure IDE?

19:18 for a mac?

19:18 nDuff: percious: Most folks prefers emacs, but that has a learning curve if you've never used it.

19:18 ~survey

19:18 clojurebot: survey is http://cemerick.com/2012/08/06/results-of-the-2012-state-of-clojure-survey/

19:18 nDuff: percious: ^^ that covers what tools people use

19:18 percious: <-- kind of a vi guy

19:18 thanks nDuff

19:19 Khaoz: well, i'm a emacs fan too, but vim+vimclojure seems a good choice

19:19 nDuff: percious: I use vim for everything but Java or Clojure -- for Clojure in particular, paredit mode in Emacs is life-changing.

19:19 Khaoz: this ^

19:20 percious: Python has a really nice IDE called wing which has built-in documentation, autocomplete tools and "go to definition" functionality

19:20 Khaoz: i'm still get used with paredit but it's really good

19:20 percious: it will even dive into a zipped package to find the source for you

19:20 clojure have anything like that?

19:20 nDuff: percious: Look at the Emacs Live video

19:21 percious: ...it goes way, waaay beyond what you can do with Wing+Python.

19:21 Khaoz: percious: you can try netbeans or eclipse

19:21 nDuff: percious: http://vimeo.com/22798433

19:21 percious: previously I have been underwhelmed with eclipse.

19:22 what's the sand-boxing story for closure?

19:22 i see lein

19:22 does lein set up a sandboxed environment?

19:23 nDuff: Sandboxing from a security perspective? There are a few tools for that

19:23 cark: there are a couple libraries for sandboxing, lein isn't one of them

19:23 percious: no, from a packaging/versioning perspective

19:23 cark: lein is a builld tool

19:23 nDuff: ...it's not something lein does by default, or do you mean the virtualenv style of sandboxing?

19:23 Yes, your library selections are isolated between projects

19:23 even though they're all cached in a ~/.m2 repository, only the ones defined in your project.clj are active

19:25 percious: awesome vimeo video

19:25 thanks for sharing

19:26 what's closure's story for wrapping c libraries?

19:26 like python's ctypes if you are familiar

19:26 nDuff: Same as Java's == awful

19:26 ...well, not as awful as it used to be

19:26 but it sure isn't ctypes

19:26 percious: how about ORM

19:27 <-- lover of sqlalchemy

19:27 nDuff: Heh; SA is indeed great.

19:27 amalloy: percious: a lot of the clojure community subscribes to ideas like https://twitter.com/psnively/statuses/245972474926350337

19:27 percious: http://percious.com/blog/archives/34 ;-)

19:28 amalloy: i find that to be unfortunate

19:28 i find ORM's to be excessively useful, as long as they aren

19:28 t based on Django ;-)

19:28 amalloy: you can find ORMs in clojure, but they have all the problems that other ORMs have

19:28 casion: why would you want ORMs in clojure?

19:28 that seems… very strange

19:29 like asking if C has orm

19:29 percious: well, if'n I'ma work for a web company, and clojure is what they have chosen, I probably should understand the story there

19:30 <-- is a job seeker

19:30 technomancy: percious: korma is the closest thing to an ORM you're likely to see with Clojure

19:30 nDuff: Ugh.

19:30 percious: btw, i really appreciate you guys fielding my total newb questions

19:30 * nDuff hates Korma -- rolled his own, and saved a vast amount of headache

19:30 percious: yeah, i saw korma

19:31 technomancy: it still has some issues

19:31 percious: seems pretty primative

19:31 nDuff: OSS?

19:31 technomancy: I don't think it's the right abstraction, but I'm also pretty sure it's better than doing it raw

19:31 grim_radical: it doesn't help that it's kind of abandoned

19:31 nDuff: percious: Nope -- just enough functionality for my immediate needs and no more, so it wouldn't be worth releasing.

19:31 percious: i like SA because it abstracts the table layer, and also provides an object layer

19:32 nDuff: you'd be surprised what people consider worthy of release ;-)

19:32 cark: we're not too much into objetc around here

19:32 percious: doesn't java have a DB abstraction lib?

19:32 cark: objects*

19:32 percious: yeah, i hear you about objects

19:32 nDuff: percious: Anyhow, Clojure makes it so darned easy to build minilanguages that building "just enough ORM" is really, _really_ simple.

19:33 percious: i hear you about the mini languages, I did have 2 years of lisp, writing an NLP

19:33 and I got *paid* for it... gasp.

19:33 nDuff: percious: ...that said, the leading datastore for Clojure in terms of having advanced, interesting features is based on Datalog, not SQL

19:33 percious: thank god someone fixed string manipulation in LISP, that's all I can say

19:34 nDuff: percious: ...sadly, it's commercially licensed, or else there'd be a lot more uptake.

19:34 cark: can't be using all caps lisp that'll get the CL people angry

19:34 percious: <-- old clisp user

19:34 bruno haible was my hero i guess...

19:35 never did try common lisp

19:35 cark: nDuff: at least we got reducers out of it

19:35 technomancy: percious: clisp predates CL?

19:35 cark: clips is a common lisp

19:35 percious: you know, i am not sure

19:35 both were pretty active 10 years ago.

19:35 my supoervisor chose clisp, the rest is history

19:36 interestingly, i got my AI professor to use it instead of scheme

19:36 (for his class)

19:36 mindbender1: We are entering the space age -- Rich Hickey

19:37 percious: anyone else bothered by the fact that the clojure interpreter takes quite a bit of time to start up?

19:37 cark: clojure is not an interpreter

19:37 nDuff: percious: It's Java.

19:37 technomancy: startup time sucks

19:37 nDuff: (and indeed, it's _not_ an interpreter -- anything you enter at the REPL is actually compiled to Java bytecode before being run)

19:37 percious: jms that I am not the only one ;-)

19:37 yeah yeah, sorry for using "python" terminology.

19:37 Sgeo: So, as I was asking, any Clojure libraries for exact reals?

19:37 percious: ;-)

19:38 cark: exact reals ? lique square root fo 2 ?

19:38 aperiodic: isn't that impossible with only a finite amount of memory?

19:38 cark: like*

19:38 Sgeo: Well, when outputting a result, you could specify a precision

19:38 But not before then

19:39 Conceptually, they're as possible as "infinite lists"

19:39 (Or, I guess, infinite length lazy seqs in Clojre)

19:39 cark: i don't think there is one, that would have been advertised a lot

19:39 nDuff: percious: ...there are some tools that will keep a running interpreter in the background and let you connect to it over a socket, to get the effect of faster "startup"...

19:40 percious: ...in terms of interaction with C libraries, by the way, see https://github.com/Chouser/clojure-jna

19:40 technomancy: percious: Clojure is only suitable for a (large) subset of places the JVM is suitable

19:40 you couldn't use it to write git

19:40 percious: nDuff: seems like that would lead to a glutton of globals... leading to undesired execution.

19:40 cark: technomancy: how so ?

19:40 nDuff: percious: Only if you're reusing the same namespaces.

19:40 amalloy: technomancy: didn't someone do that already? for java, that is, not clojure

19:41 percious: anyone use clojure-jna?

19:41 technomancy: amalloy: there's an implementation of git, but it's not usable from the command-line.

19:41 casion: percious: yes

19:41 technomancy: cark: startup time, memory usage, and general sucking at being unix

19:41 percious: cool, how do you like it?

19:42 cark: technomancy: well that's java ... i'm interested in those places where java is good but clojure isn't

19:42 casion: percious: it's an excellent learning tool… easier to use JNA directly it seems

19:42 technomancy: cark: oh sure. Android is the only one that comes to mind.

19:42 casion: not by fault of the library itself

19:42 cark: technomancy: ahyes indeed

19:42 nDuff: percious: ...by the way, there _are_ non-Java-based Clojure-derived languages

19:42 percious: ...most of them implementing about the same subset as ClojureScript...

19:42 percious: yeah, makes sense

19:42 casion: there's clojure for almost everything now

19:42 nDuff: percious: ...and generally doing a lot better in terms of startup time and such, but lacking the same concurrency primitives and such.

19:42 percious: i talked to one of the pypy guys, he said the clojure implementation there is kind of a joke.

19:43 my jython friend likes clojure tho

19:43 cark: nDuff: i hear clojure.net and clojure/python are not on the same track as clojure script

19:43 percious: he's a java guy of course :)

19:43 cemerick: Easy thing to say when the project is 6 months old.

19:43 pypy has been on for what, 6 years?

19:43 nDuff: cark: ...yes, the CLR one is definitely a very different (and mature) thing

19:43 percious: ha ha, well maciej is never known to be diplomatic ;-)

19:44 technomancy: the former head of the jython project attends the seattle clojure group

19:44 nDuff: cark: ...there's a reason I said "most" and "generally"

19:44 technomancy: he's pretty skeptical of clojure-py too

19:44 cark: nDuff: well what does it leave besides clojurescript ?

19:44 nDuff: there was one with lua i thinkk

19:44 and that's it

19:44 casion: there's lua, objc (2), haskell, C

19:44 cark: oh ok =P

19:44 * nDuff nods in casion's direction

19:44 cemerick: scheme

19:45 casion: someone was screwing with some ocaml backend…

19:45 cark: mhh an haskell one might be cool =)

19:45 percious: so, the lisp syntax and the concurrency model seem to be the big attractants to clojure.

19:45 technomancy: come for the macros, stay for the referential transparency

19:45 cark: percious: it's best known for that, but the real gold is in the persistent data structures

19:45 * nDuff agrees -- the persistent data structures are what makes the biggest difference in how he designs programs

19:45 casion: percious: I started with clojure for the jvm personally, stayed for the functional-ness of it

19:46 percious: ml runs on java too tho...

19:46 technomancy: yeti?

19:46 nDuff: percious: ...having control over where your program keeps its state is important for much more than just concurrency.

19:46 cark: funny thing is that persistent data structures were only a mean to achieve good concurrency

19:46 percious: nDuff: so you find having to manage scope yourself to be a benefit?

19:47 nDuff: percious: Huh?

19:47 mindbender1: imperative=place oriented programming

19:47 percious: i once found a scoping error in cpython...

19:47 casion: there's lots of things that run on the jvm… very few of them have enough material that makes them worth learning

19:48 nDuff: percious: ...it's not about the scoping rules as such, it's about mutating your data (and the places state hangs off of) being very explicit. refs/atoms/agents/&c.

19:49 percious: ...too easy in the OO world to get into a case where your state is scattered across a huge number of objects, and you don't know what the state of the whole system is at a time.

19:50 percious: nDuff: yes, I have experienced this in the past, especially a problem with JS guis.

19:50 casion: oop is the devil

19:50 percious: python seems to have constructs to help reduce this problem.

19:50 mindbender1: program more with values

19:51 percious: usually I solve the state problem by creating a custom state object and passing it through the process.

19:51 Hodapp: OOP has value, but it sure doesn't deserve all that its proponents try to credit it with.

19:51 percious: i did this for the turbogears dispatch mechanism

19:52 mindbender1: new information requires new space

19:53 nDuff: percious: *nod*. That's part of where I've found ClojureScript to be handy -- bringing the whole immutible-data + atoms-with-watchers model to JavaScript.

19:53 percious: i am not a huge fan of ordered arguments as apposed to named arguments

19:53 nDuff: *shrug*. You can use destructuring to get named arguments when you want them, within some limitations

19:53 there are certainly cases where that approach isn't appropriate, though

19:54 one thing to keep in mind is that Clojure is playing within the boundaries of what the JVM can do efficiently

19:54 Hodapp: I am writing something in Clojure now that I intended to target Processing or OpenGL for some simple 2D, and ClojureScript (which I noticed later) had some intrigue for letting me easily target this same code to Javascript Canvas

19:54 nDuff: it's intended to be practical, along those lines, and argument-passing in Java is generally positional by nature

19:56 casion: I never really understood the need for named arguments

19:56 and when using objc, it just annoys the shit out of me

19:57 Hodapp: I've never really messed with ObjC, but I've gotten the idea that it does OO a lot closer to what Alan Kay meant when he coined the term.

20:02 Sgeo: Hodapp, try Smalltalk for OO?

20:03 I like named arguments, but think that names arguments shouldn't be positional, the way they are in Smalltalk

20:03 Hodapp: Sgeo: I am sure Smalltalk is rather close, being a creation of Kay; what I'm talking about is ObjC compared with, say, Java or C++.

20:03 casion: objc is heavily influenced by smalltalk

20:05 big emphasis on heavily

20:11 luxbock: a complete newbie trying to set-up Emacs with Clojure here

20:12 how can I tell if I successfully managed to install swank-clojure with lein?

20:12 casion: have you just tried to clojure-jack-in?

20:12 luxbock: yeah I did, but Emacs doesn't find the command

20:13 casion: do you have clojure-mode installed?

20:13 luxbock: it might be because I tried installing swank through Emacs first

20:13 yeah I do

20:13 nDuff: luxbock: ...personally, I use Emacs Live -- bundles all the various goodness in a single installation.

20:14 casion: installing swank first… I've heard that can cause some issues

20:14 luxbock: can I run Emacs Live on windows?

20:14 Hodapp: nDuff: what sort of goodness?

20:15 luxbock: casion, can I just delete the swank-clojure+1.1.0 from my .emacs.d/elpa/ folder, and then try lein'ing it again?

20:16 casion: technomancy: ping

20:16 luxbock: maybe technomancy can help you better :)

20:17 wouldnt be surprised if he just suggested using nrepl.el though

20:18 nDuff: Hodapp: Easier to point at the video; see http://vimeo.com/22798433

20:19 casion: nDuff: you use this for not-overtone?

20:19 nDuff: casion: absolutely.

20:21 luxbock: No idea -- I personally use it on Linux, and its creator uses it on MacOS.

20:21 casion: well, I'm going to play with this. it seems to be setup like my .emacs except a bit better

20:46 luxbock: On Emacs 23 you will need to get package.el yourself or install manually by placing nrepl.el on your load-path and requireing it.

20:46 where do I put package.el and how do I "install" it?

20:57 jamesmacaulay: Newbie question: I'm trying to play around with clojure.data/diff, and I expected to be able to fire up a standalone lein repl and do (use 'clojure.data)...but that gives me a java.io.FileNotFoundException that it couldn't be found in the classpath. What am I doing wrong? Do I need to install clojure.data from somewhere?

20:57 gfredericks: yep

20:57 well wait

20:58 yes

20:58 it'll go in your lein dependencies

20:58 Raynes: You're so fickle, gfredericks.

20:58 nDuff: Hmm? Looks like it's in core to me

20:58 jamesmacaulay: Which version of Clojure?

20:59 gfredericks: nDuff: it's not in my 1.4

20:59 Raynes: &(require 'clojure.data)

20:59 lazybot: ⇒ nil

20:59 Raynes: &(clojure-version)

20:59 lazybot: ⇒ "1.4.0"

20:59 gfredericks: oh whoops

20:59 Raynes: &(doc clojure.data/diff)

20:59 lazybot: ⇒ "([a b]); Recursively compares a and b, returning a tuple of [things-only-in-a things-only-in-b things-in-both]. Comparison rules: * For equal a and b, return [nil nil a]. * Maps are subdiffed where keys match and values differ. * Sets are never subdiffed. * All... https://www.refheap.com/paste/5088

20:59 gfredericks: I interpreted clojure.data/diff to be a lib name

20:59 and then interpolated the ns name to be clojure.data.diff

21:00 Raynes: &(clojure.data/diff [1 2] [2 1])

21:00 lazybot: ⇒ [[1 2] [2 1] nil]

21:00 gfredericks: and kept down that rabit trail, and then explained myself while you guys proved me wrong

21:00 jamesmacaulay: oh jeez, a standalone lein repl gives me 1.2.1, I had no idea

21:00 Raynes: Get lein 2.

21:02 jamesmacaulay: lein upgrade only gives me 1.7.1, how do I get 2?

21:02 gfredericks: gotta download it explicitly

21:02 jamesmacaulay: okay thanks

21:02 Raynes: The king of the vague.

21:02 One moment.

21:02 gfredericks: Raynes: the only important thing is that I get my answer out first

21:02 Raynes: jamesmacaulay: https://github.com/technomancy/leiningen#installation

21:03 jamesmacaulay: This is instructions for getting lein2. You can either replace your current installation (which is fine, the 'preview' prefix is meaningless at this point the final release is coming out soon and everybody has switched already) or add it alongside your existing one.

21:03 gfredericks: That's true.

21:03 3

21:03 <3

21:04 jamesmacaulay: thanks very much!

21:04 Raynes: suffix*

21:04 Surprised amalloy didn't call me out on that one. He must be playing something.

21:04 stankley: jamesmacaulay: One thing to look out for, I think it broke slime-jack-in for me, and now I've switched over to nrepl

21:05 Raynes: I hope it breaks it for everyone so as to force them to switch to nrepl. :D

21:05 Everybody should hate me as a maintainer.

21:05 I break things whenever possible.

21:05 cark: well lein2 comes with a lot of pains

21:05 stankley: Yeah, it's a weird way to find out, but the nrepl is sweet

21:05 Raynes: cark: Like?

21:05 cark: like forcing nrepl

21:06 Raynes: I don't think it actually forces nrepl.

21:06 stankley: It's a Good Thing

21:06 cark: right now nrepl is annoying me =P

21:06 Raynes: I know people using lein2 with slime.

21:06 akhudek_: I've had a few "out of heap space" errors using lein2

21:06 amalloy: Raynes: just call everything an affix, so you don't have to remember which is which

21:06 akhudek_: but they seem to have gone away after a few recompile attempts

21:06 bizarre

21:06 stankley: cark: Just takes a second to relearn key binds

21:06 Raynes: Yeah, but nrepl.el is new enough that some obscure bugs still pop up once in a while so I understand.

21:07 It also isn't as polished around the edges as SLIME at this point.

21:07 It makes up for it by being extremely hackable and having real releases.

21:07 cark: thing is i would like to continue working at my stuff rather than messing again with emacs configuration, adjusting old projects and all that kind of jazz

21:07 Raynes: If the 20 seconds it takes to set nrepl.el up is too much, you don't actually have to switch.

21:07 *shrug*

21:08 There isn't really any adjusting to do to old projects for nrepl.el.

21:08 xeqi_: and being able to run a cljs repl

21:08 cark: 20 seconds to install it, 1 hour to have autocomplete *about* right, countless restarts

21:08 and days to have projects updated

21:09 Raynes: I'm not convinced your experience was the same for everyone.

21:09 What does projects have to do with nrepl.el?

21:09 cark: i understand the worlds has to move on, but it's annoying nevertheless

21:09 Raynes: :\

21:09 Is there something you had to do to make projects work with nrepl?

21:09 Or just lein2?

21:09 cark: well it depends on the project =)

21:09 Raynes: The breaking changes in lein2, while annoying, were very worthwhile and will certainly make everyone happier in the long run.

21:10 cark: i have some that are as old as clojure

21:10 Raynes: I understand where you're coming from though.

21:10 cark: i have this one that has a project.clj, just to be able to run it with lein1, but predates it

21:11 it's uysing compojure before ring existed

21:11 stankley: cark: Ah, the entropy of code

21:11 Raynes: I actually thought you were new around here.

21:11 cark: well it's working, and i'd rather keep it this way by not upgrading everything, but i still need to maintain it sometimes

21:12 i gave you tips when you were new

21:12 stankley: Hah

21:12 cark: =)

21:12 i'm an episodic irc user =)

21:13 Raynes: cark: o/

21:13 :D

21:14 You are a gentleman and a scholar.

21:14 cark: so yes entropy it is, projects all over the place, it's a balancing act to have all these versions of lein, clojure, libraries running together

21:14 stankley: cark: Do what I do, set up a Vagrant file for the projects

21:14 cark: Like it or not, a virtual machine for each project means things don't break

21:15 cark: mhh

21:15 right, but they're big

21:15 stankley: Ugly but effective

21:15 cark: a vm is a lot to backup

21:16 i thought of that, i still have an old delphi (3!) project that i have to maintain

21:16 no7hing: i'am really, really sorry if i ask this again, but why are agents passed to the defined error handler *not* in failed state?

21:16 stankley: True, but I try to write everything in Chef, so it's just code that builds the environment

21:17 cark: mhh what is chef ?

21:17 no7hing: similar to pallet

21:18 cark: stankley: so you mean that you run a script that builds your vm and "populates" it when you want to start working on some project ?

21:18 no7hing: automation for cloud paas

21:18 arrdem: I've heard it said that Noir is crap. What libs should I be looking to as I overhaul my website?

21:18 stankley: cark: A DSL to describe the configuration of your server. It's written in Ruby. And yes.

21:19 cark: mhh that looks interesting

21:19 more hours working on infrestructure rather than code ..

21:20 stankley: thanks for the tip, i'll investigate that

21:20 stankley: cark: Exactly. No free lunch... yadda yadda

21:20 NP

21:21 no7hing: haven't used it yet, but pallet seems like a clojurey alternative

21:21 anyway, g'night

21:23 stankley: no7hing: True, that video presenting it is on my watch list.

21:24 xeqi: arrdem: noir is fine; alot of people use compojure

21:25 arrdem: xeqi: yeah I haven't had any real issues with it that aren't my fault... I've just seen it take some heat here and figured I'd ask

21:28 Raynes: arrdem: Noir is just a more stateful and magic way to get web development done. Some people don't like that. Lately I tend to be one of them. Lots of people use noir and it is certainly a capable web framework. Use whatever you feel like using.

21:29 * nDuff is on the compojure > noir side of the fence as well.

21:29 Raynes: I've certainly said a few thing about noir, but I've never called it 'crap'.

21:29 I'm a noir contributor.

21:29 Mostly lib-noir, but noir nonetheless.

21:29 And Chris is a good friend of mine.

21:31 arrdem: For my opinionated suggestion, check out compojure and lib-noir (which is a lib separate from noir with some noir goodies). It's currently my favorite one two punch for web dev.

21:31 But if you're already using noir for something and you like it, no reason to stop.

21:32 arrdem: Raynes: I'm basically doing a total site rebuild, but I have been very impressed with Noir thus far. Thanks for the advice.

21:33 ,(doseq [x ["Raynes" "xeqi" "nDuff"]] (println "(inc" x ")"))

21:33 clojurebot: (inc Raynes )

21:33 lazybot: ⇒ 1

21:33 clojurebot: (inc xeqi )

21:33 lazybot: ⇒ 1

21:33 clojurebot: (inc nDuff )

21:33 lazybot: ⇒ 1

21:33 Raynes: The only real point where you'll probably run into Noir issues if for complex middleware setups. Adding middleware in Noir is all mutable and covered up so it is very hard to order things the way you want and wrap specific routes and such.

21:33 If you don't have those problems then you should be fine.

21:34 arrdem: Raynes: yeah I think I've heard that here before. Don't expect it do be an issue as this is going to be personal and entirely from scratch.

21:36 akhudek: arrdem: also take a look at https://github.com/ohpauleez/shoreleave

21:36 I haven't tried it, but it looks interesting

22:07 Sgeo: I'm finally going to test my patch to algo.monads tonight

22:07 And maybe make m-lift-fn act more like m-lift

22:14 cark: Sgeo: i thought about it

22:14 Sgeo: What's "it"?

22:14 cark: Sgeo: and didn't really test it, but maybe m-lift-fn is the way it is for efficiency reasons ?

22:15 your patch invovles apply doesn't it ?

22:15 Sgeo: m-lift-fn is the function I wrote to replace m-lift

22:15 cark: right

22:16 Sgeo: Well... maybe. But, there is the fact that, since there's no apply in Haskell, there's no m-lift-fn, and a general lift like that would need a macro in Haskell. So, if algo.monads author was studiously copying from Haskell...

22:16 Hodapp: blarg, is it impossible when I open a :ClojureRepl in vim to use Ctrl-w,c, Ctrl-w,v, :bn to switch it from a horizontal to a vertical window?

22:17 cark: Sgeo: let me go back and see the code

22:17 Sgeo: (I didn't even test m-lift-fn yet, so I could have merely gotten it wrong)

22:17 cark: tho i don't think the author blindly copied haskell

22:17 Hodapp: why... is this not a valid thing to do?

22:19 am I just using a really half-assed development environment or am I missing something obvious here?

22:20 cark: Sgeo: mhh i think it's very efficient as it is, i would advise you to make some micro-benchmarks with both your and the library versions

22:21 Sgeo: so why do you want to change it ?

22:21 Sgeo: you already said but i forgot

22:21 casion: Hodapp: the former

22:22 cark: casion: =)

22:22 Sgeo: cark, to replace a macro that can be a function with a function. The function is also more flexible, because it doesn't need to be told how many arguements the lifted function takes

22:22 Hodapp: casion: siiiiigh. Folks in here told me that lein-tarsier & vim worked really well.

22:23 cark: Sgeo: right, but isn't there m-seq just for this kind of problem ?

22:23 casion: I keep trying it, and everytime I do I end up hitting some wall

22:23 Hodapp: casion: lein-tarsier, nailgun, vimclojure et al.?

22:24 casion: Hodapp: I actually never have got nailgun working correct :|

22:24 * Hodapp looks to Eclipse, and to Emacs...

22:24 Hodapp: casion: I think I have nailgun working okay but I'm finding the vim plugin really clunky

22:25 cark: Sgeo: some combination of apply, f-map and m-seq i guess

22:25 Sgeo: cark, and that's exactly what m-lift-fn does

22:25 (Well, I'm thinking of making it curried by default)

22:26 cark: Sgeo: allright then, maybe add it to the library, but i feel like there should still be a way to have the "fast" path

22:27 and while you're at it, we need eval-state and run-state functions =)

22:28 (defn eval-state [computation state] (get (computation state) 0))

22:28 and (defn run-state [computation state] (get (computation state) 1))

22:29 hum no

22:29 euh yes

22:29 Sgeo: My question about the library is why it uses so many macros instead of, maybe, having m-bind and m-result be dynamically bound

22:29 cark: when you look at it

22:29 Sgeo: Although I guess doing that may cause some issues with returning functions

22:30 cark: it's because they're trying to call functions directly, instead of passing a monad "object" around

22:30 if you look at defmonadfn

22:31 you'll see that it changes a function from this (defn foo [bar] to

22:31 (defn [m-bind m-return .... bar] ...

22:31 so when you do (with-monad state ....

22:32 it binds the m-bin m-result etc to local scope

22:32 then pass it around under the hood

22:32 i don't see how one can do it any faster

22:33 Sgeo: "speed" isn't my concern here. My concern is generality

22:33 cark: that's why domonad has a version where you do not specify the monad it uses

22:34 well, i think the goal is to be general, to allow "return value polymorphism"

22:34 kinda

22:34 Sgeo: It would be nice if this code were at least not tied to monads

22:34 The mechanism for this could be more general, I think

22:34 cark: well it is necessary if you don't want to pass the monad around

22:34 Sgeo: But I don't like relying on defmacrofn

22:35 cark: it allows the algo.monad user to write code which is not bound to a specific monad

22:35 Sgeo: But, if I use dynamically-scoped variables, call them *m-bind* and *m-result*, a similar result could also be done. with-monad would merely be a binding form. The big problem is making closures that capture the monad that is currently in use

22:35 cark: say you're writing a parser, with statet and maybe

22:36 then you suddenly think it would be easier to add a writer monad in there

22:36 the way it is right now, you only need to pass the right monad from your top level and it just works

22:37 right, i only see a problem with the cost of indirection when calling a var

22:38 not quite sur if there is some other reason

22:38 sure*

22:38 tho the cost must be quite high since rhickey changed the default to "not dynamic"

22:39 Sgeo: The cost of dynamics is, I think, generally an issue with correct use and comprehension

22:39 cark: that change was specifically about performances

22:40 Sgeo: Oh

22:40 cark: dynamics are good, not to be abused, just like macros

22:41 Sgeo: I do think though, that even if the current solution is good, it could be generalizable to be usable for more than just monads, and the monad use case just a specialization of such

22:42 cark: if i had done it, defmacrofn would be passing a monad deftyped instance, with a protocol implementation for monad and for monad-plus

22:42 and m-zero

22:43 i want to do something with arrows, but i'm not quite sure how to start with it

22:44 would be done just like the monad library, but yes it's cumberome

22:44 cumbersome*

22:44 Sgeo: The Functor and Applicative parts also need to be factored out to be separate.

22:45 Not all functors are applicatives, not all applicatives are monads, etc.

22:45 cark: i've been banging my head on that

22:45 but it feels like you need a real type system

22:46 Sgeo: Well, algo.monad fakes some of it, those concepts could be reused

22:46 Separable parts separated

22:46 etc

22:46 cark: did you check maybe in algo.monad

22:46 i feel like it's half-asses

22:46 half-assed

22:47 what if i want to return Just nil ?

22:47 Sgeo: jimduey's Procol monads do a correct Maybe, I think

22:47 *protocol monads

22:47 cark: mhh i need to check that out

22:49 nope not good, also taking nil as Nothing

22:49 Sgeo: nil as nothing isn't the problem, the problem is what does it do for just

22:50 cark: right, that's my problem, how do you define : data List : Cons a List | Nil

22:51 is it even possible to have a deftype without fields ?

22:51 mhh

22:52 yes it is

22:54 Sgeo: I do think that in both monad libraries, maybe is shortchanged

22:54 It should really be in a library of its own

22:54 With various utility functions and macros

22:54 cark: every monad should be =)

22:55 Sgeo: I saw an explanation by jimduey saying that "monad transformers are functions".

22:55 It hurt my soul.

22:55 Although, in the Clojure monad libraries, I guess they are

22:56 cark: well there are haskell implementations that do not use typeclasses at all

22:57 anyways, going back to work !

23:13 * Sgeo fights with Eclipse a bit

23:13 Sgeo: Ok, I'm going to need an IDE that won't make me want to shoot myself

23:13 In the meantime, I can live with lein repl and Notepad++ I think

23:14 Wait, I'm not going to be able to reload changes in files if I use lein repl, can I?

23:14 clojurebot: the repl is holding onto the head of sequences when printing them.

23:14 Sgeo: o.O what clojurebot just said kind of sucks

23:20 cark: c-c c-k to compile yoru file

23:33 Sgeo: Is NetBeans+Enclojure lighter-weight than Eclipse+Iforgetwhatit'scalled?

23:34 mindbender1: (set! *me* {}) throws IllegalStateException where (def ^:private ^:dynamic *me* nil)

23:35 Sgeo: ,(do (def ^:dynamic *me* nil) (set! *me* {}))

23:35 clojurebot: #<Exception java.lang.Exception: SANBOX DENIED>

23:35 mindbender1: and cemerick does exactly that in piggieback

23:35 Sgeo: ,(do (def ^:dynamic *me* nil))

23:35 clojurebot: #<Exception java.lang.Exception: SANBOX DENIED>

23:35 Sgeo: &(do (def ^:dynamic *me* nil) (set! *me* {}))

23:35 lazybot: java.lang.SecurityException: You tripped the alarm! set! is bad!

23:37 Sgeo: I don't think algo.monads is even a Clojure project

23:37 erm, Leiningen project

23:42 mindbender1: ,(doc set!)

23:42 clojurebot: Pardon?

23:42 mindbender1: (doc set!)

23:42 clojurebot: It's greek to me.

23:42 mindbender1: &(doc set!)

23:42 lazybot: java.lang.SecurityException: You tripped the alarm! set! is bad!

23:49 Sgeo: Ok, so this library isn't Leiningen-y

23:49 How do I make it leiningen-y?

23:54 tomoj: consider r/map's rfn: https://gist.github.com/b1e769f9e03e3e132768

23:57 if we patch reducer/folder so that they return an IKVReduce, we can do this https://gist.github.com/469d9f88d866446faf05

23:58 but note that the reducef is only getting called with 2 args

23:58 (str in this case)

Logging service provided by n01se.net