#clojure logs

2012-08-28

00:00tomojcjfrisz: had you learned well most of the set of manipulation commands?
00:00cjfrisztomoj: Oh yes
00:00cjfrisztomoj: I slurped and barfed with the rest of them
00:00cjfriszWait, I think that came out wrong...
00:01tomojhuh, that you hadn't is the only explanation I could think of
00:01cjfriszI mean, I've been thinking I should try it again to remind myself
00:01TimMccjfrisz: Did you ever use paredit-convolute-sexp ? :-)
00:01TimMcThat command is baller.
00:01cjfriszTimMc: I'm not sure
00:01cjfriszTimMc: Maybe not
00:01cjfriszWhat's it do?
00:01TimMcThat's for reversing the nesting of e.g. an if and a let.
00:02FrozenlockI'm stuck. I have a 5 line function to write to the console and it doesn't work. :-( https://www.refheap.com/paste/4670
00:03TimMc(let [foo bar] (if a b| c)) -> (if a b (let [foo bar]| c))
00:03ivanFrozenlock: maybe it needs .-keyCode
00:03cjfriszAhhh
00:03cjfriszHadn't learned that one
00:03TimMcIt's like transpose, but with parent-child relationships.
00:03cjfriszThat might make it worth my while to give paredit another shot
00:03Frozenlockivan: No I tried it also. Btw, what is the '-' for?
00:04TimMcI suspect paredit becomes even more useful if you define your own macros.
00:04ivanproperty instead of method call, but I forgot the rules
00:04ivanso, any error?
00:05FrozenlockNo, but it doesn't print anything in the log.
00:05tomojwhat is dom/log ?
00:05Frozenlockclojure.browser.dom/log
00:05cjfriszI've been in a quandary lately about the "programming my editor" business
00:06FrozenlockTo print in the console.
00:06cjfriszI used to do it quite a bit, but then I found a mentor who takes a very minimal approach
00:06FrozenlockAnd [goog.events :as events] [goog.events.KeyHandler :as KeyHandler]
00:06tomojoh, I hadn't even noticed clojure.browser.{event,dom}
00:06ivancjfrisz: you can stop programming your editor by using IDEA and fixing La Clojure ;)
00:06cshellHave you guys seen JSFiddle? http://jsfiddle.net/ - It looks like a better HTML/JS version of pastebin
00:07cjfriszWat
00:07cjfriszWhat is that?
00:07TimMccjfrisz: That, and I am gunshy of customization these days.
00:07ivanIDEA is JetBrains' IDE and La Clojure is the Clojure plugin for it
00:08cshellI've been thinking of helping out with LaClojure, but the IDEA plugin documentation is horrendous
00:08cshellhowever, there are a lot of good features in LaClojure
00:11uvtcHow can I produce a loop such that one of the bindings in it cycles through some particular vector of values?
00:12cshell,(for [x ["a" "b" "c"]] x)
00:12cshell?
00:12clojurebot("a" "b" "c")
00:12casionuvtc: (cycle) doesnt work?
00:13uvtcFrom inside the loop, I want to be able to call `recur` and get the *next one*.
00:13casionah
00:13cshell,(doc cycle)
00:13clojurebot"([coll]); Returns a lazy (infinite!) sequence of repetitions of the items in coll."
00:13cshellthat's cool
00:13casionyou could just do (next cyclevar)
00:13casionI think?
00:13uvtcYes, it seems like `cycle` would be involved ... but I'm not sure how to incorporate it.
00:13casionand past that in the recursion call
00:13casionpass*
00:14tomoj(loop [[head & tail] (cycle [1 2 3])] (recur tail))
00:18amalloytomoj's solution seems clearly pretty good, but there's probably a simpler approach to uvtc's problem that doesn't involve loop
00:19uvtcIn my loop there's a collection that I'm paring down each time through, a data structure I'm building up, then a third item which I want to take on values in that cycle.
00:19casion(loop [x (cycle [1 2 3])] (recur (rest x))) works for me
00:20amalloyuvtc: so isn't it a reduce, or a reductions?
00:20amalloyevery time i try to use reductions it turns out manual recursion is simpler, though, so maybe loop isn't the worst idea ever
00:21uvtcamalloy: will also see if I can use reduce.
00:22tomojcan you do reductions with a reducer?
00:23amalloytomoj: i think that's just a transformation
00:24amalloywell, maybe not
00:25tomojsay (= (reduce __ [1 2 3 4]) [1 3 6 10])
00:25amalloytomoj: you can easily do that much
00:26amalloybut i'm not sure how you can *use* the reductions like you could use a lazy-seq reduction, eg to stop when the total is >= 40
00:26tomojso it should be (= (reduce __ (__ [1 2 3 4])) [1 3 6 10]) ?
00:27tomoj(reduce + (__ [1 2 3 4])) I guess?
00:28tomojoh, duh, filling in the reducef above is trivial
00:29tomojI wish defcurried and friends weren't private in jvm land
00:29tomojin cljs they seem to be available without even requiring anything
00:35TheBusbyany decent IRC bots publicly available in Clojure?
00:35amalloy$whatis source
00:35lazybotsource is http://github.com/flatland/lazybot
00:35TheBusbyamalloy: thank you!
00:36amalloy~source
00:36clojurebotsource is http://github.com/hiredman/clojurebot/tree/master
00:46tomojcurried ops are sometimes hard to make :(
00:46tomojpartition for example
00:47tomojI guess in cases like that you just drop the currying and require partial
00:50Sgeohmm
00:51uvtcamalloy, tomoj : Thanks for the help. This is what I came up with : https://gist.github.com/3495031 . It works.
00:52casionuvtc: thanks for posting the result
00:52uvtcY/w. I'm not sure if it's the most elegant way to do it though.
00:53casionI'm working on something very similar
00:54SgeoGiving the existence of partition, maybe I shouldn't complain that it's harder to write macros that take vectors with an even number of stuff over macros that group each pair of things
00:55uvtccasion: that code is just an extract of the program I'm working on. I'd actually like to take more care in selecting which student gets assigned to the current teacher (rather than just taking the first one).
00:56uvtcBut I tried to boil down the problem in order to get feedback on the best way to do that cycling through the teachers bit.
00:56uvtc*to do that "cycling through the teachers" bit. :)
00:57casionuvtc: I'm pairing 2 collections so that with your example data I'd end up with [[A [ ad g j]] [B [b e h]] [C [c f i]]]
00:57tomoj(->> students (map #(array-map %1 #{%2}) (cycle teachers)) (apply merge-with clojure.set/union))
00:57casionmistype, no quotes, but you get the idea
00:57tomojmaybe there is an even better way?
00:58tomojin any case I think amalloy was right about loop :)
00:58francisCould someon point me to a good java irc channel?
00:59samrathaving trouble understanding wison's maze(Clojure Programming)- https://gist.github.com/792959#L14. (keys paths) gives only either the x or the y coordinate, right?
00:59samratWilson*
00:59tomojuvtc: oh, that wasn't the real problem, so maybe loop is still good for you?
01:01uvtctomoj: Well, given the current teacher we're on, I'd *like* to pick a student, compute a score on how well they mesh with the student-pool so far, and if it's a bad fit, randomly choose another student...
01:02tomojsounds loopy to me
01:02uvtcSo, if the resulting group gets a negative score, choose another student. But if the resulting group gets zero or positive score, keep that student there and move on.
01:02uvtcYeah, kinda' crazy, but ...
01:02uvtc;)
01:02tomojI mean (loop [])-y
01:02uvtctomoj: That's what I thought too.
01:02uvtc:)
01:02uvtcSounds `loop`y.
01:02amalloyfrancis: /join ##java
01:03francisamalloy: thanks
01:04uvtctomoj: But, again, I was trying to boil it down to figure out how to do that cycling with the loop (and thanks for that `[head & tail]` suggestion, tomoj).
01:07uvtc(Gah, in my above comment, I *meant* "see how they mesh with the students already assigned to that teacher". Sorry.
01:07uvtc)
01:07clojurebot) is http://xkcd.com/224/
01:08uvtcclojurebot, hah. Elegant weapons, for a more ... civilized age. http://xkcd.com/297/
01:08clojurebotmake a note of http://scienceblogs.com/goodmath/2006/11/the_c_is_efficient_language_fa.php it is yet another article about picking c or c++ for performance being naive
01:09uvtcAlways has to get in the last word.
01:12SgeoWould choosing Common Lisp for performance be sensible or naive?
01:12casioncompared to what, in what context?
01:12casionon what architecture?
01:12casionetc..
01:13uvtc~performance
01:13clojurebothttp://clojure.org/java_interop#toc46
01:13SgeoI think I may be reluctant to consider the JVM to be "fast"
01:14frioer?
01:14clojurebotso I don't see where my understanding of 'do' is wrong. I have looked at the special forms page on clojure.org, but the explanation of 'do' is very short and it seems that my usage of it should be ok in this situation
01:14uvtc(Hm. I was just guessing clojurebot would share some wisdom on performance there. :) )
01:14friothe JVM is very fast
01:14frioit's slow to start, admittedly, but it's widely regarded as being one of the fastest runtime environments
01:15casionjvm is quite fast
01:15casionand usually faster than CL
01:15casionthough sometimes not
01:16Sgeoclojurebot, what situation?
01:16clojurebotexcusez-moi
01:16SgeoIs clojurebot sometimes human controlled?
01:16SgeoOr was it just being weird?
01:16friono :p
01:16frioit's just reading quotes, iirc
01:16SgeoNow I'm curious what situation that person was referring to
01:16friohaha :)
01:17Sgeo(Also, is there a Clojure equivalent to prog1?)
01:17uvtcClojurebot wishes it to be known that one should not meddle in the affairs of wizards ... or clojurebots.
01:18Sgeoclojuredocs is horrible. If I search for do, do is nowhere to be seen on the results page
01:19uvtcSgeo: check the cheatsheet (under "special forms")
01:19SgeoI know what it does, I wish clojuredocs search wasn't horrible.
01:24tomojamalloy: https://gist.github.com/543a721f0f44cf48459d
01:25tomojmaybe it can be folded too?
01:25SgeoAnd I still want a prog1
01:27tomojdoes the clhs description of prog2 contain a typo? http://clhs.lisp.se/Body/m_prog1c.htm
01:28emezeskeSgeo: As a workaround, you can search for ^do$
01:28emezeskeSgeo: It is unfortunate that a direct match isn't ranked higher without that though
01:29Sgeotomoj, yeah. I don't think any implementation does it like tha
01:29Sgeothat
01:33SgeoI wonder if I should try to make a wrapper around some quantum random library
01:34SgeoWould be interesting practice
01:35uvtcOh, amalloy , thanks for posting that gist the other day re. the change counting function. :) Instructive.
01:38amalloyinstructive is what i usually aim for. glad you found it useful
01:40SgeoWould using with-redefs to make a macro to use a difference source of randomness for things such as shuffle be an abuse of with-redefs?
01:40Sgeo(Rather than me rewriting shuffle)
01:54emezeskeSgeo: I don't think with-redefs is recommended for use in non-test code
01:54emezeskeSgeo: It affects the Vars it swaps in all threads, which could cause some very weird things to happen
01:54emezeskeDepending on your circumstances
01:55emezeskeProbably the general tradeoffs about monkey-patching apply.
02:24SgeoI wish I could (time lein repl) to see how bad it is
02:26mkSgeo: startup?
02:27SgeoYeah
02:27emezeske$ time lein repl <<< exit
02:27lazybotemezeske: The time is now 2012-08-28T06:25:27Z
02:28emezeskelazybot: Thanks, but I think you may have missed the point :P
02:28mkyou can probably manually time it
02:28emezeskeSgeo: ^
02:28mkwhat emezeske said
02:29SgeoI'm on Windows
02:29emezeskeI'd like to give Windows the benefit of the doubt and assume there's an equivalent shell command
02:29emezeskeBut I'm wary of giving Windows too much credit
02:30mkSgeo: google shell script system time. Then use a shell script to start lein repl up on a program that prints system time
02:32mkpresumably this would add some overhead due to having to load that program
03:42kralnamaste
05:59augustlis it possible to force a snapshot dependency download in leiningen?
06:01xeqilein -U
06:05augustlxeqi: "Wrong number of arguments to [with-profile update,dev,user,default] task. " :)
06:06augustlupdated to latest leiningen version, works just fine now
06:06augustloh nvm, still not working..
06:11xeqiaugustl: are you giving it a task?
06:12xeqi`lein -U deps` for examp
06:13augustlxeqi: ah
07:08ro_stRaynes: any idea how i can get noir's code reloading to also pick up code in ./checkouts/* ?
07:08ro_sti already have (server/add-middleware reload/wrap-reload ["checkouts/Core/src"]) but it has no effect
07:10ro_stoh wait, that probably stops it from reloading in src
07:15wjcHi
07:16wjcin cljs, I'd like sql results to be seqable. I tried to extend-type js/SQLResultSetRowList, but that returns a reference error
07:17wjcwhat should I be trying to extend?
07:45augustlhmm, lein deploy: "java.lang.String cannot be cast to clojure.lang.IPersistentCollection"
07:47hyPiRionaugustl: some of the data you have in project.clj is most likely a string instead of a vector
07:48augustldoesn't seem like it
07:48augustlthe only thing I changed lately is the leiningen version, I'm pretty sure the previous version I had worked fine
07:49jweissis require+refer now preferred over use?
07:50augustlthe leiningen error seems to now happen for all projects
07:50cemerickaugustl: can you paste the exception?
07:50cemericker, stack trace?
07:51augustlthere is no exception
07:51augustlstack trace* :)
07:51hyPiRionjweiss: yes
07:51cemerickit's just the message?
07:51augustlcemerick: yes
07:51cemerick:-/
07:51augustlstatus code 1
07:51augustlexit code, I mean
07:51hyPiRion(:require lib :refer :all) == (:use lib)
07:52cemerickaugustl: what repo are you trying to deploy to?
07:52augustlis there a way to downgrade leiningen to the latest "stable"?
07:52augustlcemerick: my own nexus
07:53cemerickaugustl: can you paste your project.clj?
07:53augustlcemerick: nothing has changed in my project.clj :)
07:53cemerickI know, I know. :-)
07:53cemerickI have a theory.
07:53augustlsure, https://www.refheap.com/paste/4676
07:54cemerickaugustl: replace those repo URL strings with {:url "http://…&quot;}
07:54augustlreally? ><
07:54augustlnot even a deprecation warning, that kind of sucks..
07:54cemerickIf that works, it's a bug.
07:54augustlah, that's good
07:55jsabeaudryalso, cheshire 4.0.1 is out
07:55augustlcemerick: works fine with {:url foo} instead of just fo
07:56augustljsabeaudry: doesn't 4.0.0 actually mean 4.0.0 or newer in maven speak?
07:56cemerickaugustl: Good. (Not good, but you know what I mean.) File a bug, include your project.clj, and say "it looks like the repository values aren't being normalized to maps when they're supposed to be"
07:57cemericktechnomancy_'s gonna facepalm ;-)
07:57augustlcemerick: great, will do
08:00jsabeaudryaugustl, I'm not familiar with maven, plugins like lei-outdated lead me to beleive that when you write 4.0.0 it is 4.0.0
08:00jsabeaudrylein-outdated*
08:01augustlI recall reading an article about maven version numbers working like that
08:01augustlbut I'm not sure, and for all I know leiningen fixes it
08:02clgvjsabeaudry: nope you have to specify a range instead of an exact number
08:02clgvjsabeaudry: as far as I remember you can do something like "[4.0.0,)" to have an open range
08:03augustlI do have 4.0.1 in my ~/.m2 and none of my projects have 4.0.1 specified
08:03xeqiaugustl: "4.0.0" means I'd like 4.0.0, but I'll accept any version
08:04xeqiso if something else has a hard requirement or version range maven/aether/lein uses that instead of 4.0.0
08:04jsabeaudryThat is very interesting, so from day to another my project can break without me changing any file
08:04hyPiRionAnd "[4.0.0]" means I'd only accept 4.0.0, as far as I understand.
08:04xeqihyPiRion: yep
08:06xeqijsabeaudry: if a transative dependency uses a version range including a version that is not out yet then yes, it could break
08:07clgvxeqi: are you sure? usually leiningen gets the exact version you specified if you refrain from using ranges
08:08clgvwell at least lein 1.x did always get what was specified
08:08xeqiclgv: if you don't have any ranges in the entire dep tree then yes, it grabs the soft versions based on range to root
08:08xeqiand really, if the version range over laps with the soft dependencies
08:09xeqithis is all hand wavy for quick summary on irc
08:09clgvthere should be info in leiningen's documentation about that for non-maven devs ^^
08:12cemerickclgv: the same things applied in lein 1.x
08:13clgvcemerick: humm never encountered them and never read about the issue
08:13cemericknevertheless :-)
08:15xeqiclgv: the ecosystem, in general, has chosen to use soft dependencies so its not a common occurance
08:15cemerickxeqi: you make it sound like more than 25 people know that "2.0" doesn't mean "[2.0]"
08:16xeqi...
08:16clgvcemerick: "20 people" would have been the better choice for that post ;)
08:16xeqimaven has chosen to use soft dependencies by default so its not a common occurance
08:16cemerickor, maybe, '"[2.0]" when I want 2.0, and 2.1 when that comes out next week'
08:17cemerickhuh
08:17cemerick(I thought you were talking about Clojure-land.)
08:18clgvwho? me?
08:18cemerickA number of people that I know that know Maven _very_ well say things like "if you're not using version ranges correctly, you're not using Maven correctly"
08:18jsabeaudryI'm so confused.
08:18cemerickclgv: no, I'm just generalizing :-)
08:19hyPiRionProject management isn't a solved problem, heh.
08:20clgvthat's just dependency management I guess - but your sentence probably applies as well ^^
08:20cemerickNot by a long shot. Probably won't ever be, insofar as different use cases often require entirely unreconcilable semantics.
08:37gfredericksI'm having trouble getting CLJS dependencies included in my output JS
08:37gfredericksI'm using lein checkouts but hopefully that doesn't make a difference
08:39gfredericksI have a single namespace in my own project, from which I require namespaces in the other projects. My code shows up in the built JS file but none of the other code does
08:40gfredericksand in the browser it fails on the goog.require statements from my namespace
09:04jweissfor the reader literals, will clojure automatically load the namespace from the classpath (the vars that are the values in data_readers.clj)?
09:05S11001001jweiss: I would hope not, but I don't know
09:05gfredericksI believe not
09:06gfredericksI think I ran into that problem when using them
09:08jweissgfredericks: so how are you supposed to load those functions then?
09:08jweissthe namespaces that need them have to load them themselves? that doesn't seem right either
09:09gfredericksjweiss: if you're depending on the functionality of a data reader then you should know to load the namespaces, I suppose
09:09jweissfor one of the major features of clojure1.4 the docs are basically non-existent :)
09:09XPheriorIs there a way to block until (run-jetty) actually fully launches its server?
09:09XPheriorMy tests begin before the server can finish getting up.
09:10S11001001jweiss: I think it's caring-proportional (i.e. only those who care enough to hunt down the details should be handed the keys to the feature)
09:10jweissS11001001: i do care, and i've been hunting :)
09:10XPheriorOh. That's what :join? does, doesn't it..
09:10gfredericksS11001001: does "hunt down" refer to requiring namespaces or googling for docs?
09:11jweissi think he meant googling for docs
09:11gfredericksXPherior: :join? determines if it blocks or not
09:11S11001001gfredericks: as jweiss says
09:11S11001001I would really hate it if they auto-required nses
09:11jweisswhich i did, and there's really nothing beyond the release note that i could find after 10 minutes of searching
09:11XPheriorgfredericks: Makes sense. So calling (run-jetty #'app {:join? true}) should do the trick, I suppose.
09:11gfredericksXPherior: I think that's the default behavior
09:12XPheriorgfredericks: Hm.. I'm always so clumsy with new web frameworks.
09:13gfredericksXPherior: I've always been able to use :join? false to start the server in another thread and haven't had an issue
09:13XPheriorgfredericks: Yeah, this would be the opposite issue.
09:14XPheriorOh, ha. This is my problem. After my tests finishes, the server is still hanging around.
09:14gfredericksXPherior: you're using clojure.test? fixtures are great for that
09:15gfredericks(defn wrap-with-server [test-func] (let [server (start-server)] (try (test-func) (finally (.stop server)))))
09:15XPheriorgfredericks: Midje. But should be all the same.
09:15XPheriorSweet. I will definitely use that.
09:17gfredericksah ha; lein-classpath suggests that src-cljs from the deps doesn't make it to the classpath
09:17gfrederickshow do I make that happen?
09:43duck1123gfredericks: Are you just now trying lein2 for the first time?
09:43gfredericksno I'm just now trying to use it consistently
09:44duck1123ahh, ok. I found that hard to believe otherwise
09:45gfredericksI default to avoiding new things.
09:45wmealing_new things are hard
09:46duck1123I love new things. Give me something fun to play with
09:48gfredericksold things are not fun?
09:49duck1123old things, or old to me?
09:50gfredericksold to you
09:51duck1123old things can be fun, but it's not like that rush of learning or exploring something new
09:52gfredericksI consider that the least comfortable part; when I don't know what's going on
09:52gfredericksonly when the thing is old does the rush come :) "Hey now I really know how to use this..."
09:55gfrederickseven when explicitly adding the checkouts/*/src-cljs to the classpath the compiler still silently ignores them :/
09:56clgvthat's mean!
09:57ro_stwhat are you trying to do, gfredericks?
09:58ro_stand with which version of lein?
09:59gfredericksro_st: just upgraded to lein2; I'm trying to use cljs deps in /checkouts
10:00ro_stso you have cljs projects in checkouts and you want to compile cljs namespaces from there as though they were in the containing project?
10:01dgrnbrgIs there a place to register to give unconj talks for this year's conj?
10:02ro_sti'd put an issue on github for cljsbuild, gfredericks
10:02gfredericksro_st: yes
10:02gfredericksokay. I will do that.
10:03ro_sti'm using crossovers from a checkout just fine
10:06ohpauleezdgrnbrg: Usually the list opens up at the conj itself on the first day
10:07ro_stohpauleez: :-)
10:07ro_stdid you see i fixed the demo up?
10:08ohpauleezro_st: I just got settled from all of my traveling/moving - the demo totally works?!
10:08ro_sttotally works now
10:08ohpauleezThat's awesome! Thanks so much!
10:08ro_sti should inform creighton as well
10:08ohpauleezDo you mind if I link to it and mention it in the Clojure mailing list when I announce Shoreleave
10:09ro_stthat's why i built it :-)
10:10ohpauleezro_st: Awesome
10:10dgrnbrgohpauleez: thanks!
10:14magopianro_st: what demo are you talking about?
10:14ro_stwhy, i thought someone would never ask :-)
10:15ro_sthttps://github.com/robert-stuttaford/demo-enfocus-pubsub-remote/
10:17magopianro_st: ;)
10:18magopianro_st: mmm, it's like chinese to me !
10:18ro_sthaha oh dear
10:18bOR_hmm. getting an integer-or-mark-p, nil error when I'm trying to type in the nrepl buffer (its not showing a prompt in emacs23).
10:19bOR_anyone knows what I am doing wrong? (leiningen, nrepl beta9, nrepl.el
10:19magopianro_st: well, i'm just a clojure noob, you know ;)
10:19ro_styou do any html/js work?
10:20ro_stmaybe with some php or ruby or python on the back?
10:21magopianro_st: i'm a web dev (django atm)
10:21bOR_ah. found it. have to open a valid .clj file before nrepl works
10:22ro_stthen you have enough background to grok that demo
10:22magopiani understand pubsub, but not enfocus, remotes, and i only vaguely know what is cljs for the moment ;)
10:22ro_stcljs is clojure compiled down to javascript. so it's loading a minified js app into the page, and running it
10:23magopianyup, i groked that ;)
10:23ro_stthat app uses enfocus to render views with html templating and listen for user events
10:23magopiannoir is clojure's most known web framework i believe
10:23ro_stremotes to encapsulate calls to the server-side clojure code (in noir, in this demo)
10:23magopian(i've just finished viewing bodil stokke's talk, awesome ;
10:24ro_stand pubsub (in the cljs) to bind the ui (views and event handlers) to the 'model', which in this case is just the remotes
10:24magopianok ;)
10:24magopianro_st: looks nice ;)
10:24ro_sti suggest reading through all the code, and then getting it running and interacting with it, watching the network and console in chrome dev tools
10:24ro_styou'll pick it up quickly
10:25magopiansure ;)
10:25ro_stsrc-cljs folder: all runs in js in the browser. src folder: runs on the server in on top of noir
10:25ro_stboom-chicka-pow.
10:26ro_stfeel free to ask q's etc
10:30ro_stmanaged to get code-reloading with ring working with checkouts. damned handy
10:31magopianro_st: i will ask, as soon as i get around to try it ;)
10:31magopianmmm, i've just finished applying for job positions at kodowa and relevance
10:31magopianas a clojure noob, i'm not sure yet if that is brave, useless, or full stupid
10:32duck1123magopian: are you in range of those companies, or are you just looking for a clojure job and don't care where?
10:34magopianduck1123: in range, you mean "close to, geographically" ?
10:34duck1123I was really hoping I could find something in my area when I was last looking. There are some good clojure jobs out there, but I didn't want to have to leave the state
10:34duck1123magopian: yes
10:34magopiani'm from france, so no
10:34jamiltronIs there a function that given two (or more vectors) applies a function requiring the first element of both, then the second element of both, etc. without needing to do something like (map (apply (partition (interleave … ?
10:34magopiani won't mind moving, if i have to
10:34magopianbut for relevance, it seems they have remote employees
10:35magopiani've worked remotely for two years now, and i just love it
10:35gfredericksjamiltron: sounds like map
10:35magopianjamiltron: just "map" is enough
10:36magopian&(map vector [1 2 3] [4 5 6])
10:36lazybot⇒ ([1 4] [2 5] [3 6])
10:36gfredericks,(map hash-set [1 2 3] [:a :b :c] [[] [[]] [[[]]]])
10:36clojurebot(#{1 [] :a} #{[[]] 2 :b} #{3 :c [[[]]]})
10:36jamiltronAh, thanks!
10:36jamiltronI guess I never checked the docs for map and just assumed it would only take one coll.
10:37magopianjamiltron: if you're learning to program in clojure (like i am ;), i highly recommend reading through http://java.ociweb.com/mark/clojure/article.html and playing with 4clojure.org ;)
10:37magopiansorry, 4clojure.com
10:38magopianit's both fun and challenging
10:38magopiansome of the problems just made my brain hurt ;)
10:38clgvmagopian: I would setup a dev environment and use that instead of 4clojure ^^
10:39magopianclgv: well, i will, eventually ;)
10:39magopianfor now, my dev environment is the LT playground :D
10:39scriptorthat's perfectly fine
10:39jamiltronmagopian: Thanks - I've used Clojure off and on here and there and have worked through some of 4clojure. It's just that Haskell is my default functional language and map in haskell is a function taking a single list.
10:39jamiltronI guess I should have checked the docs to compare differences.
10:39clgvmagopian: uuuh somehow I interpolated tryclojure website into your post - but its not in there on second read ;)
10:39magopianmmm, clojure is my first "real" functional language (by real, i mean "other than scheme i used at school")
10:40magopianclgv: ;)
10:40magopianclgv: it was my first "dev environment" to be honest, but now that i have the playground, ...
10:40magopianwell, let's put it that way: tryclojure isn't as attractive as it once was :)
10:42bOR_jamiltron: I tend to use (source nameoffunction) rather than (doc nameoffunction). You get to see both the doc, and the source code of the function
10:42bOR_helps me understand what it is doing underneath :-)
10:42bOR_for (source function) to work, you might need to load clojure.repl though.
10:43jamiltronbOR_: That's a great suggestion. The only reason I know Haskell somewhat ok is because I read the source of the main list library.
10:43bOR_&(source source)
10:43lazybotjava.lang.RuntimeException: Unable to resolve symbol: source in this context
10:43bOR_,(source source)
10:43clojurebotSource not found
10:44clgvclojurebot has no sources. they have to be present as sourcefiles
10:44bOR_,(source frequencies)
10:44clojurebotSource not found
10:44bOR_noticing that.
10:45bOR_has anyone run into trouble trying to get nrepl + nrepl.el to load incanter libraries?
10:45bOR_I can load core and stats, but not charts
10:45clgvthat's weird.
10:45clgvbOR_: what's the error?
10:46bOR_testing now
10:47bOR_so, no errors or problems when I load incanter in the repl prompt (lein repl)
10:47bOR_(or when I draw a chart)
10:48bOR_java.io.FileNotFoundException: Could not locate incanter/charts__init.class or incanter/charts.clj on classpath: (NO_SOURCE_FILE:0)
10:48bOR_and that one after I nrepl-jack-in into emacs and do a (use '(incanter core stats charts))
10:49bOR_nrepl.middleware.interruptible_eval$run_next
10:51clgvbOR_: do you have the complete incanter as dependency or only incanter-core?
10:51algernonro_st: that demo is awesome
10:51bOR_incanter core, charts, io, pdf
10:51jamiltrongfredericks: magopian: Thanks for the hint to use map, cleaned up my code very nicely.
10:51bOR_weird thing is. If I start a lein repl in the project library, and do (use '(incanter core stats charts)) in there
10:51clgvbOR_: sure? and incanter-charts.jar is on your classpath?
10:52michaelr`hello
10:52ro_stalgernon: thanks! i'm keen to expand on it. any areas you think would be good to do that?
10:52bOR_then I can do (view (xy-plot)) in the repl in the emacs (which I connected to with M-x nrepl)
10:52bOR_I'll check for nrepl-jack-in what is in the classpath.
10:53magopianjamiltron: you're welcome! i believe it's the first time i can actually provide a (correct ;) answer to someone here :)
10:53clgvbOR_: core and stats are namespaces of incanter-core.jar. so it sounds pretty much like incanter-charts.jar is not on your classpath
10:54bOR_you are right for when I do nrepl-jack-in
10:54algernonro_st: not sure yet, I just had a quick glimpse. I'll have a closer look as soon as I have some more clojure-time
10:54bOR_there is no charts on the classpath then
10:55ro_stcool
10:55bOR_I'm not sure why not though, as it is in the project file, and it is available to me when I do lein repl in the project directory.
10:56clgvbOR_: maybe you need to restart the nrepl-server? I dont know any specifics of nrepl.el
10:56algernonro_st: timbre is a very nice touch in the demo by the way :)
10:57clgvbOR_: could be that you added charts as dep when the nrepl-server was already running
10:57ro_st-grin-
10:58ro_ststill need to 'solve' logging
10:58abalonero_st: can i ask what you're demo-ing?
10:58ro_stthe integration of the four elements to make a whole: enfocus, pubsub, remotes, crossovers
10:59bOR_clgv: hmm. then it should be something that is happening automatically. I now just put the whole incanter as a dependency in my projects.clj, and it is still only core and stats loading
10:59abalonero_or: where is the demo?
10:59ro_sthttps://github.com/robert-stuttaford/demo-enfocus-pubsub-remote/
11:00abaloneoops s/ro_or/ro_st sorry
11:01bOR_clgv: I'll send a message to nrepl.el maintainer.
11:02magopianro_or looks like a funny smiley ;)
11:02clgvbOR_: did you restart the nrepl server? or is that the usual workflow for nrepl.el?
11:03bOR_I never start it. I just open my src/projectname/core.clj file in emacs and do a nrepl-jack-in
11:04clgvbOR_: in CCW I have to restart the repl when I added a new dependency. it's also using nrepl
11:05bOR_how does restarting work? is it a command?
11:06clgvbOR_: no idea what it is in nrepl.el or if you have to do it. check its docs
11:06bOR_will do.
11:07clgvro_st: uhh, that cljs stuff explodes with warnings ...
11:08ro_styay
11:08ro_stmy evil plan has come to fruition
11:09ro_stwhen building, or when running in the browser?
11:13clgvro_st: when building ^^
11:14clgvro_st: your demo is currently only "adding items" - or does my browser hide something?
11:16ro_stin the browser, you should see 3 items listed
11:16ro_stclicking add item should add more, once per click
11:17ro_styou probably saw lots of WARNINGs?
11:17clgvyup that works
11:17clgvjust checking the source ^^
11:17ohpauleezthose should be fixed in Enfocus' release
11:18ohpauleezro_st: So, I'm going to cut 0.2.2 stable Shoreleave releases today, unless you have any objections
11:18ro_stsorry, you should have seen 5 items to begin with
11:19ro_stclgv: so check the source to see where the items are created and how both clj and cljs can use model/make-item
11:19ro_stohpauleez: none from me :-)
11:19ro_stare you wrapping localstorage now?
11:20ro_stclgv: i suppose i can bootstrap the ui so it doesn't look so darn shite
11:21clgvro_st: *g* some css can do magic ^^
11:21ohpauleezro_st: I was going to leave localstorage for 0.2.3
11:21ro_stindeed it can
11:23abalonehm. looking for ac-nrepl in my marmalade package list but cannot find it
11:24duck1123ohpauleez: I don't know if you're aware of it, but the shoreleave readme points to the marg docs for -worker, but I get a 404
11:25ohpauleezduck1123: Thank you, I'll fix that up today too. I appreciate the heads up
11:26ohpauleezduck1123: Fwiw, I'd stay away from the worker stuff, it's going to change a lot in the future, but it's cool to play around with nonetheless
11:27duck1123I decided I needed to take another look at what shoreleave has to offer, and I noticed that
11:33bOR_abalone its in melpa
11:33abalonebOR_: thanks!
11:44abaloneis it true that light table does not yet have paredit?
11:44scriptorI'm not sure if there are plans to have paredit soon
11:45scriptorbesides maybe through plugins
11:50ro_stlight table is cljs based
11:50ro_stso they'd have to build paredit in cljs first
11:52duck1123I would think that the browser would step on most of the key sequences you'd really want to use
11:54abaloneduck1123: that's a good point. would it step on something like F2?
11:55duck1123abalone: looks like you can catch the F-keys https://groups.google.com/forum/#!topic/objectivej/ff5ZypwkEPw
11:56duck1123if that 2nd post can be trusted
11:56clgvduck1123: afair lighttable is a webapp but shall be also shipped wrapped in a program. so there you should be able to use any key sequences
11:58duck1123There's a js library that let you assign key chords to js functions. I've been tempted to use it to define as many of the emacs commands as are relevant in my app
11:58duck1123but I wouldn't want to overwrite stuff like C-x or C-c as that might cause more confusion
12:07Frozenlo`Does (goog.dom.getDocument) gives me the entire content, such that I could store it in a variable and recreate it, or it is a pointer to the document?
12:12dnolenFrozenlock: it can be used to traverse the DOM, but things are usually done that way. Probably best to use something like domina if you aren't already using jayq.
12:14Frozenlockdnolen: Usually done which way?
12:17dnolenFrozenlock: querying the DOM for particular elements.
12:18dnolenand I meant "thing are not usually done that way"
12:18dnolenFrozenlock: I would use domina or jayq. domina is a bit nicer in some respects since it can be GClosure optimized.
12:19FrozenlockI see. Still, if I do (goog.dom.getDocument), is this a copy of the entire document?
12:20nDuffFrozenlock: Changes to the results given you from getDocument will have side effects, if that's what you're asking.
12:21dnolenFrozenlock: it's just a node.
12:21dnolenFrozenlock: with pointers to other nodes.
12:21FrozenlockNo, I'm thinking of storing some stuff in a map where the keys are the dom-objects.
12:22FrozenlockFor example: {#<[object HTMLDocument]> {"ctrl-f" (print "hello")}}
12:22FrozenlockBut now I don't how to eval the stored function... I miss eval :(
12:23nDuffFrozenlock: Don't store code there, store a _function_.
12:23dnolenFrozenlock: I don't see why you need eval here.
12:23nDuffFrozenlock: ...if this were real Clojure, you'd want an IFn, not to use eval in that case either.
12:23dnolenFrozenlock: also why do you need DOM references as keys in the map?
12:24FrozenlockWell in my case I'm trying to make key-bindings as in emacs, meaning I can have different ones depending of where I am in the dom.
12:25FrozenlockSo my listener would look in the map and choose what function to execute.
12:25nDuffYou could just attach a property to the DOM elements themselves, and walk up the tree to find the most recent one.
12:26nDuff...that's the approach I'd take, anyhow. Granted, it's not very Clojure-y.
12:26FrozenlockI don't know enough about the DOM yet for this to have even occured to me :(
12:27dnolenFrozenlock: you definitely want to attach events to DOM elements.
12:30FrozenlockI `think' that's what I'm doing, but I need to differentiate between the keypresses. If I follow this example, every key registered call the same function. http://closure-library.googlecode.com/svn/trunk/closure/goog/demos/keyboardshortcuts.html
12:30FrozenlockIt's then its job to check which key was pressed.
12:32dnolenFrozenlock: so handle the different key cases inside the key press handler fn.
12:33dnolenFrozenlock: another option would be call a multimethod. But I'm not sure about the performance of multimethods in CLJS, it may not matter for what you are attempting.
12:34FrozenlockWell yeah, but If I want to be able to redefine these bindings on-the-fly, I can't hardcode them in function... Thus my handler would look in the map and call the associated function. Unless I'm missing something...
12:34FrozenlockWhich is more than probable :)
12:34dnolenFrozenlock: why do you think you need to redefine them on the fly?
12:36FrozenlockBecause that's the goal I've given myself to learn cljs. It would also make REPL change a breeze: (global-set-key "ctrl+shift+a" random-function)
12:37FrozenlockGranted, it might never be used in a true app development.
12:40dnolenFrozenlock: OK, but I still think this can be done w/ one key handler + hash map of listener fns for particular key/key combos.
12:44duck1123Frozenlock: have you seen this? https://github.com/AndreasKostler/dyscord
12:45FrozenlockI have not! Thanks!
12:58Frozenlockduck1123: Is it me or dyscord.events is missing from the repo?
12:59duck1123Frozenlock: to tell the truth, I've never used it. it's just been sitting in my starred repos section
13:00duck1123that's a bit upsetting
13:01FrozenlockShame, it looked very nice. I might try to patch the missing part.
13:01duck1123there was a similar js-only library, but I can't seem to find it atm
13:02Frozenlockduck1123: Well there's the google keyboard shortcut library I was basing my code on. But it's far less emacs-like.
13:07FrozenlockMight as well ask here: Is there a browser REPL for inside the browser?
13:16scriptoris there a way to show line numbers or go to a line listed in the traceback?
13:16scriptor*stack trace
13:16scriptorer, in light table, that is
13:35chouserFrozenlock: http://himera.herokuapp.com/index.html
13:41duck11231so is there a cljs library that doesn't implement converting a clojurescript map into a js object?
13:41duck11231it seems like every library I've seen has re-invented that particular wheel
13:43sh10151error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
13:44sh10151when running lein self-install, any ideas?
13:45sh10151nm probably something wrong in curl
13:45technomancy_sh10151: make sure you don't have an outdated libssl
13:47sh10151unfortunately i don't administer this machine
13:47scriptoris there a function that checks if the given argument can support metadata?
13:47technomancy_sh10151: you can set HTTP_CLIENT to disable certificate checks; check bin/lein
13:48hoover_dammalso openssl seems to be wanting -CApath in 12.04.1 for wget
13:48hoover_dammwhich is bizzare
13:48hoover_dammit's not loading the root CA's without it, so the Verisign CA's go untrusted
13:48hoover_dammfor example
13:49technomancy_ugh; very strange
13:49sh10151i did find a typo in https://raw.github.com/technomancy/leiningen/preview/bin/lein :)
13:50sh10151bin/lein: line 179: downoad_failed_message: command not found
13:50technomancy_sh10151: yeah, fixed within minutes of the release; unfortunately too late
13:50hoover_dammi'm hoping it's not new behavior as my Gentoo servers don't exhibit that behavior
13:50technomancy_hoover_damm: do you know a link I can point people to?
13:53hoover_dammtechnomancy_, google brought up https://github.com/zendframework/zf2/pull/2223
13:53hoover_dammtechnomancy_, I only experienced it, resolved it and didn't report a bug because I was unsure if the behavior was desired or not
13:54hoover_dammtechnomancy_, I guess it could be http://rt.openssl.org/Ticket/Display.html?id=2700&amp;user=guest&amp;pass=guest
13:54hoover_dammtechnomancy_, I haven't hit it again so I really don't know how it's occuring
13:55hoover_dammfeels quite weird
14:00technomancy_the openssl bug is about breakage specifying a custom capath rather than requiring one when you should be able to omit it
14:00clojurebotc'est bon!
14:00technomancy_clojurebot: shut up
14:00clojurebotHuh?
14:00technomancy_clojurebot: forget the openssl bug |is| about breakage specifying a custom capath rather than requiring one when you should be able to omit it
14:00clojurebotI forgot that the openssl bug is about breakage specifying a custom capath rather than requiring one when you should be able to omit it
14:01uvtc~performance
14:01clojurebothttp://clojure.org/java_interop#toc46
14:01uvtcWhy does clojurebot link there?
14:01S11001001uvtc: I bet it links to the bit about how you shouldn't worry about annotation until you actually find a performance problem
14:02S11001001linked
14:06uvtcS11001001: thanks.
14:09hoover_dammtechnomancy_, exactly... so either it's a weird ubuntu bug that no one has reported, or I don't know
14:10hoover_dammtechnomancy_, only hit it with lxc a few times
14:10technomancy_I'll try it on my 12.04 machine when I get home
14:30pepijndevoswait, what? So drip launches a ton of jvms and then uses one every time you need a new one?
14:40`foguscore.cache docs available. Feedback much appreciated. https://github.com/clojure/core.cache/wiki
14:45antares_`fogus: https://github.com/clojure/core.cache/wiki/Including does not explain what repository artifacts are published to
14:46antares_https://github.com/clojure/core.cache/wiki/Using does not explain what clojure.core.cache/hit and /miss do
14:49`fogusantares: Do you mean that they exist in Maven Central?
14:50antares_https://github.com/clojure/core.cache/wiki/Extending does not demonstrate how to properly require/import the protocol, so without reading the code it will be very challenging to implement your own cache
14:50antares_speaking from my own experience with https://github.com/michaelklishin/monger/blob/master/src/clojure/monger/cache.clj#L24 and another implementation in Welle
14:50antares_`fogus: yes, for cases when a version cannot be found and people are confused about if they need to add a repo or a particular version wasn't published after all
14:53antares_«hit signifies that the item was found» still does not explain much
14:54antares_I think they are best explained as "return this value from the cache" and "put this value to the cache"
14:56`fogusantares: "return value from cache" is for lookup. hit return a cache
14:56`foguswhich reminds me, I should mention lookup
14:57pjstadig`fogus: i noticed in one of the release notes that it said the soft cache is immutable, which it's not
14:57pjstadigsince it is based on CHM
14:58`foguspjstadig: True
14:59`foguspjstadig: I will make sure to mention that when I create its wiki page
15:07`fogusantares_: Monger docs and such are awe inspiring. Very nice work.
15:07amalloypepijndevos: more or less, yeah
15:08antares_`fogus: thank you. Take a look at other clojurewerkz.org projects, they sometimes have even better guides (I think).
15:09`fogusantares_: What is Clojurewerks? In a nutshell.
15:09antares_`fogus: a collection of Clojure libraries for practical stuff
15:09antares_`fogus: http://clojurewerkz.org/articles/about.html
15:10`fogusantares_: How did CW form?
15:12antares_`fogus: me and my coworker needed a few libraries, most for data store clients. So we developed a few, open sourced them, written the guides and keep improving them and keep adding libraries as we need them or want to experiment with something.
15:13`fogusantares_: Very inspiring work. Nice job. I'm very motivated to work on docs now
15:14antares_there is no commercial entity behind CLJW, some projects are experimental. One (Romulan) is a dead end at this point.
15:14antares_I find CLJW guides a great way to learn about, say, the details of ElasticSearch features
15:15`fogusantares_: I imagine so.
15:15antares_so instead of blogging I dig ES docs or source and document what I find
15:15antares_we have a doc guides template and worked out a nice efficient way of writing and posting code examples
15:15antares_so it does not take as much effort as one may think
15:16alcyantares_: an outsider here, but an es-user, appreciate that view point re: docs !
15:17antares_alcy: our pleasure. Did you see Elastisch docs?
15:17antares_http://clojureelasticsearch.info
15:17scriptorantares_: any chance of open sourcing of the doc guides themselves?
15:17`fogusI love the idea of a dedicated .info domain!
15:17antares_scriptor: they are open source, the base template: https://github.com/clojurewerkz/docslate
15:17scriptorah, awesome
15:17antares_all doc sites are open source under https://github.com/clojurewerkz/
15:17`fogusantares_: You guys are rocking my world
15:18antares_`fogus: thank you. Feel free to spread the word ;) Clojure needs documentation like no other thing, IMO.
15:18alcyantares_: heh yea, i bought the clojure few days back, thought of getting down with it by using elasitsch - but leiningrad kinda troubled me (or maybe I troubled it)...nevertheless, with enoguh clojure basics, pretty sure I am gonna play with es rather than solve math problems, if you understand what i mean ;)
15:18`fogus(inc _antares)
15:18lazybot⇒ 1
15:18antares_books are great but library guides are just as important
15:18alcyantares_: s/clojure/clojure-book ;)
15:19antares_alcy: if you need help with lein, just ask
15:19antares_several active lein contributors are in here and in #leiningen
15:19uvtcantares_: Looks like, in your documentation, you use the word "guide" in place of "chapter".
15:20uvtcI tend to think of a guide as something containing multiple chapters.
15:20alcyantares_: ah sure, will spend some time first to figure out the warts n all from a learning perspective, 99.9& sure its not a lein problem but mine ;)
15:21uvtcantares_: and in the url, instead of guide/page-name.html, you have articles/page-name.html...
15:22uvtcHm.
15:22antares_uvtc: you are probably right. I am not a native English speaker and may use some terminology incorrectly.
15:22antares_the /articles part is unfortunate but too late to change by now
15:23antares_it originated with http://rubyamqp.info
15:23antares_which was the first guides site of that kind we did with my coworker
15:23uvtcantares_: I could see "Article" ≅ "chapter".
15:23nz-`fogus: is it possible to mix cache factories somehow? e.g LRU cache that also evicts stuff based on time to live
15:23antares_and for some reasons we used /articles there
15:24`fogusnz-: Yes, although all combinations have not been tested.
15:24antares_uvtc: but honestly, that's not that important as long as we have the content :)
15:24nz-`fogus: is there an example of that?
15:24`fogusnz-: The base cache just needs to be something associative, which core.caches are
15:24uvtcantares_: "articles" to me mean standalone, like they could be read in any order (like a Clojure set), whereas "chapters" imply ordering (like a Clojure vector).
15:24`fogusnz-: Not yet. Thanks for the reminder.
15:24antares_uvtc: CLJW guides are supposed to be read in order
15:25antares_we even have "What to read next" at the end of each chapter
15:26nz-`fogus: I'd like also a more full blown example: e.g how to cache some DAO like thing
15:27Frozenlockchouser: this one evaluates on the server side?
15:28`fogusnz-: You mean, an example of extending the protocol to some db?
15:28nz-`fogus: e.g how to cache this kind of method (def get-user [user-id] ...)
15:31`fogusnz-: I'll think about how/what to add for that
15:35nz-`fogus: great
15:36nz-`fogus: Function backed cache page is missing: https://github.com/clojure/core.cache/wiki/FN , Link to FN is in https://github.com/clojure/core.cache/wiki/Using
15:37`fogusnz-: WiP
15:53ninjuddpepijndevos: drip only keeps one spare JVM running per unique hash of JVM options
15:53pepijndevosninjudd: but, when I use one... it does need to laucn another one, right? But I assume that could happen in the background
15:54ninjuddpepijndevos: right
15:57pepijndevosninjudd: pretty neat. :)
15:59ggenikus`Hello guys, i am new to clojure and try to use it in practice. I am in situation when i need use (case) inside (->), is it posible? For example (-> (one) (case (expr) 1 (two) 2 (three))(four)).
16:00pepijndevosggenikus`: macroexpand is your friend
16:00hyPiRion,(require 'clojure.pprint)
16:00clojurebotnil
16:00hyPiRion,(clojure.pprint/macroexpand-all '(-> (one) (case 1 (two) 2 (three)) (four)))
16:00clojurebot#<CompilerException java.lang.RuntimeException: No such var: clojure.pprint/macroexpand-all, compiling:(NO_SOURCE_PATH:0)>
16:01pepijndevos,(require 'clojure.walk)
16:01clojurebotnil
16:01hyPiRionoh right
16:01hyPiRion,(clojure.walk/macroexpand-all '(-> (one) (case 1 (two) 2 (three)) (four)))
16:01clojurebot(four (let* [G__270 (one)] (case* G__270 0 0 (throw (new java.lang.IllegalArgumentException (clojure.core/str "No matching clause: " G__270))) ...)))
16:02pepijndevosClojure needs interactive expansion...
16:03emezeskepepijndevos: In Vim with vimclojure, "\me" macroexpands the form under the cursor, and I'm sure that slime in emacs does the same thing
16:03pepijndevosemezeske: amazing :)
16:03emezeskepepijndevos: It is *very* handy!
16:05pepijndevosemezeske: I barely use vimclojure, shame. It needs better installation and a cheatsheet
16:05S11001001When gigamonkey told me to imagine a junior employee hand-expanding macros over email for the compiler, that sounded cooler than what actually happens
16:05fentonhow do i make clojure functions available as instance methods for accessing from java?
16:06hyPiRionfenton: Take a look at gen-class and reify.
16:06emezeskepepijndevos: The cheatsheet is ":help vimclojure"
16:06S11001001http://gigamonkeys.com/book/macros-defining-your-own.html#the-story-of-mac-a-just-so-story
16:06pepijndevosemezeske: to much information
16:07emezeskepepijndevos: Just scroll to the hotkeys, it's really not that bad
16:07fentonhyPiRion: thx. what does reify mean?
16:07Apage43I've used vimclojure for a while, but it is awkward to set up at times
16:07Apage43I'm seeing if I can get myself used to emacs/evil
16:08pepijndevosApage43: there is also a slimev thing if you want to do that. It does not aloow you to type unbalanced parens
16:08emezeskeApage43: Do you frequently have to set up vimclojure?
16:09Apage43pepijndevos: it's not so much the editing parts that bother me, it's more that if I accidentally fire off a thing that will never finish in a vimclojure REPL I basically kill Vim
16:09pepijndevosemezeske: I'm just back from hacker school, and I set up vimclojure like, 5 times. Twice for myself and a few times for other people starting clojure dev
16:09Apage43I really like my Vim editing setup
16:10emezeskeApage43: REPLs in vim will always suck. Vim just is not built for that, unfortunately
16:10Apage43emezeske: not anymore =P. I used to use it on Windows even.
16:10emezeskeApage43: I recommend using lein-tarsier and running a command-line repl next to vimclojure
16:10pepijndevosApage43: you can kill the server and vim wil unfreeze
16:10nz-`fogus: If I have understood correctly, all the cache instances are immutable? Then in the case where you are caching a dao like function you probably need to store cache state to a atom or something like that
16:10pepijndevosemezeske: why does nREPL not work on vim?
16:10emezeskepepijndevos: Vim does not support asynchronous buffer updates
16:11emezeskeApage43: I find the best experience to be just turning on the lein-tarsier repl and using that
16:12gzmaskhey folks , where is \sr key in vim?
16:13pepijndevosemezeske: I'm not sure I understand what that means... I was under the impression nrepl was designed to be compatible with all the needs of tool authors
16:14emezeskepepijndevos: It means that Vim cannot be made to properly display an interactive REPL.
16:15emezeskepepijndevos: Vim buffers can't be updated as the REPL prints lines out -- they have to poll or do something else horrible
16:15emezeskepepijndevos: It's just not possible to have a good REPL experience in a Vim buffer.
16:17pepijndevosemezeske: that sucks... someone should go ahead and fix vim
16:17emezeskepepijndevos: I think you might find that to be a rather monstrously insurmountable problem
16:18pepijndevoslol
16:36FrozenlockI find it creepy to find this afternoon's #clojure log of myself when searching on google.
16:42fentonany idea why I get an airity error when trying to call clojure from java? http://pastie.org/4605825
16:43hiredmanfenton: you are missing a "this" parameter
16:44fentonhiredman: thank you!!!
16:45fentonhiredman: does the this go into the :gen-class or the call from java?
16:46hiredmanfenton: in the function
16:46hiredmanthe function takes this+args, so a function backing a single arg method needs to take 2 args
16:47fentonhiredman: thx
16:49SegFaultAX|work2What's the correct way to compare a float and an int?
16:50SegFaultAX|work2Actually, nevermind.
16:50jkkramer,(== 0 0.0)
16:50clojurebottrue
16:58justinleitgebHey folks - anyone know where I can find the seq-utils for Clojure 1.4? I'm looking for the `separate` function in particular: http://clojuredocs.org/clojure_contrib/clojure.contrib.seq-utils/separate
16:59RaynesI think it might have just disappeared in the contrib -> standalone library transition.
16:59RaynesIt is a really simple function though.
16:59S11001001justinleitgeb: some things are in core; others were deemed unimportant
16:59Raynes(defn separate [f s] [(filter f s) (remove f s)])
16:59technomancy_Raynes: I am disappoint.
16:59RaynesUntested, but should work.
17:00Raynesemezeske: I mostly just copied the implementation on clojuredocs
17:00Raynes(def separate (juxt filter remove))
17:00Raynesyey
17:00technomancy_that's more like it
17:00justinleitgebNice :)
17:00justinleitgebthanks guys!
17:01emezeskeRaynes: Six of one, half-dozen of the other. I say it's fine both ways, but I knew someone was gonna mention juxt :)
17:01Raynesjuxt is so pretty in this situation though.
17:01emezeskeI wonder if there is a simple one-pass solution, or if you have to do a reduce for that
17:01RaynesAnd if I hadn't done the juxt example, amalloy would have killed me.
17:02emezeskeThat is true.
17:02RaynesHe is nuts for it, you know.
17:03jkkramer(inc juxt)
17:03lazybot⇒ 2
17:03SegFaultAX|work24clojure #74 is a horrible problem.
17:05emezeskejkkramer: I had to do a double take on that to figure out why the hell (inc juxt) would return 2 :)
17:05Raynes4clojure/4clojure#74
17:05lazybotLess retarded Leagues link -- https://github.com/4clojure/4clojure/issues/74 is closed
17:05RaynesYeah, lazybot can do that. Send payments to...
17:06SegFaultAX|work2Haha, not issue #74
17:06SegFaultAX|work2Problem 74.
17:06SegFaultAX|work2http://www.4clojure.com/problem/74
17:06amalloyRaynes: go back to bed, man
17:06Raynesamalloy: Doesn't matter. I got to show off a new feature.
17:07SegFaultAX|work2My solution: https://www.refheap.com/paste/4684
17:07RaynesEven if I did look stupid in the process.
17:07SegFaultAX|work2How could it be improved?
17:07scriptorKodowa/Light-Table-Playground#113
17:07lazybotNamespace filtering -- https://github.com/Kodowa/Light-Table-Playground/issues/113 is open
17:08FrozenlockIs it possible that some parts of closure aren't in clojurescript?
17:08jkkramerSegFaultAX|work2: see clojure.string/join
17:08SegFaultAX|work2jkkramer: Derp, forgot about that.
17:09SegFaultAX|work2Ok, so other than re-inventing join, how is it?
17:10ohpauleezFrozenlock: some of the APIs are not in the Closure jar cljs ships with
17:10ohpauleezbut they constantly update the jar, and recently rolled in the "third-party" jar, which has a lot of the newer closure stuff in it
17:10jkkramerSegFaultAX|work2: looks fine. stylistically, I would indent psqaure?
17:11ohpauleezFrozenlock: What specifically are you looking for?
17:11Frozenlockhttp://closure-library.googlecode.com/svn/docs/class_goog_events_KeyHandler.html
17:12FrozenlockI was naively expecting (goog.events.KeyHandler. element) to work.
17:12FrozenlockSo I should download the js and add it to my :extern?
17:12SegFaultAX|work2jkkramer: I put it at the same level as the other let-bound locals, is that wrong?
17:12ohpauleezFrozenlock: That should work, I would imagine
17:13ohpauleezthe stuff that doesn't work is some of the HTML5 stuff
17:13jkkramerSegFaultAX|work2: I just mean spreading it across more than one line, so it's easier to read
17:13SegFaultAX|work2jkkramer: Oh the function itself. Yea I wrote it literally in the textbox on 4clojure.
17:14SegFaultAX|work2jkkramer: If it were in vim I would have kept it cleaner. But since it's a throwaway anyway, I didn't care.
17:14emezeskeSegFaultAX|work2: Your solution looks eminently reasonable to me.
17:14SegFaultAX|work2I feel like the problem is doing 3 things at once which makes your solution necessarily ugly.
17:15emezeskeSegFaultAX|work2: Your solution is not ugly at all.
17:15SegFaultAX|work2Eg process the text, do the real calculation, convert it back to text.
17:15SegFaultAX|work2emezeske: That's very encouraging, thank you.
17:19devnEvery bit of code I've ever written or read becomes ugly at some point.
17:21brehautdevn: for me that point is about 15 seconds after i stop typing
17:22RaynesBefore, during, and after.
17:23scriptorI just redefine my idea of ugly with every newline
17:24scriptoralso, is there any way to check whether something supports metadata?
17:24scriptoror do I need to manually check for each meta-able data type?
17:26naegscriptor: not sure whether this is clever, but how about just trying (with-meta) with some nonsense?
17:26scriptornaeg: would have to catch the exception then, I think
17:27scriptor,(with-meta 2 {})
17:27clojurebot#<ClassCastException java.lang.ClassCastException: java.lang.Long cannot be cast to clojure.lang.IObj>
17:27scriptornot sure if that's idiomatic? Seems rather hacky personally
17:27naegright. not sure whether this is considered good style in cljoure though
17:28naegyeah, same concerns here. just an idea I had (python programmers would do so I think)
17:30TimMcscriptor: IMeta
17:30naegscriptor: btw, finished that blog post about the code from last time. though I'm not comparing it to other python implementations, it was under the top 10 for half a day on HN: http://programmablelife.blogspot.co.at/2012/08/conways-game-of-life-in-clojure.html
17:31TimMc&(instance? clojure.lang.IMeta [])
17:31lazybot⇒ true
17:31scriptorah, thanks TimMc
17:31scriptorsaw that naeg, great post
17:32naeggave my blog quite some reads in two days - the people on HN are really curious about stuff written in Clojure
17:33firesofmayHi, what is the best way to send email attachments of screenshots taken from testing using email in clojure?
17:35SegFaultAX|work2naeg: I did a more literal translation a while back.
17:35SegFaultAX|work2naeg: https://gist.github.com/3190354 if you're interested.
17:35naegSegFaultAX|work2: from what to what?
17:35naegoh, yeah
17:36naegSegFaultAX|work2: I stumbled upon that one when I was looking for mapcat in Python
17:36SegFaultAX|work2naeg: Neat! :)
17:37naegI used chain from itertools though. Also, Python 3 offers the Counter dictionary, which does exactly what frequencies does in Clojure
17:37SegFaultAX|work2naeg: Sure. That wasn't the point of the exercise though.
17:38naegSegFaultAX|work2: what was the point of your exercise?
17:39naegoh, that comparison to lua?
17:39SegFaultAX|work2naeg: Lulz, mostly.
17:39SegFaultAX|work2naeg: And I also wrote it in Lua first.
17:39SegFaultAX|work2naeg: Yea.
17:39naegyeah, same here. I was just curious whether Python can go that far and still be reasonable good
17:40SegFaultAX|work2naeg: I make note that the Python in that document is purposefully not idiomatic and doesn't take advantage of what Python offers.
17:40SegFaultAX|work2It's a Python port of a Lua port of Clojure code.
17:41naegSegFaultAX|work2: I made that clear too. Otherwhise the guys at #python would have probably stoned me
17:41naegsome of them weren't too happy when they saw what I was doing. One was very helpful though
17:41SegFaultAX|work2naeg: I enjoy re-writing stuff from Clojure in other languages. I'm not sure why.
17:41SegFaultAX|work2https://gist.github.com/3373635
17:42technomancy_hoover_damm: so I wasn't able to reproduce any issues with curl or wget on the latest ubuntu at home
17:42technomancy_was there something specific needed to trigger that?
17:42naegSegFaultAX|work2: I enjoyed doing so too. probably because I secretly compare my "old main language" with my "probably soon new main language"
17:42naegeven though that comparison between Python and Clojure isn't fair in general
17:42eggsbySegFaultAX|work2: the sad part is that FP in python is very slow
17:42SegFaultAX|work2naeg: If I did that, my gist would be filled with Clojure wannabe Erlang.
17:43eggsbythat thread fn is cute though :)
17:43SegFaultAX|work2eggsby: And Python is very "objecty". I don't know what that means, I just made it up. But I think you know what I mean.
17:43eggsby'of course you can have rich lambdas! just give them names!'
17:44eggsbys/names/nouns
17:45naegthere are probably other reasons why most people don't really use FP in Python than performance
17:45scriptorimperative is just more idiomatic in it, might as well use everything python gives you
17:46SegFaultAX|work2I have mixed emotions about FP in Python. I will say this though: Clojure's persistent data structures are a dream.
17:46SegFaultAX|work2And the lack of those in Python is painful to say the least.
17:47eggsbyclojure is one of the slower jvm guys though, I think it's just the penalty of being dynamic
17:47naegI like Python much more than e.g. Java though. OOP is not bad, but there are simply just problems around where OOP doesn't fit - if you still use the OO langauge, you're going to have a bad time
17:47SegFaultAX|work2Although pysistence is a pretty neat little project.
17:47naegPython on the other hand doesn't force OOP on you as e.g. Java does
17:48eggsbyya python is a lot more pragmatic than java, but also a lot slower
17:49SegFaultAX|work2Java vs. Python is a fairly apples and oranges comparison.
17:50scriptorspeed is probably not a major issue for a lot of the things python is used for
17:50scriptorweb dev, command-line scripts, etc.
17:50pbostromtechnomancy_: hoover_damm mentioned "only hit it with lxc a few times" so maybe from inside a container?
17:51naegyeah, probably right SegFaultAX|work2. Just reduced both of them to OOP-style
17:51eggsbyya, that's true.. both play the OO game tho, i'm not sure how beneficial OO is for simple cli scripts, if it's not just for cli scripts it implies its in the same game as java
17:51naegI don't think that a lot of people use OOP for CLI stuff
17:51naegthe web stuff is mostly OO though
17:52magopiancan somebody who already solved the 4clojure problem 125 let me know if their solution is still working right now?
17:52technomancy_pbostrom: oh, that's right
17:53naegSegFaultAX|work2: I think I'll start using gist too - do quite some proof-of-concepts from time to time and just keep them for myself, but it's interesing to read them
17:53magopiani have some strange error (java.lang.ClassCastException: clojure.lang.PersistentList cannot be cast to clojure.lang.IFn) that i don't have in my playground nor in tryclojure
17:53dnoleneggsby: idiomatic Clojure perhaps is slower - but Clojure has the necessary escape hatches to get perf w/o resorting to the verbosity of Java.
17:54eggsbydnolen: those escape hatches are somewhat of a black art, just a lot of typecasting and hinting, right? I made a (bad) app in clojure and scala, the scala version was almost 4x as performant (this was after clojure typecasting/hinting)
17:55dnoleneggsby: the perf costs don
17:55dnolen't really have anything to do w/ being dynamic.
17:55eggsbyI was interested in what caused it, it was the classic double tail recursive fib, one of the worst programs you can write but I was shocked how much slower clojure was than the scala version. I don't know nearly enough to say *why* though.
17:55dnoleneggsby: typecasting / hinting isn't really what's required for fast code. That said, it's not obvious - Scala benefits in that the imperative style is easy to express.
17:57magopianamalloy: are you there by any chance?
17:57amalloyindeed
17:58eggsbydnolen: some of the scala advocates around the office have argued that scala could be classified as *more* functional than clojure because it allows invariant refs (i.e. vals) where clojure allows everything to be dynamically redefined
17:58eggsbyIt seemed like a bit of a red herring, since in order to dynamically redefine you'd have to intentionally do that but...
17:58amalloyproblem 125 is still working fine, magopian
17:58eggsbyI do wish we had something like (def-and-prevent-redef ..)
17:59dnoleneggsby: dynamic redefinition outside of development w/o an incredibly good reason makes little sense.
17:59dnoleneggsby: defonce.
17:59technomancy_defonce doesn't prevent redefinition
17:59technomancy_definline, maybe
17:59magopianamalloy: mmm ok then, strange that i have this issue only in 4clojure, not in my repl
18:00magopiani'll keep digging then, thanks a lot amalloy for your responsiveness ;)
18:00scriptoryou *could* redefine everything in clojure, just in the same way you *could* not use invariants at all in scala
18:00dnolentechnomancy_: does anything really prevent redefinition? you can always recompile a larger compilation unit.
18:01technomancy_yeah, it quickly devolves into nonsense
18:02technomancy_which is kinda the expected outcome of a "my language is more functional than yours" argument
18:03eggsbymy lang is bigger than your lang it has more fns than a fn convention
18:05arohnerclojurebot: separate
18:05clojurebotseparate is in clojure.contrib.seq-utils, but just use (juxt filter remove) instead
18:05eggsbytechnomancy_: it is interesting in the context of what the language encourages and which is the Correct(tm) way to do things. In a language like clojure I feel like I'd prefer if the defs were final and have a special syntax for the other case (which we kind of have with ^:dynamic)
18:06SgeoAFAICT, with-redefs is often used to aide testing
18:06hiredmaneggsby: that's dumb
18:07hiredmanthe whole point of vars as an indirect linking construct is to allow for that
18:07technomancy_I appreciate having the flexibility to help during development. it's obvious when it's abused in non-development contexts.
18:07SgeoYou shouldn't need to include in your main code things designed only to make it easier to test... I think
18:07hiredmanit is useful in all kinds of cases
18:07hiredmane.g. repl dev, hot patching, etc
18:07SgeoI remember writing C# code and realizing I had no idea how to do automated testing on any of it
18:08eggsbybut isn't it weird that we don't even have a `final`?
18:08SgeoAlthough that could also be the fault of a bunch of globals lurking around
18:08hiredmanwhy?
18:08clojurebotwhy is the ram gone is <reply>I blame UTF-16. http://www.tumblr.com/tagged/but-why-is-the-ram-gone
18:10dnoleneggsby: most things are effectively final if you're not dev'ing at the REPL. There are real problems and imaginary ones, no?
18:13eggsbyyes, it is an imaginary problem because in practice you simply don't redef without an explicit need to, and if you're being particularly vigilant you'd use earmuffs. It still irks me that I have no defense against people saying it's a language bug and is ~dangerous~ and makes everything possibly ~impure~ other than 'yes but we dont do that'
18:14eggsbymaybe it has to do with simplicity to just have a single construct for defining a reference
18:14dnoleneggsby: well tell them if they're worried about they can just AOT all the time - from sound of Scala compile times I don't think they'll notice much of a difference ;)
18:15hiredmaneggsby: there is a defense
18:15hiredmaneggsby: "what do you want that for?"
18:15hiredman"what is the use of that?"
18:15hiredmanthere is no reason to include every feature under the sun without justification
18:16eggsbyha, *that* certainly flies in the face of scala
18:16hiredmana "final" facility causes much more pain then not having one
18:17hiredmanprogramming is about getting things done, is it a feature if the library you are using denies you access to the thing you need to make it work?
18:17technomancy_one word... unsafePerformIO
18:17RaynesThat's three words.
18:17RaynesActually four.
18:17Frozenlock^^
18:18hiredmanyou often end up with the choice of forking, or using reflection
18:18hiredman(in java)
18:18hiredmanjust to use a library slightly differently then the creators intended
18:19hiredmanbecause stuff is private or final or otherwise "encapsulated"
18:19hoover_dammtechnomancy_, gimme a few i'm back i can fire up another lxc guest (fresh) and see if it's isolated to lxc
18:20imeredithhiredman: programming is about getting stuff done - but there is a lot of debate over the best method to get things done :)
18:20hoover_dammtechnomancy_, I admit most of the problem is just related to SNI and github's SSL certificates
18:20Bronsasono molto simili
18:20Bronsaops wrong channel
18:20hoover_dammtechnomancy_, and weird openssl handshake errors
18:21hiredmanimeredith: sure, but final/private/etc limit your choices
18:21eggsbybut I thought clojure was a conservative language
18:21eggsby;)
18:22imeredithhiredman: well, im sure that people that like them would say that it leads to less pain in the future because you cant do things by accident or something (i dont really understand it myself)
18:22eggsbyWHERE ARE MY MULTIPLE PASS COMPILATIONS AND CYCLIC DEPENDENCIES
18:22hiredmanevery var in your clojure program is an indirect link and provides leverage and choice
18:23eggsbyya imeredith I always hear described in terms of 'your code lives beyond you, using explicit declarations allows you to express intended usage to future devs'
18:23technomancy_more power isn't necessarily good, (the power to malloc/free, the power to bash your data structures in place) but you have to show that it's easy to abuse the power by mistake to make a case for removing it.
18:24technomancy_"you have a def in column not-zero" is the easiest thing in the world to catch
18:24hiredmanthe power from the indirect changable linkage from vars is effectively infinite, so how do you trade that off?
18:24imereditheggsby: all that said, some constructs are useful - personally im a scala person and using monads in scala is cool because general if it compiles its going to be correct
18:25imeredithbut private? meh
18:25hiredmanclojurebot: tell us about scala
18:25clojurebotscala is also<reply>"we are completely screwed on ==." -- seen in #scala
18:25hiredmantouche
18:25hiredmanclojurebot: tell us about scala
18:25clojurebotUnfortunately the standard idiom of consuming an infinite/unbounded resource as a stream can be problematic unless you're really careful -- seen in #scala
18:25imeredithlol
18:25hiredmanyeah well
18:25imeredith#scala is useless
18:26imeredithlol
18:26hiredmanclojurebot: tell us more about scala
18:26clojurebotScala often gets in the way when trying to write neat code -- seen in #scala
18:26eggsbyI was talking to a scala advocate today about private and specifically whether a function can be considered pure if it internally memoizes some value, even it is idempotent
18:26eggsbyif another ~thing~ can reference that memoized reference then it would be impure since something could rely on that being in one state or another (this is an *extremely* contrived example), but if it was private that wouldn't be the case
18:26hiredmaneggsby: sure
18:27hiredmanbut in a real world program, you always end up wanting access to the cache
18:27hiredmanfor one reason or another
18:27imereditheggsby: i think it would depend if anything else can change that momized reference - because then the function would return the wrong thing
18:27eggsbyright, and the STM is amazing for that sort of thing
18:28imereditheggsby: but im not sure
18:28hiredmanbut the stm isn't magic, it is managing impurity, not removing it
18:28eggsbyyes, it's largely eliminating the warts and gotchyas from dealing w/ mutation
18:28eggsbyAnyhow it's all lofty and idealogical and not really founded in actual programming re: getting shit done
18:29imerediththe scala community is hugely diverse
18:29hiredmanthat's one way to put it
18:29eggsbynot the STM, 'purity'
18:29imeredithheh
18:29eggsbyya imeredith
18:29eggsbyI'm interested in learning scala but part of my love for clojure is a love for lisp.
18:30hiredmanif the scala community cared about getting stuff done they would use a simpler language
18:30imeredithi almost started on clojure but got really into scalaz first heh
18:30imeredithlol
18:30hiredmanif you care about getting stuff done you cannot treat your langauge and runtime as a blackbox
18:30imeredithscala is a simple langauge
18:30eggsbyhiredman: my take on scala is that it's a better java with comparable performance
18:30hiredmanyou have to know how they work
18:30imeredithwell, the scala runtime isnt all that awesome
18:31mkI'm not sure what it means to treat the language itself as a black box
18:31nDuffmk: To not know/care about its implementation
18:31imeredithone of the problems scala has is that people come from java and move from OO -> FP progressively - but scala gets complicated for heavy FP
18:32hiredmanyour language is just another library, which library do you pick? the one with the source code you can scan through easily to find out why something isn't working, or the library with implicits?
18:32mkas for the runtime, it can be a black box, as long as you've got decent enough abstractions to model it. Obviously I need to know about the performance characteristics of my structures
18:32imeredithimplicits are not the problem people say they are
18:32eggsbybtw #clojure is probably the best language channel i'm aware of
18:33mkeggsby: I agree
18:33hoover_dammindeed
18:33hyPiRion#clojure is the only language channel I'm aware of.
18:33wjlroeThere are other language channels?
18:33eggsbyit's crazy to have a convo about this sort of stuff without it devolving into YA BUT MY WAY
18:33hiredmandidn't they used to be a github graph on repos that would give you a line of code count?
18:33imereditheggsby: thats the problem with #scala lol
18:34technomancy_hiredman: they removed a bunch of graphs for some reason
18:34hiredman:/
18:35technomancy_hiredman: ohloh has those graphs though
18:35hiredmanthe code freq graph may work for me
18:35imeredithpeople mistake complexity for unfamiliarity - i am unfamiliar with clojure - to the point of it seeming complex - but i would never say its complex
18:35hiredmanhttps://github.com/scala/scala/graphs/code-frequency https://github.com/scala/scala/graphs/code-frequency
18:35hiredmanwhoops
18:35Frozenlockdnolen: Thanks for the domina cue, it's very nice!
18:35hiredmanhttps://github.com/clojure/clojure/graphs/code-frequency
18:36technomancy_I wish it would distinguish between implementation and test source, but I understand why that's hard
18:36hiredmanwhich library are you going to want to wade through when something doesn't work?
18:36mkimeredith: what counts as complex, then?
18:37technomancy_hiredman: I'd take clojure circa late 2009 =)
18:37dnolenFrozenlock: glad you like it!
18:37mkimeredith: in most contexts, complex is "I have to know a lot to use this"
18:37hiredmantechnomancy_: request denied
18:37hiredmantechnomancy_: sure line count can't be the only metric
18:37imeredithmk: well, in that context clojure is complex
18:38eggsby~simple v. easy~
18:38hiredmanbut, when you are talking about reading the codebase, it is a decent one
18:38clojurebotforget ~paste is gist
18:38technomancy_hiredman: reminds me of https://github.com/technomancy/bludgeon
18:38imeredithmk: i think things are simple when you can reason over them - referential transperncy for example is easy to reason over
18:39mkeggsby: good presentation, but I think that that particular distinction is more marketing than substance
18:40mkimeredith: maybe... I mean, in general, we want a the language to correspond as much as possible to good ways of thinking about programs
18:40eggsbyreally? if only for the distinction between simplicity as a lack of logical interweaving and easiness as familiarity I thought it was huge (but maybe it's because I previously wasnt so aware of the disctintion)
18:41imeredithmk: right, but you can find examples in any language that is terrible
18:41thorbjornDXThread thread = new Thread()
18:42imeredithmk: but java vs scala, in scala people generally use vals, so dont end up mutating variables, just because it has the construct 'val'
18:42technomancy_Malkovitch malkovitch = new Malkovitch();
18:42imeredithso you are right
18:42imeredithbut only to a point
18:44mkeggsby: yeah, agreed. But the two opposites were stuck together in a "complected" way, from what I recall. What does familiarity have to do with non-interweaving? I thought it was a great and justified attack on oo, and on choosing to stick with it because it's something you know well
18:44imeredithone day ill get around to clojure, i refuse to comment for/against clojure specifically until ive used it a bit.
18:47mkhiredman: what do those charts represent?
18:55jkkramerbeen doing a project in scala play framework lately. no comparison - ring/compojure is vastly simpler and easier to understand, write code for, etc
18:56imeredithjkkramer: unforunatly there is lots of play that is crap - there is no really good scala framework
18:56jkkramerin play, they say it's basically request -> fn(s) -> response, but in practice everything is locked inside types and class/object hierarchies
18:56imeredith?
18:56SegFaultAX|work2This is my answer to 4clojure 75, how can I make it better? https://www.refheap.com/paste/4687
18:56imerediththat is the one thing of play that is good Request => Response
18:57jkkramerconceptually yes. in practice it's Controller/Action/Response, which all have peculiarities and can be difficult to compose
18:57mkSegFaultAX|work2: if you've submitted, you can subscribe to other people, and view their answers
18:58jkkramerin ring, you get a request map - just a plain hash map. a function operates on it, and returns another simple map. so simple.
18:58SegFaultAX|work2mk: Real-time feedback is useful for my learning.
18:58mkSegFaultAX|work2: yep, probably for everyone's. But if you haven't already, check those out, you'll see some pretty cool and weird solutions
18:58technomancy_heroku's play support strips out the repl at deploy time =(
18:59imeredithjkkramer: well, ill disagree on this point :)
19:00jkkramerthat's the other thing - the play console stinks. you can't even query the DB easily. runtime config is a big hairball
19:00imeredithyes ill aggree with that
19:00imeredithits a real pita
19:00imeredithas i said, Request => Response is the one good thing play has
19:00imeredithheh
19:01jkkramerbut the feedback loop is slow and cumbersome
19:01jkkramerit's hard(er) to build small, composable pieces
19:01imeredithwell, thats because the scala compiler is slow - but i dont aggree with composable
19:02imeredithjkkramer: in play1/play2 with java the feedback is really good - but yeah...java
19:03imeredithi dont like the whole refresh thing anyway, i just have the compiler in the background validating the code as i save
19:03jkkramerit's a matter of degree. it's composable, yes, but full of warts and weirdness
19:03jkkramerenough grousing form me. gotta run
19:03jkkramer*from
19:22gfredericksemezeske: ping
19:27emezeskegfredericks: pong
19:28gfredericksemezeske: was wondering if you could give me some tips to debugging my checkouts issue (mentioned on github)
19:28gfredericks`lein classpath` includes the relevant src-cljs directories
19:29emezeskeYeah, that is a weird problem
19:30emezeskeA tricky thing is that the compiler runs in "eval-in-subproject", which may have a slightly different classpath
19:30emezeskeI forget the easiest way to hack things to print the CP in the subproject
19:30emezeskeThis is lein2 right?
19:30gfredericksyeah
19:30gfredericksis it normal for the compiler not to fail when a ns isn't found?
19:31emezeskeI think so
19:32gfrederickshmm
19:32gfredericksoh wait
19:32gfredericksit might be working now
19:32gfredericksnow that I've specifically bothered you about it
19:33gfrederickshm; now it's missing a transitive dep (jayq)
19:33gfrederickscuriouser and curiouser
19:34emezeskehaha
19:35gfrederickswell the jayq jar isn't in lib so I guess that's not cljsbuild's fault
19:37emezeskeWith lein2, the jars don't get copied into lib anymore, though, right?
19:37gfredericksoh that sounds right
19:37gfredericksmust be a stale lib
19:38gfredericksnope not there
19:38emezeskeWhat jar does your project depend on that transitively depends on jayq?
19:38gfredericksan unpublished one
19:38gfredericksI installed it locally just so mvn would shutup
19:38gfredericksso I should probably double-check that jar
19:39emezeskeI would.
19:40gfredericksthe pom.xml in there definitely mentions jayq
19:40gfredericksdoes lein have a dep tree thing yet? or do I just use maven's?
19:41technomancy_gfredericks: geez; welcome to four months ago =)
19:41technomancy_lein deps :tree
19:41gfredericksmaven misses it
19:42gfredericksas does lein
19:47ssurgnier\part
19:48gfrederickshow does lein/mvn tell from a jar that it has deps?
19:48technomancy_gfredericks: deps come from poms
19:48gfredericksthe project.clj? the META-INF/maven/group/artifact/pom.xml?
19:48technomancy_the jar often happens to contain a non-canonical pom
19:49technomancy_but it's the top-level pom artifact that's used
19:49gfredericksthere is no top-level pom in this case
19:49gfredericksdoes that explain it?
19:49technomancy_yeah
19:49gfredericksI'll try to re-jar
19:51technomancy_I believe installing with mvn install:install-file will never get you dependencies
19:52gfrederickso_O isn't getting dependencies a separate issue from getting your pom.xml to the top-level of your jar?
19:52technomancy_by "top-level" I mean "not inside a jar"
19:52emezeskegfredericks: Does this mean I'm off the hook? :)
19:53gfredericksemezeske: I think so ;)
19:53gfrederickstechnomancy_: okay so you're saying it's impossible to get transitive deps without deploying a jar to a proper maven repo?
19:54technomancy_without deploying a pom
19:54gfredericksoh I can deploy that locally
19:54gfredericksright they go separate
19:54gfredericksokay phew
19:54gfredericksI expect THAT's my issue then :)
19:54gfrederickstechnomancy_: thank you sir
19:54technomancy_np
19:55technomancy_this is why I tell people to stay away from bare jars
19:55technomancy_way more trouble than it's worth
19:55gfredericksit didn't occur to me that maven wouldn't pull the pom out of my jar
19:56gfredericksoh man lein2 deps doesn't tell me the maven cmd for local installation anymore
19:56technomancy_that's because install:install-file is hell of sketchy
19:57gfrederickseven if you install the pom with it?
19:57technomancy_for anything but experimentation, yes
19:57technomancy_because as soon as you try to hack the project on someone else's machine it'll break
19:58gfredericksit's an alternative to running your own private maven thinger
19:58technomancy_yes, just not a good alternative =)
19:58technomancy_s3 is super cheap
19:59hiredmanmaven repos are just dumb http end points
19:59technomancy_that too
19:59technomancy_even nexus is easy to set up
19:59hiredmanrunning one is super simple
19:59hiredmanyou can even act as a maven repo from s3 without using the s3-wagon or whatever
20:00hiredmanjust server the files from s3 over http
20:00technomancy_hiredman: is that easy to do with basic-auth?
20:00gfredericksstep 0: set up s3
20:00hiredmantechnomancy_: no
20:00hiredmanactaully I dunno
20:00hiredmannever tried
20:00hiredmanjust public stuff
20:00hiredmanyou can literally just upload the directory out of your .m2 to create a maven repo
20:01technomancy_eh... I don't think you get checksums that way
20:01technomancy_better to lein deploy to /tmp/myrepo and rsync that
20:01hiredman*shrug*
20:01technomancy_I should look into documenting the scp wagon; that would probably be simpler for a lot of people
20:02hiredmanmy .m2 seems to contain .sha1 and .md5 files
20:02technomancy_huh; maybe that's new with aether
20:02technomancy_that's cool
20:02technomancy_someone should document that
20:02gfredericks(inc technomancy)
20:02lazybot⇒ 39
20:02gfredericksthanks folks
20:13casionso since swank-clojure is depreciated, is there any good explanations of an nrepl workflow with emacs?
20:13technomancy_casion: it's very similar; just replace clojure-jack-in with nrepl-jack-in
20:15casionguess I need to move to lein 2 then
20:39Raynescasion: Should have already done that.
21:58cjfriszMan, how come it's so quiet around here lately?
21:59casionin my experience it's usually quiet around this time
22:00taliosAfternoon
22:00brehauthi talios
22:00talios'lo brehaut
22:01cjfriszcasion: Huh...I must have used to get on earlier
22:01cjfriszOr later, not sure which
22:05mkyou can always run stats on the logs to know for sure
22:21jacobsenHi all, is there a standard way to address "return code 405" errors when deploying to Clojars with leiningen 1.7?
22:24xeqijacobsen: hm, 405 should happen when deploying to clojars.org/ instead of clojars.org/repo
22:24jacobsenin case it's helpful, https://gist.github.com/3506189
22:25jacobsenIt does say it's trying to deploy to clojars.org/repo ...
22:25xeqidoesn't look like thats the case for that...
22:30cjfriszIn the course of writing CTCO, I think I've written and scrapped 3 versions of alpha-renaming
22:30cjfriszAnd I'm just about to write another one
22:30cjfriszBut I think this one is actually going to stay
22:31akhudekctco?
22:31casionctco?
22:31uvtcCTCO?
22:31emezeskeC T C O ?
22:31casioneieio?
22:31cjfriszC
22:31cjfriszT
22:31cjfriszC
22:31cjfriszO
22:31cjfrisz?
22:31emezeske^_^
22:32cjfriszhttps://github.com/cjfrisz/clojure-tco
22:32akhudekNice. That's what I hoped you meant! :-)
22:33casionoh, you're the guy who did that presentation on tail calls in cojure
22:33cjfriszI am
22:33emezeskecjfrisz: Wow, that's crazy!
22:33casion'that guy'
22:33casionI enjoyed the presentation
22:34cjfriszThanks
22:34xeqijacobsen: hmm, I see the GETs in the server logs, but not a PUT. Are you using a proxy perchance?
22:34mklink to presentation?
22:34cjfriszI submitted to do an expanded version at Clojure/Conj
22:34akhudekcool, would like to see that
22:34cjfriszhttp://www.chrisfrisz.com/blog/?p=220
22:35cjfriszyeah, I've been working both on improving CTCO and writing a whole-program compiler that'll do some smarter analysis and hopefully produce noticeably faster code
22:35cjfriszSo hopefully I have the snazzy compiler ready for my talk...if it gets picked
22:36cjfriszAnd at some point, I'm supposed to write tools.cps
22:37xeqijacobsen: oh, I notice its pushing to http, you need to use https. check out https://github.com/ato/clojars-web/wiki/Pushing
22:37amalloycjfrisz: is CTCO basically resolving down to (trampoline (lambdas....)), or is it doing smarter stuff to avoid creating functions entirely via eg loop/recur?
22:38cjfriszamalloy: It's a somewhat smarter version of the former
22:38cjfriszamalloy: Part of the point is to allow arbitrary mutual recursion, so loop/recur won't work for that case
22:39amalloyif they're actual tail-calls, can't you rewrite that as a loop-recur?
22:40jacobsenxeqi: thanks, I'll check that out
22:40cjfriszamalloy: That's certainly possible
22:41cjfriszamalloy: And I was thinking about that in the last few days
22:41amalloycool! i can just barely write my own CPS programs, and transform them to CPS w/loop-recur with some effort; just interested in seeing how all your stuff works
22:46gfrederickswoah lazybot monitors pings
22:46gfredericks(inc lazybot)
22:46lazybot⇒ 6
22:47mkmonitors pings?
22:47Raynesmk: Type 'Raynes: ping'
22:47mkRaynes: ping
22:48RaynesHi there.
22:48gfredericksit happened in my freenode buffer so I didn't notice till much later
22:48RaynesYou should now have a NOTICE, mk.
22:48cjfriszamalloy: Yeah, when I stopped and thought about it, I realized that loop/recur without the thunks could be a noticeable savings
22:48gfredericks,(println "gfredericks: ping")
22:48clojurebotgfredericks: ping
22:48mkin fact I do have a notice. That's neat
22:48cjfriszamalloy: But in compilers, you never know. Things that seem like obvious wins sometimes turn out to only marginally help
22:49TimMcTimMc: ping
22:49mkI like how it gives me the turnaround time down to the millisecond
22:49amalloytrue
22:49cjfriszAnd then sometimes you mess up the code layout just enough with an optimization that you get caching effects that actually make things slower
22:49TimMc:-(
22:49amalloymk: only because it was recent. if you ping rhickey and he gets back to you two days later, you just get days/hours
22:49RaynesRaynes: ping
22:49Rayneshi self
22:49RaynesCool, I can ping myself.
22:49TimMcAh, I see.
22:50mkamalloy: right. Still, though
22:50gfrederickskeep that to yourself
22:50cjfriszgfredericks: I lol'd
22:50RaynesHah
22:50gfrederickscjfrisz: phew
22:50Raynesgfredericks: You and are are in constant competition for the most snark, aren't we?
22:51gfredericksare are are are
22:51gfredericksand
22:51RaynesI'm sorely insufficient.
22:52gfredericksand now your grandchildren will be able to read about it on clojure-log.n01se.net
22:53tmciverTimMc: were you looking for 'the other' Tim Mc?
22:53TimMcNope.
22:53tmciverwould the real Tim Mc please stand up?
22:54TimMcBut both of us do!
22:54TimMc(Explanation for the rest of the channel: We both have standing workstations.)
22:55casionpeople actually use those?
22:55casionI thought that was some sort of april fools thing
22:55cjfriszNot at all
22:55cjfriszWe've got a few in my office, and I am jealous
22:56cjfriszI'm even more jealous of the one walking desk
22:56casionwhy?
22:56clojurebotwhy not?
22:56amalloyninjudd and lancepantz both use standing desks; ninjudd has a treadmill
22:56casionbecause!
22:56casionreally though, why would anyone want to use a standing workstation?
22:56TimMcOne of the execs at my office has a treadmill!
22:56mkI've got a standing desk as well, small world
22:56cjfriszcasion: Good for the circulation
22:56amalloyand posture
22:57wmealing_Ive got a squat rack.
22:57TimMccasion: It really helped my RSI, it forces me to take typing breaks, I get less sleepy...
22:57cjfriszcasion: Also fights off a number of teh problems associated with sitting at a desk 8+ per day
22:57tmciverbecause we weren't meant to sit in front of a keyboard all day.
22:57TimMcRSI was the main thing.
22:57cjfriszYes, all of those things
22:57metelluswe weren't really meant to stand in front of a keyboard all day either
22:57casiontmciver: we also weren't meant to stand in one place for 8+ hours a day
22:57cjfriszI'm planning on setting up a standing desk in the near future
22:57cjfriszcasion: Most people I know don't use them for the whole day
22:58casioncjfrisz: well that'd be useful I guess
22:58mkcasion: a standing desk forces you to take breaks if you're not up for it, a chair doesn't
22:58casionI understand why someone else may want to use it now, thank you for the responses
22:58tmcivercasion: true, but hopefully standing AND sitting for 8+ hours a day is better than doing just one of those.
22:59TimMccasion: There are also sit/stand workstations, although I prefer being forced by leg fatigue to sit down and stop typing periodically.
22:59cjfriszThough I'm pretty impressed that the guy who has the walking desk pretty well uses it all day every day
22:59casionI get up from my chair constantly through the day
22:59TimMccjfrisz: No kidding? That's gotta be good for him.
22:59casionit never occured to me that there's people who don't take constant breaks and move around
23:00cjfriszcasion: I'm also like you, which is part of what draws me to it, actually
23:00cjfriszI move around enough that I think the idea of standing for a while is more freeing than sitting all the time
23:00cjfriszI've done some time at the walking desk and I find it really nice
23:01TimMcI used to sit on an exercise ball, which kept me a moving a bit.
23:01casionit sounds useful for some folks
23:01casionI would never do it though
23:01TimMcUnfortunately, it's also easy to have *terrible* posture on those.
23:01cjfriszTimMc: I'm afraid I'd fall into that category
23:01casionI sit on a chair with no back, and no arms
23:01mkTimMc: how's that?
23:01casionsometimes I sit on the floor
23:02casionmaybe if one day I can get comfortable shoes I'll try the standing
23:02TimMcmk: Hard to describe in text. :-)
23:02TimMccasion: Barefoot. Seriously.
23:02mkTimMc: ascii art? ;)
23:03TimMcmk: Well... butt far back on the ball, torso leaned forward, forearms resting on desk edge, elbows splayed.
23:03TimMcIt's not a very dignified posture either. :-P
23:03casionTimMc: I'd love to but I have to walk through my metal shop all day long
23:03TimMccasion: Oof. Got it.
23:04casionI've done it once...
23:04casionstitches were involved
23:04gfredericksRaynes: if I'm in a snark competition with you, I consider that to be a success already
23:05casiondo you guys use purpose built standing desks? or just rig something together
23:05mkTimMc: I see. Yeah, I think the easiest way to go wrong is to rely on something to prop yourself
23:07jacobsenxeqi: thanks again, migrating to lein2 seems to have done the trick
23:07TimMccasion: Jerry-rigged. Monitor on cube shelf, mouse on a pile of boxes, keyboard on a LapDawg the CEO dug out of a corner of his office.
23:08TimMcThe LapDawg is slightly more bouncy than I'd like, but it's hella adjustable.
23:09casionTimMc: sounds good
23:32hoover_dammtechnomancy_, still can reproduce it in lxc... openssl s_client -conect github.com:443 without -CApath fails
23:33hoover_dammtechnomancy_, curl seems to be adding the capath by default where wget isn't
23:33hoover_dammweird
23:35hoover_dammfeels like new behavior
23:42gfredericksany guesses why org-html-slideshow depends on clojurescript-one? what does that provide?
23:43emezeskegfredericks: Oh god...
23:43gfredericksemezeske: I was aiming to port this to lein-cljsbuild
23:43gfredericksbut it'd help if I understood it first :)
23:44emezeskeYeah, that's mighty weird
23:44gfredericksit's not a proper lein dep
23:44gfredericksI'm not sure how they pull it in
23:44emezeskeMaybe it uses some utility namespace or something
23:45gfredericksone.dispatch is the ns they use
23:46gfrederickslooks like a bunch of eventing; they use it a lot
23:52gfredericksthat namespace is about 30 lines of actual code, and that's the only thing it uses from one; would it be bad form to just paste it in to get rid of the dep?
23:54gfredericksalso cljsbuild is crashing saying it can't find cljs/analyzer.clj; it's doing that in two different projects now
23:54emezeskeRegarding the 30-line file, I'm pretty sure they never intended for clojurescript-one to be used as a library. Pasting it is probably the best choice.
23:54emezeskeRegarding the crash, I've never seen that before.
23:55gfredericksI bet it will once again somehow turn out to be maven
23:55gfredericksoh maybe this is because org-html-slideshow declares a particular CLJS version?
23:56gfredericksin particular, "0.0-971"
23:57gfrederickswhat version does cljsbuild want?
23:57emezeskeOh god, that is so. ridiculously. old.
23:57emezeskecljsbuild will pull in 0.0-1450 if left to its own devices
23:58gfrederickscool thx
23:58emezeskeYou shouldn't use anything but 0.0-1450 unless you're prepared to debug differences between lein-cljsbuild and clojurescript
23:58emezeske(i.e. that's the version combo I've tested) :)