#clojure logs

2012-09-14

02:02akhudekwhoa aot + repl is not fun
02:02akhudekat least with intellij
02:03akhudekseems the repl always uses the compiled code no mater if you request it load from source
02:03akhudekfor protocols
02:33UrthwhyteHey guys - would you recommend slimv or VimClojure more?
03:24kralnamaste
03:24kralI thought clojure was more attractive for emacs users
03:25kralSeems like there's a lot of clojurist out there that use vim...
03:30antares_kral: I'd say the majority does use emacs, but vimclojure is very good from what I hear
03:38kralantares_: I started with vim and moved to emacs long ago, but vim still intrigues me
03:39kralso good to know vimclojure is good :)
03:42hfaafbhttps://gist.github.com/37a902a2ee88c2f73d49 my first clojure program >_>
03:43ro_stcan i put atoms inside other atoms? in cljs, too?
04:01antares_ro_st: you can, not sure about cljs
04:02antares_hfaafb: #(keyword %) can be just keyword
04:02antares_hfaafb: also, looks like you can use reduce instead of explicit loop/recur, just an idea
04:03hfaafbthat's why i posted it! thank you
04:03amalloywell, numerals is better written as a lazy-seq, not as a reduce
04:04antares_hfaafb: and do on line 29 seems unnecessary, you only have one expression in that branch (let)
04:16mindbender1No 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
04:18mindbender1Though people mostly always choose to keep that bases hidden
06:07mindbender1(doc bases)
06:07clojurebot"([c]); Returns the immediate superclass and direct interfaces of c, if any"
06:10chaunceyhi! how do I determine what profiles I am in (:dev, :release) from clojure and clojurescript alike?
06:11chaunceyI used a distinct src-path with a profile-current.clj in it, but that doesn't work well with crossovers or cljs in general
06:11chaunceyand seems hacky :(
06:16hyPiRionIt seems rather hacky to try and find it out in the first place. Could you do what you try to achieve without doing it?
06:17chaunceyyes, disable logging etc.
06:18chaunceyall the stuff I use when developing
06:19chaunceyso, I could set a *loglevel* var somewhere, but...
06:19chaunceythere are some other things as well, and I don't want to forget and have it in my release version ^^
06:20chaunceyMight of course be that there is something fundamentally wrong with my workflow, in that case I am happy to hear alternatives :)
06:21ro_stin clojure, an env var would do
06:22ro_stin 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
06:23ro_stor find a way to leverage gclosure compiler's conditional compilation. not sure if cljs compiler exposes it.
06:25chaunceyI 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
06:25chaunceyunfortunately that seems to always take the one from the standard environment
06:25chaunceyi.e. de
06:25chaunceyv
06:26chaunceyIs it so unusual to have an application behave differently in development and release?
06:27chaunceyI could do it as a rpc, but that also doesn't feel right
06:30ro_stthis is a dependency injection issue
06:32hyPiRionchauncey: https://github.com/technomancy/leiningen/blob/master/sample.project.clj#L63
06:32hyPiRionLook at the :injections thing.
06:32ro_styeah, that'll solve clj.
06:34hyPiRion"lein help profiles"
06:39ro_stgrr why can't cljs find goog.crypt.Md5
06:39ro_stit's in the jar
06:48chaunceyum, okay... how about cljs?
06:49ro_stargh goog-jar you monstrosity
06:49chauncey:)
06:49ro_stchauncey: your cljs served via the web?
06:49ro_stor are you up to rhino/node.js shenanigans
06:50chaunceyno, noir + cljs app
06:50ro_stthen inject the env value into the call that starts your app
06:50ro_stmy.app.ns.run(<here>)
06:50ro_stand drive that value from clj using your env var
06:51chaunceyhm, that sounds like a good idea
06:51chaunceyI'll try it, thanks
06:53ro_sthth :-)
07:30zalentA-sa
07:30zalentA-cs mac +1 olunur
09:06mindbender1Maths=Symbolic Nonsense
09:06uvtcHow do I say, "if this regex matches, do $this with group 1 in the match"?
09:07enican you use clojure apps in a java app easliy? if yes, can i see an example?
09:08uvtcThat is to say, without repeating my call to re-find.
09:08elzibubuvtc: try re-seq
09:08elzibubeni: link clojure.jar and use Var from Java
09:10mindbender1eni: and other data structures
09:10eniwhat do you mean by other data structures, are there some code examples online?
09:17uvtcelzibub: Ok. Thanks. I ended up doing "(let [search-result ...] (if search-result (let [part (search-result 1) ..."
09:26chouseruvtc: you might consider if-let
09:27uvtcchouser: Ah, that would reduce indenting a bit. Thanks.
09:28uvtcActually, I've got 2 regexes. If the first one matches, pull out group 1. If that fails, try another. Was thinking to try `cond`...
09:28chousersure
09:29chouserpeople have written things that amount to let-cond, but none have caught on
09:31grayzoneHello everyone, I have a problem to import a protocol to another file CLJ: prompt returns ClassNotFound: can someone help me?
09:34mindbender1grayzone: it would make sense if you say what you did specifically
09:35grayzoneok : the command is : (import '[examples.midi MidiNote]) (from book 'Programming Clojure')
09:35grayzonebut the response is : ClassNotFoundException examples.midi.MidiNote java.net.URLClassLoader$1.run (URLClassLoader.java:202)
09:36uvtccemerick: re. travis email (clojure-clutch), that was weird.
09:38grayzonein example.midi has a (defprotocol MidiNote ..... )
09:39mindbender1grayzone: 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
09:40mindbender1read the book gently
09:41mindbender1grayzone: I have the book with me which page
09:41grayzonemember:mindbender1 : you reason but the import has written by author ....
09:41cemerickuvtc: what travis email?
09:42uvtccemerick: I just got one after you made that trivial change regarding the backtick in the readme. It said the build failed.
09:42grayzonemindbender1 : i attempt with (:require ....
09:43mindbender1grayzone: what's page are you on
09:43cemerickuvtc: so it did, but I didn't get an email :-/
09:44grayzonemindbender1 : i am at page 162 ... (2 edition) in sample generator.clj
09:44cemerickLooks like travis doesn't have a couchdb server running in the test environments anymore…
09:45uvtccemerick: thanks for looking into it!
09:46cemerickSeems it needs to be requested in the .travis.yml file now
09:48wumpwompanyone have experience with lacij? the create-graph function seems to be missing from graph.core...
09:49mindbender1grayzone: I think I have the 1st edition.
09:50mindbender1Anyway try with (require '[]) or (use '[]) i.e if you started in the repl correctly
09:51mindbender1you could also use (load-file ..). Use (doc fn) to check up the doc of the above fn
09:51cemerickuvtc: fixed up, thanks for letting me know. Bizarre that I didn't get an email on the failure.
09:52uvtccemerick: {insert emoticon for "high-five"} :)
09:52uvtco/
09:52cemerick\o
09:52grayzonemindbender1: thanks anyway for your interest : i attempt your suggestion (plse my bad english!)
09:52cemerickIt's all love and plushy pink elephants here in #clojure. :-D
09:53uvtcIt's so fluffy I'm gonna die!
09:55clgvgrayzone: you probably do not have the examples directory on the classpath of your repl
09:56grayzoneclgv: is possible .... i check ... thanks
10:06grayzonemindbender1-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:07abaloneclojure misspelled as cloujure in a recent article on scala
10:07abaloneyay
10:31TimMccluejure
10:31TimMckludger
10:57mwcampbellI'm brand new to Clojure, and not very experienced with any Lisp. Which book should I use to start learning Clojure?
10:58ddimaI've not finished it myself yet, but I like The Joy of Clojure
10:58scriptorjoy of clojure isn't aimed at beginners
10:58uvtc~clojurebook
10:58clojurebotClojureBooks is http://clojure.org/books
10:58ddimait depends on how he likes to learn ;)
10:58casionwhat languages do you know now?
10:58scriptormwcampbell: I've heard good things about http://www.clojurebook.com/
10:58clgvis there something like that [a b & rest] for map destructuring {a :a, b :b, :rest r} ?
10:58ddimawith much pain or only just a little
10:58uvtcOooh. Didn't know about that page. :)
10:59jondot`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:00mwcampbellcasion: 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:00casionmwcampbell: http://www.clojurebook.com then
11:00clgvjondot`: some had the idea to use akka ad where fit write convenience functions/macro for it
11:01casionmwcampbell: it's nearly a clojure book for python or ruby programmers
11:02uvtcmwcampbell: 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:02casionmwcampbell: 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:04casionhttp://www.clojureatlas.com is also super cool (by one of the authors of the book suggested no less)
11:04elzibubclgv: Try [& {:keys [a b]}]
11:04cemerickcasion: thanks :-)
11:05clgvelzibub: erm no. I want to select the keys and get the remaining keys ;)
11:05elzibubCoincidentally in 1st chapter of "Programming Clojure" I read at lunch - which is an excellent book and a far better tutorial than Joy
11:05cemerickand to all for your recommendations :-D
11:05meliponehello! 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:06elzibubclgv: This doesn't work then? [{:keys [a b]} & rest]
11:06casionelzibub: I personally far prefer 'programming clojure', but everyone I know who is into python/ruby seems to like 'clojure programming' better
11:06casionthey're both great books though, I think it just depends on where you're coming from
11:06elzibubcasion: Whooops... I meant Clojure Programming! But then I haven't read Programming Clojure
11:07casionand joy of clojure is amazing once you've got the basics down, I just started reading it and I absolutely love it
11:07clgvelzibub: 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:07elzibubcasion: I'm sure it's a great book once you're a year in
11:08pepijndevoswhat the hell does this function do? (Integer/bitCount (bitwise-and bitmap (- bit 1)))
11:09jondot`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:09elzibubclgv: To the REPL!
11:10clgvjondot`: there is an rpc lib called slacker but I am not sure if I wanted to use that to build anything
11:10casionpepijndevos: it should be explained in here http://lampwww.epfl.ch/papers/idealhashtrees.pdf
11:10casionit's on page 4 I think, I don't remember exactly
11:10jondot`also looked at this one: https://github.com/antoniogarrote/jobim
11:11casionand I think http://blog.higher-order.net/2009/09/08/understanding-clojures-persistenthashmap-deftwice/ explains it as well
11:12pepijndevoscasion: okay, will look at it
11:17casionpepijndevos: 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:17elzibubclgv: Can't see a way from CP book. Closest I can offer is to use {:keys a b :as all} then dissoc
11:18pepijndevoscasion: oh, i read past it, I was on page 5 already
11:18casionpepijndevos: I would try to explain it myself, but I'm terrible with terminology and I just end up confusing people
11:18meliponeha! I found my error: I had an object stored in the map and not a string! euou euou!!
11:20pepijndevoscasion: The paper does not explain the bit twiddling as far as I can see.
11:21pepijndevosjust that there is a bitmap of 32 bits
11:23casionpepijndevos: ok, let me see if I can explain this and not create chaos
11:23pepijndevoscasion: 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:23casionpepijndevos: yes
11:23pepijndevoscasion: then I but that number in the function I just posted
11:24casionand that gives you the index
11:25pepijndevoscasion: how does that happen?
11:26casionso 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:27casionit's because each index size isn't a fixed width
11:27casionso you have to mask it against the bit count to have an accurate mask
11:27pepijndevosaaaah, what? I thought ever index had 32
11:28casionsee, I'm shit with explaining things :|
11:28pepijndevoscasion: no, it's starting to make sense. so you're mapping from 0-31 to the number of items you really have.
11:29casionpepijndevos: there you go
11:29pepijndevoscasion: I still don't understand why the bitcount of the the thing adned minus one returns that.
11:30pepijndevosso the bitcount of the the bitmap is the length of the actual array
11:30mwcampbellHas any of the Clojure implementations been used to develop a native iOS application?
11:31scriptorpepijndevos: have you read the blog posts about clojure's vector and hashmap implementations?
11:31nDuffmwcampbell: I think there's intent for ClojureC to eventually be suitable for that.
11:31casionyeah, there's http://blog.higher-order.net/2009/09/08/understanding-clojures-persistenthashmap-deftwice/ which explains it as well
11:31casionI think I linked that
11:32pepijndevoscasion: that is the old version I think, there is a part two
11:33pepijndevosoh, i need to read this better
11:33scriptorpepijndevos: it does explain that line though
11:33scriptorwith the bitcount
11:34pepijndevoscool
11:34mwcampbellnDuff: Ah, I didn't know ClojureC existed.
11:36casionthere's a clojure targeted at objc as well
11:36pepijndevoswant!
11:37casionhttps://github.com/jspahrsummers/objective-clojure
11:37casionand https://github.com/joshaber/clojurem
11:39mwcampbellI 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:39casionmwcampbell: that's assuming effort on each 'port' is exclusive
11:40casiondifferent people with different interests working on different things
11:41mwcampbellcasion: There's always the danger of spreading the effort of a small community too thin though, right?
11:41mwcampbellOnce I learn Clojure, I might start contributing to the Lua port
11:41casionmwcampbell: I don't see why, people are free to do as they wish
11:42casionhow would you manage to concentrate effort? email the clojureC guys and tell them to go work on clojurescript-lua instead?
11:42casionI somehow have lost a cup of tea on my desk…maybe i should clean a bit today :|
11:42mwcampbellcasion: Touche; I'd probably be better off just working on clojurescript-lua myself if I'm interested in it
11:43casionmwcampbell: also, I'm far more interested in clojureC myself ;)
11:43mwcampbellcasion: Why? Just curious
11:43nDuffmwcampbell: A lot of the "ports" are using common work originally done for cljs
11:44nDuffmwcampbell: ...so there's definitely common/combined effort.
11:44casionmwcampbell: I do embedded, and clojureC could be of use to me in that area
11:45mwcampbellcasion: It depends on GLib though, right? That's a pretty hefty dependency, and an LGPL'd one at that
11:45casionmwcampbell: a boy can dream :)
11:46mwcampbellcasion: Have you looked at LuaJIT? ~415k on x64, with impressive performance
11:46casionalso glib works fine on arm, which I use often
11:46mwcampbellcasion: and LuaJIT has ports to ARM and now MIPS
11:47casionmwcampbell: I did mess with lua, but I just never managed to find anything about it attractive
11:47pepijndevoscasion: makes no sense… http://pastebin.com/4Hp40NNV
11:49mwcampbellcasion: 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:50mwcampbellcasion: So I will be looking more closely at clojurescript-lua
11:51casionpepijndevos: that looks right to me
11:51casionexcept the last few...
11:51casionhmmm
11:52pepijndevoscasion: so there are 4 elements, so the indext fro the first is 4, and then for both 1 and 2 it's 0
11:58clgvpepijndevos: you can have that easier by the way ##2r10101010
11:58pepijndevoscasion: 4 is out of bounds, right? and I kind of expected 5+ to have different results
11:58clgv,2r10101010
11:58clojurebot170
11:58pepijndevosoh :)
11:58casion5 is out of bounds I thought
11:59pepijndevoscasion: I have 4 1 bits, so 4 elements, right, so that's 0,1,2,3
11:59casionoh, yes
12:01pepijndevosdoes not look right to me at all :(
12:01pepijndevosmaybe some casting promoting signed blah is interfering?
12:01casionnow you have me confused too
12:06casion,(Integer/bitCount (bit-and 2r00000000000000010000000010000101) (- 7 1))
12:06clojurebot#<CompilerException java.lang.IllegalArgumentException: No matching method: bitCount, compiling:(NO_SOURCE_PATH:0)>
12:06casionpfft
12:06casionit gives 1… it should return 2
12:06casion:\
12:09casionpepijndevos: where is this code, I want to look… I thought I understood this but it's making zero sense now
12:09pepijndevoscasion: 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:11casionwait
12:11casionduh :|
12:11casionok
12:11pepijndevoswhat?
12:11clojurebotwhat is bla
12:11casionhere, let me do a few and pastebin it for you
12:11pepijndevosok
12:12casionbitpos isn't an int, it's a position in the int 2r10 is 2, 2r1000000 is 7
12:12pepijndevoswait, really?
12:13pepijndevosoh...
12:13casionhttp://pastebin.com/aAzeYFTb
12:13casionsee?
12:13pepijndevosstupid infix notation
12:14casionbit is the position of the bit from the right in binary, not an integer representation
12:14nDuffcasion: ...in the future, would you mind using refheap or gist.github.com? pastebin.com is full of ads for anyone not running adblock.
12:14casionnDuff: sure, I wasn't aware
12:14pepijndevosI read bitpos as shifting mask right one, because it has keys and values interleaved
12:14pepijndevosbut it shifts one by mask :P
12:16pepijndevosnow the -1 also makes more sense
12:16casionok, good luck :) lunch meeting
12:17pepijndevoscasion: diner for me, thanks a lot
12:22uvtcCan I compose regexes of other regexes (regexen? regexi?) ?
12:23uvtcre-pattern only takes one arg...
12:23technomancyuvtc: elisp has a symbolic regex representation that lets you compose things before they're compiled to actual regexes; kind of a cool idea
12:26uvtctechnomancy: Any way to do it in Clojure? I've got the same regex repeated within a number of other regexen...
12:27technomancyit can probably be done with string mashing; haven't thought it through
12:27xeqikeeping strings around and using re-pattern?
12:27uvtcOh, maybe (re-pattern (str s1 s2 ...)).
12:27uvtcRight.
12:27uvtctechnomancy, xeqi: Thanks.
12:28uvtcBut then I'd have to add extra backslashes into those strings.
12:46borkdude"but Ruby and Python code bases will go to Go" http://gigaom.com/cloud/will-go-be-the-new-go-to-programming-language/
12:46borkdudewhat's so special about it, anyone got experience with Go?
12:47technomancyI've looked at it briefly. the main thing about it is it's not C, and it has momentum.
12:47emezeskeGo 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:47technomancyFSVO "pretty unobtrusive"
12:47technomancyit's still utter crap compared to hindley-milner
12:48nDuffI'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:48emezesketechnomancy: True enough.
12:49technomancybut 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:49emezesketechnomancy: Less obtrusive than C I guess is the point
12:49technomancyocaml and go both target places the JVM is crap at
12:49technomancyemezeske: "better than getting kicked in the shins! check it out!"
12:50mindbender1Ocaml..that language is a beast
12:50emezesketechnomancy: I don't like being kicked in the shins!
12:50dnolenborkdude: maybe Go users - I
12:50technomancymostly it's the advocacy that bothers me; people come this close to implying that Go invented type inference.
12:50dnolenborkdude: er I mean maybe Python users. Less Ruby people I think. Go doesn't even have REPL
12:50pandeiroi started learning ocaml recently b/c i needed it installed for llpp and i wanted to like it, i really did
12:50pandeirobut i did not get very far
12:51dnolenGo & Dart - it's 2012 let's pretend McCarthy didn't exist
12:51pandeirodnolen: u read my mind, i was wondering about a Go repl
12:51pandeiroi saw on HN recently someone created a kind of C repl using some debugging tool...
12:51mindbender1Novelty
12:51emezesketechnomancy: Whoa, who does that? Silliness
12:52technomancyemezeske: well maybe it's unfair to extrapolate to Go users in general from hacker news
12:55emezesketechnomancy: 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:56technomancyemezeske: yeah, as much as it bugs me I think the momentum it has outweighs the fact that ocaml is just plain better-designed.
12:57technomancyif it means that fewer C programs get written, that's a net win
13:00dnolenhttp://shootout.alioth.debian.org/u64/benchmark.php?test=all&amp;lang=java&amp;lang2=go, go
13:01dnolen's advantage over Java seems primarily in the area of memory usage
13:01mindbender1technomancy: have you gone through the handbook of automated reasoning and practical logic
13:01dnolendoesn't say much about memory behavior for non-trivial programs tho ...
13:01borkdudeso how is that clojure 2 c compiler? could I advice anyone to program clojure for native code instead of Go?
13:02borkdudewasn't there something with clojure -> scheme -> c -> native or smth?
13:02borkdudehaven't followed it closely
13:02technomancymindbender1: haven't heard of it
13:02mindbender1It's based on Ocaml
13:03mindbender1Very advanced
13:04mindbender1For those moments when one is bored
13:04UrthwhyteMorning everyone - trying to get a SLIME like environment set up before a flight
13:04UrthwhyteIs VimClojure or Slimv better supported/recommended?
13:07borkdudeI guess Go for native is the best option then
13:07UrthwhytenDuff: I would do that if last time I tried emacs I didn't end up with lots of hand pain
13:07borkdudeso Go is a very fast native language like C but has Pythonesque features in it, it sounds nice to me
13:07Urthwhyteand it would give my roommate too much satisfaction to see me switch ;)
13:07emezeskeUrthwhyte: My understanding is that VimClojure is more clojure-specific; slimv is for CL but has special case support for clojure
13:08emezeskeUrthwhyte: VimClojure is reasonably easy to set up if you use lein-tarsier
13:08hoover_dammI guess that's what I get for being a multi-editor user who just uses what works best
13:08UrthwhyteIf you had years of muscle memory in an editor it makes it very hard to switch
13:08scriptorhoover_damm: in this case, it's good to know what's better supported and just in general considered better practice
13:08hoover_dammsure I get hand cramps with vim when I accidentally hit ^S
13:08emezeskehoover_damm: Lock-in can happen when you have muscle memory for >100 key bindings
13:08hoover_dammor other keys
13:09dnolenborkdude: there's a ClojureC project
13:09borkdudeok… I am mentally ready now to install nrepl.el
13:09hoover_dammemezeske, I started using ed over 20 years ago and then moved to vi
13:09hoover_dammemezeske, I truly look at the whole editor groan and get confused
13:09technomancyfeels like navigating with mittens on
13:10hoover_dammemezeske, I am able to use nano, vi, emacs, ed without grumping or caring
13:10HodappI 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:10hoover_dammemezeske, obviously nano with clojure would be pure pain
13:10technomancyhoover_damm: maybe starting with ed has imbued with super editor powers =)
13:10hoover_damm(at least it feels pretty painful to me)
13:10emezeskehoover_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:11emezeskehoover_damm: Either way, you can't just tell people to stop groaning
13:11hoover_dammtechnomancy, I would like to think people are overcaring more and just need to relax and try it
13:11dnolenon the Clojure native front this looks really interesting http://www.ravenbrook.com/project/mps/
13:11UrthwhyteI just want a repl with working tab-complete and navigating back and forth between older and newer commands
13:11dnolenGC used in Harlequin Dylan and MLWorks I believe
13:11emezeskehoover_damm: Either they have to spend time developing muscle memory, or they have to drop the idea of having advanced features
13:11HodappUrthwhyte: and have you found one?
13:11hoover_dammbecause you learn you grow
13:11dnolensounds like Open Dylan is using it as well
13:11no7hingon agents: anybody had problems with the error handler, as in the passed agent wasn't in error state?
13:11mindbender1With emacs..all your computer comes to party
13:11UrthwhyteHodapp: Having some trouble getting slivm working due to what looks like classpath issues
13:11hoover_dammemezeske, everytime I hear advanced features and not the word emacs... I laugh
13:12HodappAnyone know a REPL that is as Urthwhyte describes?
13:12technomancyhoover_damm: it's not about editors so much as losing access to an embedded lisp in everything I do.
13:12Urthwhytebut 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:12emezeskehoover_damm: So you're some kind of editor elitist? I don't understand your position at all.
13:12hoover_dammtechnomancy, loosing access to embedded lisp is :(
13:12Hodapptechnomancy: you use Emacs then?
13:13UrthwhyteI'd be comfortable enough with something that was irb/ipython for clj, doesn't even need to integrate with my editor
13:13mindbender1emezeske: has he taken a position?
13:13UrthwhyteI can do that comfortably enough with some inotify magic
13:13technomancyHodapp: yes, and I pretend that Conkeror is implemented in a lisp as well even though it's not =(
13:13cemerickHodapp: either Counterclockwise or Emacs are safe bets.
13:13hoover_dammemezeske, if i'm an editor elitest it's because I can use almost any editor with advanced features
13:13technomancyHodapp: it still has M-: where you can quickly eval code snippets though
13:13technomancyand dotfile support
13:13hoover_dammemezeske, and try and learn new editors and :) keep learning
13:13HodappI'm currently a vim user but I suppose I could attempt to learn Emacs...
13:14Cheironwhen documenting defs, is is better to include ^{:doc "..."} or to use comments above the declaration?
13:14hoover_dammlearning is the wholt point
13:14mindbender1that looks like me when I was looking for a house to rent
13:14hoover_dammrejecting part of what you accept is normal
13:14hoover_dammand learning something new
13:14cemerickhoover_damm: use a docstring
13:14technomancyCheiron: you can put in a proper docstring without ^:doc syntax
13:14hoover_dammwhole*
13:14technomancyhoover_damm: but programs that don't have a repl are objectively worse
13:14Hodapphoover_damm: Sometimes you want to debug your program, not debug your environment.
13:14cemerickhoover_damm: sorry, meant that for Cheiron :-)
13:14emezeskehoover_damm: Sometimes, you have to stop "learning and growing," and actually get shit done
13:15mindbender1right
13:15HodappUsing Clojure is basically by definition not learning something different, say, ASM.
13:15Cheirondocstring without ^{:doc} ? how?
13:16aniero(defn foo "docstring" [& args] ... ) ?
13:17Cheironi'm talking about def not defn
13:17Cheironlike (def url ".....")
13:20no7hingis it expected that the failed agent in the gist is *not* in failed state? https://gist.github.com/3723317
13:21no7hingrestart-agent blocks
13:21mindbender1By the way, our chosen programming language OCaml is derived from Edinburgh
13:21mindbender1ML, which was expressly designed for writing theorem proving programs
13:21mindbender1(Gordon, Milner and Wadsworth 1979) and whose name stands for Meta
13:21mindbender1Language
13:22UrthwhyteAnyone know where clojure.jar would be if I installed it from the ubuntu repos?
13:22carkin emacs+nrepl, how does one kill the java process ?
13:22carkcleanly
13:23technomancycark: there's an open ticket for that
13:23jjidoUrthwhyte no, but did you check JAVA_HOME?
13:23technomancyfor now kill the *nrepl-server* buffer
13:23carktechnomancy: oh ok thanks
13:23technomancyUrthwhyte: in general... don't?
13:23technomancyUrthwhyte: apt-get is for installing applications, it's not useful for installing libraries alone.
13:23Hodappalright, technomancy, I'm installing Emacs here. If I look like Richard Stallman in a month, I'm blaming you.
13:24technomancyHodapp: I disclaim all responsibility
13:24Hodapptechnomancy: I already have a lawyer on retainer
13:24technomancyI can't actually remember the last time I suggested someone try Emacs in this channel.
13:24technomancypretty sure it's been over a year.
13:25Hodapptechnomancy: what editor do you recommend?
13:25technomancyHodapp: most of the time I have to tell people to not try to learn Emacs and Clojure at the same time
13:25technomancyit's too much to take in at once
13:26technomancywhen you're learning Clojure, use what you already know. once you've got Clojure down then maybe consider switching things up.
13:27borkdudewasn't clojure written to get more people to use emacs? then was was the point, I forgot… ;)
13:27Cheironwhile the question isn't targeting me, but I prefer Sublime Text 2 for Clojure dev
13:28no7hingbork: i thought that was erlang
13:29anieroi'm using vim :P
13:29borkdudeyay, nrepl.el works
13:30nDuff...Emacs for Clojure, IDEA for Java.
13:30anierolein-tarsier + vimclojure is pretty decent
13:31UrthwhyteI've heard bad things about the vimclojure repl though?
13:32Urthwhytein terms of feature-completeness?
13:33mefestoHello everyone :)
13:35mefestoI'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:35antares_mefesto: absolutely
13:35antares_clojurewerkz.support.js lets you load them from classpath without hassle
13:35antares_sorry that it does not have any docs
13:35mefestoantares_: great thanks for the tip! :)
13:35antares_(I am the author of Welle, by the way)
13:36mefestoantares_: 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:37antares_https://github.com/clojurewerkz/support/blob/master/src/clojure/clojurewerkz/support/js.clj#L29 is the function you need
13:37antares_yes, the map/reduce part is worth writing a book on
13:37antares_also, I think that Riak's own docs can cover it much better, there is little client-specific about M/R
13:38mefestoyeah i was watching some of their vimeo vids
13:40borkdudenice 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:42uvtcborkdude: 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:43borkdudeyes
13:46antares_mefesto: I have to step away, let me know how it goes with Welle
13:46antares_mefesto: also, do complain about the docs, it is my favorite feature
13:46mefestowill do
13:46borkdudegtg
14:06mefistoemacs is the free software borg
14:06mefistoif you start using it, you will be assimilated
14:06pistolpeteI am using emacs==>erc right now. I am assimilated.
14:09pistolpetequestion: 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:09technomancypistolpete: you don't need much for a static site generator
14:10technomancythe seajure web site has one; it's pretty simple to build from scratch
14:10antares_pistolpete: haven't used any of those but why are you not happy with jekyll?
14:11pistolpeteantares_: I'd like to put a bit of logic into some of the includes to prevent myself from repeating code.
14:12pistolpetetechnomancy: 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:12pistolpeteI'm still quite new at Clojure
14:13Apage43heh, 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:13Apage43*variant
14:14pistolpeteantares_: and my secret reason is that I love using hiccup/writing html in sexpr form.
14:14antares_pistolpete: I see :) then use whichever uses hiccup
14:14Apage43my 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:14technomancyseajure uses enlive but swapping out that should be trivial
14:14pistolpeteantares_: problem -- both use hiccup ;-)
14:15pistolpeteohh cool
14:17pistolpetetechnomancy: should I be looking at enlive in the long run anyway, or are they equivalent in power/concise-ness?
14:17antares_pistolpete: I think enlive is a bit different in scope but yes, more or less
14:17technomancypistolpete: 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:18pistolpeteantares_ & technomancy: thanks!
14:18technomancyyeah, also it sucks not being able to use paredit on your templates =)
14:19pistolpeteApage43: same here
14:19technomancyalso, hiccup: http://screencrave.com/wp-content/uploads/2010/03/How-To-Train-Your-Dragon-Hiccup-and-Astrid-25-3-10-kc.jpg
14:21pistolpetehaha
14:22mefestoi created an nrepl server using nrepl-jack-in from emacs. is there a way to kill the server from emacs?
14:26pistolpetetechnomancy: sorry, what could the seajure static-site-generator be called? I'm not seeing it in the projects list there.
14:26technomancyit's just here: https://github.com/Seajure/seajure
14:26pistolpeted'oh, thanks!
14:27technomancymefesto: right now you have to just kill *nrepl-server*; there's an open ticket for making that not suck
14:31zmarilIf 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_ulisesevening 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_uliseshere are the tests for the code https://www.refheap.com/paste/5074/fullscreen
14:32dnolenzmaril: what do you mean by name of the "variable"? Do you mean the symbol?
14:32zmarilYes
14:33dnolenzmaril: the string representation of the symbol? name
14:33zmarilI would like to get the name of the symbol and use that
14:35cch1,(+ 1 2 3)
14:35clojurebot6
14:36cch1OK, weird problem with macros + closures....
14:36cch1,(defmacro m [x] (let [f (fn [] (println x))] `(~f)))
14:36clojurebot#<Exception java.lang.Exception: SANBOX DENIED>
14:36cch1(defmacro m [x] (let [f (fn [] (println x))] `(~f)))
14:37cch1That macro can't be run. It's just a simple closure over the arg passed to the macro, run from the expanded code.
14:37cch1Can anybody explain why it fails?
14:38dnolencch1: that's not really how macros are supposed to work.
14:39dnolenperhaps you want (defmacro m [x] (let [f `(fn [] (println ~x))] `(~f)))
14:39cch1dnolen: yep -that's what I ended up with.
14:40DaoWenclojuredocs 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:41zmarildnolen: Great! It works now
14:41zmaril(defmacro shame-println [v] `(println ~(name v) ~v)) (def testing {:a 1}) (shame-println testing)
14:41S11001001DaoWen: core.incubator
14:41zmaril;; testing {:a 1}
14:41dnolenzmaril: cool
14:41clojurebotExcuse me?
14:41S11001001DaoWen: where did clojure contrib go lists that as the new location of c.c.core
14:41S11001001~contrib
14:41clojurebotMonolithic 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:41zmarilThanks!
14:42S11001001~flatten
14:42clojurebotflatten 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:42DaoWenS11001001: thanks!
14:43mmitchell~reductions
14:43clojurebotexcusez-moi
14:44S11001001mmitchell: no reductions is cool so no clojurebot complaints about it
14:44S11001001clojurebot only complains, no praise
14:45mmitchellhilarious
14:45mefistolike an alcoholic father :(
14:50abaranoskyhey 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:51mefestoabaranosky: i think there is an option you can pass that will disable that behavior
14:51mefesto:throw-exceptions false
14:52drewrmefesto is correct
14:52mefestoabaranosky: (client/get url {:throw-exceptions false})
14:52abaranoskythanks @mefesto, appreciated
14:54brainproxycan I get cond-let for clojure 1.4? hunting around in the libs section of clojure.org...
15:05antares_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:07Sgeo_Are there Clojure libraries for exact real numbers?
15:08gfredericksSgeo_: curious what you mean exactly by that
15:08gfredericksalgebraics?
15:09brainproxyantares_: 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:10Sgeo_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:10Sgeo_And those digits will be correct (modulo rounding or truncation at the end)
15:10Sgeo_Example representation: A lazy list of decimal digits
15:10gfredericksfascinating
15:11Sgeo_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:12antares_brainproxy: yes, it very likely will work, just no library to conveniently get it
15:13scriptorSgeo_: so as a very simple example, you could represent the digits of pi as an infinite list of pi's digits?
15:14Sgeo_scriptor, yes
15:14Sgeo_http://www.haskell.org/haskellwiki/Exact_real_arithmetic
15:15scriptorhmm, the first thing I thought of was trying to use infinite series
15:18Sgeo_Well, a list of digits is a series
15:18Sgeo_Although specifying "series" rather than "digits" is probably easier, come to think of it
15:19Sgeo_I think though that various existing Haskell libraries are more likely to have clues to efficient implementations
15:32mefestoantares_: map and reduce functions take an arg parameter. how do i specify that value with welle?
15:39antares_mefesto: https://github.com/michaelklishin/welle/blob/master/test/clojurewerkz/welle/test/mr_test.clj#L98
16:10gfredericksSgeo_: I'm trying to prove to myself that what you're describing is impossible
16:10gfrederickse.g., what is the first digit of (+ (repeat 3) (repeat 6))?
16:11gfredericks(assume those represent 0.333... and 0.666...)
16:12Sgeo_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:12gfrederickswell
16:12gfredericksassume (repeat 3 3) and (repeat 3 6) represent 0.333 and 0.666
16:13gfredericksyou ask for the first digit and it should give 9
16:13gfredericksbut 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:13gfredericksbut if the list is infinite, it can't return
16:13Sgeo_Ah.
16:14Sgeo_Maybe that representation isn't good, then
16:14gfredericksI think binary has the same issue
16:14Kowboyhello!
16:14gfredericksSgeo_: I know there are reasonable ways to do math with algebraics, but it's a lot more complicated than rationals
16:16mattmoss,(+ 1/3 2/3)
16:16clojurebot1N
16:16hyPiRion,(apply + (map float [1/10 9/10]))
16:16clojurebot0.9999999776482582
16:16hyPiRion,(apply + (map double [1/10 9/10]))
16:16clojurebot1.0
16:16mattmosswoo!
16:16hiredmangfredericks: 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:17gfrederickshiredman: so if I ask for a precision of 50 digits, I still can't be sure that the first digit is accurate
16:18hiredmanso the value of (+ (repeat 3) (repeat 6)) is effectively a function that calculates it with a given precision
16:18mefestoantares_: ah thanks again
16:18gfredericksbut I suppose I can be sure that the result is nonetheless quite close
16:18SgeoEep, computer went weird
16:18gfrederickshiredman: so as long as we don't insist on the correctness of particular digits, which Sgeo wanted
16:18SgeoWhat happened after <Sgeo_> Maybe that representation isn't good, then
16:18mattmossThe perils of doing math with merely potential numbers.
16:19mattmossOr the reverse. One of those.
16:23SgeoAnother 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:23SgeoThe two values get closer later in the seq
16:24Sgeo(Although such a representation also means it's possible to construct nonsense numbers)
16:31holohi
16:40dnolenholo: hello
16:52uvtcI 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:52technomancyuvtc: lack of wrap there always bugged me
16:52Raynesuvtc: Not bad at all.
16:52Raynesuvtc: I like it. :D
16:52technomancyuvtc: feature request: use the same nick coloring algorithm as erc-hl-nicks =D
16:53Raynesuvtc: Feature request: add anchors to messages so I can link to specific ones.
16:53uvtcYou can do that.
16:54RaynesOh
16:54Raynestimestamps
16:54RaynesGotcha
16:54technomancyit's a pretty good algorithm
16:54RaynesCool. Wanna have my babies?
16:54technomancyit normalizes for trailing ` and _ chars
16:54uvtcI just removed the underlines since I thought it made it look cluttered.
16:54uvtcRaynes: hehehe
16:55uvtctechnomancy: my current algorithm is: find all users, then: (zipmap users (cycle colors)))
16:55amalloyuvtc: pretty nice. some of the colors are uncomfortably bright/pale on the white background for me
16:55aperiodicuvtc: right-align the nicks, and maybe leave the text uncolored?
16:55technomancyyeah, agreed that the actual text should be monochrome
16:55technomancyleathekd did the erc module; it's pretty great
16:55uvtcReally? Hm. Interesting. Thought the colors made it easier to scan through and see who wrote what.
16:56uvtcAny feedback on the code itself?
16:56technomancythere are already lines for that
16:56TimMcuvtc: Timestamps should underline on hover.
16:56technomancy...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:56uvtcTimMc: Ah. Right. Thanks.
16:56technomancyalso ponies
16:56technomancypreferably several
16:56uvtcPonies. Hm. Tricky. Unicorns ok?
16:57technomancyonly if they're pegasus-unicorn hybrids.
16:57uvtcamalloy: Yes, it's difficult to come up with a large list of colors that look sufficiently different from eachother.
16:57uvtctechnomancy: I will have to talk to our breeding unit and see what they can do.
16:57TimMcGravatars.
16:58nsxtany way to dynamically generate a namespaced keyword besides prepending a colon?
16:58uvtcTimMc: Hm! Gravatars. Interesting.
16:58TimMcOr 5 colored rectangles next to each nick. More visual data.
16:58TimMcnsxt: ##(keyword "foo/bar")
16:58lazybot⇒ :foo/bar
16:59amalloyuvtc: 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:59technomancy,(-> keyword var meta :arglists)
16:59TimMcmd5 of username
16:59clojurebot([name] [ns name])
16:59technomancynsxt: ^
16:59TimMcoooh
17:00uvtcamalloy: 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:00aperiodicit would be cool if evaluation requests to the bots were in a monospaced font
17:00technomancyamalloy: it would shift every day then
17:00technomancyaperiodic: aw yezz
17:00uvtcaperiodic: Oooh. That would be cool.
17:01uvtcamalloy: will look into memoizing.
17:01uvtcThanks for the feedback, all.
17:01clojurebotWe live to serve.
17:01technomancydon't make it random
17:01nsxttechnomancy: i don't follow :(
17:01technomancyit needs to be consistent across regenerations
17:01amalloytechnomancy: wat. it will shift exactly as often as his current random-zipmap
17:01amalloyusing 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:02technomancy=(
17:02amalloyi already have different colors at home and at work due to 64/32-bit differences or something like that
17:02technomancywell 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:04aperiodici get irritated even when someone's nick gets truncated/underscored and they start showing up as a different color
17:04technomancyaperiodic: yeah leathekd fixed my client so it normalizes across that. <3
17:04uvtcVariety is the spice of life... :)
17:05aperiodictechnomancy: ooh! man, i should really use a client that doesn't require knowing perl to hack on
17:05technomancyit's only 40 lines or so, I should port it
17:05aperiodici would love you forever
17:06technomancyport it to clojure I mean
17:06technomancynot touching perl
17:06technomancynot even for you =)
17:06aperiodicdrat!
17:06technomancyhttps://github.com/leathekd/erc-hl-nicks/blob/master/erc-hl-nicks.el#L125
17:06scriptorso…who's writing the clojure->perl compiler?
17:07technomancyit's only 4 functions
17:07uvtcAnother way to do it is to just have set colors for folks who ask.
17:07technomancyheh; assign it by pull requests
17:08technomancyIssue #23: clojurebot should totally be pink
17:08uvtcWill work on that tonight.
17:08hiredmanthat is the obvious color
17:08uvtcHow about lazybot?
17:08uvtclazybot: favorite color?
17:09uvtcclojurebot: what's lazybot's favorite color?
17:09clojurebotGabh mo leithsc?al?
17:09technomancyclojurebot: mind your encodings
17:09clojurebotTitim gan ?ir? ort.
17:09technomancyyou're hopeless
17:10amalloy&(Integer/toHexString (rand-int (apply * (repeat 24 2))))
17:10lazybot⇒ "6b55a4"
17:10amalloynot bad, i guess
17:10TimMc,(str "#" (.substring (Long/toString 36rlazybot 16) 0 6))
17:10clojurebot"#acc502"
17:10technomancynice
17:11TimMcI'm sure that could be condensed witha format string.
17:11amalloyit's just 4 characters with cl-pprint, probably
17:16TimMc,(format "#%06x" (mod 36rlazybot 16rFFFFFF))
17:16clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.NoClassDefFoundError: Could not initialize class clojure.lang.RT>
17:16TimMcokay...
17:16TimMc&(format "#%06x" (mod 36rlazybot 16rFFFFFF))
17:16lazybot⇒ "#503579"
17:16TimMcApparently format doesn't have a truncation option for ints.
17:18Mandarhey there
17:19hyPiRionHumm
17:20amalloyTimMc: you don't want to use mod there
17:21amalloydo you? maybe you do. i didn't think the math through
17:21amalloyright, i'm dumb. mod is fine
17:23Mandarhow can i search the docs for what the ` symbol does?
17:24Mandari've tried running (find-doc "`")
17:24nDuffMandar: it's called syntax-quote
17:24nDuffMandar: ...if that helps you search.
17:24TimMcMandar: clojure.org/reader
17:24Mandar(find-doc "syntax-quote") doesn't return anything either
17:24TimMcThat page covers the reader syntax.
17:24Mandarthanks TimMc
17:26amalloyit's also not a symbol
17:27Mandarhow is it called amalloy?
17:27amalloyi dunno. i guess it's a reader macro? thinking of it as a prefix character is probably best
17:28Mandar(type `) doesn't run either
17:31scriptorMandar: clojure syntax quotes something before it's evaluated, there's no way to refer to ` on its own
17:33Mandarhttp://pastie.org/4722271
17:33nDuffMandar: ...yes, meant that for purposes of searching the web. The reader isn't self-documenting.
17:33Mandarwhy is the second form better than the first one?
17:33nDuff...uhh.
17:33nDuffHuh?
17:33nDuffWhy would it be better?
17:33Mandari don't know, that's what the koan's comment says
17:34nDuffWhich koan?
17:34nDuff...I mean, syntax-quote makes much more sense when you're mixing dereferences with literal content
17:34nDuffwhich is usually the case when writing macros
17:34Mandarmacros.clj
17:34nDuffbut that particular example really doesn't do a good job of demonstrating what it's good for.
17:35Mandarmaytbe i didn't fill the blank rights
17:35Mandarright*
17:35Mandarthe test runs but it might not be the best answer
17:38Mandari don't get it
17:38Mandar~(second form) is needed to actually apply the operation operator
17:38clojurebotAlles klar
17:39Mandarbut why ~(first form)
17:39scriptorMandar: it's better because using syntax-quote is more idiomatic
17:39scriptoryou can use list and so on, but that gets verbose fast
17:39scriptorat least, that's what I think they mean
17:39Mandarsure but i just don't understand the code
17:40Mandar(first form) returns a number
17:40Mandarwhat does "unquote a number" mean?
17:41nDuffMandar: ...so, by default, you would get the literal list ('first 'form)
17:41scriptorMandar: so, say you entered `(second form)
17:41nDuffMandar: ...you wouldn't be running the function at all.
17:41aperiodicMandar: you're not unquoting the number, you're unquoting the (first form) form
17:41scriptorthat would have the macro return (second form) and place it where you called the macro
17:42scriptorif you did `(~(second form)) it would evaluate the part that's unquoted (second form) in this case
17:42scriptorwhich would return +
17:42scriptorso then the macro return (+)
17:46Mandari still don't get what ~(first form) does
17:46Mandarwhat's the type of the returned value?
17:46Mandaris it a raw list?
17:46scriptorMandar: so we're agreed form is (9 + 1) right?
17:46Mandaryes
17:47scriptorso ~(first form) tells clojure that we are no longer syntax quoting,
17:47scriptorbut instead, we want to actually evaluate that code
17:47scriptorso (first form) returns the first element of form
17:47Mandarbut doesn't (first form) evaluate it already?
17:47scriptorno
17:48scriptorbecause of the syntax quote
17:48Mandaroh
17:48nDuffThink about a regular, non-syntax quote
17:48nDuff'(first form) doesn't get evaluated
17:48Mandaryes
17:48nDuffand in fact, _nothing_ in that quote does
17:48nDuffsyntax quotes do that, but give you an escape hatch
17:48Mandarbut i thought the syntax quote would be applied at the end
17:48Mandarlike a regular function
17:48scriptorMandar: nope, the syntax quote is applied before pretty much anything
17:48nDuffNo -- that's why we pointed you to the reader documentation
17:48nDuffthe reader does its work before anything else
17:49Mandarsorry, i was trying my best
17:49scriptorMandar: learn about regular quote first
17:49scriptorand the difference between quote: ' and syntax-quote `
17:50Mandari think i now understand what it does, it says "do not evalue this, unless ~ tells you to"
17:51nDuffThere's more than just ~
17:51nDuffthere's also ~@, for instance
17:51scriptorMandar: you're on the right track, but syntax quote also namespace qualifies every symbol
17:51nDuffreally do read the reader documentation
17:51scriptoractually, I suggest a book or something more introductiony to teach you about macros
17:52MandarnDuff, the documentation is quite hard to understand at my level
17:52RaynesThe reader documentation is as useful to a person new to Lisp as telling them to read the reader documentation is.
17:52nDuffMandar: Fair 'nuff -- the clojure.org docs are indeed not nearly as good as the better dead-tree books published.
17:53scriptorare there any good stand-alone clojure macro tutorials?
17:53Mandari'm not criticizing anything, i know i need to learn about this stuff and i'm grateful for the help
17:54Mandari'll get a book after i'm done with the koans
17:54Mandarbut i need to build a toy project first
17:55scriptorMandar: just stay clear from macros for now…unless you feel particularly adventurous ;)
17:55Mandari was just curious :)
18:00technomancyit would be nice if clojure.org were actually a resource you could rely upon to get started with clojure
18:01scriptorwell, a couple of links in does get you http://dev.clojure.org/display/doc/Getting+Started
18:04aperiodicoh 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:06scriptorit's just practice for when you have to grapple with the classpath, emacs, and clojure all at the same time
18:07aperiodicthat's the impression it gives me
18:08Mandarthanks guys, i finally understood the difference between ` and '
18:09technomancymuhoo: unless they're paying for training, in which case clojure.com covers them just fine =)
18:18muhooof course, it makes perfect sense now. i'd never looked at that site before. now i get it.
18:31Mandarwhat book would you advise to a beginner?
18:31Mandar(and i don't especially mean "closure for dummies")
18:35no7hingsomebody should tell them that http://clojure.com/roadshow gives a 404
18:43jk12netbeans or eclipse for windows clojure dev? have no prior experience in either
18:44casionseems counterclockwise is more up to date
18:47jk12casion: thanks
18:48no7hingshould the agent in http://clojuredocs.org/clojure_core/clojure.core/set-error-handler! be the failed one?
18:48no7hingshould/is
18:49no7hingah, confused, i meant the agent the actual handler get's passed
18:49no7hingkind of late here
19:00muhooMandar: clojurebook.com
19:00Mandarmuhoo, thanks :)
19:16percioushello out there, total clojure gumby here, coming from the python world, old-school lisp programmer
19:17Khaozo/
19:18perciousis there a good free clojure IDE?
19:18perciousfor a mac?
19:18nDuffpercious: Most folks prefers emacs, but that has a learning curve if you've never used it.
19:18nDuff~survey
19:18clojurebotsurvey is http://cemerick.com/2012/08/06/results-of-the-2012-state-of-clojure-survey/
19:18nDuffpercious: ^^ that covers what tools people use
19:18percious<-- kind of a vi guy
19:18perciousthanks nDuff
19:19Khaozwell, i'm a emacs fan too, but vim+vimclojure seems a good choice
19:19nDuffpercious: I use vim for everything but Java or Clojure -- for Clojure in particular, paredit mode in Emacs is life-changing.
19:19Khaozthis ^
19:20perciousPython has a really nice IDE called wing which has built-in documentation, autocomplete tools and "go to definition" functionality
19:20Khaozi'm still get used with paredit but it's really good
19:20perciousit will even dive into a zipped package to find the source for you
19:20perciousclojure have anything like that?
19:20nDuffpercious: Look at the Emacs Live video
19:21nDuffpercious: ...it goes way, waaay beyond what you can do with Wing+Python.
19:21Khaozpercious: you can try netbeans or eclipse
19:21nDuffpercious: http://vimeo.com/22798433
19:21perciouspreviously I have been underwhelmed with eclipse.
19:22perciouswhat's the sand-boxing story for closure?
19:22perciousi see lein
19:22perciousdoes lein set up a sandboxed environment?
19:23nDuffSandboxing from a security perspective? There are a few tools for that
19:23carkthere are a couple libraries for sandboxing, lein isn't one of them
19:23perciousno, from a packaging/versioning perspective
19:23carklein is a builld tool
19:23nDuff...it's not something lein does by default, or do you mean the virtualenv style of sandboxing?
19:23nDuffYes, your library selections are isolated between projects
19:23nDuffeven though they're all cached in a ~/.m2 repository, only the ones defined in your project.clj are active
19:25perciousawesome vimeo video
19:25perciousthanks for sharing
19:26perciouswhat's closure's story for wrapping c libraries?
19:26perciouslike python's ctypes if you are familiar
19:26nDuffSame as Java's == awful
19:26nDuff...well, not as awful as it used to be
19:26nDuffbut it sure isn't ctypes
19:26percioushow about ORM
19:27percious<-- lover of sqlalchemy
19:27nDuffHeh; SA is indeed great.
19:27amalloypercious: a lot of the clojure community subscribes to ideas like https://twitter.com/psnively/statuses/245972474926350337
19:27percioushttp://percious.com/blog/archives/34 ;-)
19:28perciousamalloy: i find that to be unfortunate
19:28perciousi find ORM's to be excessively useful, as long as they aren
19:28percioust based on Django ;-)
19:28amalloyyou can find ORMs in clojure, but they have all the problems that other ORMs have
19:28casionwhy would you want ORMs in clojure?
19:28casionthat seems… very strange
19:29casionlike asking if C has orm
19:29perciouswell, if'n I'ma work for a web company, and clojure is what they have chosen, I probably should understand the story there
19:30percious<-- is a job seeker
19:30technomancypercious: korma is the closest thing to an ORM you're likely to see with Clojure
19:30nDuffUgh.
19:30perciousbtw, i really appreciate you guys fielding my total newb questions
19:30perciousyeah, i saw korma
19:31technomancyit still has some issues
19:31perciousseems pretty primative
19:31perciousnDuff: OSS?
19:31technomancyI don't think it's the right abstraction, but I'm also pretty sure it's better than doing it raw
19:31grim_radicalit doesn't help that it's kind of abandoned
19:31nDuffpercious: Nope -- just enough functionality for my immediate needs and no more, so it wouldn't be worth releasing.
19:31perciousi like SA because it abstracts the table layer, and also provides an object layer
19:32perciousnDuff: you'd be surprised what people consider worthy of release ;-)
19:32carkwe're not too much into objetc around here
19:32perciousdoesn't java have a DB abstraction lib?
19:32carkobjects*
19:32perciousyeah, i hear you about objects
19:32nDuffpercious: Anyhow, Clojure makes it so darned easy to build minilanguages that building "just enough ORM" is really, _really_ simple.
19:33perciousi hear you about the mini languages, I did have 2 years of lisp, writing an NLP
19:33perciousand I got *paid* for it... gasp.
19:33nDuffpercious: ...that said, the leading datastore for Clojure in terms of having advanced, interesting features is based on Datalog, not SQL
19:33perciousthank god someone fixed string manipulation in LISP, that's all I can say
19:34nDuffpercious: ...sadly, it's commercially licensed, or else there'd be a lot more uptake.
19:34carkcan't be using all caps lisp that'll get the CL people angry
19:34percious<-- old clisp user
19:34perciousbruno haible was my hero i guess...
19:35perciousnever did try common lisp
19:35carknDuff: at least we got reducers out of it
19:35technomancypercious: clisp predates CL?
19:35carkclips is a common lisp
19:35perciousyou know, i am not sure
19:35perciousboth were pretty active 10 years ago.
19:35perciousmy supoervisor chose clisp, the rest is history
19:36perciousinterestingly, i got my AI professor to use it instead of scheme
19:36percious(for his class)
19:36mindbender1We are entering the space age -- Rich Hickey
19:37perciousanyone else bothered by the fact that the clojure interpreter takes quite a bit of time to start up?
19:37carkclojure is not an interpreter
19:37nDuffpercious: It's Java.
19:37technomancystartup time sucks
19:37nDuff(and indeed, it's _not_ an interpreter -- anything you enter at the REPL is actually compiled to Java bytecode before being run)
19:37perciousjms that I am not the only one ;-)
19:37perciousyeah yeah, sorry for using "python" terminology.
19:37SgeoSo, as I was asking, any Clojure libraries for exact reals?
19:37percious;-)
19:38carkexact reals ? lique square root fo 2 ?
19:38aperiodicisn't that impossible with only a finite amount of memory?
19:38carklike*
19:38SgeoWell, when outputting a result, you could specify a precision
19:38SgeoBut not before then
19:39SgeoConceptually, they're as possible as "infinite lists"
19:39Sgeo(Or, I guess, infinite length lazy seqs in Clojre)
19:39carki don't think there is one, that would have been advertised a lot
19:39nDuffpercious: ...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:40nDuffpercious: ...in terms of interaction with C libraries, by the way, see https://github.com/Chouser/clojure-jna
19:40technomancypercious: Clojure is only suitable for a (large) subset of places the JVM is suitable
19:40technomancyyou couldn't use it to write git
19:40perciousnDuff: seems like that would lead to a glutton of globals... leading to undesired execution.
19:40carktechnomancy: how so ?
19:40nDuffpercious: Only if you're reusing the same namespaces.
19:40amalloytechnomancy: didn't someone do that already? for java, that is, not clojure
19:41perciousanyone use clojure-jna?
19:41technomancyamalloy: there's an implementation of git, but it's not usable from the command-line.
19:41casionpercious: yes
19:41technomancycark: startup time, memory usage, and general sucking at being unix
19:41perciouscool, how do you like it?
19:42carktechnomancy: well that's java ... i'm interested in those places where java is good but clojure isn't
19:42casionpercious: it's an excellent learning tool… easier to use JNA directly it seems
19:42technomancycark: oh sure. Android is the only one that comes to mind.
19:42casionnot by fault of the library itself
19:42carktechnomancy: ahyes indeed
19:42nDuffpercious: ...by the way, there _are_ non-Java-based Clojure-derived languages
19:42nDuffpercious: ...most of them implementing about the same subset as ClojureScript...
19:42perciousyeah, makes sense
19:42casionthere's clojure for almost everything now
19:42nDuffpercious: ...and generally doing a lot better in terms of startup time and such, but lacking the same concurrency primitives and such.
19:42perciousi talked to one of the pypy guys, he said the clojure implementation there is kind of a joke.
19:43perciousmy jython friend likes clojure tho
19:43carknDuff: i hear clojure.net and clojure/python are not on the same track as clojure script
19:43percioushe's a java guy of course :)
19:43cemerickEasy thing to say when the project is 6 months old.
19:43cemerickpypy has been on for what, 6 years?
19:43nDuffcark: ...yes, the CLR one is definitely a very different (and mature) thing
19:43perciousha ha, well maciej is never known to be diplomatic ;-)
19:44technomancythe former head of the jython project attends the seattle clojure group
19:44nDuffcark: ...there's a reason I said "most" and "generally"
19:44technomancyhe's pretty skeptical of clojure-py too
19:44carknDuff: well what does it leave besides clojurescript ?
19:44carknDuff: there was one with lua i thinkk
19:44carkand that's it
19:44casionthere's lua, objc (2), haskell, C
19:44carkoh ok =P
19:44cemerickscheme
19:45casionsomeone was screwing with some ocaml backend…
19:45carkmhh an haskell one might be cool =)
19:45perciousso, the lisp syntax and the concurrency model seem to be the big attractants to clojure.
19:45technomancycome for the macros, stay for the referential transparency
19:45carkpercious: it's best known for that, but the real gold is in the persistent data structures
19:45casionpercious: I started with clojure for the jvm personally, stayed for the functional-ness of it
19:46perciousml runs on java too tho...
19:46technomancyyeti?
19:46nDuffpercious: ...having control over where your program keeps its state is important for much more than just concurrency.
19:46carkfunny thing is that persistent data structures were only a mean to achieve good concurrency
19:46perciousnDuff: so you find having to manage scope yourself to be a benefit?
19:47nDuffpercious: Huh?
19:47mindbender1imperative=place oriented programming
19:47perciousi once found a scoping error in cpython...
19:47casionthere's lots of things that run on the jvm… very few of them have enough material that makes them worth learning
19:48nDuffpercious: ...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:49nDuffpercious: ...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:50perciousnDuff: yes, I have experienced this in the past, especially a problem with JS guis.
19:50casionoop is the devil
19:50perciouspython seems to have constructs to help reduce this problem.
19:50mindbender1program more with values
19:51percioususually I solve the state problem by creating a custom state object and passing it through the process.
19:51HodappOOP has value, but it sure doesn't deserve all that its proponents try to credit it with.
19:51perciousi did this for the turbogears dispatch mechanism
19:52mindbender1new information requires new space
19:53nDuffpercious: *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:53perciousi am not a huge fan of ordered arguments as apposed to named arguments
19:53nDuff*shrug*. You can use destructuring to get named arguments when you want them, within some limitations
19:53nDuffthere are certainly cases where that approach isn't appropriate, though
19:54nDuffone thing to keep in mind is that Clojure is playing within the boundaries of what the JVM can do efficiently
19:54HodappI 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:54nDuffit's intended to be practical, along those lines, and argument-passing in Java is generally positional by nature
19:56casionI never really understood the need for named arguments
19:56casionand when using objc, it just annoys the shit out of me
19:57HodappI'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:02SgeoHodapp, try Smalltalk for OO?
20:03SgeoI like named arguments, but think that names arguments shouldn't be positional, the way they are in Smalltalk
20:03HodappSgeo: 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:03casionobjc is heavily influenced by smalltalk
20:05casionbig emphasis on heavily
20:11luxbocka complete newbie trying to set-up Emacs with Clojure here
20:12luxbockhow can I tell if I successfully managed to install swank-clojure with lein?
20:12casionhave you just tried to clojure-jack-in?
20:12luxbockyeah I did, but Emacs doesn't find the command
20:13casiondo you have clojure-mode installed?
20:13luxbockit might be because I tried installing swank through Emacs first
20:13luxbockyeah I do
20:13nDuffluxbock: ...personally, I use Emacs Live -- bundles all the various goodness in a single installation.
20:14casioninstalling swank first… I've heard that can cause some issues
20:14luxbockcan I run Emacs Live on windows?
20:14HodappnDuff: what sort of goodness?
20:15luxbockcasion, can I just delete the swank-clojure+1.1.0 from my .emacs.d/elpa/ folder, and then try lein'ing it again?
20:16casiontechnomancy: ping
20:16casionluxbock: maybe technomancy can help you better :)
20:17casionwouldnt be surprised if he just suggested using nrepl.el though
20:18nDuffHodapp: Easier to point at the video; see http://vimeo.com/22798433
20:19casionnDuff: you use this for not-overtone?
20:19nDuffcasion: absolutely.
20:21nDuffluxbock: No idea -- I personally use it on Linux, and its creator uses it on MacOS.
20:21casionwell, I'm going to play with this. it seems to be setup like my .emacs except a bit better
20:46luxbockOn 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:46luxbockwhere do I put package.el and how do I "install" it?
20:57jamesmacaulayNewbie 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:57gfredericksyep
20:57gfrederickswell wait
20:58gfredericksyes
20:58gfredericksit'll go in your lein dependencies
20:58RaynesYou're so fickle, gfredericks.
20:58nDuffHmm? Looks like it's in core to me
20:58nDuffjamesmacaulay: Which version of Clojure?
20:59gfredericksnDuff: it's not in my 1.4
20:59Raynes&(require 'clojure.data)
20:59lazybot⇒ nil
20:59Raynes&(clojure-version)
20:59lazybot⇒ "1.4.0"
20:59gfredericksoh whoops
20:59Raynes&(doc clojure.data/diff)
20:59lazybot⇒ "([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:59gfredericksI interpreted clojure.data/diff to be a lib name
20:59gfredericksand then interpolated the ns name to be clojure.data.diff
21:00Raynes&(clojure.data/diff [1 2] [2 1])
21:00lazybot⇒ [[1 2] [2 1] nil]
21:00gfredericksand kept down that rabit trail, and then explained myself while you guys proved me wrong
21:00jamesmacaulayoh jeez, a standalone lein repl gives me 1.2.1, I had no idea
21:00RaynesGet lein 2.
21:02jamesmacaulaylein upgrade only gives me 1.7.1, how do I get 2?
21:02gfredericksgotta download it explicitly
21:02jamesmacaulayokay thanks
21:02RaynesThe king of the vague.
21:02RaynesOne moment.
21:02gfredericksRaynes: the only important thing is that I get my answer out first
21:02Raynesjamesmacaulay: https://github.com/technomancy/leiningen#installation
21:03Raynesjamesmacaulay: 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:03Raynesgfredericks: That's true.
21:03Raynes3
21:03Raynes<3
21:04jamesmacaulaythanks very much!
21:04Raynessuffix*
21:04RaynesSurprised amalloy didn't call me out on that one. He must be playing something.
21:04stankleyjamesmacaulay: One thing to look out for, I think it broke slime-jack-in for me, and now I've switched over to nrepl
21:05RaynesI hope it breaks it for everyone so as to force them to switch to nrepl. :D
21:05RaynesEverybody should hate me as a maintainer.
21:05RaynesI break things whenever possible.
21:05carkwell lein2 comes with a lot of pains
21:05stankleyYeah, it's a weird way to find out, but the nrepl is sweet
21:05Raynescark: Like?
21:05carklike forcing nrepl
21:06Raynes I don't think it actually forces nrepl.
21:06stankleyIt's a Good Thing
21:06carkright now nrepl is annoying me =P
21:06RaynesI know people using lein2 with slime.
21:06akhudek_I've had a few "out of heap space" errors using lein2
21:06amalloyRaynes: just call everything an affix, so you don't have to remember which is which
21:06akhudek_but they seem to have gone away after a few recompile attempts
21:06akhudek_bizarre
21:06stankleycark: Just takes a second to relearn key binds
21:06RaynesYeah, but nrepl.el is new enough that some obscure bugs still pop up once in a while so I understand.
21:07RaynesIt also isn't as polished around the edges as SLIME at this point.
21:07RaynesIt makes up for it by being extremely hackable and having real releases.
21:07carkthing 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:07RaynesIf the 20 seconds it takes to set nrepl.el up is too much, you don't actually have to switch.
21:07Raynes*shrug*
21:08RaynesThere isn't really any adjusting to do to old projects for nrepl.el.
21:08xeqi_and being able to run a cljs repl
21:08cark20 seconds to install it, 1 hour to have autocomplete *about* right, countless restarts
21:08carkand days to have projects updated
21:09RaynesI'm not convinced your experience was the same for everyone.
21:09RaynesWhat does projects have to do with nrepl.el?
21:09carki understand the worlds has to move on, but it's annoying nevertheless
21:09Raynes:\
21:09RaynesIs there something you had to do to make projects work with nrepl?
21:09RaynesOr just lein2?
21:09carkwell it depends on the project =)
21:09RaynesThe breaking changes in lein2, while annoying, were very worthwhile and will certainly make everyone happier in the long run.
21:10carki have some that are as old as clojure
21:10RaynesI understand where you're coming from though.
21:10carki have this one that has a project.clj, just to be able to run it with lein1, but predates it
21:11carkit's uysing compojure before ring existed
21:11stankleycark: Ah, the entropy of code
21:11RaynesI actually thought you were new around here.
21:11carkwell it's working, and i'd rather keep it this way by not upgrading everything, but i still need to maintain it sometimes
21:12carki gave you tips when you were new
21:12stankleyHah
21:12cark=)
21:12carki'm an episodic irc user =)
21:13Raynescark: o/
21:13Raynes:D
21:14RaynesYou are a gentleman and a scholar.
21:14carkso 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:14stankleycark: Do what I do, set up a Vagrant file for the projects
21:14stankleycark: Like it or not, a virtual machine for each project means things don't break
21:15carkmhh
21:15carkright, but they're big
21:15stankleyUgly but effective
21:15carka vm is a lot to backup
21:16carki thought of that, i still have an old delphi (3!) project that i have to maintain
21:16no7hingi'am really, really sorry if i ask this again, but why are agents passed to the defined error handler *not* in failed state?
21:16stankleyTrue, but I try to write everything in Chef, so it's just code that builds the environment
21:17carkmhh what is chef ?
21:17no7hingsimilar to pallet
21:18carkstankley: 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:18no7hingautomation for cloud paas
21:18arrdemI've heard it said that Noir is crap. What libs should I be looking to as I overhaul my website?
21:18stankleycark: A DSL to describe the configuration of your server. It's written in Ruby. And yes.
21:19carkmhh that looks interesting
21:19carkmore hours working on infrestructure rather than code ..
21:20carkstankley: thanks for the tip, i'll investigate that
21:20stankleycark: Exactly. No free lunch... yadda yadda
21:20stankleyNP
21:21no7hinghaven't used it yet, but pallet seems like a clojurey alternative
21:21no7hinganyway, g'night
21:23stankleyno7hing: True, that video presenting it is on my watch list.
21:24xeqiarrdem: noir is fine; alot of people use compojure
21:25arrdemxeqi: 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:28Raynesarrdem: 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:29RaynesI've certainly said a few thing about noir, but I've never called it 'crap'.
21:29RaynesI'm a noir contributor.
21:29RaynesMostly lib-noir, but noir nonetheless.
21:29RaynesAnd Chris is a good friend of mine.
21:31Raynesarrdem: 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:31RaynesBut if you're already using noir for something and you like it, no reason to stop.
21:32arrdemRaynes: I'm basically doing a total site rebuild, but I have been very impressed with Noir thus far. Thanks for the advice.
21:33arrdem,(doseq [x ["Raynes" "xeqi" "nDuff"]] (println "(inc" x ")"))
21:33clojurebot(inc Raynes )
21:33lazybot⇒ 1
21:33clojurebot(inc xeqi )
21:33lazybot⇒ 1
21:33clojurebot(inc nDuff )
21:33lazybot⇒ 1
21:33RaynesThe 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:33RaynesIf you don't have those problems then you should be fine.
21:34arrdemRaynes: 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:36akhudekarrdem: also take a look at https://github.com/ohpauleez/shoreleave
21:36akhudekI haven't tried it, but it looks interesting
22:07SgeoI'm finally going to test my patch to algo.monads tonight
22:07SgeoAnd maybe make m-lift-fn act more like m-lift
22:14carkSgeo: i thought about it
22:14SgeoWhat's "it"?
22:14carkSgeo: and didn't really test it, but maybe m-lift-fn is the way it is for efficiency reasons ?
22:15carkyour patch invovles apply doesn't it ?
22:15Sgeom-lift-fn is the function I wrote to replace m-lift
22:15carkright
22:16SgeoWell... 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:16Hodappblarg, 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:17carkSgeo: let me go back and see the code
22:17Sgeo(I didn't even test m-lift-fn yet, so I could have merely gotten it wrong)
22:17carktho i don't think the author blindly copied haskell
22:17Hodappwhy... is this not a valid thing to do?
22:19Hodappam I just using a really half-assed development environment or am I missing something obvious here?
22:20carkSgeo: 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:21carkSgeo: so why do you want to change it ?
22:21carkSgeo: you already said but i forgot
22:21casionHodapp: the former
22:22carkcasion: =)
22:22Sgeocark, 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:22Hodappcasion: siiiiigh. Folks in here told me that lein-tarsier & vim worked really well.
22:23carkSgeo: right, but isn't there m-seq just for this kind of problem ?
22:23casionI keep trying it, and everytime I do I end up hitting some wall
22:23Hodappcasion: lein-tarsier, nailgun, vimclojure et al.?
22:24casionHodapp: I actually never have got nailgun working correct :|
22:24Hodappcasion: I think I have nailgun working okay but I'm finding the vim plugin really clunky
22:25carkSgeo: some combination of apply, f-map and m-seq i guess
22:25Sgeocark, and that's exactly what m-lift-fn does
22:25Sgeo(Well, I'm thinking of making it curried by default)
22:26carkSgeo: allright then, maybe add it to the library, but i feel like there should still be a way to have the "fast" path
22:27carkand while you're at it, we need eval-state and run-state functions =)
22:28cark(defn eval-state [computation state] (get (computation state) 0))
22:28carkand (defn run-state [computation state] (get (computation state) 1))
22:29carkhum no
22:29carkeuh yes
22:29SgeoMy question about the library is why it uses so many macros instead of, maybe, having m-bind and m-result be dynamically bound
22:29carkwhen you look at it
22:29SgeoAlthough I guess doing that may cause some issues with returning functions
22:30carkit's because they're trying to call functions directly, instead of passing a monad "object" around
22:30carkif you look at defmonadfn
22:31carkyou'll see that it changes a function from this (defn foo [bar] to
22:31cark(defn [m-bind m-return .... bar] ...
22:31carkso when you do (with-monad state ....
22:32carkit binds the m-bin m-result etc to local scope
22:32carkthen pass it around under the hood
22:32carki don't see how one can do it any faster
22:33Sgeo"speed" isn't my concern here. My concern is generality
22:33carkthat's why domonad has a version where you do not specify the monad it uses
22:34carkwell, i think the goal is to be general, to allow "return value polymorphism"
22:34carkkinda
22:34SgeoIt would be nice if this code were at least not tied to monads
22:34SgeoThe mechanism for this could be more general, I think
22:34carkwell it is necessary if you don't want to pass the monad around
22:34SgeoBut I don't like relying on defmacrofn
22:35carkit allows the algo.monad user to write code which is not bound to a specific monad
22:35SgeoBut, 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:35carksay you're writing a parser, with statet and maybe
22:36carkthen you suddenly think it would be easier to add a writer monad in there
22:36carkthe way it is right now, you only need to pass the right monad from your top level and it just works
22:37carkright, i only see a problem with the cost of indirection when calling a var
22:38carknot quite sur if there is some other reason
22:38carksure*
22:38carktho the cost must be quite high since rhickey changed the default to "not dynamic"
22:39SgeoThe cost of dynamics is, I think, generally an issue with correct use and comprehension
22:39carkthat change was specifically about performances
22:40SgeoOh
22:40carkdynamics are good, not to be abused, just like macros
22:41SgeoI 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:42carkif i had done it, defmacrofn would be passing a monad deftyped instance, with a protocol implementation for monad and for monad-plus
22:42carkand m-zero
22:43carki want to do something with arrows, but i'm not quite sure how to start with it
22:44carkwould be done just like the monad library, but yes it's cumberome
22:44carkcumbersome*
22:44SgeoThe Functor and Applicative parts also need to be factored out to be separate.
22:45SgeoNot all functors are applicatives, not all applicatives are monads, etc.
22:45carki've been banging my head on that
22:45carkbut it feels like you need a real type system
22:46SgeoWell, algo.monad fakes some of it, those concepts could be reused
22:46SgeoSeparable parts separated
22:46Sgeoetc
22:46carkdid you check maybe in algo.monad
22:46carki feel like it's half-asses
22:46carkhalf-assed
22:47carkwhat if i want to return Just nil ?
22:47Sgeojimduey's Procol monads do a correct Maybe, I think
22:47Sgeo*protocol monads
22:47carkmhh i need to check that out
22:49carknope not good, also taking nil as Nothing
22:49Sgeonil as nothing isn't the problem, the problem is what does it do for just
22:50carkright, that's my problem, how do you define : data List : Cons a List | Nil
22:51carkis it even possible to have a deftype without fields ?
22:51carkmhh
22:52carkyes it is
22:54SgeoI do think that in both monad libraries, maybe is shortchanged
22:54SgeoIt should really be in a library of its own
22:54SgeoWith various utility functions and macros
22:54carkevery monad should be =)
22:55SgeoI saw an explanation by jimduey saying that "monad transformers are functions".
22:55SgeoIt hurt my soul.
22:55SgeoAlthough, in the Clojure monad libraries, I guess they are
22:56carkwell there are haskell implementations that do not use typeclasses at all
22:57carkanyways, going back to work !
23:13SgeoOk, I'm going to need an IDE that won't make me want to shoot myself
23:13SgeoIn the meantime, I can live with lein repl and Notepad++ I think
23:14SgeoWait, I'm not going to be able to reload changes in files if I use lein repl, can I?
23:14clojurebotthe repl is holding onto the head of sequences when printing them.
23:14Sgeoo.O what clojurebot just said kind of sucks
23:20carkc-c c-k to compile yoru file
23:33SgeoIs NetBeans+Enclojure lighter-weight than Eclipse+Iforgetwhatit'scalled?
23:34mindbender1(set! *me* {}) throws IllegalStateException where (def ^:private ^:dynamic *me* nil)
23:35Sgeo,(do (def ^:dynamic *me* nil) (set! *me* {}))
23:35clojurebot#<Exception java.lang.Exception: SANBOX DENIED>
23:35mindbender1and cemerick does exactly that in piggieback
23:35Sgeo,(do (def ^:dynamic *me* nil))
23:35clojurebot#<Exception java.lang.Exception: SANBOX DENIED>
23:35Sgeo&(do (def ^:dynamic *me* nil) (set! *me* {}))
23:35lazybotjava.lang.SecurityException: You tripped the alarm! set! is bad!
23:37SgeoI don't think algo.monads is even a Clojure project
23:37Sgeoerm, Leiningen project
23:42mindbender1,(doc set!)
23:42clojurebotPardon?
23:42mindbender1(doc set!)
23:42clojurebotIt's greek to me.
23:42mindbender1&(doc set!)
23:42lazybotjava.lang.SecurityException: You tripped the alarm! set! is bad!
23:49SgeoOk, so this library isn't Leiningen-y
23:49SgeoHow do I make it leiningen-y?
23:54tomojconsider r/map's rfn: https://gist.github.com/b1e769f9e03e3e132768
23:57tomojif we patch reducer/folder so that they return an IKVReduce, we can do this https://gist.github.com/469d9f88d866446faf05
23:58tomojbut note that the reducef is only getting called with 2 args
23:58tomoj(str in this case)